Custom Video: explicit chart placement control - #42
Merged
Conversation
AJ's upgrade #4 request ("1-4可以全做", slide count/chart placement control). Slide COUNT was already explicitly controllable via admin. html's videoChatSlides dropdown (num_slides param) -- this adds control over WHERE chart slide(s) land among the body slots, which was previously always hardcoded to the front regardless of what the admin asked for. - _detect_chart_placement(): reads an explicit instruction from the topic text -- "chart at the end"/圖表放最後 -> end, "chart in the middle"/圖表放中間 -> middle, "chart on slide N"/第N張slide (only when the word chart/圖 is also present, so a plain "make it 3 slides" doesn't misfire) -> that overall slide position. Defaults to "start" -- the exact pre-existing behavior -- when nothing explicit is said. - generate_custom_video()'s body_kinds/body_payloads construction now places chart slots per that instruction (clamped so all chart slides always fit on-screen, even for a wildly out-of-range slide number), then builds each body slide's payload by walking body_kinds in order instead of assuming charts are a fixed leading prefix. Verified: py_compile, unit tests for _detect_chart_placement (start/ end/middle/index detection incl. Chinese keywords, and the "slide N" guard not misfiring without the word chart/圖 present), 7 end-to-end generate_custom_video() integration scenarios (default/start, end, middle, exact index, index clamped high, index clamped low, and placement being a no-op when no ticker/chart was detected at all), backend boot (66 routes, unchanged). Depends on feature/video-indicator-charts -> feature/video-multi-chart- slides -> feature/video-ai-background-image (branched from the first, merge in that order).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AJ's upgrade #4 request ("1-4可以全做", slide count/chart placement control). Slide COUNT was already explicitly controllable via admin. html's videoChatSlides dropdown (num_slides param) -- this adds control over WHERE chart slide(s) land among the body slots, which was previously always hardcoded to the front regardless of what the admin asked for.
Verified: py_compile, unit tests for _detect_chart_placement (start/ end/middle/index detection incl. Chinese keywords, and the "slide N" guard not misfiring without the word chart/圖 present), 7 end-to-end generate_custom_video() integration scenarios (default/start, end, middle, exact index, index clamped high, index clamped low, and placement being a no-op when no ticker/chart was detected at all), backend boot (66 routes, unchanged).
Depends on feature/video-indicator-charts -> feature/video-multi-chart- slides -> feature/video-ai-background-image (branched from the first, merge in that order).