feat(ui): add confirmations and terminal motion
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2026-05-12 19:44:18 -05:00
parent cc98aa180b
commit 0755213d6a
12 changed files with 263 additions and 29 deletions
+15
View File
@@ -48,4 +48,19 @@ describe('computeChips — sample world', () => {
expect(chips.find((c) => c.command === 'wait')).toBeTruthy()
expect(chips.find((c) => c.command === 'help')).toBeTruthy()
})
it('shows only confirmation chips while a dangerous command is pending', () => {
const s = {
...initialStateFor(world),
pendingConfirmation: {
command: { kind: 'verb-target' as const, verb: 'attack' as const, target: { canonical: 'rat', raw: 'rat' } },
prompt: 'Are you sure?',
},
}
const chips = computeChips(s, world)
expect(chips).toEqual([
{ kind: 'meta', label: 'YES', command: 'yes', disabled: false },
{ kind: 'meta', label: 'NO', command: 'no', disabled: false },
])
})
})