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 ? (