|
1 | 1 | import { describe, expect, it } from 'vitest' |
2 | | -import { activityPreviewFor, artifactRailItems, causalVisualItemsFor, commandFor, compareRunArtifacts, defaultComputerItem, evidenceItemId, filterItemsByRun, formatDuration, formatInspectable, matchesRailQuery, presentationItems, railCardTypeFor, runIdsFor, runLabel, summarizeRunEvidence, terminalActivityFor, virtualRailRange, visualEvidenceStateFor, type ComputerItem } from './computer-timeline-activity' |
| 2 | +import { activityPreviewFor, artifactRailItems, causalVisualItemsFor, commandFor, compareRunArtifacts, defaultComputerItem, evidenceItemId, filterItemsByRun, formatDuration, formatInspectable, matchesRailQuery, presentationItems, railCardTypeFor, runIdsFor, runLabel, summarizeRunEvidence, terminalActivityFor, timelineNavigationAllowedFor, virtualRailRange, visualEvidenceStateFor, type ComputerItem } from './computer-timeline-activity' |
3 | 3 | import type { RuntimeEvent } from '../types' |
4 | 4 |
|
5 | 5 | const event = (id: string, type: string, payload: Record<string, unknown>, content?: string): RuntimeEvent => ({ |
@@ -141,6 +141,14 @@ describe('Computer timeline terminal inspection', () => { |
141 | 141 | expect(virtualRailRange(3, 0, 340)).toEqual({ start: 0, end: 3 }) |
142 | 142 | }) |
143 | 143 |
|
| 144 | + it('reserves arrow and home/end controls for the rail without stealing editable-field navigation', () => { |
| 145 | + expect(timelineNavigationAllowedFor('div')).toBe(true) |
| 146 | + expect(timelineNavigationAllowedFor('input')).toBe(false) |
| 147 | + expect(timelineNavigationAllowedFor('textarea')).toBe(false) |
| 148 | + expect(timelineNavigationAllowedFor('select')).toBe(false) |
| 149 | + expect(timelineNavigationAllowedFor('div', true)).toBe(false) |
| 150 | + }) |
| 151 | + |
144 | 152 | it('searches only projected rail metadata', () => { |
145 | 153 | const item: ComputerItem = { id: 'browser-event', kind: 'terminal', title: 'browser_navigate', detail: 'Opened the approved reference', activityPreview: 'https://example.com/docs', createdAt: '2026-07-16T00:00:00.000Z' } |
146 | 154 | expect(matchesRailQuery(item, 'navigate')).toBe(true) |
|
0 commit comments