Repository navigation
fix(desktop-gpui): drag, nudge and type the manual caption position - #3692
Merged
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Member
Author
|
@greptileai review |
Member
Author
|
@greptileai review |
…le the canvas overlay is live
Member
Author
|
@greptileai review |
richiemcilroy
force-pushed
the
fix/gpui-manual-caption-drag
branch
from
November 3, 2026 19:10
7d8e1d5 to
2acf210
Compare
richiemcilroy
marked this pull request as ready for review
November 3, 2026 20:49
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.
Manual caption placement in the Studio editor now does what it says: the captions on the preview can be hovered, selected and dragged, nudged with the arrow keys, or placed by typing an exact X and Y. Reported on Discord: with Position set to Manual the captions stayed bottom-centre and nothing on the stage could select them.
Why Manual did nothing
captions.settings.manualPosition, and fix(desktop-gpui): movable manual captions, area aspect ratio lock, playhead clamp after shortening edits #3230 added X/Y sliders, but the canvas had no hit target for captions. Only the caption layer measures the caption box (text shaping), and the editor'sFrameLayoutonly carried the display and camera rects, so there was nothing to hit-test.How it works
flowchart LR A[CaptionsLayer::prepare] -->|resting box, before bounce/pop| B[CaptionFrameBox] B --> C[FrameLayout.caption<br/>filled after each editor frame] C --> D{caption placed Manual?} D -- no --> E[no canvas box: clicks go to what is underneath, as before] D -- yes --> F[canvas box: hover, select, drag with guides, arrow nudge] F -->|centre as a fraction of the output frame| G[captions.settings.manualPosition] G --> Acrates/rendering/src/layers/captions.rs: the box placement is one pure function,caption_box_origin, used by preview and export alike. The layer records the resting box (bounce and pop excluded) as aCaptionFrameBox, andcrates/editorcopies it intoFrameLayout.captionafter each editor frame.apps/desktop-gpui/src/editor_canvas.rs: aCanvasSelection::Captionselement. Its size comes from the renderer; its position comes from the stored centre with the renderer's own clamp, so a drag never waits on a frame. The box only exists while the caption on screen is placed manually, so preset captions never take a click from a text overlay, mask or the screen under them. It sits on top of the other boxes because captions are drawn last.Per-segment
position_overridemanualPosition, never the global Position, so a segment overriding tomanualunder a preset global stays that way.Compatibility
manualPositionalready existed, and old projects (with or without it, including Tauri-era ones) load unchanged.FrameLayoutgainscaption: Option<CaptionFrameBox>. A preset caption's box is ignored when deciding whether a paused frame rebuilds the editor, so scrubbing across preset captions costs nothing extra.Evidence
Before and after
Screen recording (hover, drag with guides, nudge): https://raw.githubusercontent.com/CapSoftware/Cap/pr-assets/caption-drag/caption-drag.mp4
Preview matches export
Columns: editor preview, 720p export, 4K export, same frame (t = 3.4 s). Rows: centre (0.5, 0.5), top left (0.25, 0.2), bottom right (0.8, 0.9), where the box is pushed back inside the frame.
Caption box as a fraction of the frame (x0, y0, x1, y1), measured from the pixels:
Performance
Editor hover bench with the ruler held (every move is a paused scrub step), captions tab open, manual captions, release builds on the Mac mini, alternating order, 5 runs each:
Playback of the same project for 10 s: 60 fps with 0 dropped frames on both builds.
Tests


Confidence Score: 5/5
The PR appears safe to merge; no new actionable issues were found.Summary
Manual captions can now be selected, dragged, nudged, and placed with typed percentages.
No new actionable issues found. Checks were based on source review; the native UI was not run.
Reviews (4) · Last reviewed commit: "perf(desktop-gpui): read the manual capt..." · Reviewed by Greptile