feat: propose TUI integration change#282
Closed
avoidwork wants to merge 6 commits into
Closed
Conversation
Generate full OpenSpec proposal from docs/TUI.md blueprint: - proposal.md: motivation, capabilities, impact analysis - design.md: technical decisions, risks, migration plan - 6 spec files: state-management, streaming-hook, file-structure, panel-removal, command-registry, runtime-toggles - tasks.md: 38 implementation tasks across 11 phases
d227459 to
2623311
Compare
…nd reducer - Create src/tui/state/types.js with TUIState interface, TUIAction union, Message interface, ToggleConfig type, and initialState - Create src/tui/state/selectors.js with getStatusMessage, formatContextSize, and derived state selectors (getLastMessage, hasMessages, etc.) - Create src/tui/state/reducer.js with tuiReducer handling all 21 action types: messages (ADD/UPDATE/CLEAR), input (SET_TEXT/SUBMIT/FOCUSED), history (ADD/INDEX), status (SET_STATUS/CONTEXT_SIZE/COMPACTING), streaming (SET_STREAMING/AUTO_CONTINUING/INCREMENT/RESET), scroll (SET_OFFSET/VIEWPORT_HEIGHT), config (TOGGLE/SET), banner/onboarding (SET_SHOW_BANNER/ONBOARDING/RESPONSE) - Export action type constants and helper functions for tests
- Create src/tui/hooks/useStreaming.js with useStreaming() hook - Manage AbortController lifecycle: create on start, abort on interrupt - Transform stream events: text, reasoning, tool_start, tool_end, tool_error, compaction_start, compaction_end, todo_status - Implement auto-continue circuit breaker with configurable limit - Expose streamingState object and abort() method - Memoized public API to avoid unnecessary re-renders
- Create src/tui/hooks/useScroll.js: manages ScrollView ref, terminal resize handling, scroll-to-bottom on content changes, page up/down - Create src/tui/hooks/useInput.js: keyboard routing between scroll, history navigation, and input fields based on focus state - Wire useInput to handle arrow keys, PageUp/PageDown, Tab, Escape, Enter
- Rewrite src/tui/utils/commandParser.js as CommandRegistry class - Event-driven registration with validate/execute/help properties - Command interface: name, description, usage, validate, execute - CommandHelpers interface with dispatchProvider, sessionState, config, etc. - Register all built-in commands: quit, new, clear, provider, config, schedule, gc, help — with grouped display - Validation before execution for safer command processing - Grouped /help output organized by category (Session, Provider, Config, Schedule, System, General)
- Create src/tui/utils/format.js with toggle logic and format specifiers - TOGGLE_KEYS mapping: autoScroll, timestamps, commandEcho, cursorBreathe, debugOutput - getToggleStatusString() for status bar display (e.g., [ts:1 scroll:1]) - parseToggleKey() for short/full name resolution - Format helpers: formatNumber, formatSize - Toggle checkers: shouldShowTimestamps, shouldEchoCommands, shouldShowDebug, shouldBreatheCursor, shouldAutoScroll (all with sensible defaults)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Propose a comprehensive OpenSpec change for the TUI integration based on the blueprint in docs/TUI.md. Creates 7 capability specs, a design document, and a 99-task implementation checklist.
Type of Change
Testing
OpenSpec artifacts validated via
openspec status— all 4/4 artifacts complete. Specs audited against docs/TUI.md blueprint with 4 gaps identified and resolved.Coverage
Checklist
npm run lintpasses