@omercnet/paseo-pr-radar 3.0.0 → 3.0.1-next.296.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/README.md +2 -2
- package/client/pr-radar.tsx +47 -1
- package/package.json +5 -5
- package/paseo-plugin.json +1 -1
- package/server/viewer-scope.ts +25 -2
package/README.md
CHANGED
|
@@ -51,7 +51,7 @@ Update an npm installation to the latest published release:
|
|
|
51
51
|
paseo plugin update pr-radar
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
The npm install and update flow requires Paseo `^0.12.0` with npm available on the daemon host.
|
|
54
|
+
The npm install and update flow requires Paseo `^0.12.0 || ^0.13.0` with npm available on the daemon host.
|
|
55
55
|
|
|
56
56
|
|
|
57
57
|
The daemon must have plugins enabled and `gh` authenticated for GitHub viewer-aware triage.
|
|
@@ -69,7 +69,7 @@ bun run typecheck
|
|
|
69
69
|
Release Please maintains the version, changelog, component tag, and GitHub release from
|
|
70
70
|
Conventional Commits in the monorepo.
|
|
71
71
|
|
|
72
|
-
The manifest supports Paseo `^0.12.0`. Development uses the 0.
|
|
72
|
+
The manifest supports Paseo `^0.12.0 || ^0.13.0`. Development uses the 0.13 CLI, client, plugin SDK,
|
|
73
73
|
and protocol packages together from the workspace catalog. Host-owned navigation opens linked agents and workspaces without private routes or
|
|
74
74
|
page reloads on web, desktop, iOS, and Android. React `19.1` and React Native `0.81` match the versions supplied by
|
|
75
75
|
the plugin host.
|
package/client/pr-radar.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { openExternalUrl, type PluginSurfaceProps, useRpc } from "@getpaseo/plugin/client";
|
|
2
|
+
import { copyText } from "@getpaseo/plugin/client/react-native";
|
|
2
3
|
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
3
4
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
4
5
|
import { ActivityIndicator, FlatList, Pressable, Text, TextInput, View } from "react-native";
|
|
@@ -84,6 +85,13 @@ export function PrRadar({
|
|
|
84
85
|
const [now, setNow] = useState(() => Date.now());
|
|
85
86
|
const [openError, setOpenError] = useState<string | null>(null);
|
|
86
87
|
const [actionNotice, setActionNotice] = useState<string | null>(null);
|
|
88
|
+
// A fresh object per copy re-arms the reset timer; the effect cleanup cancels it on re-copy and unmount.
|
|
89
|
+
const [copied, setCopied] = useState<{ id: string } | null>(null);
|
|
90
|
+
useEffect(() => {
|
|
91
|
+
if (!copied) return;
|
|
92
|
+
const timer = setTimeout(() => setCopied(null), 1500);
|
|
93
|
+
return () => clearTimeout(timer);
|
|
94
|
+
}, [copied]);
|
|
87
95
|
|
|
88
96
|
const {
|
|
89
97
|
paseo,
|
|
@@ -357,6 +365,7 @@ export function PrRadar({
|
|
|
357
365
|
},
|
|
358
366
|
warningText: { color: theme.colors.foregroundMuted, fontSize: 12, lineHeight: 17 },
|
|
359
367
|
row: {
|
|
368
|
+
position: "relative" as const,
|
|
360
369
|
flexDirection: "row" as const,
|
|
361
370
|
marginHorizontal: gutter,
|
|
362
371
|
borderTopWidth: 1,
|
|
@@ -370,7 +379,22 @@ export function PrRadar({
|
|
|
370
379
|
paddingLeft: 12,
|
|
371
380
|
gap: 6,
|
|
372
381
|
},
|
|
373
|
-
rowTop: {
|
|
382
|
+
rowTop: {
|
|
383
|
+
flexDirection: "row" as const,
|
|
384
|
+
alignItems: "center" as const,
|
|
385
|
+
gap: 8,
|
|
386
|
+
paddingRight: 80,
|
|
387
|
+
},
|
|
388
|
+
copyButton: {
|
|
389
|
+
position: "absolute" as const,
|
|
390
|
+
top: 10,
|
|
391
|
+
right: 0,
|
|
392
|
+
minHeight: 28,
|
|
393
|
+
justifyContent: "center" as const,
|
|
394
|
+
paddingHorizontal: 8,
|
|
395
|
+
borderRadius: 6,
|
|
396
|
+
},
|
|
397
|
+
copyText: { color: theme.colors.foregroundMuted, fontSize: 11, fontWeight: "600" as const },
|
|
374
398
|
identifier: {
|
|
375
399
|
color: theme.colors.foregroundMuted,
|
|
376
400
|
fontSize: 11,
|
|
@@ -452,6 +476,18 @@ export function PrRadar({
|
|
|
452
476
|
}
|
|
453
477
|
}, []);
|
|
454
478
|
|
|
479
|
+
const copyPrLink = useCallback(async (row: RadarRow) => {
|
|
480
|
+
setOpenError(null);
|
|
481
|
+
setCopied(null);
|
|
482
|
+
try {
|
|
483
|
+
await copyText(row.url);
|
|
484
|
+
setOpenError(null);
|
|
485
|
+
setCopied({ id: row.id });
|
|
486
|
+
} catch {
|
|
487
|
+
setOpenError(`Could not copy the link for ${row.repository}#${row.number ?? "PR"}.`);
|
|
488
|
+
}
|
|
489
|
+
}, []);
|
|
490
|
+
|
|
455
491
|
const renderRow = ({ item }: { item: RadarRow }) => {
|
|
456
492
|
const color = bucketColor(item.bucket, theme.colors);
|
|
457
493
|
const age = formatAge(item.activityAt, now);
|
|
@@ -576,6 +612,16 @@ export function PrRadar({
|
|
|
576
612
|
{layout.compact ? actions : null}
|
|
577
613
|
</View>
|
|
578
614
|
{layout.compact ? null : actions}
|
|
615
|
+
<Pressable
|
|
616
|
+
accessibilityRole="button"
|
|
617
|
+
accessibilityLabel={`Copy link to pull request ${item.repository} ${item.number ?? ""}`}
|
|
618
|
+
onPress={() => void copyPrLink(item)}
|
|
619
|
+
style={({ pressed }) => [styles.copyButton, pressed && styles.refreshPressed]}
|
|
620
|
+
>
|
|
621
|
+
<Text style={styles.copyText} accessibilityLiveRegion="polite">
|
|
622
|
+
{copied?.id === item.id ? "Copied" : "Copy link"}
|
|
623
|
+
</Text>
|
|
624
|
+
</Pressable>
|
|
579
625
|
</View>
|
|
580
626
|
);
|
|
581
627
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omercnet/paseo-pr-radar",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.1-next.296.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A viewer-aware delivery queue for pull requests linked to Paseo workspaces.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -47,10 +47,10 @@
|
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@biomejs/biome": "^2.5.10",
|
|
50
|
-
"@getpaseo/cli": "0.
|
|
51
|
-
"@getpaseo/client": "0.
|
|
52
|
-
"@getpaseo/plugin": "0.
|
|
53
|
-
"@getpaseo/protocol": "0.
|
|
50
|
+
"@getpaseo/cli": "0.13.0",
|
|
51
|
+
"@getpaseo/client": "0.13.0",
|
|
52
|
+
"@getpaseo/plugin": "0.13.0",
|
|
53
|
+
"@getpaseo/protocol": "0.13.0",
|
|
54
54
|
"@tanstack/react-query": "^5.102.3",
|
|
55
55
|
"@types/node": "^24.10.1",
|
|
56
56
|
"@types/react": "^19.2.18",
|
package/paseo-plugin.json
CHANGED
package/server/viewer-scope.ts
CHANGED
|
@@ -70,6 +70,29 @@ async function runGh(args: string[], timeout = COMMAND_TIMEOUT_MS): Promise<stri
|
|
|
70
70
|
return stdout.trim();
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
+
/**
|
|
74
|
+
* One refresh issues four searches (the scope searches page up to ten times each). GitHub advises
|
|
75
|
+
* serial requests to avoid secondary rate limits, so searches share a small queue.
|
|
76
|
+
*/
|
|
77
|
+
const SEARCH_CONCURRENCY = 2;
|
|
78
|
+
let activeSearches = 0;
|
|
79
|
+
const searchWaiters: Array<() => void> = [];
|
|
80
|
+
|
|
81
|
+
async function runSearch(args: string[]): Promise<string> {
|
|
82
|
+
while (activeSearches >= SEARCH_CONCURRENCY) {
|
|
83
|
+
const { promise, resolve } = Promise.withResolvers<void>();
|
|
84
|
+
searchWaiters.push(resolve);
|
|
85
|
+
await promise;
|
|
86
|
+
}
|
|
87
|
+
activeSearches += 1;
|
|
88
|
+
try {
|
|
89
|
+
return await runGh(args);
|
|
90
|
+
} finally {
|
|
91
|
+
activeSearches -= 1;
|
|
92
|
+
searchWaiters.shift()?.();
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
73
96
|
function delay(milliseconds: number): Promise<void> {
|
|
74
97
|
const { promise, resolve } = Promise.withResolvers<void>();
|
|
75
98
|
setTimeout(resolve, milliseconds);
|
|
@@ -110,7 +133,7 @@ async function searchPullRequests(
|
|
|
110
133
|
"commentsCount",
|
|
111
134
|
"labels",
|
|
112
135
|
].join(",");
|
|
113
|
-
const output = await
|
|
136
|
+
const output = await runSearch([
|
|
114
137
|
"search",
|
|
115
138
|
"prs",
|
|
116
139
|
`--${filter}=${viewer}`,
|
|
@@ -126,7 +149,7 @@ async function searchPullRequests(
|
|
|
126
149
|
}
|
|
127
150
|
|
|
128
151
|
async function searchScopeUrls(filter: "author" | "review-requested"): Promise<string[]> {
|
|
129
|
-
const output = await
|
|
152
|
+
const output = await runSearch([
|
|
130
153
|
"search",
|
|
131
154
|
"prs",
|
|
132
155
|
`--${filter}=@me`,
|