Repository navigation
[0.0.27] feat(cli): add Ghostty-style +list-*/+show-config helper actions (#2464) - #2550
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 17 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
7ed511d to
14131a6
Compare
Address the #2550 review findings on the helper-action surface: - Portable editor tests: use PATH-resolved `true`/`false` and a PATH-unique missing-editor name instead of `/bin/true` and an absolute missing path, so the Unix-only regressions also run on macOS. - Reject `config edit`/`+edit-config` with `--safe`: safe mode never reads the edited file, so validating through the safe loader would report a false success. Exit 2 with `E_SAFE_UNSUPPORTED`, leave the file untouched, and remove `--safe` from the alias usage/flags. - Attribute the `profile` JSON row from `LoadedConfig.profile_name`/ `profile_path` (never `core-defaults/default`) and mark the derived `theme.contrast` row as `policy`/`policy`; add a `--profile` JSON regression. - Compute `truncated` from the real row count, normalize editor failures to exit 1 with a message and `E_EDITOR_FAILED` (no-config-root remains `E_CONFIG_PATH`), and classify the Windows per-user font root. - Rename remaining CTX-1446 code comments to the durable task CTX-1467. Refs #2464.
56dc8ec to
191fdc6
Compare
Address the #2550 review findings on the helper-action surface: - Portable editor tests: use PATH-resolved `true`/`false` and a PATH-unique missing-editor name instead of `/bin/true` and an absolute missing path, so the Unix-only regressions also run on macOS. - Reject `config edit`/`+edit-config` with `--safe`: safe mode never reads the edited file, so validating through the safe loader would report a false success. Exit 2 with `E_SAFE_UNSUPPORTED`, leave the file untouched, and remove `--safe` from the alias usage/flags. - Attribute the `profile` JSON row from `LoadedConfig.profile_name`/ `profile_path` (never `core-defaults/default`) and mark the derived `theme.contrast` row as `policy`/`policy`; add a `--profile` JSON regression. - Compute `truncated` from the real row count, normalize editor failures to exit 1 with a message and `E_EDITOR_FAILED` (no-config-root remains `E_CONFIG_PATH`), and classify the Windows per-user font root. - Rename remaining CTX-1446 code comments to the durable task CTX-1467. Refs #2464.
191fdc6 to
49e2923
Compare
|
Review finding (canonicalization wording) resolved at final head
Not merged. |
49e2923 to
564fbef
Compare
|
Guard triage (bitty guard cron): CI red is infrastructure, not this diff.
One targeted rerun of the failed leaf jobs was attempted from this tick and reproduced the same signature. Per the guard rule this is not rerun-chased further and the PR is not merged past a red check. Every other leg (Quality gates, MSRV, macOS, Windows, supply chain, CodeQL, compat matrices) is green. Blocked on: #2561 (reduce the bench footprint / move the perf build out of the M1 matrix legs). Re-queue this PR once #2561 lands, or report the green non-bench legs if the owner accepts a bench-leg exception here. |
9a668f4 to
bba2ac9
Compare
Address the #2550 review findings on the helper-action surface: - Portable editor tests: use PATH-resolved `true`/`false` and a PATH-unique missing-editor name instead of `/bin/true` and an absolute missing path, so the Unix-only regressions also run on macOS. - Reject `config edit`/`+edit-config` with `--safe`: safe mode never reads the edited file, so validating through the safe loader would report a false success. Exit 2 with `E_SAFE_UNSUPPORTED`, leave the file untouched, and remove `--safe` from the alias usage/flags. - Attribute the `profile` JSON row from `LoadedConfig.profile_name`/ `profile_path` (never `core-defaults/default`) and mark the derived `theme.contrast` row as `policy`/`policy`; add a `--profile` JSON regression. - Compute `truncated` from the real row count, normalize editor failures to exit 1 with a message and `E_EDITOR_FAILED` (no-config-root remains `E_CONFIG_PATH`), and classify the Windows per-user font root. - Rename remaining CTX-1446 code comments to the durable task CTX-1467. Refs #2464.
…ctions (#2464) Add bitty +<action> aliases over the canonical implementations instead of parallel logic: the parser maps each alias onto the existing list, config, or extension dispatch fields, so both spellings run one code path. - +list-themes, +list-keybinds, +list-actions, +list-plugins map to list kinds. - +list-colors adds the effective 16 ANSI + UI token catalog with resolved values and the shared theme contrast policy (no parallel rule). - +list-fonts reuses the renderer's process-wide fontdb scan: family, style, and coarse source, sorted, deduplicated, capped at 512 rows, headless safe. - +list-extensions maps to `extension list`; --safe is accepted as a no-op for the static inventory. - +show-config, +validate-config, +edit-config map to new config show, validate, and edit verbs. show/validate emit stable envelope v1 JSON with per-key layer/source attribution; validate exits 2 on invalid config; edit re-validates after the editor exits without rewriting the user's bytes. - Static lists load no plugin VM and open no network; --safe keeps builtin parity for themes/colors/config. - Help, completion grammar, and golden fixtures cover every alias; CHANGELOG records the new surface. Manual/docs pages needing sync are named in the PR. Refs #2464.
Address the #2550 review findings on the helper-action surface: - Portable editor tests: use PATH-resolved `true`/`false` and a PATH-unique missing-editor name instead of `/bin/true` and an absolute missing path, so the Unix-only regressions also run on macOS. - Reject `config edit`/`+edit-config` with `--safe`: safe mode never reads the edited file, so validating through the safe loader would report a false success. Exit 2 with `E_SAFE_UNSUPPORTED`, leave the file untouched, and remove `--safe` from the alias usage/flags. - Attribute the `profile` JSON row from `LoadedConfig.profile_name`/ `profile_path` (never `core-defaults/default`) and mark the derived `theme.contrast` row as `policy`/`policy`; add a `--profile` JSON regression. - Compute `truncated` from the real row count, normalize editor failures to exit 1 with a message and `E_EDITOR_FAILED` (no-config-root remains `E_CONFIG_PATH`), and classify the Windows per-user font root. - Rename remaining CTX-1446 code comments to the durable task CTX-1467. Refs #2464.
#2464) The profile-attribution regression built the expected source with Path::display() and raw substring matching, but the JSON writer escapes Windows backslashes. Parse the flat key row and compare decoded value/layer/source fields instead, keeping the layer assertions for the profile row and the derived theme.contrast policy row. Verified with the focused Linux test and `cargo check -p bitty-terminal -p bitty-render --target x86_64-pc-windows-gnu --all-targets --locked`. Refs #2464.
…ty (#2464) Windows may render the same profile path in 8.3 short form in the config envelope while the fixture holds the long form. Canonicalize the decoded `profile: ` path and the fixture path before comparing, so the assertion checks canonical path equality instead of a rendered string. This keeps the profile `layer:"profile"` and `theme.contrast` `layer:"policy"` assertions without weakening them to a file name. Verified with the focused and full Linux cli_plus_actions suites and `cargo check -p bitty-terminal -p bitty-render --target x86_64-pc-windows-gnu --all-targets --locked`. Refs #2464.
9b1ef8a to
41bb66b
Compare
Summary
Implements #2464 (CarryCtx CTX-1467) with Ghostty-style
+<action>aliases over the existing canonical implementations.bitty list ...,bitty config ..., andbitty extension listremain canonical; the parser maps every alias onto the same dispatch fields, so there is no parallel catalog or validation logic.New aliases
bitty +list-themesbitty list themesbitty +list-colorsbitty list colors(new kind)bitty +list-fontsbitty list fonts(new kind)bitty +list-keybindsbitty list keymapsbitty +list-actionsbitty list actionsbitty +list-pluginsbitty list pluginsbitty +list-extensionsbitty extension listbitty +show-configbitty config show(new verb; same rows asconfig check, JSON adds attribution)bitty +validate-configbitty config validate(new verb)bitty +edit-configbitty config edit+ post-edit validationBehavior
#rrggbbvalues and contrast measured by the sharedbitty-config::theme::contrast_checkspolicy. Result envelope also carries the canvasbackground. No parallel contrast rule.fontdbscan (bitty-render::font_catalog), not a second discovery mechanism. Rows are unique(family, style, source), sorted, capped at 512, withsupported/total/truncated.sourceisuser|system|embedded; absolute paths never appear. No network, no subprocess, no VM; missing fontconfig or headless sessions yield an empty/partial catalog without panicking.config show/config validateemit stable envelope v1 JSON.showprojects 30 bounded effective keys, each withvalue,type,layer, andsourceattribution from the startup loader.validateexits 2 with a typedE_CONFIG_INVALIDenvelope on invalid input and no key dump.editre-validates after the editor exits, never rewrites the user's bytes, and returns 2 on an invalid edit; a failed editor launch leaves the file untouched.--safeselects the built-in safe config for colors/show/validate and keeps theme listing built-in-only;+list-extensions --safeis accepted as a no-op for the static inventory.config edit/+edit-configrejects--safe(exit 2,E_SAFE_UNSUPPORTED) because safe mode never reads the edited file; validating through it would report a false success.--help,bitty help +<action>, completion grammar, and all five golden fixtures cover the new surface.CHANGELOG.mdrecords the feature.Command examples
Example
+list-colorsoutput (table):Verification
Scoped target dir
CARGO_TARGET_DIR=$BITTY_WORKSPACE/.targets/ctx-1446; worktree based onorigin/mainat7173d7e0.cargo fmt --all -- --check— clean.cargo clippy -p bitty-terminal -p bitty-render --all-targets --locked -- -D warnings— clean.cargo check -p bitty-terminal -p bitty-render --target x86_64-pc-windows-gnu --all-targets --locked— clean (includes the attribution regression and the Windows per-user font root).cli_*integration suites — 293 tests passed, including:cli_plus_actions(new) — 13 passed: alias/canonical payload equivalence, JSON schema stability, invalid config, missing editor, post-edit validation, safe edit rejection, editor-failure normalization, profile/policy attribution, safe-mode parity, headless fonts, help, completions.cli_list— 31 passed (updated for the new kinds).cli_completion,cli_help,cli_config_fallback,cli_safe_parity,cli_show_font,cli_theme_contrast,cli_unknown_flag, and the remaining CLI suites.plus::— 4 passedlist::tests::— 51 passedconfig_cli::startup_tests::— 12 passedgrammar::tests::— 7 passedbitty-renderfont_catalog— 4 passedReview follow-up (#2550)
Applied on the same branch in
22bf1382:true/falseand a PATH-unique missing-editor name; no/bin/trueor absolute fixture paths.config edit/+edit-configrejects--safewith exit 2 andE_SAFE_UNSUPPORTEDbefore spawning an editor;--saferemoved from the alias usage/completion flags; regression proves the file is untouched.profilerow now usesLoadedConfig.profile_name/profile_path(layer: profile,source: profile: <path>), and the derivedtheme.contrastrow reportspolicy/policy;--profileJSON regression added.truncatedis computed from the real row count; editor failures normalize to exit 1 with a message andE_EDITOR_FAILED(no-config-root usesE_CONFIG_PATH); Windows per-user font root (%LOCALAPPDATA%\Microsoft\Windows\Fonts) classified; remainingCTX-1446code comments renamed toCTX-1467.keysrow and compares decodedvalue/layer/sourcefields instead of raw substring matchingPath::display(). The decodedprofile:source is now compared by canonical path equality: both sides are passed throughstd::fs::canonicalizeand the resultingPathBufs are compared. This handles Windows 8.3 short forms versus long forms without weakening the assertion to a file name. Thelayer:"profile"andtheme.contrastlayer:"policy"assertions remain; Windows cross-targetcargo check --all-targetsis clean.Docs and manual sync (follow-up in the owning repos)
These pages mention the affected CLI/config surfaces and need synchronization in their own repos (not edited here):
bitty-terminal-docs/interfaces/cli.mdbitty-terminal-docs/specifications/cli-contract-rfc.mdbitty-terminal-docs/configuration/themes.mdbitty-manual/en/getting-started/cli.mdbitty-manual/en/configuration/overview.mdbitty-manual/en/configuration/themes.mdbitty-manual/en/faq/troubleshooting.md(pluszh-CNcounterparts once i18n ownership/sync is defined)Notes
CTX-1446, an unrelated completed task). Code comments and commit headers useCTX-1467; the worktree directory keeps the originally requested name.564fbef99ecd78e2ea0bd7b7b13346b2e4cb5fb3(rebased onmainatd014721a).config editeditor flow, now followed by read-only validation.Do not merge; awaiting independent review, CodeRabbit, and CI.
Closes #2464