Skip to content

Grida canvas- add bool ops shortcut#493

Merged
softmarshmallow merged 1 commit intomainfrom
canary
Jan 14, 2026
Merged

Grida canvas- add bool ops shortcut#493
softmarshmallow merged 1 commit intomainfrom
canary

Conversation

@softmarshmallow
Copy link
Copy Markdown
Member

@softmarshmallow softmarshmallow commented Jan 14, 2026

Summary by CodeRabbit

  • New Features
    • Added four boolean operations for shape manipulation: Union, Subtract, Intersect, and Exclude
    • Keyboard shortcuts now available for each operation (Alt+Shift+U, Alt+Shift+S, Alt+Shift+I, Alt+Shift+E)
    • Shortcuts are displayed in the Object menu for quick reference

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 14, 2026

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

Project Deployment Review Updated (UTC)
docs Ready Ready Preview, Comment Jan 14, 2026 11:50am
grida Ready Ready Preview, Comment Jan 14, 2026 11:50am
5 Skipped Deployments
Project Deployment Review Updated (UTC)
code Ignored Ignored Jan 14, 2026 11:50am
legacy Ignored Ignored Jan 14, 2026 11:50am
backgrounds Skipped Skipped Jan 14, 2026 11:50am
blog Skipped Skipped Jan 14, 2026 11:50am
viewer Skipped Skipped Jan 14, 2026 11:50am

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 14, 2026

Walkthrough

This PR adds keyboard shortcut support for four boolean operations (union, subtract, intersect, exclude) across the editor's action registry, menu system, hotkey handlers, and UI controls. Shortcuts use Alt+Shift with U/S/I/E respectively, with consistent implementation across all layers of the editor interface.

Changes

Cohort / File(s) Summary
Action & Menu Definition
editor/grida-canvas-hosted/playground/uxhost-actions.ts, uxhost-menu.md
Registered four new boolean operations (union, subtract, intersect, exclude) with Alt+Shift+U/S/I/E keybindings in the action registry and added corresponding macOS shortcuts (⌥⇧U/S/I/E) to the menu markdown
Menu Rendering
uxhost-menu.tsx, editor/scaffolds/sidecontrol/controls/ext-ops.tsx
Added UI components to display keyboard shortcuts alongside menu items for all four boolean operations using DropdownMenuShortcut components
Hotkey Handlers
editor/grida-canvas-react/viewport/hotkeys.tsx
Implemented four hotkey bindings that trigger boolean operations (union, difference, intersection, xor) on canvas selection with error handling and user feedback

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • Daily RC - Main Menu & Actions #485: Introduced the initial boolean object actions and menu wiring; this PR extends that foundation by adding keyboard shortcuts and hotkey bindings

Suggested labels

daily

🐰 Four operations, shortcuts so neat,
⌥⇧ keys making combinations sweet,
Union, subtract, intersect with flair,
Boolean magic floating in the air! ✨

🚥 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 accurately summarizes the main change: adding keyboard shortcuts for boolean operations (union, subtract, intersect, exclude) across the Grida canvas editor.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch canary


📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9b9fe72 and 7fd110f.

📒 Files selected for processing (5)
  • editor/grida-canvas-hosted/playground/uxhost-actions.ts
  • editor/grida-canvas-hosted/playground/uxhost-menu.md
  • editor/grida-canvas-hosted/playground/uxhost-menu.tsx
  • editor/grida-canvas-react/viewport/hotkeys.tsx
  • editor/scaffolds/sidecontrol/controls/ext-ops.tsx
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
Repo: gridaco/grida PR: 0
File: crates/grida-canvas/AGENTS.md:0-0
Timestamp: 2025-12-20T08:11:16.220Z
Learning: Applies to crates/grida-canvas/**/*.rs : Use `skia-safe` crate for painting operations in the rendering engine
📚 Learning: 2025-12-01T00:22:56.899Z
Learnt from: CR
Repo: gridaco/grida PR: 0
File: editor/app/(tools)/tools/halftone/AGENTS.md:0-0
Timestamp: 2025-12-01T00:22:56.899Z
Learning: Applies to editor/app/(tools)/tools/halftone/app/(tools)/tools/halftone/_page.tsx : When adding new shape types, update the Shape type union, add cases in drawShape() function, add cases in shapeToSVG() function, and add SelectItem in UI

Applied to files:

  • editor/grida-canvas-hosted/playground/uxhost-menu.tsx
  • editor/scaffolds/sidecontrol/controls/ext-ops.tsx
  • editor/grida-canvas-hosted/playground/uxhost-actions.ts
  • editor/grida-canvas-react/viewport/hotkeys.tsx
🧬 Code graph analysis (3)
editor/scaffolds/sidecontrol/controls/ext-ops.tsx (2)
editor/components/ui/dropdown-menu.tsx (1)
  • DropdownMenuShortcut (253-253)
editor/grida-canvas-hosted/playground/uxhost-shortcut-renderer.tsx (1)
  • keyboardShortcutText (55-66)
editor/grida-canvas-hosted/playground/uxhost-actions.ts (1)
editor/grida-canvas/keybinding.ts (1)
  • kb (99-101)
editor/grida-canvas-react/viewport/hotkeys.tsx (1)
editor/grida-canvas/index.ts (1)
  • editor (4-4)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: test
🔇 Additional comments (5)
editor/grida-canvas-hosted/playground/uxhost-menu.md (1)

99-102: LGTM!

Documentation correctly updated to reflect the new boolean operation shortcuts (⌥⇧U/S/I/E) with the Ready status set to ✅, consistent with the action definitions.

editor/grida-canvas-hosted/playground/uxhost-menu.tsx (1)

1364-1396: LGTM!

The keyboard shortcuts for all four boolean operations are correctly wired using keyboardShortcutText with the appropriate action IDs, following the established pattern in this file.

editor/scaffolds/sidecontrol/controls/ext-ops.tsx (1)

7-18: LGTM!

Shortcuts correctly added to the boolean operations dropdown, using the same pattern and action IDs as the main menu. Import additions are appropriate.

Also applies to: 60-95

editor/grida-canvas-react/viewport/hotkeys.tsx (1)

526-601: LGTM! Well-implemented hotkey handlers.

The boolean operation hotkeys are correctly implemented with:

  • Appropriate guards (canvas backend, selection ≥ 2)
  • Consistent error handling pattern with console.error and toast.error
  • Standard hotkey options for disabling on form tags and contentEditable

The handlers follow the same pattern used elsewhere in this file.

editor/grida-canvas-hosted/playground/uxhost-actions.ts (1)

489-512: LGTM!

The boolean operation actions are correctly defined with:

  • Consistent naming pattern (boolean-union, boolean-subtract, etc.)
  • Clear descriptions
  • Proper keybinding definitions using M.Alt | M.Shift with the appropriate keys
  • No conflicts with existing keybindings in the registry

✏️ Tip: You can disable this entire section by setting review_details to false in your review 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.

@softmarshmallow softmarshmallow merged commit b62be61 into main Jan 14, 2026
10 checks passed
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