From 77d9706e937e9546c2c0fdcf7e1d891f25402420 Mon Sep 17 00:00:00 2001 From: Badcuban <108198679+badcuban@users.noreply.github.com> Date: Fri, 20 Nov 2026 14:01:00 -0500 Subject: [PATCH] fix(web): a wrapped parent's open child drops the shared topic too The sidebar shortened a started thread's title when its siblings share a topic, but only under a live parent. Under a wrapped parent, the child open in the chat still showed its full title. Wrapped rows now carry the same childShortTitles, worked out over the parent's whole family, and the open child's row uses them. --- apps/web/src/components/Sidebar.logic.test.ts | 6 ++++++ apps/web/src/components/Sidebar.logic.ts | 6 +++++- apps/web/src/components/Sidebar.tsx | 11 +++++++++-- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/apps/web/src/components/Sidebar.logic.test.ts b/apps/web/src/components/Sidebar.logic.test.ts index ba28e7e9f..b6adeec2e 100644 --- a/apps/web/src/components/Sidebar.logic.test.ts +++ b/apps/web/src/components/Sidebar.logic.test.ts @@ -1988,6 +1988,12 @@ describe("child thread families", () => { android: "Android toolchain", polish: "UI polish pass", }); + + // Wrapped with its family: the child open in the chat, drawn under it, reads the same. + const wrapped = entries.map((candidate) => ({ ...candidate, isDone: true })); + const [done] = sections(wrapped, { active: "android" }).done; + expect(done!.openChild?.threadKey).toBe("android"); + expect(done!.childShortTitles.get("android")).toBe("Android toolchain"); }); it("takes one seat per family and lists exactly the rows it draws", () => { diff --git a/apps/web/src/components/Sidebar.logic.ts b/apps/web/src/components/Sidebar.logic.ts index 3ccf35da5..12715f4a5 100644 --- a/apps/web/src/components/Sidebar.logic.ts +++ b/apps/web/src/components/Sidebar.logic.ts @@ -1736,6 +1736,8 @@ export interface InboxDoneRow { readonly remoteChildren: readonly InboxRemoteChild[]; /** A wrapped child of this wrapped parent that is open in the chat. */ readonly openChild: E | null; + /** What its children's rows show, as on a live row (InboxLiveRow.childShortTitles). */ + readonly childShortTitles: ReadonlyMap; /** * The thread that started it, when it stands here apart from that thread's * family: it left a live parent's family, or the machine filter hides the @@ -2031,10 +2033,12 @@ export function buildInboxSections(input: { liveParentByKey.get(entry.threadKey) ?? scopedOutParentByKey.get(entry.threadKey) ?? null; const standsApart = startedBy !== null; const children = standsApart ? [] : (childrenByParentKey.get(entry.threadKey) ?? []); + const remoteChildren = standsApart ? [] : remoteChildrenOf(entry); return { entry, children, - remoteChildren: standsApart ? [] : remoteChildrenOf(entry), + remoteChildren, + childShortTitles: childShortTitlesOf(children, remoteChildren), openChild: children.find((child) => child.isDone && child.threadKey === input.activeThreadKey) ?? null, startedBy, diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsx index 686c3a322..bf3748ab5 100644 --- a/apps/web/src/components/Sidebar.tsx +++ b/apps/web/src/components/Sidebar.tsx @@ -2416,8 +2416,14 @@ export default function Sidebar() { ); } - const { entry, children, remoteChildren, openChild, startedBy } = - shelfRow.row; + const { + entry, + children, + remoteChildren, + openChild, + childShortTitles, + startedBy, + } = shelfRow.row; return ( {dayGroup !== null ? : null} @@ -2450,6 +2456,7 @@ export default function Sidebar() { {openChild ? (