Triage the whole queue from the keyboard, and never type an n

The last of the UX review's item 8. Ctrl+. and Ctrl+, step through the
underlines from anywhere in the text; the card that opens takes focus and
answers Tab / Shift+Tab / Enter / Del / ? / Esc itself. Answering a card
advances to the next by itself, and the last one closes and puts the caret
back in the prose — so a document is triaged in five presses of Enter.

The item asked for bare Tab or n/p. Neither can exist in a text editor: an
unmodified letter is a letter. They work fine once a card holds focus, which
is where the item wanted them; getting there needs a chord that is safe to
press mid-sentence, and mid-composition, so the entry keys are IME-guarded
like every other binding.

The queue is the underlines read off the decoration DOM in document order,
not the suggestion list: a stop she cannot see is worse than one she never
visits, and it guarantees the card can anchor itself.

Escape is stopped at the card. Unhandled it would also have left
distraction-free mode, restoring the sidebar and — via the rail-follows-the-
mode fix — pulling the rail out from under her mid-triage.

The legend is bilingual and leads with the pair language, unlike the card's
English buttons: those name what she is learning, this is an instruction for
operating Petal, like the status bar. Key names are as printed on her
keyboard (Entrée, Suppr, Intro, Supr). The es pack's own punctuation test
caught the "?" and is right in general; the key cap is one named exemption.

Verified in a real browser at 1517x810 on a fresh database with no model,
over CDP — a keystroke feature deserves real keystrokes. Both layouts, wrap
in both directions, the accept/dismiss/advance loop, Ask Petal and back, the
full triage-to-empty criterion, and Accept-all clicked from a keyboard card.
The wiring has no unit test for the reason items 6, 7 and 8 recorded: jsdom
has no layout. triage.ts is pure and tested; browser-verified is written
down as browser-verified.

Claude-Session: https://claude.ai/code/session_01GJHNvirh7Hzhc9RL3HAvz7
This commit is contained in:
prosolis
2026-07-28 21:11:42 -07:00
parent 178cb7ae67
commit c6bf36bddf
11 changed files with 639 additions and 16 deletions
+21
View File
@@ -203,6 +203,22 @@ describe('the zh pack', () => {
expect(p.status.petalsToPolish(2).en).toContain('petals to polish')
})
// The triage legend is the only place a Petal binding is written down, so a
// pack that drops a key drops the feature for that pair: nothing else on
// screen says Tab moves to the next underline. The key caps themselves stay
// as they are printed on the keyboard, which is why the English half is not
// the interesting one — a pack may well translate "Entrée" and be right to.
it.each(PACKS)('names every triage key in both halves ($code)', (p) => {
const { native, en } = p.editor.triageHint
expect(native, `${p.code} has no pair-language triage legend`).toBeTruthy()
expect(en, `${p.code} has no English triage legend`).toBeTruthy()
expect(en).toBe('Tab next · Enter accept · Del dismiss · ? Ask Petal · Esc exit')
// Five bindings, five entries — in whatever the pack calls the keys.
expect(native.split('·'), `${p.code} lists the wrong number of keys`).toHaveLength(5)
expect(native, `${p.code} loses the Tab key`).toContain('Tab')
expect(native, `${p.code} loses the Ask Petal key`).toContain('?')
})
it.each(PACKS)('labels every companion, tone and style ($code)', async (p) => {
const { COMPANIONS } = await import('../components/Companion/companions')
for (const c of COMPANIONS) {
@@ -414,7 +430,12 @@ describe('the es pack', () => {
}
walk(es, '')
expect(lines.length).toBeGreaterThan(40)
// The one exemption, and it is not a question: `triageHint` is a legend of
// key caps, and its "?" is the key she presses to ask Petal — the same
// literal printed on the keyboard, no more Spanish punctuation than "Esc".
const keyCaps = new Set(['editor.triageHint'])
for (const { native, where } of lines) {
if (keyCaps.has(where)) continue
if (native.includes('?')) expect(native, `${where} closes ? without ¿`).toContain('¿')
if (native.includes('!')) expect(native, `${where} closes ! without ¡`).toContain('¡')
}