Refactor TextInputNode to move history management to ViewModel#39
Merged
Aaronontheweb merged 1 commit intodevfrom Dec 16, 2025
Merged
Conversation
- Remove built-in history from TextInputNode (was causing disposal issues when used in reactive layouts) - TextInputNode is now a pure UI component handling text editing only - Up/Down arrows return false to let ViewModel handle history navigation - Enter no longer auto-clears text; added Clear() method for ViewModel to call - Add Page Up/Down scrolling support to StreamingTextNode - Fix streaming demo: move history management to StreamingChatViewModel - Fix reactive layout disposal bug by using static input panel - Add comprehensive TextInputNode unit tests
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
TextInputNodewhich was causing disposal issues when used in reactive layoutsTextInputNodeis now a pure UI component handling text editing onlyfalseto let ViewModel handle history navigationClear()method for ViewModel to callStreamingTextNodeStreamingChatViewModelTextInputNodeunit testsBackground
The
TextInputNodewas storing input history internally, but this caused issues when the node was used inside aReactiveLayoutNode. When the layout rebuilt (e.g., whenIsGeneratingchanged), the oldPanelNodewas disposed, which cascaded to dispose the sharedTextInputNode, losing all history and breaking input.The fix moves history management to the ViewModel where it belongs - this follows proper separation of concerns and allows the application to control whether history is enabled, how many entries to keep, and whether to persist it.
Test plan
TextInputNodeTestscover cursor movement, editing, and event firing