chore(tui): clean remaining Ink perf scaffolding

Trim narration comments and collapse small one-off helpers in the remaining ui-tui perf support files while preserving behaviour.
This commit is contained in:
Brooklyn Nicholson 2026-04-26 21:20:54 -05:00
parent 7da2f07641
commit 2e4b65b9f5
8 changed files with 43 additions and 78 deletions

View file

@ -2,6 +2,9 @@ import { nonAlphanumericKeys, type ParsedKey } from '../parse-keypress.js'
import { Event } from './event.js'
const inputForSpecialSequence = (name: string): string =>
name === 'space' ? ' ' : name === 'return' || name === 'escape' ? '' : name
export type Key = {
upArrow: boolean
downArrow: boolean
@ -116,11 +119,7 @@ function parseKey(keypress: ParsedKey): [Key, string] {
// so the raw "[57358u" doesn't leak into the prompt. See #38781.
input = ''
} else {
// 'space' → ' '; functional keys like Enter/Escape carry their state
// through key.return/key.escape, and processedAsSpecialSequence bypasses
// the nonAlphanumericKeys clear below, so clear them explicitly here.
input =
keypress.name === 'space' ? ' ' : keypress.name === 'return' || keypress.name === 'escape' ? '' : keypress.name
input = inputForSpecialSequence(keypress.name)
}
processedAsSpecialSequence = true
@ -138,8 +137,7 @@ function parseKey(keypress: ParsedKey): [Key, string] {
// guards against future terminal behavior.
input = ''
} else {
input =
keypress.name === 'space' ? ' ' : keypress.name === 'return' || keypress.name === 'escape' ? '' : keypress.name
input = inputForSpecialSequence(keypress.name)
}
processedAsSpecialSequence = true