Skip to content

fix: correct TUI Ink API mismatches, key handling, and error handling - #167

Merged
avoidwork merged 2 commits into
mainfrom
fix/tui-audit-corrections
Jun 11, 2026
Merged

fix: correct TUI Ink API mismatches, key handling, and error handling#167
avoidwork merged 2 commits into
mainfrom
fix/tui-audit-corrections

Conversation

@avoidwork

Copy link
Copy Markdown
Owner

Description

Fixes 11 TUI issues discovered during an audit against the Ink v7 API spec: 2 critical runtime errors, 3 invalid Ink prop usages, 3 incorrect key property names, and 3 design improvements (graceful exit, input guards, dead code removal).

Type of Change

  • Bugfix (non-breaking change which fixes an issue)

Testing

  • Verified syntax on all 6 modified files with node -c
  • Pre-commit hook passed: oxlint (0 errors), oxfmt, coverage report generated
  • No new code added — only corrections to existing logic

Coverage

  • 100% line coverage maintained (no new functions added)

Checklist

  • npm run lint passes
  • Tests pass with 100% line coverage
  • No forbidden patterns used
  • Conventional Commit style applied

Changes by File

src/tui/app.js

  • Removed dead activeToolCall = null assignments (never read, caused ReferenceError on tool events)
  • Replaced 3x process.exit(0) with graceful useApp().exit() via exitRef

src/tui/conversationPanel.js

  • Fixed areEqual comparator: p._index === nextProps.assistantNamep._index === n._index (was always false, breaking React.memo)
  • dim: truedimColor: true (3 occurrences)
  • gray: truecolor: "gray" (empty message prompt)
  • Removed no-op if (!stdout) return guard

src/tui/onboardingPanel.js

  • Removed invalid growDirection: "down" prop (not a valid Ink Box prop)

src/tui/skillsPanel.js

  • key.up / key.downkey.upArrow / key.downArrow
  • Added isActive guard to useInput

src/tui/memoryPanel.js

  • key.up / key.downkey.upArrow / key.downArrow
  • key.spaceinput === " " (space not a documented Ink key property)
  • Added isActive guard to useInput

src/tui/settingsPanel.js

  • key.up / key.downkey.upArrow / key.downArrow
  • key.enterkey.return
  • Added isActive guard to useInput

- Remove dead activeToolCall assignments (never read, caused ReferenceError)
- Fix broken areEqual comparator in MessageBubble memo (conversationPanel.js)
- Replace invalid 'dim' prop with 'dimColor' (conversationPanel.js)
- Replace invalid 'gray' prop with 'color: gray' (conversationPanel.js)
- Remove invalid 'growDirection' prop from OnboardingPanel (onboardingPanel.js)
- Fix key.up/key.down to key.upArrow/key.downArrow in SkillsPanel
- Fix key.up/key.down to key.upArrow/key.downArrow in MemoryPanel
- Fix key.space to input check in MemoryPanel
- Fix key.up/key.down to key.upArrow/key.downArrow in SettingsPanel
- Fix key.enter to key.return in SettingsPanel
- Add isActive guard to all panel useInput hooks
- Replace process.exit(0) with graceful useApp().exit() in App
- Remove no-op stdout guard in conversationPanel.js
@avoidwork avoidwork self-assigned this Jun 11, 2026
@avoidwork
avoidwork merged commit 2d1c9ca into main Jun 11, 2026
2 checks passed
@avoidwork
avoidwork deleted the fix/tui-audit-corrections branch June 11, 2026 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant