Skip to content

feat: add batch map generation from ideas file, Run History map resto… - #3

Merged
deltaaa00 merged 5 commits into
deltaaa00:mainfrom
bibed234:main
Nov 14, 2026
Merged

deltaaa00 merged 5 commits into
deltaaa00:mainfrom
bibed234:main

Conversation

@bibed234

Copy link
Copy Markdown
Collaborator

…re, and smooth loading stage animations

@bibed234
bibed234 requested a review from deltaaa00 as a code owner November 14, 2026 19:44

@deltaaa00 deltaaa00 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address these issues before merging. This includes deltaaa00's two existing inline comments, which remain requirements:

  1. [P1] Support ONLY .csv batch files with a defined structure. Remove TXT/Markdown/JSON and unknown-extension fallbacks from the parser, CLI help, and UI. Define and validate required/optional columns and allowed values before generation. Report malformed rows clearly instead of silently dropping them or replacing invalid gsm values.

  2. [P1] Add batch_template.csv containing the defined headers and exactly one example data row, and make it downloadable from the web UI.

  3. [P1] Fix HTML injection in templates/index.html:1378–1387. Uploaded prompts and filenames are interpolated into innerHTML; an img element with an onerror handler in a prompt can execute when results render. Use textContent and safe attribute assignment, including the batch history display.

  4. [P2] Validate and forward temperature in main.py's generate_batch endpoint, consistently with /api/generate. The browser sends it, but auto_map never receives it, including an explicit value of 0.

  5. [P2] Save effective per-row parameters in batch history. index.html:1474–1484 stores form defaults plus the row prompt, losing CSV overrides for mode, map_type, gsm, font, model, extra_option, and palette_theme. Restoring an image must restore the parameters that generated it.

  6. [P2] Update StudioStorage's latest-map asset when selecting a batch result or restoring a history image. These paths currently update only the preview; Video Studio loads latest-map and can consequently use an older image or have no map available.

Please add or update regression tests alongside the fixes. This PR changes four production files but adds no tests for the new behavior:

  • Parser/CLI/API tests for CSV-only enforcement, the defined schema, malformed rows/values, and clear validation errors before any AI call.
  • A test that the downloadable template is served successfully and parses into exactly one valid example.
  • Endpoint tests that temperature (including 0) and row overrides reach auto_map, plus partial batch failure coverage.
  • Browser tests that uploaded prompts/filenames render literally without executing markup, history restores effective row parameters, and batch/history selection updates the map consumed by Video Studio.
  • Mock external AI/network calls, run the relevant existing suites, fix failures, and report the commands and results.

Reviewed commit 0b1e117. Validation used targeted parser and mocked endpoint checks without real AI requests.

Comment thread map/functions.py Outdated
if entry is not None:
ideas.append(entry)
return ideas

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] it must support ONLY .CSV Files with defined structure

Comment thread main.py
item_eop = None if raw_eop in ("none", "") else raw_eop
item_model = str(idea.get("model") or default_model)
item_font = str(idea.get("font") or default_font)
if item_font not in available_fonts:

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Add batch_template.csv file. CSV File example with 1 example. And it must be able to be downloaded from web

@deltaaa00 deltaaa00 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the updated PR at 65457ef. The CSV-only workflow and downloadable one-example template are implemented. Temperature forwarding, effective batch history parameters, and Video Studio map synchronization have been added. The remaining history filename HTML injection is now fixed using DOM creation and textContent, with a browser regression test covering literal rendering and history restoration. Flask debug mode has been restored as requested.

Validation: 228 targeted parser/API/CLI/rendering tests passed on the final code, and all 13 map UI browser tests passed, including the new XSS regression test. No remaining blocking issues found in the reviewed scope. Approved from a code review perspective; please wait for the GitHub Actions run to pass before merging (it was still in progress at review time).

@deltaaa00
deltaaa00 merged commit 6f5d453 into deltaaa00:main Nov 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants