feat: replace ref-based messages with component-based message bubbles#553
Closed
avoidwork wants to merge 1 commit into
Closed
feat: replace ref-based messages with component-based message bubbles#553avoidwork wants to merge 1 commit into
avoidwork wants to merge 1 commit into
Conversation
avoidwork
deleted the
feat/replace-ref-based-messages-with-component-message-bubbles
branch
July 18, 2026 03:03
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.
Summary
Replace the ref-based message array architecture in the TUI with a component-based system where each message is a standalone MessageBubble component managing its own state.
Motivation
The current architecture uses
messagesstate array + array spreading ([...prev]) + element mutation on every render. This fights React's model and causes:setMessages(prev => { clone + mutate })call sites acrossapp.jsChanges
src/tui/messageBubble.js— Standalone MessageBubble component with internal state and imperativeupdate()method viaReact.forwardRefsrc/tui/messageList.js— Manages array of MessageBubble instances with imperativeaddMessage()/updateMessage()/clear()API and scroll managementsrc/tui/conversationPanel.js— Simplified to a thin wrapper (delegates to MessageList)src/tui/app.js— Replaces array-mutation state updates with imperative ref callsopenspec/changes/...— Full OpenSpec proposal, design, specs, and tasksSpec Coverage
Implementation Plan
See
openspec/changes/replace-ref-based-messages-with-component-message-bubbles/tasks.mdfor 47 implementation tasks across 8 groups.Testing
Security
No new dependencies, no network changes. All changes are internal TUI component architecture.