Skip to content

Added Sift+Arrow right/left for faster timeline peaking#417

Open
qubydev wants to merge 2 commits intosiddharthvaddem:mainfrom
qubydev:main
Open

Added Sift+Arrow right/left for faster timeline peaking#417
qubydev wants to merge 2 commits intosiddharthvaddem:mainfrom
qubydev:main

Conversation

@qubydev
Copy link
Copy Markdown

@qubydev qubydev commented Apr 10, 2026

Pull Request Template

Description

Added Shift + ArrowLeft and Shift + ArrowRight keyboard shortcuts to allow jumping through the video timeline in larger 10-frame increments.

Motivation

Makes scrubbing through the timeline significantly faster, as regular arrow keys only move one frame at a time.

Type of Change

  • New Feature
  • Bug Fix
  • Refactor / Code Cleanup
  • Documentation Update (Added to FIXED_SHORTCUTS)
  • Other (please specify)

Related Issue(s)

#416

Screenshots / Video

Recording.2026-04-11.034313.mp4

Testing

  1. Open the editor and load a video.
  2. Hold Shift and press or .
  3. Verify that the playhead jumps by 10 frames instead of the usual 1 frame.
  4. Run tests with npx vitest run.

Checklist

  • I have performed a self-review of my code.
  • I have added any necessary screenshots or videos.
  • I have linked related issue(s) and updated the changelog if applicable.

Summary by CodeRabbit

  • New Features
    • Added faster frame navigation: Shift + ← / Shift + → jump 10 frames in the video editor.
  • Tests
    • Added unit tests validating large-step (10-frame) forward/back stepping.
  • Localization
    • Added shortcut labels for the new large-step actions in English, Spanish, French, Turkish, and Chinese (zh-CN).

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 10, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d9ee7d1c-d385-4ce9-afc8-743e81287dc8

📥 Commits

Reviewing files that changed from the base of the PR and between efb9c1c and 133b829.

📒 Files selected for processing (5)
  • src/i18n/locales/en/shortcuts.json
  • src/i18n/locales/es/shortcuts.json
  • src/i18n/locales/fr/shortcuts.json
  • src/i18n/locales/tr/shortcuts.json
  • src/i18n/locales/zh-CN/shortcuts.json
✅ Files skipped from review due to trivial changes (5)
  • src/i18n/locales/zh-CN/shortcuts.json
  • src/i18n/locales/fr/shortcuts.json
  • src/i18n/locales/en/shortcuts.json
  • src/i18n/locales/es/shortcuts.json
  • src/i18n/locales/tr/shortcuts.json

📝 Walkthrough

Walkthrough

Shift+Arrow now triggers a larger (10-frame) step: added LARGE_FRAME_DURATION_SEC, extended computeFrameStepTime with an isFast flag, wired VideoEditor keyboard handler to pass e.shiftKey, added fixed Shift+Arrow shortcuts, and updated tests and i18n entries.

Changes

Cohort / File(s) Summary
Core Frame Step Logic
src/lib/frameStep.ts
Exported LARGE_FRAME_DURATION_SEC (10/60s) and updated computeFrameStepTime(currentTime, duration, direction, isFast = false) to use the larger delta when isFast is true; still clamps to [0, duration].
Tests
src/lib/__tests__/frameStepNavigation.test.ts
Added tests invoking computeFrameStepTime(..., isFast = true) to assert forward/backward jumps use LARGE_FRAME_DURATION_SEC.
VideoEditor Integration
src/components/video-editor/VideoEditor.tsx
Arrow key handler loosened to allow e.shiftKey (still blocks Ctrl/Meta/Alt) and now passes e.shiftKey into computeFrameStepTime to enable fast stepping.
Shortcut Registration
src/lib/shortcuts.ts
Added largeFrameBack and largeFrameForward to FIXED_SHORTCUTS as Shift+← and Shift+→ bindings (affects conflict detection).
i18n
src/i18n/locales/en/shortcuts.json, src/i18n/locales/es/shortcuts.json, src/i18n/locales/fr/shortcuts.json, src/i18n/locales/tr/shortcuts.json, src/i18n/locales/zh-CN/shortcuts.json
Added fixedActions.largeFrameBack and fixedActions.largeFrameForward translation entries across locales.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • siddharthvaddem

