diff options
| author | JJ Liebig <jonathan.liebig@gmail.com> | 2026-09-13 20:17:42 +0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-13 18:17:42 +0200 |
| commit | 5f26879bcd4190750c79cbff92454e400166ca98 (patch) | |
| tree | 5843579cb70ad81b3dc102294496cdc6868e99da /src/client/shell/tests/agents_worktrees_notifications.rs | |
| parent | 981fe83ca2e23474255f4cacc4da2814f9de0744 (diff) | |
fix(ui): keep muted sidebar and tab labels readable (#4062)
refs #2692
Diffstat (limited to 'src/client/shell/tests/agents_worktrees_notifications.rs')
| -rw-r--r-- | src/client/shell/tests/agents_worktrees_notifications.rs | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/src/client/shell/tests/agents_worktrees_notifications.rs b/src/client/shell/tests/agents_worktrees_notifications.rs index fb47ab87..0b936903 100644 --- a/src/client/shell/tests/agents_worktrees_notifications.rs +++ b/src/client/shell/tests/agents_worktrees_notifications.rs @@ -572,6 +572,67 @@ fn agent_sidebar_honors_priority_symbols_tokens_and_stable_hits() { } #[test] +fn muted_agent_sidebar_rows_do_not_stack_terminal_faint() { + let mut projected = snapshot(); + projected.tabs[0].label = "second".into(); + projected.tabs[0].custom_label = true; + projected.agents = vec![ClientShellAgent { + pane_id: "pane_1".into(), + workspace_id: "ws_1".into(), + tab_id: "tab_1".into(), + name: Some("reviewer".into()), + display_agent: None, + agent: Some("pi".into()), + title: None, + terminal_title: None, + terminal_title_stripped: None, + agent_status: AgentStatus::Working, + state_change_seq: 1, + state_labels: Vec::new(), + tokens: Vec::new(), + focused: true, + }]; + let mut state = ClientShellState::new(ClientShellConfig::from_config(&Config::default())); + state.set_snapshot(Box::new(projected)); + state.set_pane_surface(surface()); + let frame = state.compose(106, 30).expect("agent sidebar frame"); + let row = state.hits.agents.first().expect("agent row hit").0; + let buffer = frame.to_ratatui_buffer().expect("agent sidebar buffer"); + + for (label, needle) in [("tab", "second"), ("agent", "reviewer"), ("separator", "ยท")] { + let (x, y) = cell_symbol_position(&frame, row, needle); + let cell = buffer.cell((x, y)).expect("muted sidebar cell"); + assert!( + !cell.modifier.contains(Modifier::DIM), + "{label} cell at ({x},{y}) should not stack terminal faint: {cell:?}" + ); + } +} + +#[test] +fn workspace_state_text_does_not_stack_terminal_faint() { + use crate::config::SpaceSidebarToken; + + let mut config = Config::default(); + config.ui.sidebar.spaces.rows = vec![ + vec![SpaceSidebarToken::StateIcon, SpaceSidebarToken::Workspace], + vec![SpaceSidebarToken::StateText], + ]; + let mut state = ClientShellState::new(ClientShellConfig::from_config(&config)); + state.set_snapshot(Box::new(snapshot())); + state.set_pane_surface(surface()); + let frame = state.compose(106, 30).expect("workspace sidebar frame"); + let rect = state.hits.workspaces.first().expect("workspace hit").rect; + let buffer = frame.to_ratatui_buffer().expect("workspace sidebar buffer"); + let (x, y) = cell_symbol_position(&frame, rect, "idle"); + let cell = buffer.cell((x, y)).expect("workspace state text cell"); + assert!( + !cell.modifier.contains(Modifier::DIM), + "workspace state text at ({x},{y}) should not stack terminal faint: {cell:?}" + ); +} + +#[test] fn active_agent_view_controls_sidebar_order_and_focus_indices() { let mut projected = snapshot(); let mut second_pane = projected.panes[0].clone(); |
