Skip to content

feat(tui): list custom themes in picker - #5907

Open
wuisabel-gif wants to merge 1 commit into
Hmbown:mainfrom
wuisabel-gif:wuisabel/5901-custom-theme-picker
Open

feat(tui): list custom themes in picker#5907
wuisabel-gif wants to merge 1 commit into
Hmbown:mainfrom
wuisabel-gif:wuisabel/5901-custom-theme-picker

Conversation

@wuisabel-gif

Copy link
Copy Markdown
Contributor

Summary

Addresses the approved #5901 slice.

The /theme picker now:

  • discovers valid user-authored overlays from $CODEWHALE_HOME/themes/;
  • appends custom overlay rows after compiled themes in stable order;
  • preserves the normalized raw custom:<name> selector in App state;
  • highlights the active custom overlay and previews its resolved colors;
  • preserves a custom selector when the picker is opened and committed without navigation;
  • continues to persist intentional built-in-theme selection normally;
  • ignores invalid, unreadable, oversized, and symlinked overlay files without breaking the built-in picker.

The configuration guide and synchronized changelogs document the picker behavior.

Tests

Passed locally:

  • cargo fmt --all -- --check
  • git diff --check
  • ./scripts/sync-changelog.sh --check
  • user-theme discovery tests: 4 passed
  • theme-picker tests: 20 passed with RUST_MIN_STACK=16777216
  • custom live App-state test: passed
  • config-command tests: 94 passed
  • cargo clippy -p codewhale-tui --all-targets --locked -- -D warnings

No provider credentials or network access are required.

No-Issue: This PR addresses the approved focused #5901 picker slice without automatically closing the broader issue.

Discover validated user theme overlays, preserve the raw custom selector in App state, preview custom colors, and prevent no-movement picker commits from clobbering overlays. Add picker, loader, and config regression coverage for Hmbown#5901.
@wuisabel-gif
wuisabel-gif requested a review from Hmbown as a code owner September 6, 2026 01:03

@Hmbown Hmbown left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Verified the clobber on main — apply.rs passed the base theme name as the picker's original, and app/init.rs dropped the normalized selector, so storing app.theme_name (and cloning it at apply.rs:1981) is the right fix; the custom:midnight preview/commit test and the live App-state test in config.rs are exactly the coverage this needed. Two asks: (1) are the new custom rows exercised at narrow width (the picker's list-when-narrow path at theme_picker.rs:202 has infra; a one-line assertion would pin it), and (2) confirm custom row labels route through the same localized label helpers as built-ins. Thanks for skipping invalid/oversized/symlinked overlays and for leaving prompts/text.rs untouched. Housekeeping: commit is missing a Signed-off-by trailer — git commit --amend -s when convenient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants