mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-17 11:20:37 +09:00
Refine issue workflow surfaces and live updates
This commit is contained in:
parent
b4a58ba8a6
commit
03dff1a29a
48 changed files with 2800 additions and 1163 deletions
|
|
@ -14,12 +14,14 @@ import {
|
|||
DEFAULT_INBOX_ISSUE_COLUMNS,
|
||||
buildInboxDismissedAtByKey,
|
||||
computeInboxBadgeData,
|
||||
filterInboxIssues,
|
||||
getAvailableInboxIssueColumns,
|
||||
getApprovalsForTab,
|
||||
getInboxWorkItems,
|
||||
getInboxKeyboardSelectionIndex,
|
||||
getRecentTouchedIssues,
|
||||
getUnreadTouchedIssues,
|
||||
groupInboxWorkItems,
|
||||
isInboxEntityDismissed,
|
||||
isMineInboxTab,
|
||||
loadInboxIssueColumns,
|
||||
|
|
@ -32,6 +34,7 @@ import {
|
|||
saveInboxIssueColumns,
|
||||
saveLastInboxTab,
|
||||
shouldShowInboxSection,
|
||||
type InboxWorkItem,
|
||||
} from "./inbox";
|
||||
|
||||
const storage = new Map<string, string>();
|
||||
|
|
@ -336,7 +339,6 @@ describe("inbox helpers", () => {
|
|||
});
|
||||
|
||||
expect(result.mineIssues).toBe(1);
|
||||
// inbox = mineIssues(1) + agent-error alert(1) + budget alert(1)
|
||||
expect(result.inbox).toBe(3);
|
||||
});
|
||||
|
||||
|
|
@ -493,7 +495,7 @@ describe("inbox helpers", () => {
|
|||
approvals: [],
|
||||
});
|
||||
|
||||
expect(items.map((i) => (i.kind === "issue" ? i.issue.id : ""))).toEqual([
|
||||
expect(items.map((item) => (item.kind === "issue" ? item.issue.id : ""))).toEqual([
|
||||
"recent",
|
||||
"older",
|
||||
]);
|
||||
|
|
@ -701,4 +703,30 @@ describe("inbox helpers", () => {
|
|||
expect(getInboxKeyboardSelectionIndex(0, 3, "next")).toBe(1);
|
||||
expect(getInboxKeyboardSelectionIndex(0, 3, "previous")).toBe(0);
|
||||
});
|
||||
|
||||
it("hides routine execution issues until the toggle is enabled", () => {
|
||||
const manualIssue = { ...makeIssue("manual", true), originKind: "manual" as const };
|
||||
const routineIssue = { ...makeIssue("routine", true), originKind: "routine_execution" as const };
|
||||
|
||||
expect(filterInboxIssues([manualIssue, routineIssue], false)).toEqual([manualIssue]);
|
||||
expect(filterInboxIssues([manualIssue, routineIssue], true)).toEqual([manualIssue, routineIssue]);
|
||||
});
|
||||
|
||||
it("groups mixed inbox items by type while preserving item order within each group", () => {
|
||||
const items: InboxWorkItem[] = [
|
||||
{ kind: "approval", timestamp: 4, approval: makeApproval("pending") },
|
||||
{ kind: "issue", timestamp: 3, issue: makeIssue("1", true) },
|
||||
{ kind: "issue", timestamp: 2, issue: makeIssue("2", false) },
|
||||
{ kind: "failed_run", timestamp: 1, run: makeRun("run-1", "failed", "2026-03-11T00:00:00.000Z") },
|
||||
{ kind: "join_request", timestamp: 0, joinRequest: makeJoinRequest("join-1") },
|
||||
];
|
||||
|
||||
expect(groupInboxWorkItems(items, "none")).toEqual([{ key: "__all", label: null, items }]);
|
||||
expect(groupInboxWorkItems(items, "type")).toEqual([
|
||||
{ key: "issue", label: "Issues", items: [items[1], items[2]] },
|
||||
{ key: "approval", label: "Approvals", items: [items[0]] },
|
||||
{ key: "failed_run", label: "Failed runs", items: [items[3]] },
|
||||
{ key: "join_request", label: "Join requests", items: [items[4]] },
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue