fix(captions): position presets you can click, sliders that reach the true edge - #471
Conversation
… true edge The offset sliders shipped in #396 let a caption band reach every position but gave users no legible way to say "put it at the top" short of finding the right number. Presets (top/middle/bottom, and a new left/center/right band position) are now the everyday path; a preset button is highlighted only while its axis' offset is exactly the value that preset would set — so dragging a slider away silently clears the highlight, and clicking a preset snaps the slider back to a clean value, with no separate "active preset" state to keep in sync. The new left/center/right row is band position, not text alignment — kept visually distinct from the existing (unchanged) text-align row with its own section label and icon buttons, since the two would otherwise read as the same control. offsetX/offsetY already reached the true frame edge (that was #396); this only changes how presets and sliders talk to each other.
…d anchor settings.ts:217,262 was already stale before this change; the new preset helpers land right above getCaptionSettings/patchCaptionSettings and shift it further, to :279,324. Kept separate from the fix commit: docs-only changes aren't part of what the release branch's cherry-pick lane accepts.
|
Warning Review limit reached
Next review available in: 33 minutes Limit details: You’ve used all 4 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?Wait for the limit to reset, then comment An organization admin can change what happens after included review limits in Billing. How do review limits work?CodeRabbit enforces per-developer PR review limits within each organization. For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (19)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…ecked activeHorizontalPositionPreset checked "is this centered?" before "is this flush left/right?" — fine normally, but as width approaches 100 the whole reachable range shrinks toward 0 right along with it, so a band sitting exactly at the true left/right edge could fall inside the center check's epsilon too and get reported as centered. Comparing all three candidates and keeping the nearest one is correct regardless of how narrow the range gets. Found via code review (CodeRabbit hit its OSS rate limit on the PR, so this ran as a subagent review instead). Reachable today only through a hand-edited or externally-generated project file — legacyEditor.captions has no schema validation — not through the shipped integer-stepped width slider.
|
@coderabbitai review |
|
The anchor redesign's doc rewrite rode along with the guide-overlay commit, which is add-then-revert within the PR and was therefore skipped here. This carries the surviving half: the settings table, and the sections that described the fixed band, the overhang and the preset machinery — none of which exists any more. Applied as one commit rather than cherry-picked because this branch's copy of the file never received #471's docs commit (docs are excluded from the cherry-pick lane), so its lineage differs from main's and the patch does not apply.
Summary
offsetX/offsetY, so old projects open unchanged.offsetX/offsetYalready reached the true frame edge ([Bug]: captions are placed relative to the footage rect, not the frame — and can't be nudged to the edges #396); this changes how presets and sliders talk to each other, not the reachable range.positionLeft/Center/Right+textAlignkeys, "offset" → "position" wording) so a cherry-pick can't ship the new UI in English-only.Targets
main; per request this is meant to be cherry-picked ontorelease/v1.10.0afterward as a self-contained fix.Test plan
npx vitest --run src/lib/ai-edition/captions src/components/ai-edition/CaptionsPane.placement.test.tsx— 55 passed, including new preset-derivation and preset/slider-interaction testsnpm run test(full suite) — 181 files / 2160 tests passednpm run i18n:checkand thelocaleParityvitest suite — all 13 locales passnpx tsc --noEmitandnpx tsc -p tsconfig.test.json --noEmit— cleannpm run lint— cleannpm run docs:check— clean?windowType=editorneeds one): clicking Top/Middle/Bottom and the new Position left/center/right icons sets the store'soffsetX/offsetYto the exact expected value and highlights the right button; dragging either slider clears every preset in that row; the new row disables exactly when the band is full-width, matching the existing horizontal slider🤖 Generated with Claude Code