Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
packages/ui/src/components/ui-builder/internal/components/layer-menu-items.tsx
Outdated
Show resolved
Hide resolved
…tion_* metadata in layer store
…ed performance and usability
packages/ui/src/components/ui-builder/internal/utils/templates.tsx
Outdated
Show resolved
Hide resolved
| ]; | ||
| }, [isSelected, handleCopy, handleCut, handlePaste, handleDuplicate, handleDelete, getCanPaste, isInputFocused]); | ||
|
|
||
| useKeyboardShortcuts(keyCombinations); |
There was a problem hiding this comment.
Keyboard shortcuts won't fire inside iframe canvas
High Severity
The LayerContextMenu registers copy/cut/paste/duplicate/delete keyboard shortcuts via useKeyboardShortcuts, which attaches listeners to the parent window. However, AutoFrame renders canvas content inside an iframe using createPortal. After clicking to select a layer in the canvas, focus moves to the iframe, and keyboard events fire on the iframe's window, not the parent window. The shortcuts will never trigger in the primary use case. The LayerContextMenuPortal correctly uses frameContext.document for its escape handler, showing awareness of this issue, but LayerContextMenu doesn't follow the same pattern.
Additional Locations (1)
packages/ui/src/components/ui-builder/internal/utils/templates.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| label: 'Paste', | ||
| shortcutDisplay: '⌘V', | ||
| category: 'edit', | ||
| }, |
There was a problem hiding this comment.
Shortcuts match unintended modifier key combinations
Medium Severity
The copy, cut, paste, and duplicate shortcut definitions only specify metaKey: true without constraining other modifiers like shiftKey, ctrlKey, or altKey. Since useKeyboardShortcuts treats undefined modifiers as "any value matches," combinations like Cmd+Shift+C (browser DevTools) and Cmd+Shift+V (paste unformatted) incorrectly trigger these shortcuts and call e.preventDefault(), blocking expected browser behavior. The delete, undo, and redo shortcuts correctly specify all relevant modifier constraints.


Note
Medium Risk
Touches core UI Builder editing flows (store state, event binding resolution, code generation, and layer operations), so regressions could affect runtime behavior and exported output, but changes are scoped to builder internals and are additive behind optional registries.
Overview
The UI Builder now supports bindable functions via an optional
functionRegistry, introducingVariable.type: "function"and resolving function bindings both at runtime (resolveVariableReferences) and in exported code (pageLayerToCodenow emitsfunctionsprops and infers function signatures from Zod schemas /typeSignature).Editing UX is expanded with a new layer clipboard + context menu system: global clipboard state and context-menu coordinates are added to
editor-store,useGlobalLayerActionscentralizes copy/cut/paste/duplicate/delete with permission checks and paste validation, and a portal-based context menu is rendered inside the iframe; layer menus and tree actions are refactored to use this shared action hook and a shortcut registry.Additional changes include adding
radix-ui, updatingreact-day-picker, filtering internal__function_*metadata props out of renderers, improving children/variable binding field overrides (including function-prop dropdowns), handling variable-reference children in the layers tree, adding aToaster, and bumping@btst/stackto2.1.0with updated UI Builder docs to match the new APIs.Written by Cursor Bugbot for commit c86d10c. This will update automatically on new commits. Configure here.