Uh oh!
There was an error while loading. Please reload this page.
fix(app): refresh v2 tab titles - #30335
Conversation
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Fixes#30329
Type of change
What does this PR do?
Fixes the v2 layout tab bar not refreshing when the model generates a session title.
Root cause:
mapArrayruns its mapper insideuntrack, so readingsession.titleinside the mapper creates no reactive subscription. When the store is later updated viareconcile(in thesession.updatedSSE handler), the mapped result stays stale.Fix: Extract tab enrichment into
createTitlebarTabsEnriched()(titlebar-tabs.ts). Instead of eagerly reading session data inside the untracked mapper, the helper stores the session accessor and exposestitleas a reactive getter:The
<For>render function now callstab.title()andtab.info()under a tracking scope, so updates propagate correctly.How did you verify your code works?
session.titleas a static snapshot, test asserts stale valuebun test --preload ./happydom.ts ./src/components/titlebar.test.tsfrompackages/app: 1 passbun typecheckfrompackages/app: no new errors (pre-existingmessage-timeline.tsxerror unrelated)git diff --check: cleanChecklist