@omercnet/paseo-pr-radar 3.0.1-next.296.1 → 3.0.1-next.298.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/pr-radar.tsx +12 -2
- package/package.json +1 -1
- package/server/changes.ts +27 -0
- package/server/viewer-scope.ts +20 -1
package/client/pr-radar.tsx
CHANGED
|
@@ -57,9 +57,12 @@ function agentState(row: RadarRow): string {
|
|
|
57
57
|
return `${agent.title} · ${agent.status}${extra}`;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
// Below this width (px) the radar uses its compact card layout: actions under the text.
|
|
61
|
+
const NARROW_PANE_WIDTH = 640;
|
|
62
|
+
|
|
60
63
|
export function PrRadar({
|
|
61
64
|
theme,
|
|
62
|
-
layout,
|
|
65
|
+
layout: hostLayout,
|
|
63
66
|
host,
|
|
64
67
|
navigation,
|
|
65
68
|
params = {},
|
|
@@ -67,6 +70,10 @@ export function PrRadar({
|
|
|
67
70
|
const queryClient = useQueryClient();
|
|
68
71
|
const acknowledgeUpdates = useRpc(acknowledgeViewerScope);
|
|
69
72
|
const parsed = parseRadarParams(params);
|
|
73
|
+
// The host's compact flag follows the window, so a pane narrower than the window (the screen
|
|
74
|
+
// sits beside a sidebar) kept the wide card. Measure the radar's own width as well.
|
|
75
|
+
const [narrow, setNarrow] = useState(false);
|
|
76
|
+
const layout = { ...hostLayout, compact: hostLayout.compact || narrow };
|
|
70
77
|
const [filter, setFilterState] = useState<RadarFilter | null>(parsed.filter);
|
|
71
78
|
const [focusedPr, setFocusedPr] = useState<string | null>(parsed.pr);
|
|
72
79
|
// Chips are local state: openScreen would push a new screen per tap. A chip press also ends PR focus.
|
|
@@ -807,7 +814,10 @@ export function PrRadar({
|
|
|
807
814
|
);
|
|
808
815
|
|
|
809
816
|
return (
|
|
810
|
-
<View
|
|
817
|
+
<View
|
|
818
|
+
style={styles.screen}
|
|
819
|
+
onLayout={(event) => setNarrow(event.nativeEvent.layout.width < NARROW_PANE_WIDTH)}
|
|
820
|
+
>
|
|
811
821
|
<FlatList
|
|
812
822
|
contentContainerStyle={styles.content}
|
|
813
823
|
data={visibleRows}
|
package/package.json
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const TRANSITION = /^(.+?): (.+) → (.+)$/;
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Reports each field's net change from its first recorded origin to its trustworthy current value.
|
|
5
|
+
* Legacy pending lists deduplicate repeated transitions, so their last entry is not the latest state.
|
|
6
|
+
*/
|
|
7
|
+
export function mergeChanges(
|
|
8
|
+
pending: string[],
|
|
9
|
+
detected: string[],
|
|
10
|
+
current: Readonly<Record<string, string | undefined>>,
|
|
11
|
+
): string[] {
|
|
12
|
+
const merged: string[] = [];
|
|
13
|
+
const seen = new Set<string>();
|
|
14
|
+
for (const change of [...pending, ...detected]) {
|
|
15
|
+
const next = TRANSITION.exec(change);
|
|
16
|
+
const to = next ? current[next[1]] : undefined;
|
|
17
|
+
if (!next || typeof to !== "string") {
|
|
18
|
+
if (!merged.includes(change)) merged.push(change);
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
const [, label, from] = next;
|
|
22
|
+
if (seen.has(label)) continue;
|
|
23
|
+
seen.add(label);
|
|
24
|
+
if (from !== to) merged.push(`${label}: ${from} → ${to}`);
|
|
25
|
+
}
|
|
26
|
+
return merged;
|
|
27
|
+
}
|
package/server/viewer-scope.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { dirname, join } from "node:path";
|
|
|
5
5
|
import { promisify } from "node:util";
|
|
6
6
|
import type { z } from "zod";
|
|
7
7
|
import type { acknowledgeViewerScope, GitHubInboxItem, viewerScope } from "../shared/viewer-scope";
|
|
8
|
+
import { mergeChanges } from "./changes";
|
|
8
9
|
|
|
9
10
|
const execFileAsync = promisify(execFile);
|
|
10
11
|
const SEARCH_LIMIT = 100;
|
|
@@ -362,9 +363,27 @@ export async function resolveViewerScope({
|
|
|
362
363
|
const nextPending: Record<string, string[]> = {};
|
|
363
364
|
for (const item of inboxItems) {
|
|
364
365
|
const prior = previous.items[item.id];
|
|
366
|
+
const state = enrichment.states.get(item.id);
|
|
365
367
|
const detected =
|
|
366
368
|
initialized && (!prior || enrichment.states.has(item.id)) ? detectChanges(prior, item) : [];
|
|
367
|
-
item.changes =
|
|
369
|
+
item.changes = mergeChanges(previous.pendingChanges[item.id] ?? [], detected, {
|
|
370
|
+
Checks:
|
|
371
|
+
state?.statusCheckRollup === null || item.checksStatus !== "none"
|
|
372
|
+
? item.checksStatus
|
|
373
|
+
: undefined,
|
|
374
|
+
Review:
|
|
375
|
+
state?.reviewDecision === null || item.reviewDecision !== null
|
|
376
|
+
? (item.reviewDecision ?? "none")
|
|
377
|
+
: undefined,
|
|
378
|
+
Mergeable:
|
|
379
|
+
item.mergeable === "MERGEABLE" || item.mergeable === "CONFLICTING"
|
|
380
|
+
? item.mergeable.toLowerCase()
|
|
381
|
+
: undefined,
|
|
382
|
+
"Merge state":
|
|
383
|
+
item.mergeStateStatus && item.mergeStateStatus.toUpperCase() !== "UNKNOWN"
|
|
384
|
+
? item.mergeStateStatus
|
|
385
|
+
: undefined,
|
|
386
|
+
});
|
|
368
387
|
nextItems[item.id] = prior && !enrichment.states.has(item.id) ? prior : storedItem(item);
|
|
369
388
|
if (item.changes.length > 0) nextPending[item.id] = item.changes;
|
|
370
389
|
}
|