The open-source app everyone uses to manage agents at work
TypeScript acpxagent-orchestrationagent-skillsagentic-aiai-agentsai-engineeringai-governanceai-toolsautonomous-agentsclaudeclaude-codeclaude-skillscodexhermesllmmcpmulti-agentopenclawproject-managementworkflow-automation
[codex] Polish inbox nested issue UI (#4959)
Dottafe401b7fa942
diff --git a/ui/src/components/IssueChatThread.test.tsx b/ui/src/components/IssueChatThread.test.tsxindex 977d2bedbd..dddec3b2cd 100644--- a/ui/src/components/IssueChatThread.test.tsx+++ b/ui/src/components/IssueChatThread.test.tsx@@ -1487,6 +1487,49 @@ describe("IssueChatThread", () => {});});+ it("invokes the cancel callback for pending question interactions", async () => {+ const root = createRoot(container);+ const onCancelInteraction = vi.fn(async () => undefined);++ await act(async () => {+ root.render(+ <MemoryRouter>+ <IssueChatThread+ comments={[]}+ interactions={[createQuestionInteraction()]}+ linkedRuns={[]}+ timelineEvents={[]}+ liveRuns={[]}+ onAdd={async () => {}}+ onCancelInteraction={onCancelInteraction}+ showComposer={false}+ enableLiveTranscriptPolling={false}+ />+ </MemoryRouter>,+ );+ });++ const cancelButton = Array.from(container.querySelectorAll("button")).find((button) =>+ button.textContent?.includes("Cancel question"),+ );+ expect(cancelButton).toBeTruthy();++ await act(async () => {+ cancelButton?.dispatchEvent(new MouseEvent("click", { bubbles: true }));+ });++ expect(onCancelInteraction).toHaveBeenCalledWith(+ expect.objectContaining({+ id: "interaction-question-1",+ kind: "ask_user_questions",+ }),+ );++ act(() => {+ root.unmount();+ });+ });+it("folds expired request confirmations into an activity row by default", async () => {const root = createRoot(container);diff --git a/ui/src/components/IssueThreadInteractionCard.tsx b/ui/src/components/IssueThreadInteractionCard.tsxindex d48bd5b1d3..a05f0dc2f5 100644--- a/ui/src/components/IssueThreadInteractionCard.tsx+++ b/ui/src/components/IssueThreadInteractionCard.tsx@@ -807,8 +807,8 @@ function AskUserQuestionsCard({) : ("Cancel question")}- </Button>- ) : null}+ </Button>+ ) : null}<Buttonsize="sm"disabled={!onSubmitInteractionAnswers || !canSubmit || working || cancelling}diff --git a/ui/src/components/SwipeToArchive.tsx b/ui/src/components/SwipeToArchive.tsxindex 639179c349..f22fdd62dc 100644--- a/ui/src/components/SwipeToArchive.tsx+++ b/ui/src/components/SwipeToArchive.tsx@@ -153,7 +153,7 @@ export function SwipeToArchive({data-inbox-row-surfaceclassName={cn("relative will-change-transform",- selected ? "bg-zinc-100 dark:bg-zinc-800" : "bg-card",+ selected ? "bg-zinc-100 dark:bg-zinc-800" : "bg-background",)}style={{transform: `translate3d(${offsetX}px, 0, 0)`,diff --git a/ui/src/lib/inbox.test.ts b/ui/src/lib/inbox.test.tsindex cae820df6c..862c5c5203 100644--- a/ui/src/lib/inbox.test.ts+++ b/ui/src/lib/inbox.test.ts@@ -634,6 +634,71 @@ describe("inbox helpers", () => {]);});+ it("keeps nested grandchild issues visible in keyboard navigation", () => {+ const parentIssue = makeIssue("parent", true);+ parentIssue.lastActivityAt = new Date("2026-03-11T01:00:00.000Z");+ const childIssue = makeIssue("child", true);+ childIssue.parentId = parentIssue.id;+ childIssue.lastActivityAt = new Date("2026-03-11T02:00:00.000Z");+ const grandchildIssue = makeIssue("grandchild", false);+ grandchildIssue.parentId = childIssue.id;+ grandchildIssue.lastActivityAt = new Date("2026-03-11T05:00:00.000Z");++ const [section] = buildGroupedInboxSections(+ getInboxWorkItems({ issues: [parentIssue, childIssue, grandchildIssue], approvals: [] }),+ "none",+ {},+ { nestingEnabled: true },+ );++ expect(section?.displayItems.map((item) => item.kind === "issue" ? item.issue.id : "other")).toEqual([+ parentIssue.id,+ ]);+ expect(section?.displayItems[0]?.timestamp).toBe(new Date("2026-03-11T05:00:00.000Z").getTime());++ expect(+ buildInboxKeyboardNavEntries([section!], new Set(), new Set()).map((entry) => entry.type === "top"+ ? entry.item.kind === "issue" ? entry.item.issue.id : "other"+ : entry.type === "child"+ ? entry.issueId+ : entry.groupKey),+ ).toEqual([parentIssue.id, childIssue.id, grandchildIssue.id]);++ expect(+ buildInboxKeyboardNavEntries([section!], new Set(), new Set([childIssue.id])).map((entry) => entry.type === "top"+ ? entry.item.kind === "issue" ? entry.item.issue.id : "other"+ : entry.type === "child"+ ? entry.issueId+ : entry.groupKey),+ ).toEqual([parentIssue.id, childIssue.id]);+ });++ it("stops cyclic child issue traversal when building keyboard navigation", () => {+ const parentIssue = makeIssue("parent", true);+ const childIssue = makeIssue("child", true);+ childIssue.parentId = parentIssue.id;+ parentIssue.parentId = childIssue.id;++ const groupedSections = [+ {+ key: "workspace:default",+ displayItems: [{ kind: "issue", timestamp: 2, issue: parentIssue } satisfies InboxWorkItem],+ childrenByIssueId: new Map([+ [parentIssue.id, [childIssue]],+ [childIssue.id, [parentIssue]],+ ]),+ },+ ];++ expect(+ buildInboxKeyboardNavEntries(groupedSections, new Set(), new Set()).map((entry) => entry.type === "top"+ ? entry.item.kind === "issue" ? entry.item.issue.id : "other"+ : entry.type === "child"+ ? entry.issueId+ : entry.groupKey),+ ).toEqual([parentIssue.id, childIssue.id]);+ });+it("emits a group nav entry for labeled groups and omits children when the group is collapsed", () => {const visibleIssue = makeIssue("visible", true);const hiddenIssue = makeIssue("hidden", true);diff --git a/ui/src/lib/inbox.ts b/ui/src/lib/inbox.tsindex 37e0d90f7b..09614e1b55 100644--- a/ui/src/lib/inbox.ts+++ b/ui/src/lib/inbox.ts@@ -906,9 +906,26 @@ export function buildInboxNesting(items: InboxWorkItem[]): {}}- // Sort each child list by most recent activity+ const subtreeActivityTimestamp = (issue: Issue, seen: ReadonlySet<string> = new Set()): number => {+ const ownTimestamp = issueLastActivityTimestamp(issue);+ if (seen.has(issue.id)) return ownTimestamp;+ const nextSeen = new Set(seen);+ nextSeen.add(issue.id);+ const children = childrenByIssueId.get(issue.id) ?? [];+ if (children.length === 0) return ownTimestamp;+ return Math.max(+ ownTimestamp,+ ...children.map((child) => subtreeActivityTimestamp(child, nextSeen)),+ );+ };++ // Sort each child list by most recent descendant activity, not just direct issue activity.for (const children of childrenByIssueId.values()) {- children.sort(sortIssuesByMostRecentActivity);+ children.sort((a, b) => {+ const activityDiff = subtreeActivityTimestamp(b) - subtreeActivityTimestamp(a);+ if (activityDiff !== 0) return activityDiff;+ return sortIssuesByMostRecentActivity(a, b);+ });}// Build root issue items with group-adjusted timestamps@@ -917,7 +934,7 @@ export function buildInboxNesting(items: InboxWorkItem[]): {.map((item) => {const children = childrenByIssueId.get(item.issue.id);if (!children?.length) return item;- const maxChildTs = Math.max(...children.map(issueLastActivityTimestamp));+ const maxChildTs = Math.max(...children.map((child) => subtreeActivityTimestamp(child)));return { ...item, timestamp: Math.max(item.timestamp, maxChildTs) };});@@ -985,25 +1002,32 @@ export function buildInboxKeyboardNavEntries(}if (isCollapsed) continue;- for (const item of group.displayItems) {- entries.push({- type: "top",- itemKey: `${group.key}:${getInboxWorkItemKey(item)}`,- item,- });-- if (item.kind !== "issue") continue;-- const children = group.childrenByIssueId.get(item.issue.id);- if (!children?.length || collapsedInboxParents.has(item.issue.id)) continue;+ const addIssueChildren = (issueId: string, seen: ReadonlySet<string>) => {+ const children = group.childrenByIssueId.get(issueId);+ if (!children?.length || collapsedInboxParents.has(issueId)) return;for (const child of children) {+ if (seen.has(child.id)) continue;+ const nextSeen = new Set(seen);+ nextSeen.add(child.id);entries.push({type: "child",issueId: child.id,issue: child,});+ addIssueChildren(child.id, nextSeen);}+ };++ for (const item of group.displayItems) {+ entries.push({+ type: "top",+ itemKey: `${group.key}:${getInboxWorkItemKey(item)}`,+ item,+ });++ if (item.kind !== "issue") continue;+ addIssueChildren(item.issue.id, new Set([item.issue.id]));}}diff --git a/ui/src/pages/Inbox.tsx b/ui/src/pages/Inbox.tsxindex cf4675fe12..0e37a01ebf 100644--- a/ui/src/pages/Inbox.tsx+++ b/ui/src/pages/Inbox.tsx@@ -2122,7 +2122,7 @@ export function Inbox() {<>{showSeparatorBefore("work_items") && <Separator />}<div>- <div ref={listRef} className="overflow-hidden rounded-xl bg-card">+ <div ref={listRef} className="overflow-hidden rounded-xl">{(() => {const renderInboxIssue = ({issue,@@ -2436,40 +2436,32 @@ export function Inbox() {const hasChildren = childIssues.length > 0;const isExpanded = hasChildren && !collapsedInboxParents.has(issue.id);const canArchiveIssue = canArchiveFromTab && group.searchSection === "none";- const parentRow = renderInboxIssue({- issue,- depth: 0,- selected: isSelected,- hasChildren,- isExpanded,- childCount: childIssues.length,- collapseParentId: issue.id,- allowArchive: canArchiveIssue,- });-- elements.push(wrapItem(`issue:${issue.id}`, isSelected, canArchiveIssue ? (- <SwipeToArchive- key={`issue:${issue.id}`}- selected={isSelected}- disabled={archivingIssueIds.has(issue.id) || archiveIssueMutation.isPending}- onArchive={() => archiveIssueMutation.mutate(issue.id)}- >- {parentRow}- </SwipeToArchive>- ) : parentRow));-- if (isExpanded) {- for (const child of childIssues) {+ const renderChildIssueRows = (+ children: Issue[],+ depth: number,+ seen: ReadonlySet<string>,+ ): ReactNode[] =>+ children.flatMap((child) => {+ if (seen.has(child.id)) return [];+ const nextSeen = new Set(seen);+ nextSeen.add(child.id);const childNavIdx = childFlatIndex.get(child.id) ?? -1;const isChildSelected = selectedIndex === childNavIdx;+ const grandchildIssues = group.childrenByIssueId.get(child.id) ?? [];+ const childHasChildren = grandchildIssues.length > 0;+ const childIsExpanded = childHasChildren && !collapsedInboxParents.has(child.id);const childRow = renderInboxIssue({issue: child,- depth: 1,+ depth,selected: isChildSelected,+ hasChildren: childHasChildren,+ isExpanded: childIsExpanded,+ childCount: grandchildIssues.length,+ collapseParentId: child.id,allowArchive: canArchiveIssue,});const isChildArchiving = archivingIssueIds.has(child.id);- elements.push(+ const row = (<divkey={`sel-issue:${child.id}`}data-inbox-item@@ -2486,9 +2478,37 @@ export function Inbox() {{childRow}</SwipeToArchive>) : childRow}- </div>,+ </div>);- }++ return childIsExpanded+ ? [row, ...renderChildIssueRows(grandchildIssues, depth + 1, nextSeen)]+ : [row];+ });+ const parentRow = renderInboxIssue({+ issue,+ depth: 0,+ selected: isSelected,+ hasChildren,+ isExpanded,+ childCount: childIssues.length,+ collapseParentId: issue.id,+ allowArchive: canArchiveIssue,+ });++ elements.push(wrapItem(`issue:${issue.id}`, isSelected, canArchiveIssue ? (+ <SwipeToArchive+ key={`issue:${issue.id}`}+ selected={isSelected}+ disabled={archivingIssueIds.has(issue.id) || archiveIssueMutation.isPending}+ onArchive={() => archiveIssueMutation.mutate(issue.id)}+ >+ {parentRow}+ </SwipeToArchive>+ ) : parentRow));++ if (isExpanded) {+ elements.push(...renderChildIssueRows(childIssues, 1, new Set([issue.id])));}}