Repository navigation
perf(app): a chat item no longer changes the bot it belongs to - #77
Merged
Merged
Conversation
Every chat.item with a list line replaced the bot object, and everything that shows the bot re-rendered: the open bot's whole view with its chat, every conversation in the sidebar and every row of the crew timeline. - The list line lives in its own map, state.activity, filled from bots.list and bot.changed (which carry it) and by chat.item; the sidebar and the alerts read it with activityOf. - The sidebar's conversations are memoized, so a change to one bot re-renders only its line. - A timeline row reads only its two bots instead of all of them, and is memoized. - attentionCount and actionableDead, asked on every store change, are worked out again only when their inputs change.
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.
Fourth slice of the performance round. It is independent of the others; with #76 the gain adds up: the open chat stops re-rendering on every tool call.
What changes
state.activity: the conversation-list line leaves theBotobject.chat.itemwithactivitycreated a newbot. That re-rendered the open bot's whole view (header, chat, every run), every conversation in the sidebar and every timeline row.bots.listandbot.changed(which already carrylastActivity) and bychat.item. The sidebar and the alerts read it withactivityOf.Conversationis memoized: a change to one bot re-renders only its line.MessageRowsubscribed to the wholestate.botson every row. Now it reads only its two bots, and it is memoized.attentionCountandactionableDeadran on every store change, sorting every delivery each time. Now they recompute only when their inputs change.Tests
app.test.ts: a chat item changes the list line and keeps the samebotobject.pnpm checkpasses. In theFakeBotloftpreview, the sidebar shows each bot's line and the timeline shows its senders and recipients.Manual check (real Claude)