Skip to content

refactor: merge commandline metadata into config metadata (C5) (@miodec) - #8537

Merged
Miodec merged 8 commits into
masterfrom
c5-commandline-metadata
Oct 28, 2026
Merged

Miodec merged 8 commits into
masterfrom
c5-commandline-metadata

Conversation

@Miodec

@Miodec Miodec commented Oct 28, 2026

Copy link
Copy Markdown
Member

Roadmap step C5.

Summary

 config/metadata.tsx
   configMetadata[key]
     fa, displayString, changeRequiresRestart, …
+    commandline: { alias, display, subgroup, input } | null   // null + reason: set elsewhere / hand-built list
+  CommandlineConfigKey   // derived: keys whose commandline isn't null
 commandline/
-├── commandline-metadata.ts   # data + side effects, separate key list
+├── config-actions.ts         # afterExec / hover only (restarts, sound + font previews)
 ├── util.ts                   # builds commands from metadata.commandline + actions
 └── types.ts                  # Command.icon/iconType → fa: FaObject
  • The side effects stay commandline-side because the modules they call (test-logic, sound controller) import the config setters, which import config metadata. Moving them into metadata creates a cycle. The restarts in config-actions go away at T6b.
  • Generated commands take the settings labels: option labels come from optionsMetadata (via a shared optionLabel), command names from displayString. A commandline display override stays only where settings has no label to share: blind mode, quote length, sound volume, font family, keymap layout.
  • Every command list now uses fa: { icon, variant? }. The modal's faProps cast is gone, and so is its text-icon branch, which no command used. Two "fa-file-import fa-fw" strings lose the redundant fa-fw: the modal already renders icons fixed width.
  • Separate commit: every madge script now runs with --extensions ts,tsx. Before this, .tsx modules (incl. config metadata) were never checked for cycles. All packages still pass; frontend now checks 515 files instead of 445.

Behaviour changes

These are recorded in the spec's intended deviations.

Was Now
Minimum speed... / Minimum accuracy... Min speed... / Min accuracy... (+ "minimum" alias)
Sound on click... / Sound on error... Play sound on click... / Play sound on error...
Pace caret mode... Pace caret...
Live progress color... / opacity... Timer color... / Timer opacity... (+ "progress" alias)
Key tips... / Out of focus warning... Show key tips... / Show out of focus warning...
key tips, out of focus warning, caps lock warning: on / off show / hide
error sound "punch miss" "missed punch"
layout "off" "default"
random theme "fav" "favorite"
pace caret "tagPb" "tag pb"

Evidence

  • Before/after: I dumped every generated config command on master and on this branch (79 keys). The dump covers ids, labels, aliases, icons and variants, options, default values, input conversion, and the side effects of each exec/hover (setConfig, restart, sound/font preview calls).
    • After the merge commit, diff master.json branch.json → identical.
    • After the label commit, the only differences are the labels and aliases in the table above. No ids or side effects changed.
  • madge (ts+tsx) finds no cycles. A planted metadata.tsx → config-actions import is reported as 9 cycles through setters → metadata → config-actions → test-logic, which confirms the split is needed.
  • Unit tests: 88 files / 1674 tests pass. New util specs cover settings labels and the override. oxlint type-aware + type-check is clean.
  • Browser:
    • runCommand subgroup (setPunctuation*) and input (setFontSizeCustom) both apply.
    • Icons render correctly in search, single-list (parent icon) and input mode.
    • Searching "progress" finds Timer color and Timer opacity.
    • No console errors.

Merge Danger

Door: two-way

Blast Radius: commandline

Apart from the renamed labels, the generated commands are unchanged. The risk is in hand-built list commands, whose icon field was converted mechanically.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NZNRfGDYsGYMUTp2zYUTrv

Miodec and others added 3 commits October 28, 2026 10:01
Each config key's metadata gets a required `commandline` field (`null`
with a reason when the key has no generated command). Side effects
(test restarts, sound/font previews) move to `commandline/config-actions`
to avoid importing the setters' dependents from config metadata.
Command icons become `fa: FaObject`.

