feat: add signal bind method to message list component#8783
Open
feat: add signal bind method to message list component#8783
Conversation
Add `bindItems(Signal<List<S>>)` method and a signal-based constructor to MessageList, allowing items to be reactively bound to signals. The rendered messages update automatically when the list signal or any individual item signal changes. Implementation details: - Extract private `updateItems()` from `setItems()` for reuse by the signal effect callback - Guard `setItems()` and `addItem()` with `throwIfItemsBindingActive()` to prevent manual mutation while a signal binding is active - Use `SignalBindingFeature` for binding lifecycle management - Add unit tests covering signal constructor, reactive updates for both list and item signals, deferred activation until attach, and error cases (mutation while bound, double bind, null signal) - Add manual test page and integration tests for signal binding Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
13 tasks
|
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
bindItems(Signal<List<S>>)method and signal-based constructor toMessageList, allowing items to be reactively bound to signalsupdateItems()fromsetItems()for reuse by the signal effect callbacksetItems()andaddItem()withthrowIfItemsBindingActive()to prevent manual mutation while a signal binding is activeTest plan
MessageListSignalTestcovering signal constructor, reactive updates (list and item signals), deferred activation until attach, and error casesMessageListSignalITcovering initial render, add, remove, update, and add+remove via signal-bound pageMessageListunit tests still pass🤖 Generated with Claude Code