Skip to content

Web canvas scene navigation#572

Merged
softmarshmallow merged 1 commit intomainfrom
chore/web-canvas-scene-navigation-0e18
Mar 12, 2026
Merged

Web canvas scene navigation#572
softmarshmallow merged 1 commit intomainfrom
chore/web-canvas-scene-navigation-0e18

Conversation

@softmarshmallow
Copy link
Copy Markdown
Member

@softmarshmallow softmarshmallow commented Mar 12, 2026

Add PageUp/PageDown keybindings for switching between scenes in the web canvas.

This allows users to navigate between scenes using keyboard shortcuts: PageUp for the previous scene and PageDown for the next scene. The shortcuts are wrap-safe, prevent default browser scrolling, and are disabled when focus is on form fields or contentEditable elements.

Summary by CodeRabbit

  • New Features
    • Added keyboard shortcuts for scene navigation. Press PageUp to switch to the previous scene or PageDown to advance to the next scene within your project. Navigation shortcuts respect your current input context and only function when multiple scenes are available.

- PageUp: switch to previous scene
- PageDown: switch to next scene
- Register actions in uxhost-actions for keyboard shortcuts UI

Co-authored-by: Universe <universe@grida.co>
@cursor
Copy link
Copy Markdown

cursor Bot commented Mar 12, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 12, 2026

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

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Mar 12, 2026 9:21am
grida Ready Ready Preview, Comment Mar 12, 2026 9:21am
5 Skipped Deployments
Project Deployment Actions Updated (UTC)
code Ignored Ignored Mar 12, 2026 9:21am
legacy Ignored Ignored Mar 12, 2026 9:21am
backgrounds Skipped Skipped Mar 12, 2026 9:21am
blog Skipped Skipped Mar 12, 2026 9:21am
viewer Skipped Skipped Mar 12, 2026 9:21am

Request Review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 12, 2026

Caution

Review failed

Pull request was closed or merged during review

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: bea2a884-5c8b-4066-915b-e0cac35272b6

📥 Commits

Reviewing files that changed from the base of the PR and between 63f275d and 3f4ce5f.

📒 Files selected for processing (2)
  • editor/grida-canvas-hosted/playground/uxhost-actions.ts
  • editor/grida-canvas-react/viewport/hotkeys.tsx

Walkthrough

The changes add keyboard-based scene navigation functionality by registering two new actions (PageUp and PageDown) in the action registry and implementing corresponding hotkey handlers that switch between scenes in the current document.

Changes

Cohort / File(s) Summary
Action Registry
editor/grida-canvas-hosted/playground/uxhost-actions.ts
Added two new action entries for scene navigation: workbench.surface.view.scene-previous (PageUp) and workbench.surface.view.scene-next (PageDown), each with name, description, and keybinding configuration.
Hotkey Handlers
editor/grida-canvas-react/viewport/hotkeys.tsx
Implemented PageUp and PageDown hotkey handlers that retrieve the current scene, determine the target scene from the document's scenes list, and invoke editor.commands.loadScene() to switch scenes, with guards to prevent action when only one scene exists or when inputs/forms are focused.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Web canvas scene navigation' accurately reflects the main change in the PR, which adds PageUp/PageDown keybindings to switch between scenes in the web canvas.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/web-canvas-scene-navigation-0e18

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.

@softmarshmallow softmarshmallow merged commit fc965ba into main Mar 12, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants