Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions apps/web/src/components/Sidebar.logic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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", () => {
Expand Down
6 changes: 5 additions & 1 deletion apps/web/src/components/Sidebar.logic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1736,6 +1736,8 @@ export interface InboxDoneRow<E extends InboxFamilyEntry> {
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<string, string>;
/**
* 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
Expand Down Expand Up @@ -2031,10 +2033,12 @@ export function buildInboxSections<E extends InboxFamilyEntry>(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,
Expand Down
11 changes: 9 additions & 2 deletions apps/web/src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2416,8 +2416,14 @@ export default function Sidebar() {
</React.Fragment>
);
}
const { entry, children, remoteChildren, openChild, startedBy } =
shelfRow.row;
const {
entry,
children,
remoteChildren,
openChild,
childShortTitles,
startedBy,
} = shelfRow.row;
return (
<React.Fragment key={entry.threadKey}>
{dayGroup !== null ? <InboxWrappedDayLabel group={dayGroup} /> : null}
Expand Down Expand Up @@ -2450,6 +2456,7 @@ export default function Sidebar() {
{openChild ? (
<InboxChildRow
thread={openChild.thread}
shortTitle={childShortTitles.get(openChild.threadKey)}
status={openChild.status}
isDone
doneAt={openChild.doneAt}
Expand Down
Loading