Poem

shift held down, frames leap in a dash,
ten at once — lowkey fast, slightly brash,
left or right, the cursor flies,
nit: feels good, kinda cursed in disguise ✨🎬

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive Title contains a typo ('Sift' instead of 'Shift') and uses vague phrasing ('faster timeline peaking') that doesn't clearly convey the actual change. Fix typo and clarify: 'Add Shift+Arrow shortcuts for 10-frame timeline navigation' or similar would be more descriptive and accurate.
✅ Passed checks (2 passed)
Check name Status Explanation
Description check ✅ Passed Description covers all required sections: purpose clearly stated, motivation explained, type of change marked, related issue linked, testing steps provided, and checklist items completed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/lib/__tests__/frameStepNavigation.test.ts (1)

47-55: Add fast-mode boundary clamp tests too (nit: cleaner coverage).

These two tests validate the delta math, but we still don’t explicitly assert clamping with isFast=true near 0/duration. small gap, easy win.

Suggested extra tests
+ it("clamps to 0 when fast-stepping backward near the beginning", () => {
+   const result = computeFrameStepTime(LARGE_FRAME_DURATION_SEC / 2, duration, "backward", true);
+   expect(result).toBe(0);
+ });
+
+ it("clamps to duration when fast-stepping forward near the end", () => {
+   const result = computeFrameStepTime(
+     duration - LARGE_FRAME_DURATION_SEC / 2,
+     duration,
+     "forward",
+     true,
+   );
+   expect(result).toBe(duration);
+ });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/lib/__tests__/frameStepNavigation.test.ts` around lines 47 - 55, Tests
for computeFrameStepTime with isFast=true are missing boundary-clamp assertions;
add two additional unit tests that call computeFrameStepTime near the lower and
upper boundaries (e.g., time = 0 + small epsilon and time = duration - small
epsilon) with direction "backward"/"forward" and isFast=true and assert the
result is clamped to 0 and duration respectively (use LARGE_FRAME_DURATION_SEC
and the existing duration test variable to compute expected clamped values and
toBeCloseTo for numeric comparison). Ensure test names mention fast-mode
boundary clamping and reuse the same helpers/variables as the existing tests.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/lib/shortcuts.ts`:
- Around line 74-85: Add missing translation entries for the new shortcut i18n
keys: fixedActions.largeFrameBack and fixedActions.largeFrameForward (these
correspond to the i18nKey values "largeFrameBack" and "largeFrameForward" in the
shortcuts list) to the English locale JSON used for shortcuts (so they don't
fall back to default). Update the shortcuts locale object (e.g., the shortcut
keys section in the shortcuts.json locale file) with human-readable strings for
both keys, keeping the wording consistent with the other entries such as "Large
Frame Back" and "Large Frame Forward".

---

Nitpick comments:
In `@src/lib/__tests__/frameStepNavigation.test.ts`:
- Around line 47-55: Tests for computeFrameStepTime with isFast=true are missing
boundary-clamp assertions; add two additional unit tests that call
computeFrameStepTime near the lower and upper boundaries (e.g., time = 0 + small
epsilon and time = duration - small epsilon) with direction "backward"/"forward"
and isFast=true and assert the result is clamped to 0 and duration respectively
(use LARGE_FRAME_DURATION_SEC and the existing duration test variable to compute
expected clamped values and toBeCloseTo for numeric comparison). Ensure test
names mention fast-mode boundary clamping and reuse the same helpers/variables
as the existing tests.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b5ca909a-a0a3-46c8-91cd-841af2d1c8e3

📥 Commits

Reviewing files that changed from the base of the PR and between 68295b2 and efb9c1c.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (4)
  • src/components/video-editor/VideoEditor.tsx
  • src/lib/__tests__/frameStepNavigation.test.ts
  • src/lib/frameStep.ts
  • src/lib/shortcuts.ts

Comment thread src/lib/shortcuts.ts
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