Repository navigation
Conversation
… the editor Recording or importing a clip into an open project appends it and then rebuilds the editor window, which fitted the timeline from 0:00 again. The reload now carries the old window's position and zoom into the new one, applied where the first render would otherwise fit the timeline. A view that was never fitted is ignored, since restoring a zero zoom would zoom all the way in.
Contributor
|
@Zingzy is attempting to deploy a commit to the Cap Software Inc Team on Vercel. A member of the Team first needs to authorize it. |
Member
|
@greptileai review |
This branch has not been deployed
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.
Recording a new clip into an open project, or importing one from the Clips panel, sends the editor back to the start of the timeline. On a long project you lose your place every time you add a clip.
Cause
append_recorded_clipand the import path both finish withapp_windows::reload_editor, which removes the editor window and opens a new one. The newEditorWindowstarts with a defaultTimelineView, and its first render runsfit_on_mount, so the timeline opens at 0:00 like a fresh project. The old window's position and zoom are dropped with it.Fix
reload_editorreads the old window'sTransformbefore removing it and hands it to the new window.fit_on_mount, throughTransform::restored. That clamps the zoom and position to the new duration with the sameupdate_zoomandset_positionthe timeline already uses.MAX_ZOOM_IN.reload_editorsets the restore, so every other way of opening an editor is unchanged.The Tauri app in 0.6.0 behaves the same way. It isn't changed here.
Testing
restored_transform_keeps_the_saved_view_and_clamps_to_the_timelinecovers the saved view on a longer timeline, clamping to a shorter one, and the unfitted view.cargo test --bin cap-gpui: 1184 passed.cargo fmt --checkpasses, andcargo clippy --bin cap-gpui --testsreports nothing on the changed lines.

Confidence Score: 5/5
The PR appears safe to merge; no blocking issues were found.Summary
Keeps the timeline’s position and zoom when adding a clip reloads the GPUI editor.
No actionable issues found. Checks were limited to source inspection; tests and native UI checks were not run.
Reviews (2) · Last reviewed commit: "Merge branch 'main' into fix/editor-relo..." · Reviewed by Greptile