Repository navigation
refactor: merge commandline metadata into config metadata (C5) (@miodec) - #8537
Conversation
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
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NZNRfGDYsGYMUTp2zYUTrv
There was a problem hiding this comment.
🟡 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
commandlinefield to every config key and deriveCommandlineConfigKeyfrom the non-null entries; delete the oldcommandline-metadata.ts. - Extract command side effects into
config-actions.ts; reworkutil.tsto build commands fromconfigMeta.commandline+ actions, sharing option labels with settings. - Convert
Command.icon/iconType→fa: FaObjectacross all hand-built lists and the modal (removing the now-dead text-icon branch); add--extensions ts,tsxto 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
|
Continuous integration check(s) failed. Please review the failing check's logs and make the necessary changes. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NZNRfGDYsGYMUTp2zYUTrv
…pegame/monkeytype into c5-commandline-metadata

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: FaObjectconfig-actionsgo away at T6b.optionsMetadata(via a sharedoptionLabel), command names fromdisplayString. A commandlinedisplayoverride stays only where settings has no label to share: blind mode, quote length, sound volume, font family, keymap layout.fa: { icon, variant? }. The modal'sfaPropscast is gone, and so is its text-icon branch, which no command used. Two"fa-file-import fa-fw"strings lose the redundantfa-fw: the modal already renders icons fixed width.--extensions ts,tsx. Before this,.tsxmodules (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.
Evidence
exec/hover(setConfig, restart, sound/font preview calls).diff master.json branch.json→ identical.metadata.tsx → config-actionsimport is reported as 9 cycles throughsetters → metadata → config-actions → test-logic, which confirms the split is needed.runCommandsubgroup (setPunctuation*) and input (setFontSizeCustom) both apply.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