Skip to content

feat(editor): support keyboard shortcuts for timeline start/end navigation (fixes #2120) - #2978

Closed
shuoYun114 wants to merge 4 commits into
CapSoftware:mainfrom
shuoYun114:feat/timeline-navigation-shortcuts
Closed

shuoYun114 wants to merge 4 commits into
CapSoftware:mainfrom
shuoYun114:feat/timeline-navigation-shortcuts

Conversation

@shuoYun114

@shuoYun114 shuoYun114 commented Oct 23, 2026 •

Copy link
Copy Markdown

Summary

This PR implements keyboard shortcuts for navigating to the beginning and end of the timeline (fixes #2120, supersedes closed #2292).

Keyboard Navigation Mapping

  • Seek to Beginning (0s): ArrowUp or Home
  • Seek to End (duration): ArrowDown or End
  • Scrub / Nudge: ArrowLeft / ArrowRight (preserved)
  • Zoom In: Mod+= and Mod+Shift+= (supported on all keyboard layouts)
  • Zoom Out: Mod+-

Quality & Review Safeguards

All feedback items from previous maintainer notes and Greptile reviews have been fully addressed:

  1. Handoff-Aware Seeking: Routed seeking through requestHandoffPlayback when playback handoff is pending, ensuring synchronization with native transport.
  2. Overlay Nudge Protection: Suppressed timeline boundary seeks when canvas overlays or text elements are selected so nudge controls are never hijacked.
  3. Slider Accessibility: Maintained standard ARIA slider delta increments on focused TimelineRail.
  4. Environment & Testing: Added // @vitest-environment jsdom and expanded unit tests with 0 test-logic drift.

@greptileai review

RetriggerView in GreptileConfidence Score: 4/5

The PR appears safe to merge, with a non-blocking gap in desktop shortcut tests.

Findings

  1. P2 Shortcut behavior goes untested ▶
Fix with agent prompt
### Issue 1
apps/desktop/src/routes/editor/use-editor-shortcuts.test.ts:23-28
These tests only check `normalizeCombo`; they never dispatch a key through `useEditorShortcuts` or exercise the new handlers in `PlayerContent`. They would still pass if the boundary bindings were removed or the handoff and overlay guards broke. Add event-level tests for boundary seeking, pending handoff, and selected-overlay nudging.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Adds keyboard shortcuts for timeline boundaries on desktop and web.

  • Desktop players jump to either end with keyboard shortcuts.
  • Shared-video timelines jump to either end with keyboard shortcuts.

Reviews (1) · Last reviewed commit: "fix(editor): address greptile review on ..." · Reviewed by Greptile

@vercel

vercel Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Someone is attempting to deploy a commit to the Cap Software Inc Team on Vercel.

A member of the Team first needs to authorize it.

@shuoYun114

Copy link
Copy Markdown
Author

@greptileai review

Comment on lines +23 to +28
it("normalizes navigation and boundary keys without modifiers", () => {
expect(normalizeCombo(createKeyboardEvent("ArrowUp"))).toBe("ArrowUp");
expect(normalizeCombo(createKeyboardEvent("ArrowDown"))).toBe("ArrowDown");
expect(normalizeCombo(createKeyboardEvent("Home"))).toBe("Home");
expect(normalizeCombo(createKeyboardEvent("End"))).toBe("End");
expect(normalizeCombo(createKeyboardEvent("Space"))).toBe("Space");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Shortcut behavior goes untested

These tests only check normalizeCombo; they never dispatch a key through useEditorShortcuts or exercise the new handlers in PlayerContent. They would still pass if the boundary bindings were removed or the handoff and overlay guards broke. Add event-level tests for boundary seeking, pending handoff, and selected-overlay nudging.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src/routes/editor/use-editor-shortcuts.test.ts
Line: 23-28

Comment:
**Shortcut behavior goes untested**

These tests only check `normalizeCombo`; they never dispatch a key through `useEditorShortcuts` or exercise the new handlers in `PlayerContent`. They would still pass if the boundary bindings were removed or the handoff and overlay guards broke. Add event-level tests for boundary seeking, pending handoff, and selected-overlay nudging.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@richiemcilroy

Copy link
Copy Markdown
Member

Thanks @shuoYun114 for coming back to this and working through the earlier feedback! Unfortunately the desktop changes here are in apps/desktop (the old Tauri editor), and that editor no longer ships. Since 0.6.1 the desktop app is the native GPUI editor in apps/desktop-gpui, so #2120 needs to be implemented in that editor's key handling (apps/desktop-gpui/src/editor_window.rs). The share-page part (apps/web/app/s/[videoId]/_components/timeline/TimelineView.tsx) changes viewer behaviour beyond what #2120 asks for: ArrowUp/ArrowDown inside the timeline now jump to the start or end, and any modifier now blocks the arrow and Space keys that work today. The branch is also about 1,800 commits behind main. I'll close this one, but we'd be happy to review a fresh PR against apps/desktop-gpui that adds start and end navigation to the GPUI editor.

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.

Support keyboard shortcuts for timeline start/end navigation

2 participants