Skip to content

fix(workbench): keep child breadcrumb popover open during catalog updates - #7394

Merged
M4n5ter merged 1 commit into
mainfrom
fix/child-breadcrumb-popover-dismiss
Nov 28, 2026
Merged

M4n5ter merged 1 commit into
mainfrom
fix/child-breadcrumb-popover-dismiss

Conversation

@M4n5ter

@M4n5ter M4n5ter commented Nov 28, 2026

Copy link
Copy Markdown
Member

Summary

Fixes the child-session header breadcrumb popover automatically closing whenever any conversation is active in the background.

Refs #7358

Root cause

  1. In plugins/agent/conversations/ui/Conversation.tsx, the familyParent effect called props.knownSession?.(pid) without untracked, inadvertently subscribing to browsing.sessions(). Every sidebar catalog update (such as an active child/parent updating activity or recency) re-ran the effect, wrote a fresh FamilyParent object reference, and also fired a redundant agent.observe RPC.
  2. <Header titleSlot={platform.idiom !== 'terminal' && familyParent() ? <SessionFamilyBreadcrumb ... /> : undefined} /> read the object reference directly inside the titleSlot getter, so each new FamilyParent reference unmounted and remounted <SessionFamilyBreadcrumb>, destroying its open <Popover>.

Fix

  • Read props.knownSession?.(pid) inside untracked(...) so the effect only tracks parentSessionId() and stops re-querying agent.observe on every catalog tick.
  • Skip redundant familyParent.set(...) writes when all fields are unchanged.
  • Gate <Header titleSlot> (and actions) on boolean computed memos (hasFamilyParent / isBotHeader) so parent metadata updates refresh in place without remounting the breadcrumb or its popover.

Verification

  • biome check plugins/agent/conversations/ui/Conversation.tsx passed
  • just typecheck passed
  • node --test products/maka/workbench/tests/session-family.test.mjs products/maka/workbench/tests/conversation-groups.test.mjs passed (14/14)
  • git diff --check passed

Desktop 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:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Maka diagnosed the reactive remount root cause and implemented the fix in Conversation.tsx.

Checklist

  • Tests cover the change and fail without it
  • Format, typecheck and the affected suites pass locally

Does this PR entail a breaking change or persisted-data migration?

  • Yes — describe user/data impact, in-place migration, and upgrade_compat.rs coverage under Summary above
  • No

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

…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
@github-actions github-actions Bot added the effort/S Under 100 readable lines label Nov 28, 2026

@jackwener jackwener left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

@M4n5ter
M4n5ter merged commit ab19e35 into main Nov 28, 2026
2 checks passed
@M4n5ter
M4n5ter deleted the fix/child-breadcrumb-popover-dismiss branch November 28, 2026 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/S Under 100 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants