Merge pull request #6998 from Lstarsky0/ux/theme-picker-number-column

fix(tui): right-align the /theme row numbers (thanks @Lstarsky0)

Verified before merge: PR CI on fc0003d059 20 pass, 8 skipped, 0 fail. The diff applied together with #6995/#6998 to current main e66bbb2dfa: scripts/dev-test.sh tui theme_picker help shed_to 215 run, 215 passed; clippy -p codewhale-tui --all-targets --all-features --locked with CI flags clean; cargo fmt --check clean. No main commit since the PR base touches its files. Covering tests include theme_picker_matches_goldens_at_blocker_sizes with the updated 80x24 and 120x32 goldens.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NBKbhx19BRbZtvWK8rVKjz
This commit is contained in:
Hunter BownandClaude Opus 5.5 authored and GitHub committed 2026-10-17 10:24:40 +08:00
commit f09a30a6b5
3 files changed
+23 -19

No files matched your search

@@ -2,15 +2,15 @@
theme · live preview ────────────────────────────────────────────────────────────────────────────────────────────────
1. System Follow terminal background (COLORFGBG / macOS appearance)
2. Terminal Inherit terminal colors fully (transparent surfaces, ANSI accents)
3. Shoreline Warm charcoal, one restrained blue — the desktop client's palette
4. Shoreline Light Shoreline on warm paper — the desktop client's light mode
▸ 5. Underwater The painted ocean field: ombre water, ambient life, the whale
6. Underwater Retro Flat phosphor-teal ocean: the legacy deepsea look, no ombre
7. Blue Stage Stage black, action blue, and one Signal Gold human beacon
8. Blue Stage Light Paper, cobalt action, and one Signal Gold human beacon
9. Grayscale Color-minimal high contrast
1. System Follow terminal background (COLORFGBG / macOS appearance)
2. Terminal Inherit terminal colors fully (transparent surfaces, ANSI accents)
3. Shoreline Warm charcoal, one restrained blue — the desktop client's palette
4. Shoreline Light Shoreline on warm paper — the desktop client's light mode
▸ 5. Underwater The painted ocean field: ombre water, ambient life, the whale
6. Underwater Retro Flat phosphor-teal ocean: the legacy deepsea look, no ombre
7. Blue Stage Stage black, action blue, and one Signal Gold human beacon
8. Blue Stage Light Paper, cobalt action, and one Signal Gold human beacon
9. Grayscale Color-minimal high contrast
10. Catppuccin Mocha Soft pastels on warm dark
11. Tokyo Night Deep blue/violet night palette
12. Dracula Classic high-contrast purple
@@ -2,15 +2,15 @@
theme · live preview ────────────────────────────────────────────────────────
█
1. System Follow terminal background… █
2. Terminal Inherit terminal colors fully… █
3. Shoreline Warm charcoal, one restrained… █
4. Shoreline Light Shoreline on warm paper — the… █
▸ 5. Underwater The painted ocean field: ombre… █
6. Underwater Retro Flat phosphor-teal ocean: the… █
7. Blue Stage Stage black, action blue, and one… █
8. Blue Stage Light Paper, cobalt action, and one… █
9. Grayscale Color-minimal high contrast █
1. System Follow terminal background… █
2. Terminal Inherit terminal colors fully… █
3. Shoreline Warm charcoal, one restrained… █
4. Shoreline Light Shoreline on warm paper — the… █
▸ 5. Underwater The painted ocean field: ombre… █
6. Underwater Retro Flat phosphor-teal ocean: the… █
7. Blue Stage Stage black, action blue, and… █
8. Blue Stage Light Paper, cobalt action, and one… █
9. Grayscale Color-minimal high contrast █
10. Catppuccin Mocha Soft pastels on warm dark █
11. Tokyo Night Deep blue/violet night palette █
12. Dracula Classic high-contrast purple █
+5 -1
View File
@@ -368,6 +368,7 @@ impl ModalView for ThemePickerView {
.saturating_sub(header_rows)
.max(1);
let source_count = self.controller.visible().len();
let number_width = source_count.to_string().len();
let selected_visible = self.controller.selected_visible();
let max_start = source_count.saturating_sub(visible_rows);
let start = selected_visible
@@ -447,7 +448,10 @@ impl ModalView for ThemePickerView {
let mut spans: Vec<Span> = Vec::with_capacity(8);
spans.push(Span::styled(format!(" {pointer} "), row_style));
spans.push(Span::styled(format!("{}. ", visible_idx + 1), number_style));
spans.push(Span::styled(
format!("{:>number_width$}. ", visible_idx + 1),
number_style,
));
spans.push(Span::styled(format!("{:<22}", option.label), row_style));
spans.extend(swatch);
spans.push(Span::raw(" "));