Improve unread workspace contrast in the sidebar (#5866)

This commit is contained in:
Brennan Benson
2026-06-19 19:35:23 -07:00
committed by GitHub
parent 3f3a9ef94b
commit 230297b430
2 changed files with 45 additions and 2 deletions
@@ -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(<WorktreeCardAgents worktreeId="wt-1" />)
expect(markup).toContain('<span class="text-muted-foreground/90">Run tests</span>')
expect(markup).toContain('<span class="text-muted-foreground/65"> - Inspecting changes</span>')
expect(markup).not.toContain('data-focused-agent-pane="true"')
expect(markup).not.toContain('<span class="text-foreground">Run tests</span>')
})
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(<WorktreeCardAgents worktreeId="wt-1" />)
expect(markup).toContain('data-focused-agent-pane="true"')
expect(markup).toContain('<span class="text-foreground">Focused prompt</span>')
expect(markup).toContain('<span class="text-foreground/70"> - Reading output</span>')
expect(markup).not.toContain('<span class="text-muted-foreground/90">Focused prompt</span>')
})
it('marks only the focused agent row', async () => {
mockAgentActivityDisplayMode = 'full'
mockFocusedAgentPaneKey = 'tab-1:2'
@@ -199,9 +199,11 @@ export const CompactAgentRow = React.memo(function CompactAgentRow({
<span className="min-w-0 flex-1 truncate">
{/* Why: the selected-row fill is strong enough to wash out the dimmed
prompt/secondary text, so lift both toward full foreground when focused. */}
<span className={isFocusedPane ? 'text-foreground' : 'text-foreground/85'}>{primary}</span>
<span className={isFocusedPane ? 'text-foreground' : 'text-muted-foreground/90'}>
{primary}
</span>
{secondary && (
<span className={isFocusedPane ? 'text-foreground/70' : 'text-muted-foreground/75'}>
<span className={isFocusedPane ? 'text-foreground/70' : 'text-muted-foreground/65'}>
{' '}
- {secondary}
</span>