Skip to content

Commit 3732bad

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
fix(terminal): identify current output without toggle semantics
1 parent e1ceb58 commit 3732bad

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/terminal/components/terminal-row-button.test.tsx‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ describe('TerminalRowButton', () => {
4545
const button = host.querySelector('button')!
4646
expect(button.type).toBe('button')
4747
expect(button.getAttribute('aria-expanded')).toBe('true')
48-
expect(button.getAttribute('aria-pressed')).toBe('true')
48+
expect(button.getAttribute('aria-current')).toBe('true')
4949
expect(button.getAttribute('data-entry-id')).toBe('entry-1')
5050
expect(button.className).toBe(ROW_STYLES.rowSelected)
5151
act(() => button.focus())
@@ -62,15 +62,15 @@ describe('TerminalRowButton', () => {
6262
const button = host.querySelector('button')!
6363
expect(button.className).toBe(ROW_STYLES.row)
6464
expect(button.hasAttribute('aria-expanded')).toBe(false)
65-
expect(button.hasAttribute('aria-pressed')).toBe(false)
65+
expect(button.hasAttribute('aria-current')).toBe(false)
6666
expect(button.textContent).toBe('Block output')
6767
})
6868

69-
it('exposes the unselected state only for selectable rows', () => {
69+
it('does not mark an unselected output row as current', () => {
7070
act(() => {
7171
root.render(<TerminalRowButton selected={false}>Other output</TerminalRowButton>)
7272
})
73-
expect(host.querySelector('button')?.getAttribute('aria-pressed')).toBe('false')
73+
expect(host.querySelector('button')?.hasAttribute('aria-current')).toBe(false)
7474
})
7575

7676
it('keeps the running status inline inside a native button', () => {

‎apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/terminal/components/terminal-row-button.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { cn } from '@sim/emcn'
33
import { ROW_STYLES } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/terminal/types'
44

55
export interface TerminalRowButtonProps
6-
extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'aria-pressed'> {
6+
extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'aria-current'> {
77
/** Use the selected chip surface for the active output row. */
88
selected?: boolean
99
}
@@ -20,7 +20,7 @@ export function TerminalRowButton({
2020
<button
2121
type={type ?? 'button'}
2222
className={cn(selected ? ROW_STYLES.rowSelected : ROW_STYLES.row, className)}
23-
aria-pressed={selected}
23+
aria-current={selected ? 'true' : undefined}
2424
onClick={(event) => {
2525
event.stopPropagation()
2626
onClick?.(event)

0 commit comments

Comments
 (0)