refactor: solid keymap (@fehmer)#8134
Open
fehmer wants to merge 66 commits into
Open
Conversation
Contributor
|
Continuous integration check(s) failed. Please review the failing check's logs and make the necessary changes. |
a04867a to
889716f
Compare
889716f to
99e1138
Compare
Contributor
|
Continuous integration check(s) failed. Please review the failing check's logs and make the necessary changes. |
Contributor
|
Continuous integration check(s) failed. Please review the failing check's logs and make the necessary changes. |
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors the frontend keymap from legacy DOM manipulation to a SolidJS component, consolidates modifier (Shift/Alt/Caps) tracking into a shared state module, and updates config/schema/contracts to match the new keymap behavior.
Changes:
- Replace legacy
#keymapimplementation with SolidKeymapcomponent + converter/layout definitions. - Migrate
keymapShowTopRowconfig tokeymapLayoutStyle(+ legacy config migration). - Centralize modifier tracking in
states/modifiers.ts, wiring consumers (sound/opposite-shift/etc) to it.
Reviewed changes
Copilot reviewed 38 out of 38 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/schemas/src/layouts.ts | Key legends type/schema refactor; drop matrix layout schema |
| packages/schemas/src/configs.ts | Replace keymapShowTopRow with keymapLayoutStyle |
| packages/contracts/src/index.ts | Bump compatibility check header version |
| frontend/vitest.config.ts | Add static mocking harness to setup |
| frontend/static/funbox/crt.css | Update CRT keymap selector for new markup |
| frontend/src/ts/utils/misc.ts | Add typed Object.values helper |
| frontend/src/ts/test/test-ui.ts | Remove legacy keymap refresh call |
| frontend/src/ts/test/test-logic.ts | Swap tracker resets to centralized modifier reset; signal setter fix |
| frontend/src/ts/test/shift-tracker.ts | Read shift state from modifiers store |
| frontend/src/ts/test/layout-emulator.ts | Use non-reactive keymap layout getter |
| frontend/src/ts/test/alt-tracker.ts | Remove legacy alt tracker module |
| frontend/src/ts/states/test.ts | Add keymap layout resource + flash/highlight state |
| frontend/src/ts/states/modifiers.ts | New centralized modifier/caps tracking |
| frontend/src/ts/pages/test.ts | Remove legacy keymap refresh call |
| frontend/src/ts/input/handlers/keydown.ts | Use non-reactive keymap layout getter; remove mirror duplication |
| frontend/src/ts/index.ts | Stop loading legacy keymap event handler |
| frontend/src/ts/event-handlers/keymap.ts | Remove legacy click handler for keymap indicator |
| frontend/src/ts/elements/keymap.ts | Remove legacy keymap renderer/logic |
| frontend/src/ts/controllers/sound-controller.ts | Use centralized modifier state for octave shift |
| frontend/src/ts/constants/default-config.ts | Default keymapLayoutStyle value |
| frontend/src/ts/config/utils.ts | Migrate legacy keymapShowTopRow to keymapLayoutStyle |
| frontend/src/ts/config/metadata.tsx | Rename config metadata entry to keymapLayoutStyle |
| frontend/src/ts/components/pages/test/keymapLayouts.ts | New declarative keymap geometry definitions |
| frontend/src/ts/components/pages/test/keymapConverter.ts | Convert layout JSON to rendered key definitions |
| frontend/src/ts/components/pages/test/Keymap.tsx | New Solid keymap component + animations |
| frontend/src/ts/components/pages/settings/SettingsPage.tsx | Settings UI uses keymapLayoutStyle |
| frontend/src/ts/components/mount.tsx | Register/mount keymap component |
| frontend/src/ts/components/common/Button.tsx | Add tabIndex prop passthrough |
| frontend/src/ts/commandline/lists.ts | Commandline list uses keymapLayoutStyle |
| frontend/src/ts/commandline/commandline-metadata.ts | Commandline metadata for keymapLayoutStyle display |
| frontend/src/styles/media-queries-purple.scss | Remove legacy keymap sizing rules |
| frontend/src/styles/media-queries-brown.scss | Remove legacy keymap sizing rules |
| frontend/src/styles/keymap.scss | Remove legacy keymap stylesheet |
| frontend/src/styles/index.scss | Stop importing legacy keymap styles |
| frontend/src/html/pages/test.html | Replace #keymap with <mount data-component="keymap"> |
| frontend/tests/root/config-metadata.spec.ts | Update config metadata tests for new key |
| frontend/tests/components/pages/test/keymapConverter.spec.ts | Add converter regression tests |
| frontend/tests/harness/mock-static.ts | Mock static layout JSON loading for tests |
| import { fileURLToPath } from "url"; | ||
| import { vi } from "vitest"; | ||
|
|
||
| const BASE_DIR = resolve(fileURLToPath(import.meta.url), "../../../static"); |
| const charDefinitionSchema = z.array(z.string().length(1)).min(1).max(4); | ||
| const KeyLegendsSchema = z.array(z.string().length(1)).min(1).max(4); | ||
| export type KeyLegends = z.infer<typeof KeyLegendsSchema>; | ||
| const row5CharDefinitionSchema = z.array(z.string().length(1)).min(1).max(4); |
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.
No description provided.