feat: Add visual keymap editor to workbench#912
Merged
Conversation
…tegration Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ditor Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ution safety Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… popover placement Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…rting on edit Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… with Code Editor Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…n editing keycodes Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…structure Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… breaks Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…splay Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…for new keys Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…eycaps Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…al Editor Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.cfile is selected, Code Editor / Visual Editor tabs appear above the editor areaCustomKeypopover opens (KEY / HOLD-TAP / CUSTOM tabs) → select a keycode →keymap.cis updatedKC_NO), delete layersNew files
src/components/workbench/visualeditor/VisualKeymapEditor.tsx) — Main container with local state management for optimistic updatessrc/components/workbench/visualeditor/VisualKeycap.tsx) — Individual keycap rendering with keycode labelsrc/components/workbench/visualeditor/LayerSelector.tsx) — Layer tabs with add/delete buttonsLayoutPreviewDialogModified files
EditorWithVisualTabwrapper component that handles Code/Visual tab switching. Tabs only appear when a.ckeymap file is selected.Key design decisions
VisualKeymapEditormaintains its ownParsedKeymapstate, updates it immediately on edits, and syncs back from props when external code changes (e.g., switching back from Code Editor). This avoids the async Redux update delay.min(layoutKeyCount, keymapKeyCount)keys to prevent index-out-of-bounds errorsresolveKeyForPopover()wraps keycode lookup in try/catch, returning null for unrecognized codesTest plan
npm run type-check— Cleannpm test -- --run— All 1097 tests passkeymap.cCustomKeypopover appears near the keykeymap.creflects visual editskeyboard.json) → verify tabs do NOT appear🤖 Generated with Claude Code