Skip to content

feat(desktop-gpui): double-click timeline handles to fill the gap and reset audio fades - #4251

Merged
richiemcilroy merged 6 commits into
mainfrom
feat/gpui-timeline-fill-gap
Nov 17, 2026
Merged

richiemcilroy merged 6 commits into
mainfrom
feat/gpui-timeline-fill-gap

Conversation

@richiemcilroy

@richiemcilroy richiemcilroy commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Brings back two 0.6.0 timeline shortcuts: double-clicking a zoom or scene handle runs that edge to the neighbouring segment (or the timeline's edge), and double-clicking inside an audio fade resets that fade.

Root cause

  • 0.6.0 handled a double-click on a zoom or scene handle with fillStart / fillEnd (TL/ZoomTrack.tsx:359-407, TL/SceneTrack.tsx:228-262), and a double-click on an audio fade with FadeControl's onDblClick (TL/AudioTrack.tsx:582-593). The GPUI timeline treated every press as the start of a select or drag, so a double-click did nothing extra.

What changed

flowchart LR
  P[Track mouse down] --> C{click_count == 2?}
  C -- no --> D[select / drag, as before]
  C -- yes --> K{track and hit}
  K -- zoom or scene handle --> F[fill_gap_edge: run edge to neighbour or timeline edge<br/>preview frame jumps to the new edge]
  K -- audio, inside a fade --> R[fade_reset_at: that fade to 0]
  K -- anything else --> D
  F --> S[keep the first click's selection]
  R --> S
Loading
  • edits::fill_gap_edge (apps/desktop-gpui/src/editor_edits.rs:493) uses the existing neighbours lookup, so it agrees with the drag clamping on which segment counts as the neighbour. A neighbour that already touches the edge leaves it where it is.
  • edits::fade_reset_at picks the fade under the pointer: fade-in, fade-out, or the nearer edge where they overlap. Its hit zone is at least 8 px wide, so a very short fade can still be reset. It is given the time under the pointer with the same mapping the hit test uses, not the seek time, which snaps the first 10 px of the timeline to zero: a clip that starts inside that band can still have its fade-in reset.
  • EditorWindow::double_click_segment (editor_window.rs:2660) applies either edit through the normal edit path (one undo step, project saved as usual), logs fill-gap / fade-reset, and restores the selection the first click made, as 0.6.0 did. It is checked before the drag code (:5037); any other double-click falls through to the existing behaviour.

What could regress

  • Single clicks and drags: untouched, click_count == 2 is checked first and returns early only when an edit happened.
  • Double-clicks on segment bodies, clips, captions and text segments: fall through to the existing path unchanged.
  • A short fade lies inside the 10 px trim-handle zone, so audio handles are checked for a fade hit too; a handle double-click outside any fade still falls through.

Tests

  • a_double_clicked_handle_fills_the_gap_to_its_neighbour: zoom and scene, start and end, to the neighbour and to the timeline's edges; a second double-click on a filled edge goes nowhere.
  • a_double_click_inside_a_fade_resets_that_fade: inside each fade, outside both, overlapping fades, no fade, and a 0.01 s fade widened by the minimum hit span.

Proof

Real app built from this branch and from main, Linux under Xvfb, driven with xdotool. Project: the reference recording with zoom segments at 2-5 s and 9-12 s, scene segments at 3-6 s and 10-13 s, and an imported audio clip at 1-15 s with 2.5 s fades. The same three double-clicks on both builds: zoom 1's end handle, scene 2's start handle, inside the audio fade-in.

main this PR
zoomSegments 2-5, 9-12 2-9, 9-12
sceneSegments 3-6, 10-13 3-6, 6-13
audio fade in / out 2.5 / 2.5 0 / 2.5

(read back from the saved project-config.json; the app log shows timeline edit reason="fill-gap" twice and reason="fade-reset" once)

A clip starting at 0.05 s with a 2.5 s fade-in, double-clicked at 0.1 s: the saved fade-in goes to 0 (it stayed at 2.5 when the seek time was used).

Light Dark
Before
Zoom end handle, double-clicked
Scene start handle, double-clicked
Inside the audio fade-in, double-clicked
Clip starting at 0.05 s, double-click at 0.1 s (inside the 10 px snap band): fade-in reset
main, after the same three double-clicks

Recordings: this PR (light, dark), main (light, dark).

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no new actionable issues were found.

Summary

Adds double-click shortcuts for filling zoom and scene gaps and clearing audio fades.

  • Double-clicking a zoom or scene handle fills the gap to the next segment.
  • Double-clicking an audio fade resets that fade to zero.

Reviews (6) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile

@sandchest-com

sandchest-com Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Sandchest

Sandchest reviewed ce6de0e: nothing exploitable found in this change.

Sandchest reviews every change for vulnerabilities an attacker could use · 1 credit · Review details

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found 1 potential issue (1 medium).

View 1 other finding in Capy.

Open in Capy

Comment thread apps/desktop-gpui/src/editor_window.rs Resolved
Comment thread apps/desktop-gpui/src/editor_window.rs Resolved
Comment thread apps/desktop-gpui/src/editor_edits.rs Resolved
@vercel

vercel Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
cap-status Ignored Ignored Preview Nov 17, 2026 5:09am UTC

@vercel
vercel Bot temporarily deployed to Preview – cap-status November 14, 2026 05:59 Inactive
@richiemcilroy

Copy link
Copy Markdown
Member Author

hey @greptileai, please re-review the PR

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found no issues.

View 1 other finding in Capy.

Open in Capy

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found no issues.

Open in Capy

@richiemcilroy

Copy link
Copy Markdown
Member Author

hey @greptileai, please re-review the PR

Comment thread apps/desktop-gpui/src/editor_window.rs Resolved
@vercel
vercel Bot temporarily deployed to Preview – cap-status November 17, 2026 02:50 Inactive
@richiemcilroy

Copy link
Copy Markdown
Member Author

hey @greptileai, please re-review the PR

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found no issues.

View 1 other finding in Capy.

Open in Capy

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found no issues.

Open in Capy

@richiemcilroy
richiemcilroy merged commit 170eada into main Nov 17, 2026
54 checks passed

This branch was successfully deployed

1 active and 1 inactive (outdated) deployments
Preview – cap-web — ce6de0ec Deployed Nov 17, 2026 by vercel[bot]
Preview – cap-status — 2ddd485f Deployed Nov 17, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant