diff --git a/src/renderer/src/components/sidebar/WorktreeCardAgents.test.tsx b/src/renderer/src/components/sidebar/WorktreeCardAgents.test.tsx index c670db92280..f3195806907 100644 --- a/src/renderer/src/components/sidebar/WorktreeCardAgents.test.tsx +++ b/src/renderer/src/components/sidebar/WorktreeCardAgents.test.tsx @@ -205,6 +205,47 @@ describe('WorktreeCardAgents', () => { expect(markup).not.toContain('data-testid="agent-row"') }) + it('dims non-focused compact agent row text', async () => { + mockAgentActivityDisplayMode = 'compact' + mockAgents = [ + mockAgent({ + agentType: 'codex', + startedAt: 1000, + prompt: 'Run tests', + lastAssistantMessage: 'Inspecting changes' + }) + ] + const { default: WorktreeCardAgents } = await import('./WorktreeCardAgents') + + const markup = renderToStaticMarkup() + + expect(markup).toContain('Run tests') + expect(markup).toContain(' - Inspecting changes') + expect(markup).not.toContain('data-focused-agent-pane="true"') + expect(markup).not.toContain('Run tests') + }) + + it('keeps focused compact agent row text legible', async () => { + mockAgentActivityDisplayMode = 'compact' + mockFocusedAgentPaneKey = 'tab-1:1' + mockAgents = [ + mockAgent({ + agentType: 'codex', + startedAt: 1000, + prompt: 'Focused prompt', + lastAssistantMessage: 'Reading output' + }) + ] + const { default: WorktreeCardAgents } = await import('./WorktreeCardAgents') + + const markup = renderToStaticMarkup() + + expect(markup).toContain('data-focused-agent-pane="true"') + expect(markup).toContain('Focused prompt') + expect(markup).toContain(' - Reading output') + expect(markup).not.toContain('Focused prompt') + }) + it('marks only the focused agent row', async () => { mockAgentActivityDisplayMode = 'full' mockFocusedAgentPaneKey = 'tab-1:2' diff --git a/src/renderer/src/components/sidebar/worktree-card-compact-agent-row.tsx b/src/renderer/src/components/sidebar/worktree-card-compact-agent-row.tsx index e865b354117..88eab356c61 100644 --- a/src/renderer/src/components/sidebar/worktree-card-compact-agent-row.tsx +++ b/src/renderer/src/components/sidebar/worktree-card-compact-agent-row.tsx @@ -199,9 +199,11 @@ export const CompactAgentRow = React.memo(function CompactAgentRow({ {/* Why: the selected-row fill is strong enough to wash out the dimmed prompt/secondary text, so lift both toward full foreground when focused. */} - {primary} + + {primary} + {secondary && ( - + {' '} - {secondary}