Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

feat(tui): appearance panel + focused box border follow the theme (#786)

lingrd5259207c5e30
diff --git a/docs/plans/2026-10-05-012-focused-pane-border-foreground-theme-first-plan.md b/docs/plans/2026-10-05-012-focused-pane-border-foreground-theme-first-plan.md
new file mode 100644
index 000000000..0ca4b3429
--- /dev/null
+++ b/docs/plans/2026-10-05-012-focused-pane-border-foreground-theme-first-plan.md
@@ -0,0 +1,198 @@
+# Focused Pane Border Foreground + Theme-First Appearance Implementation Plan
+
+> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
+
+**Goal:** Make the focused pane's box border use the theme **foreground** (so a single-pane box border matches the white statusbar text, not the yellow accent) and move the **Theme** section to the top of the Appearance panel.
+
+**Architecture:** Three small, independent edits in `tui/` (Rust/ratatui). `modal.rs` reorders the Appearance section list; `ui.rs::box_style` recolors the focused box frame; `settings.rs::preview` recolors the Appearance preview's focused box so the panel matches the real look. Tests that assert the old color or the old section order are updated alongside each change.
+
+**Tech Stack:** Rust, ratatui, cargo. Tests are Rust unit tests in the crate's `src/*.rs` `#[cfg(test)]` modules.
+
+**Spec:** Design agreed in conversation. No separate spec file — this is a bounded change to existing code. Global conventions below are the only constraints.
+
+## Global Constraints
+
+- Bash line-drawing: keep the focused box border distinct from the quiet `pane_palette().border` (foreground is brighter; under NO_COLOR the existing `BOLD` modifier still distinguishes focus).
+- Do not change the *waiting/attention* pane color, the classic-line `pane-border-indicators` coloring, or the global `theme::accent()` used by the shortcut box, selection rows, and the status window name.
+- Keep the published behavior of the Appearance picker: opening the panel still lands the cursor on the first section row; Enter still opens that section (`theme_in` set).
+- Tests: run `cargo test` in `tui/` before and after; 366 tests currently pass, 0 fail.
+
+## Review Focus
+
+- **Section order is also the default cursor.** Reordering is not just display: the picker selects row 0, so the default cursor and "Enter opens first section" move from Pane titles to Theme. Every test that assumes the first section was `section:status` must be updated together with the reorder, or it silently breaks (they live in `input.rs` and `ui.rs`, not `modal.rs`).
+- **Focused frame color is asserted in two render tests** (`bar.rs`, `settings.rs`), not just the implementation. A color-only implementation change without the test updates fails the suite.
+- **Preview vs. real draw color source differ.** The real draw applies `theme::paint(...)`, but the preview writes `pal.foreground` directly (unpainted). The test must compare against the same source each path uses or the equality fails.
+- **The deviating-from-convention tradeoff is intentional** (tmux/clawtool use a distinct accent). It is documented in the code comment so a future reader knows the focused box is the theme foreground by choice.
+
+---
+
+### Task 1: Move the Theme section to the top of the Appearance panel
+
+**Files:**
+- Modify: `tui/src/modal.rs` (function `theme_sections`, ~lines 676-689)
+- Test: `tui/src/modal.rs` (test `theme_sections_list_the_look_sections`, ~lines 823-837)
+- Test: `tui/src/input.rs` (tests `theme_opens_the_sections_and_theme_lists_every_theme` ~line 3452, `theme_enter_opens_the_section` ~lines 3481-3488)
+- Test: `tui/src/ui.rs` (test `theme_draws_the_settings_panel_and_a_refresh_keeps_its_section`, ~lines 2911-2922)
+
+**Interfaces:**
+- Consumes: existing `Row` API and `theme_sections(app) -> Vec<Row>`.
+- Produces: `theme_sections` returns the sections in the order **Theme, Pane titles, Focus, Status bar, Borders**; the first row id is `section:theme`; Enter on it opens `theme_in == "theme"`.
+
+- [ ] **Step 1: Update `theme_sections_list_the_look_sections` expected order (failing test)**
+
+In `tui/src/modal.rs` change the expected ids to:
+
+```rust
+assert_eq!(ids, vec!["section:theme", "section:status", "section:focus",
+ "section:bar", "section:boxes"]);
+```
+
+- [ ] **Step 2: Run the failing test**
+
+Run: `cargo test theme_sections_list_the_look_sections -- --nocapture` (in `tui/`).
+Expected: FAIL — actual order is `section:status, section:focus, section:theme, ...`.
+
+- [ ] **Step 3: Reorder the `vec!` in `theme_sections`**
+
+Move the `sec("section:theme", ...)` row to the top of the vector, before `sec("section:status", ...)`. Keep each row's existing arguments unchanged (do not alter labels, details, or `.right` values). Order becomes: theme, status, focus, bar, boxes.
+
+- [ ] **Step 4: Update the dependent section-order tests in `input.rs`**
+
+- `theme_opens_the_sections_and_theme_lists_every_theme`: change
+ `Some("section:status")` → `Some("section:theme")`.
+- `theme_enter_opens_the_section`:
+ - `picker.current_id().as_deref()` expectation → `Some("section:theme")`.
+ - After Enter, `picker.theme_in.as_deref()` expectation → `Some("theme")`.
+ - The rows assertion `r.id.starts_with("border_status:")` → `r.id.starts_with("theme:")`.
+ - The "current option is marked" assertion still holds (the native `theme:` row is marked when no theme chosen).
+
+- [ ] **Step 5: Update `theme_draws_the_settings_panel_and_a_refresh_keeps_its_section` in `ui.rs`**
+
+- The loop over `["off", "top", "bottom"]` asserts left over from the old first section (those were the `status` options). Now Enter opens the theme section, so replace that loop with a check on the picker rows: `assert!(picker.rows.iter().all(|r| r.id.starts_with("theme:")), "shows the theme options after a refresh")`.
+- `picker.theme_in.as_deref()` expectation → `Some("theme")`.
+
+- [ ] **Step 6: Run the crate tests**
+
+Run: `cargo test` (in `tui/`).
+Expected: 366 passed, 0 failed.
+
+- [ ] **Step 7: Commit**
+
+```bash
+git add tui/src/modal.rs tui/src/input.rs tui/src/ui.rs
+git commit -m "feat(tui): put the Theme section first in Appearance"
+```
+
+---
+
+### Task 2: Focused box border uses the theme foreground
+
+**Files:**
+- Modify: `tui/src/ui.rs` (function `box_style`, ~line 576; comments above `boxes` ~528-532 and `box_style` ~569-571)
+- Test: `tui/src/bar.rs` (test `each_pane_is_its_own_box_in_the_focus_and_attention_colours`, ~lines 826-853)
+
+**Interfaces:**
+- Consumes: `theme::pane_palette()` and `theme::paint()` (existing), `app.pane_state`, `app.focused`.
+- Produces: a focused box frame whose `fg` is `theme::paint(theme::pane_palette().foreground)`, still with the existing `BOLD` modifier under `no_color`.
+
+- [ ] **Step 1: Update `each_pane_is_its_own_box_in_the_focus_and_attention_colours` (failing test)**
+
+In `tui/src/bar.rs`, replace the color bindings and the focused-frame assertion:
+
+```rust
+let (foreground, attention) = (theme::paint(theme::pane_palette().foreground), theme::paint(theme::ATTENTION));
+assert_eq!(buf[(left.right() - 1, mid)].fg, foreground, "the focused pane's frame");
+assert_eq!(buf[(top_right.x, top_right.y + 1)].fg, attention, "the waiting pane's frame");
+assert_ne!(buf[(below.x, below.y + 1)].fg, foreground, "a quiet frame");
+assert_ne!(buf[(below.x, below.y + 1)].fg, attention, "a quiet frame");
+```
+
+Also update the test's doc comment: "the focused one's in the accent" → "the focused one's in the theme foreground".
+
+- [ ] **Step 2: Run the failing test**
+
+Run: `cargo test each_pane_is_its_own_box_in_the_focus_and_attention_colours -- --nocapture` (in `tui/`).
+Expected: FAIL — focused frame is the accent, not the foreground.
+
+- [ ] **Step 3: Change `box_style`'s active branch**
+
+In `tui/src/ui.rs`, change the focused branch:
+
+```rust
+else if active { Style::default().fg(theme::paint(theme::pane_palette().foreground)).add_modifier(if theme::no_color() { Modifier::BOLD } else { Modifier::empty() }) }
+```
+
+Leave the `own`/`border_style`, the waiting/attention branch, and the quiet border branch unchanged. Update the `boxes` and `box_style` doc comments to say the focused box is the theme's *foreground* (readable text colour), not the accent.
+
+- [ ] **Step 4: Run the crate tests**
+
+Run: `cargo test` (in `tui/`).
+Expected: 366 passed, 0 failed.
+
+- [ ] **Step 5: Commit**
+
+```bash
+git add tui/src/ui.rs tui/src/bar.rs
+git commit -m "feat(tui): focused box border uses the theme foreground"
+```
+
+---
+
+### Task 3: Appearance preview focused box uses the theme foreground
+
+**Files:**
+- Modify: `tui/src/settings.rs` (function `preview`, ~line 899; comment ~896-897)
+- Test: `tui/src/settings.rs` (test `the_preview_draws_the_status_bar_where_it_goes_and_the_boxes_in_their_colours`, ~lines 1210-1216)
+
+**Interfaces:**
+- Consumes: `pal.foreground` (bound as `fg` at line 835), `theme::native_pane_palette()` (the source `preview` uses when no theme is shown).
+- Produces: the Appearance preview's focused box frame is drawn with the theme foreground, not the accent.
+
+- [ ] **Step 1: Update the preview test (failing test)**
+
+In `tui/src/settings.rs`, change the focused-frame assertions:
+
+```rust
+let foreground = theme::native_pane_palette().foreground;
+assert_eq!(bottom[(panes[0].x, panes[0].y)].fg, foreground);
+assert_ne!(foreground, bottom[(panes[1].x, panes[1].y)].fg);
+assert_eq!(bottom[(panes[1].x, panes[1].y)].fg, theme::paint(theme::ATTENTION));
+```
+
+(Keep the `bottom[(panes[0].x, panes[0].y)].symbol() == "┌"` and `panes[1]` symbol assertions unchanged.) Update the doc comment at ~line 1182 and the inline comment "the focused one's frame in the accent" → "in the theme foreground".
+
+- [ ] **Step 2: Run the failing test**
+
+Run: `cargo test the_preview_draws_the_status_bar_where_it_goes_and_the_boxes_in_their_colours -- --nocapture` (in `tui/`).
+Expected: FAIL — focused preview frame is the accent.
+
+- [ ] **Step 3: Change the preview box frame**
+
+In `tui/src/settings.rs` `preview`, the boxed frame line:
+
+```rust
+let frame = Style::default().fg(if here { fg } else if i == 1 { theme::paint(theme::ATTENTION) } else { pal.border }).bg(pbg);
+```
+
+Only the `if here { accent }` term changes to `if here { fg }`. Leave arrows, indicators, content lead text, and the status window name on `accent`.
+
+- [ ] **Step 4: Run the crate tests**
+
+Run: `cargo test` (in `tui/`).
+Expected: 366 passed, 0 failed.
+
+- [ ] **Step 5: Commit**
+
+```bash
+git add tui/src/settings.rs
+git commit -m "feat(tui): Appearance preview focused box uses the theme foreground"
+```
+
+---
+
+## Verification (full)
+
+Run: `cargo test` in `tui/`.
+Expected: all 366 tests pass, 0 fail.
+
+Manual spot-check (optional, if a terminal is available): open `hn`, run `theme`, confirm the Appearance panel lists **Theme** first and the focused single-pane box border renders in the theme foreground.
diff --git a/tui/Cargo.lock b/tui/Cargo.lock
index fa1b73495..42c73fbcf 100644
--- a/tui/Cargo.lock
+++ b/tui/Cargo.lock
@@ -653,7 +653,7 @@ dependencies = [
[[package]]
name = "harness-tui"
-version = "0.1.12"
+version = "0.1.13"
dependencies = [
"alacritty_terminal",
"crossterm",
diff --git a/tui/Cargo.toml b/tui/Cargo.toml
index f0fd6d0d5..44d0fb75a 100644
--- a/tui/Cargo.toml
+++ b/tui/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "harness-tui"
-version = "0.1.12"
+version = "0.1.13"
edition = "2024"
[dependencies]
diff --git a/tui/src/bar.rs b/tui/src/bar.rs
index 2c4bfbbc3..1842487a3 100644
--- a/tui/src/bar.rs
+++ b/tui/src/bar.rs
@@ -822,7 +822,7 @@ mod tests {
// ── box panes ──
/// Box panes: each pane its own frame, a cell apart (never one line shared by two panes) — the
- /// focused one's in the accent, the one waiting on you in the attention colour, the others quiet.
+ /// focused one's in the status bar's background colour, the one waiting on you in the attention colour, the others quiet.
#[test]
fn each_pane_is_its_own_box_in_the_focus_and_attention_colours() {
let _colours = crate::term_out::colours_lock();
@@ -843,10 +843,10 @@ mod tests {
assert_eq!(buf[(left.right() - 1, left.y)].symbol(), "┐", "each box its own corners, not a joint:\n{s}");
assert_eq!(buf[(left.x, left.y)].symbol(), "┌");
assert_eq!(buf[(top_right.x, top_right.y)].symbol(), "┌", "the right box is its own, not a joint:\n{s}");
- let (accent, attention) = (theme::paint(theme::accent()), theme::paint(theme::ATTENTION));
- assert_eq!(buf[(left.right() - 1, mid)].fg, accent, "the focused pane's frame");
+ let (status_bg, attention) = (theme::paint(app.status_style().bg.unwrap_or(Color::Reset)), theme::paint(theme::ATTENTION));
+ assert_eq!(buf[(left.right() - 1, mid)].fg, status_bg, "the focused pane's frame");
assert_eq!(buf[(top_right.x, top_right.y + 1)].fg, attention, "the waiting pane's frame");
- assert_ne!(buf[(below.x, below.y + 1)].fg, accent, "a quiet frame");
+ assert_ne!(buf[(below.x, below.y + 1)].fg, status_bg, "a quiet frame");
assert_ne!(buf[(below.x, below.y + 1)].fg, attention, "a quiet frame");
// The program is inside its frame.
assert_eq!(app.content_of(app.tab(), app.rects.iter().find(|(p, _)| *p == 1).unwrap().1), Rect::new(left.x + 1, left.y + 1, left.width - 2, left.height - 2));
diff --git a/tui/src/input.rs b/tui/src/input.rs
index 9c8c3d1b3..f1a535928 100644
--- a/tui/src/input.rs
+++ b/tui/src/input.rs
@@ -3449,7 +3449,7 @@ mod tests {
// Level one: the section list, not the whole flat gallery — sections only, no groups.
assert!(picker.theme_in.is_none(), "opens on the sections");
- assert_eq!(picker.rows.first().map(|r| r.id.as_str()), Some("section:status"));
+ assert_eq!(picker.rows.first().map(|r| r.id.as_str()), Some("section:theme"));
assert!(picker.rows.iter().all(|r| r.id.starts_with("section:")), "level one lists sections only");
// Each section opens onto its options; the theme section lists every bundled theme.
@@ -3478,13 +3478,13 @@ mod tests {
let Modal::Picker { kind, picker } = app.modal.take().unwrap() else { panic!() };
assert!(matches!(kind, PickerKind::Theme));
assert!(picker.theme_in.is_none(), "opens on the sections");
- assert_eq!(picker.current_id().as_deref(), Some("section:status"));
+ assert_eq!(picker.current_id().as_deref(), Some("section:theme"));
choose(&mut app, kind, picker, Choice::Enter);
}
let Modal::Picker { kind, picker } = app.modal.as_ref().unwrap() else { panic!() };
assert!(matches!(kind, PickerKind::Theme));
- assert_eq!(picker.theme_in.as_deref(), Some("status"), "Enter opened the section");
- assert!(picker.rows.iter().all(|r| r.id.starts_with("border_status:")), "the section's options show");
+ assert_eq!(picker.theme_in.as_deref(), Some("theme"), "Enter opened the section");
+ assert!(picker.rows.iter().all(|r| r.id.starts_with("theme:")), "the section's options show");
assert!(picker.rows.iter().any(|r| r.lead.iter().any(|s| s.content.as_ref() == "✓ ")), "the current option is marked");
}
}
diff --git a/tui/src/modal.rs b/tui/src/modal.rs
index 6d85c93a2..b774a96da 100644
--- a/tui/src/modal.rs
+++ b/tui/src/modal.rs
@@ -679,9 +679,9 @@ pub fn theme_sections(app: &App) -> Vec<Row> {
// C-b % and C-b " choose it each time, and a harness hn opens splits by the pane's shape —
// `layout_orientation` in tui.toml, or @hn-layout, where you want one way always. Nor a
// layout: C-b Space, C-b M-1…5 and Commands → Layout… lay the panes out now.)
+ sec("section:theme", "Theme", "bundled terminal themes", if theme.is_empty() { "terminal" } else { &theme }),
sec("section:status", "Pane titles", "pane-border-status", &status),
sec("section:focus", "Focus", "focus_style", focus),
- sec("section:theme", "Theme", "bundled terminal themes", if theme.is_empty() { "terminal" } else { &theme }),
// ── status bar ──
sec("section:bar", "Status bar", "status_bar", status_bar_of(app)),
sec("section:boxes", "Borders", "every pane its own box", if border_style_of(app) == "box" { "on" } else { "off" }),
@@ -825,7 +825,7 @@ mod theme_row_tests {
let app = app();
let rows = theme_sections(&app);
let ids: Vec<&str> = rows.iter().map(|r| r.id.as_str()).collect();
- assert_eq!(ids, vec!["section:status", "section:focus", "section:theme",
+ assert_eq!(ids, vec!["section:theme", "section:status", "section:focus",
// ── status bar ──
"section:bar", "section:boxes"]);
// Each section shows its current value and opens onto a non-empty option list.
diff --git a/tui/src/settings.rs b/tui/src/settings.rs
index 9daa9ef09..c628309c8 100644
--- a/tui/src/settings.rs
+++ b/tui/src/settings.rs
@@ -893,17 +893,19 @@ pub fn preview(buf: &mut Buffer, r: Rect, look: &Look, c: &Chrome) {
for y in p.y..p.bottom() { for x in p.x..p.right() { if let Some(cell) = buf.cell_mut((x, y)) { cell.reset(); cell.set_style(Style::default().bg(pbg)); } } }
let mut content = *p;
// ── status bar ──
- // A box: the focused pane's frame in the accent, the next one's as a harness waiting on
- // you draws it, the rest quiet; the title in the frame's top or bottom line.
+ // A box: the focused pane's frame in the status bar's background colour (the theme's
+ // foreground, as the real bar draws it), every other pane its quiet theme border colour —
+ // a pane that is working never draws the attention colour here, only a pane that is
+ // actually waiting on you does, as box_style draws it; the title in the frame's line.
if boxed && p.width >= 3 && p.height >= 3 {
- let frame = Style::default().fg(if here { accent } else if i == 1 { theme::paint(theme::ATTENTION) } else { pal.border }).bg(pbg);
+ let frame = Style::default().fg(if here { fg } else { pal.border }).bg(pbg);
let (x1, y1) = (p.right() - 1, p.bottom() - 1);
for x in p.x + 1..x1 { buf.set_string(x, p.y, joint(&look.lines, false, false, true, true), frame); buf.set_string(x, y1, joint(&look.lines, false, false, true, true), frame) }
for y in p.y + 1..y1 { buf.set_string(p.x, y, joint(&look.lines, true, true, false, false), frame); buf.set_string(x1, y, joint(&look.lines, true, true, false, false), frame) }
for (x, y, g) in [(p.x, p.y, joint(&look.lines, false, true, false, true)), (x1, p.y, joint(&look.lines, false, true, true, false)), (p.x, y1, joint(&look.lines, true, false, false, true)), (x1, y1, joint(&look.lines, true, false, true, false))] { buf.set_string(x, y, g, frame) }
if look.status != "off" {
let ty = if look.status == "bottom" { y1 } else { p.y };
- let ls = if here { frame.add_modifier(Modifier::BOLD) } else if i == 1 { frame } else { Style::default().fg(pfg).bg(pbg) };
+ let ls = if here { frame.add_modifier(Modifier::BOLD) } else { Style::default().fg(pfg).bg(pbg) };
put(buf, p.x + 1, ty, p.width.saturating_sub(2), &format!(" {} {} ", i + 1, names[i]), ls);
}
content = Rect::new(p.x, p.y + 1, p.width, p.height - 2);
@@ -940,9 +942,10 @@ pub fn preview(buf: &mut Buffer, r: Rect, look: &Look, c: &Chrome) {
}
}
- // The status line, as hn's own sits under the panes (or over them).
+ // The status line, as hn's own sits under the panes (or over them) — its background the theme's
+ // foreground, its lettering the theme's background, exactly as the real bar swaps them.
if let Some(status_row) = status_row {
- let sstyle = Style::default().fg(pal.status_foreground).bg(pal.status);
+ let sstyle = Style::default().fg(pal.background).bg(pal.foreground);
for x in screen.x..screen.right() { buf.set_string(x, status_row, " ", sstyle) }
let mut x = screen.x + 1;
for (i, n) in names.iter().take(panes.len()).enumerate() {
@@ -1179,8 +1182,8 @@ mod tests {
/// The preview draws where the status bar goes — the line at the bottom or top, or the bar
/// down a side: the windows with the current one's panes and their repos, then the machines —
- /// and the panes as boxes: the focused one's frame in the accent, one waiting on you in the
- /// attention colour.
+ /// and the panes as boxes: the focused one's frame in the status bar's background colour, one
+ /// waiting on you in the attention colour.
#[test]
fn the_preview_draws_the_status_bar_where_it_goes_and_the_boxes_in_their_colours() {
let app = app((150, 42));
@@ -1205,15 +1208,16 @@ mod tests {
assert_eq!(left[(16, 2)].symbol(), "┌", "{s}");
let right = draw(&look.clone().with(Some("status_bar:right")));
assert_eq!(right[(64 - 16, 5)].symbol(), "│");
- // Boxes: each pane its own frame; the focused one's in the accent, the next the attention colour.
- // (The accent as this draw had it: the current window's name on the status line.)
- let accent = bottom[(1, 19)].fg;
+ // Boxes: each pane its own frame; the focused one's in the status bar's background
+ // colour (the theme's foreground), every other pane its quiet theme border colour.
let panes = tiles(Rect::new(0, 2, 64, 17), &look.layout, &look.split);
assert_eq!(bottom[(panes[0].x, panes[0].y)].symbol(), "┌");
assert_eq!(bottom[(panes[1].x, panes[1].y)].symbol(), "┌");
- assert_eq!(bottom[(panes[0].x, panes[0].y)].fg, accent);
- assert_ne!(accent, bottom[(panes[1].x, panes[1].y)].fg);
- assert_eq!(bottom[(panes[1].x, panes[1].y)].fg, theme::paint(theme::ATTENTION));
+ let foreground = theme::native_pane_palette().foreground;
+ let border = theme::native_pane_palette().border;
+ assert_eq!(bottom[(panes[0].x, panes[0].y)].fg, foreground);
+ assert_ne!(foreground, bottom[(panes[1].x, panes[1].y)].fg);
+ assert_eq!(bottom[(panes[1].x, panes[1].y)].fg, border);
let line = draw(&look.clone().with(Some("border_style:line")));
assert_ne!(line[(panes[1].x, panes[1].y)].symbol(), "┌", "tmux's shared lines");
}
diff --git a/tui/src/ui.rs b/tui/src/ui.rs
index f31033a94..7ceda49d3 100644
--- a/tui/src/ui.rs
+++ b/tui/src/ui.rs
@@ -526,10 +526,11 @@ fn title_line(buf: &mut Buffer, app: &App, id: u64, area: Rect, style: Style) {
// ── box panes ──
/// Box panes (`@hn-border box`, the default): every pane its own frame in pane-border-lines' box
-/// lines — the accent around the focused one, the attention colour around one whose harness waits
-/// on you (a question, a permission, its input), as the app colours its line; the quiet border
-/// colour elsewhere (or your pane-border-style / pane-active-border-style). The pane's title is
-/// drawn into the frame's top or bottom line as ` title `, in the accent and bold when focused.
+/// lines — the status bar's background colour around the focused one, the attention colour around
+/// one whose harness waits on you (a question, a permission, its input), as the app colours its
+/// line; the quiet border colour elsewhere (or your pane-border-style / pane-active-border-style).
+/// The pane's title is drawn into the frame's top or bottom line as ` title `, in the status bar's
+/// background colour and bold when focused.
fn boxes(buf: &mut Buffer, app: &App) {
let tab = app.tab();
let (canvas, status) = (app.window_area(tab), app.pane_status(tab));
@@ -566,14 +567,16 @@ fn boxes(buf: &mut Buffer, app: &App) {
}
}
-/// A box's frame colour: focused → the accent, waiting on you → the attention colour, else the
-/// quiet border colour; your own pane-(active-)border-style where you set one (and tmux's own
-/// under `@hn-look tmux`, which draws no boxes). The marked pane's frame is bold.
+/// A box's frame colour: focused → the status bar's background colour, waiting on you → the attention
+/// colour, else the quiet border colour; your own pane-(active-)border-style where you set one (and
+/// tmux's own under `@hn-look tmux`, which draws no boxes). The marked pane's frame is bold.
fn box_style(app: &App, id: u64) -> Style {
let active = Some(id) == app.focused();
let own = if active { app.look.active_border.is_some() } else { app.look.border.is_some() };
let style = if own { border_style(app, active) }
- else if active { Style::default().fg(theme::paint(theme::accent())).add_modifier(if theme::no_color() { Modifier::BOLD } else { Modifier::empty() }) }
+ // The focused frame is the status bar's own background colour, so the active pane's box
+ // always sits in the same colour as the bar — not the accent, and not the pane text.
+ else if active { Style::default().fg(theme::paint(app.status_style().bg.unwrap_or(Color::Reset))).add_modifier(if theme::no_color() { Modifier::BOLD } else { Modifier::empty() }) }
else if app.pane_state(id) == Some(crate::fleet::State::NeedsInput) { Style::default().fg(theme::paint(theme::ATTENTION)) }
else { Style::default().fg(theme::paint(theme::pane_palette().border)) };
if app.marked == Some(id) { style.add_modifier(Modifier::BOLD) } else { style }
@@ -2916,9 +2919,9 @@ mod theme_render_tests {
crate::input::modal_key(&mut app, crossterm::event::KeyEvent::new(crossterm::event::KeyCode::Enter, crossterm::event::KeyModifiers::NONE));
crate::input::refill(&mut app);
let s = screen(&mut app);
- for v in ["off", "top", "bottom"] { assert!(s.contains(v), "{v} missing after a refresh:\n{s}") }
let Some(Modal::Picker { picker, .. }) = &app.modal else { panic!("closed") };
- assert_eq!(picker.theme_in.as_deref(), Some("status"));
+ assert!(picker.rows.iter().all(|r| r.id.starts_with("theme:")), "shows the theme options after a refresh:\n{s}");
+ assert_eq!(picker.theme_in.as_deref(), Some("theme"));
let _ = modal::theme_sections(&app);
}
@@ -3033,8 +3036,8 @@ mod theme_render_tests {
let mut app = app();
let _ = app.set_look("theme", "Aizen Dark");
crate::input::run(&mut app, "theme");
- // (Theme is the third section: Pane titles, Focus, Theme.)
- for code in [KeyCode::Down, KeyCode::Down, KeyCode::Right] { crate::input::modal_key(&mut app, KeyEvent::new(code, KeyModifiers::NONE)) }
+ // (Theme is the first section now: the cursor starts on it.)
+ crate::input::modal_key(&mut app, KeyEvent::new(KeyCode::Right, KeyModifiers::NONE));
{
let Some(Modal::Picker { picker, .. }) = &app.modal else { panic!("closed") };
assert_eq!(picker.current_id().as_deref(), Some("theme:Aizen Dark"), "a section opens on the value in use");