Repository navigation
fix(workbench): keep child breadcrumb popover open during catalog updates - #7394
Conversation
…ates Stop the familyParent effect in Conversation.tsx from subscribing to browsing.sessions() via knownSession(), and guard Header's titleSlot and actions with boolean computed memos so metadata updates never remount SessionFamilyBreadcrumb and dismiss its open sibling popover. Generated-by: Maka
jackwener
left a comment
There was a problem hiding this comment.
I reviewed 32b4f9ee6fff1791b185105a4a1cf8eba7df845d and found no P0–P2 issues. The cached boolean conditions keep the header slots stable when their underlying metadata changes, and the untracked catalog lookup removes the repeated parent observation queries.
The 14 session-family and conversation-group tests pass locally. A diagnostic using this commit's NSH reactive graph confirms the old dependency/remount behavior and the new memo behavior; this is not a desktop interaction test. The required test check and the label check both pass. The merge with main 9c051de3bc6b44385ec07bdf44edf011911fab28 is clean.
One minor follow-up is noted inline: parent metadata now remains a snapshot while the child stays open. I did not run a live desktop popover test.
Automated review notice: This comment was posted by an automated review agent operated by jackwener. It is not an independent human review and does not replace one.
| const known = props.knownSession?.(pid); | ||
| // Read cached sidebar metadata without subscribing to the entire catalog stream, | ||
| // otherwise every active session update re-runs this effect and re-queries observe. | ||
| const known = untracked(() => props.knownSession?.(pid)); |
There was a problem hiding this comment.
[P3] Keep parent labels current without repeating observe queries
After the initial observe response, renaming the parent while this child remains open no longer updates the breadcrumb or the parent row in its popover. knownSession reads the live sidebar catalog in SessionSurface.tsx, but this lookup is now untracked and the effect has no remaining dependency on parent metadata; the query is a one-shot read. Navigation still targets the correct ID, so this is a minor display issue. A separate tracked projection of the parent's display fields, guarded by the existing field equality check, could update the label while leaving the asynchronous observe effect dependent only on the parent ID. Please cover a parent rename while the child remains mounted when adding the popover regression test.
Automated review notice: This comment was posted by an automated review agent operated by jackwener. It is not an independent human review and does not replace one.
Summary
Fixes the child-session header breadcrumb popover automatically closing whenever any conversation is active in the background.
Refs #7358
Root cause
plugins/agent/conversations/ui/Conversation.tsx, thefamilyParenteffectcalledprops.knownSession?.(pid)withoutuntracked, inadvertently subscribing tobrowsing.sessions(). Every sidebar catalog update (such as an active child/parent updating activity or recency) re-ran the effect, wrote a freshFamilyParentobject reference, and also fired a redundantagent.observeRPC.<Header titleSlot={platform.idiom !== 'terminal' && familyParent() ? <SessionFamilyBreadcrumb ... /> : undefined} />read the object reference directly inside thetitleSlotgetter, so each newFamilyParentreference unmounted and remounted<SessionFamilyBreadcrumb>, destroying its open<Popover>.Fix
props.knownSession?.(pid)insideuntracked(...)so the effect only tracksparentSessionId()and stops re-queryingagent.observeon every catalog tick.familyParent.set(...)writes when all fields are unchanged.<Header titleSlot>(andactions) on booleancomputedmemos (hasFamilyParent/isBotHeader) so parent metadata updates refresh in place without remounting the breadcrumb or its popover.Verification
biome check plugins/agent/conversations/ui/Conversation.tsxpassedjust typecheckpassednode --test products/maka/workbench/tests/session-family.test.mjs products/maka/workbench/tests/conversation-groups.test.mjspassed (14/14)git diff --checkpassedDesktop live re-test was not run in this PR; the root cause is deterministic from the reactive subscription + JSX slot remount path.
AI use
Select exactly one:
Tool(s) and scope: Maka diagnosed the reactive remount root cause and implemented the fix in
Conversation.tsx.Checklist
Does this PR entail a breaking change or persisted-data migration?
upgrade_compat.rscoverage under Summary aboveDoes this PR entail a change in behavior?