Repository navigation
feat: add batch map generation from ideas file, Run History map resto… - #3
Conversation
…re, and smooth loading stage animations
deltaaa00
left a comment
There was a problem hiding this comment.
Please address these issues before merging. This includes deltaaa00's two existing inline comments, which remain requirements:
-
[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.
-
[P1] Add batch_template.csv containing the defined headers and exactly one example data row, and make it downloadable from the web UI.
-
[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.
-
[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.
-
[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.
-
[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.
| if entry is not None: | ||
| ideas.append(entry) | ||
| return ideas | ||
|
|
There was a problem hiding this comment.
[P1] it must support ONLY .CSV Files with defined structure
| 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: |
There was a problem hiding this comment.
[P1] Add batch_template.csv file. CSV File example with 1 example. And it must be able to be downloaded from web
…re/history fixes, and dynamic model list
… harden Flask/API security
deltaaa00
left a comment
There was a problem hiding this comment.
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).
…re, and smooth loading stage animations