4 Commits

Author SHA1 Message Date
zzzworm
9c6a96c2d3 fix(video): align scene narration and fit diagrams (#3014)
* fix(video): align scene narration and fit diagrams

- Refine bilingual prompts for scene-by-scene narration and visuals
- Fit and center SVG diagrams with their labels and strokes
- Improve geometry coordinate guidance and preserve layout retries

* fix(video): do not report a fitted scene graphic as overflow

The kit scales a graphic with a transform on its full-size frame, so the
scaled frame box and the SVG canvas can exceed the region while the drawing
fits. Measure HTML overflow without that transform and canvas.

---------

Co-authored-by: zzzworm <15828873+zzzworm86@user.noreply.gitee.com>
Co-authored-by: zszz3 <91608029+zszz3@users.noreply.github.com>
2026-11-28 13:51:06 +08:00
RRFZ
ee678ec8c6 fix(video_lesson): read the layout check's browser output as UTF-8
check_layout ran headless Chrome with text=True and no encoding, so the
server decoded --dump-dom with its ANSI code page. The report quotes the
lesson's own text; on a cp936/cp932 server running outside UTF-8 mode
(as under `deeptutor start`) a lesson with non-ASCII text came back as
mojibake, the JSON no longer parsed, and the check returned None, which
callers treat as "no browser available". The layout QA silently never
ran for those lessons.

Decode the browser's output as UTF-8.
2026-10-31 21:05:32 -04:00
Bingxi Zhao (Frank)
3f027d9437 fix(video): discover browsers cross-platform and distinguish unavailable reviews 2026-10-31 16:57:19 +08:00
Amar Tinawi
d6fd294284 feat(video_lesson): browser layout check with repair rounds
The build check proves a lesson compiles and plays; it cannot see a drawing
crossing a title or a card covering a label. After a lesson builds, open
the bundle in headless Chrome at a frame every 4 s, measure every visible
text box and sample points along every visible SVG stroke, and send
collisions back to the writer in 1920x1080 coordinates:

- text overlapping text
- strokes passing through text (dash-aware)
- opaque boxes covering text outside them
- anything drawn in the caption band (y > 880)

Up to 2 layout rounds (MAX_ATTEMPTS 3 -> 4). The last bundle that built is
kept, so a layout fix that then fails to compile still returns the lesson
that played. The check is advisory: no Chrome, a probe error or a timeout
skips it. The English writer prompt gains a layout contract (safe area,
planned boxes, label spacing) and layout-aware retry guidance.
2026-10-30 15:15:44 +04:00