Skip to content

Commit dcc754e

Browse files
committed
refactor(code): use status token for signal report list ordering
1 parent 798faf2 commit dcc754e

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

apps/code/src/renderer/features/inbox/utils/filterReports.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,21 +97,21 @@ describe("filterReportsBySearch", () => {
9797
});
9898

9999
describe("buildSignalReportListOrdering", () => {
100-
it("puts pipeline first then descending field", () => {
100+
it("puts status rank first then descending field", () => {
101101
expect(buildSignalReportListOrdering("total_weight", "desc")).toBe(
102-
"pipeline,-total_weight",
102+
"status,-total_weight",
103103
);
104104
});
105105

106-
it("puts pipeline first then ascending field", () => {
106+
it("puts status rank first then ascending field", () => {
107107
expect(buildSignalReportListOrdering("created_at", "asc")).toBe(
108-
"pipeline,created_at",
108+
"status,created_at",
109109
);
110110
});
111111

112112
it("works for signal_count", () => {
113113
expect(buildSignalReportListOrdering("signal_count", "desc")).toBe(
114-
"pipeline,-signal_count",
114+
"status,-signal_count",
115115
);
116116
});
117117
});

apps/code/src/renderer/features/inbox/utils/filterReports.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ export function filterReportsBySearch(
1616
}
1717

1818
/**
19-
* Comma-separated `ordering` for the signal report list API: stage (`pipeline`) then
20-
* the toolbar field (matches default inbox UX).
19+
* Comma-separated `ordering` for the signal report list API: semantic `status` rank
20+
* then the toolbar field (matches default inbox UX).
2121
*/
2222
export function buildSignalReportListOrdering(
2323
field: SignalReportOrderingField,
2424
direction: "asc" | "desc",
2525
): string {
2626
const secondary = direction === "desc" ? `-${field}` : field;
27-
return `pipeline,${secondary}`;
27+
return `status,${secondary}`;
2828
}

apps/code/src/shared/types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,9 @@ export interface SignalReportsQueryParams {
236236
offset?: number;
237237
status?: CommaSeparatedSignalReportStatuses;
238238
/**
239-
* Comma-separated sort keys (prefix `-` for descending). Use `pipeline` (or `stage`)
240-
* for report stage rank; `signal_count`, `total_weight`, `created_at`, `updated_at`, `id`.
241-
* Example: `pipeline,-total_weight`. Omit `pipeline` if you want a global sort only.
239+
* Comma-separated sort keys (prefix `-` for descending). `status` is semantic stage
240+
* rank (not lexicographic `status` column order). Also: `signal_count`, `total_weight`,
241+
* `created_at`, `updated_at`, `id`. Example: `status,-total_weight`.
242242
*/
243243
ordering?: string;
244244
}

0 commit comments

Comments
 (0)