Generated commands are identical to master (ids, labels, icons, options,
exec/hover side effects for all 79 keys).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZNRfGDYsGYMUTp2zYUTrv
`--extensions ts` skipped every .tsx module, so cycles through Solid
components and config metadata went unchecked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZNRfGDYsGYMUTp2zYUTrv
Option labels come from `optionsMetadata` via `optionLabel`, command
names from `displayString`; commandline display overrides stay only
where settings has no label to share (blind mode, quote length, sound
volume, font family, keymap layout). Renamed labels are recorded in the
spec's intended deviations; "minimum" and "progress" aliases keep the
old names searchable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZNRfGDYsGYMUTp2zYUTrv
Copilot AI balanced review requested due to automatic review settings October 28, 2026 09:11
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZNRfGDYsGYMUTp2zYUTrv
@monkeytypegeorge monkeytypegeorge added frontend User interface or web stuff docs Related to Markdown files and documentation packages Changes in local packages labels Oct 28, 2026
@github-actions github-actions Bot added the waiting for review Pull requests that require a review before continuing label Oct 28, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

An active finding remains flagged in config-actions.ts where afterExec returns the playClick reference instead of invoking it, leaving the preset sound volume preview click a no-op.

1 open issue
What changed in this PR

Roadmap step C5: merges the separate commandline/commandline-metadata.ts module into config/metadata.tsx, so each config key now carries its own commandline descriptor (or null with a reason). Pure side effects (test restarts, sound/font previews) that can't move without creating an import cycle are extracted into a new commandline/config-actions.ts. Generated commands now reuse the settings labels (displayString/optionsMetadata via a shared optionLabel), and command icons migrate from loose icon/iconType strings to a typed fa: FaObject.

Changes:

  • Add a required commandline field to every config key and derive CommandlineConfigKey from the non-null entries; delete the old commandline-metadata.ts.
  • Extract command side effects into config-actions.ts; rework util.ts to build commands from configMeta.commandline + actions, sharing option labels with settings.
  • Convert Command.icon/iconType → fa: FaObject across all hand-built lists and the modal (removing the now-dead text-icon branch); add --extensions ts,tsx to madge scripts.

The refactor is faithful: optionLabel's fallback preserves underscore replacement and boolean on/off; all old side effects are present in config-actions.ts; no references to the deleted module or .icon/.iconType remain; documented label renames match the spec's intended deviations. One minor, pre-existing no-op (soundVolume preview click) was carried over verbatim — flagged as optional.

File Description
frontend/​src/​ts/​config/​metadata.tsx Adds commandline metadata per key, CommandlineConfigKey, and shared optionLabel.
frontend/​src/​ts/​commandline/​config-actions.ts New module holding command side effects (restarts, sound/font previews).
frontend/​src/​ts/​commandline/​commandline-metadata.ts Deleted; contents split between config metadata and config-actions.
frontend/​src/​ts/​commandline/​util.ts Builds commands from config metadata + actions; reuses settings option labels.
frontend/​src/​ts/​commandline/​types.ts Command.icon/iconType → fa: FaObject.
frontend/​src/​ts/​components/​modals/​CommandlineModal.tsx Uses command.fa; removes faProps cast and dead text-icon branch.
frontend/​src/​ts/​commandline/​lists.ts & lists/​*.ts Mechanical icon: → fa: { icon } conversions; CommandlineConfigKey import.
packages/​*/​package.json, frontend/​package.json madge now scans ts,tsx.
frontend/​__tests__/​commandline/​util.spec.ts Updated to new signature; adds settings-label tests.
frontend/​__tests__/​input/​helpers/​fail-or-finish.spec.ts Preserves real utils/strings exports when mocking.
docs/​specs/​solid-monkeytype/​{spec,roadmap}.md Records C5 completion and intended label deviations.

Overall this is a clean, well-verified refactor with no blocking issues found; the single comment is an optional note on a carried-over no-op.

Review effort: Balanced

Comment thread frontend/src/ts/commandline/config-actions.ts Outdated
@github-actions

Copy link
Copy Markdown
Contributor

Continuous integration check(s) failed. Please review the failing check's logs and make the necessary changes.

@github-actions github-actions Bot added waiting for update Pull requests or issues that require changes/comments before continuing and removed waiting for review Pull requests that require a review before continuing labels Oct 28, 2026
@github-actions github-actions Bot removed the waiting for update Pull requests or issues that require changes/comments before continuing label Oct 28, 2026
@Miodec
Miodec merged commit 5478cd7 into master Oct 28, 2026
15 checks passed
@Miodec
Miodec deleted the c5-commandline-metadata branch October 28, 2026 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Related to Markdown files and documentation frontend User interface or web stuff packages Changes in local packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants