@koinzhang/paseo-plugin-activity 0.5.0 → 0.7.0
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/CHANGELOG.md +78 -1
- package/README.md +15 -8
- package/client/activity-heatmap.tsx +126 -93
- package/client/agent-creations.tsx +216 -0
- package/client/attention-pill.tsx +16 -5
- package/client/attention-popover.tsx +19 -23
- package/client/color-mix.test.ts +27 -0
- package/client/color-mix.ts +38 -0
- package/client/design-tokens.test.ts +39 -0
- package/client/design-tokens.ts +168 -0
- package/client/fit-text.test.ts +41 -0
- package/client/fit-text.ts +33 -0
- package/client/formatted-time.tsx +4 -4
- package/client/global-surface.tsx +316 -275
- package/client/header-button.ts +136 -0
- package/client/hourly-activity-timeline.tsx +425 -0
- package/client/measured-width.ts +72 -0
- package/client/panel-visibility.test.ts +25 -0
- package/client/panel-visibility.ts +45 -0
- package/client/panel.tsx +83 -108
- package/client/provider-dropdown.tsx +131 -0
- package/client/provider-filter.test.ts +17 -13
- package/client/provider-filter.ts +5 -7
- package/client/range.test.ts +44 -0
- package/client/range.ts +14 -0
- package/client/rank-color.test.ts +108 -14
- package/client/rank-color.ts +261 -48
- package/client/ranking-bars.tsx +291 -0
- package/client/ui.tsx +339 -0
- package/client/usage-popover.tsx +62 -134
- package/client/usage-stats.tsx +137 -8
- package/client/use-agent-turn-end.ts +2 -1
- package/client/use-app-language.ts +17 -0
- package/client/web.ts +73 -18
- package/client/workspace/agent-row.tsx +18 -25
- package/client/workspace/agents-section.tsx +23 -20
- package/client/workspace/constants.ts +6 -6
- package/client/workspace/display-menu.tsx +5 -4
- package/client/workspace/filters.test.ts +1 -1
- package/client/workspace/filters.ts +4 -2
- package/client/workspace/panel.tsx +176 -104
- package/client/workspace/rank-section.tsx +157 -44
- package/client/workspace/terminals-section.tsx +13 -9
- package/index.client.tsx +40 -20
- package/index.server.ts +63 -31
- package/package.json +2 -2
- package/paseo-plugin.json +2 -1
- package/server/agents.ts +20 -2
- package/server/background-sync.test.ts +43 -0
- package/server/background-sync.ts +43 -4
- package/server/handlers-query.test.ts +252 -1
- package/server/handlers.ts +174 -13
- package/server/ingest.test.ts +8 -0
- package/server/messages.test.ts +96 -1
- package/server/prompt-dedupe.ts +52 -0
- package/server/rpc-cache.test.ts +74 -0
- package/server/rpc-cache.ts +48 -0
- package/server/store.test.ts +122 -0
- package/server/store.ts +313 -19
- package/server/ttl-cache.ts +3 -0
- package/shared/activity.test.ts +159 -6
- package/shared/activity.ts +140 -5
- package/shared/classify.test.ts +1 -0
- package/shared/classify.ts +4 -1
- package/shared/explorer-agent-display.test.ts +61 -0
- package/shared/explorer-agent-display.ts +21 -2
- package/shared/format.test.ts +28 -3
- package/shared/format.ts +25 -2
- package/shared/i18n.test.ts +34 -0
- package/shared/i18n.ts +363 -0
- package/shared/insights.test.ts +162 -80
- package/shared/insights.ts +136 -61
- package/shared/usage.test.ts +330 -0
- package/shared/usage.ts +471 -0
|
@@ -8,14 +8,13 @@ import { useToast } from "@getpaseo/plugin/client/react-native";
|
|
|
8
8
|
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
9
9
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
10
10
|
import { useRegisterOpenAgent } from "../open-agent.ts";
|
|
11
|
+
import { usePanelPresenceReport } from "../panel-visibility.ts";
|
|
11
12
|
import { useWorkspaceAgentStatuses } from "../use-workspace-agent-statuses.ts";
|
|
12
13
|
import {
|
|
13
|
-
ActivityIndicator,
|
|
14
14
|
Dimensions,
|
|
15
15
|
Platform,
|
|
16
16
|
Pressable,
|
|
17
17
|
ScrollView,
|
|
18
|
-
Text,
|
|
19
18
|
View,
|
|
20
19
|
} from "react-native";
|
|
21
20
|
import { ACTIVITY_LIST_LIMIT } from "../../shared/insights.ts";
|
|
@@ -30,10 +29,14 @@ import {
|
|
|
30
29
|
usageAgentsRpc,
|
|
31
30
|
usageHostInfoRpc,
|
|
32
31
|
usageMcpByToolRpc,
|
|
32
|
+
usageRecentMcpCallsRpc,
|
|
33
|
+
usageRecentSkillCallsRpc,
|
|
33
34
|
usageSkillsByNameRpc,
|
|
34
35
|
usageSummaryRpc,
|
|
35
36
|
} from "../../shared/usage.ts";
|
|
36
37
|
import { useAppLanguage } from "../use-app-language.ts";
|
|
38
|
+
import { messagesFor } from "../../shared/i18n.ts";
|
|
39
|
+
import { ErrorState, InlineEmpty, LoadingState } from "../ui.tsx";
|
|
37
40
|
import { useWorkspaceActivityRefresh } from "../use-agent-turn-end.ts";
|
|
38
41
|
import { UsageStats } from "../usage-stats.tsx";
|
|
39
42
|
import { AgentsSection } from "./agents-section.tsx";
|
|
@@ -49,8 +52,8 @@ import {
|
|
|
49
52
|
STATUS_FILTER_OPTIONS,
|
|
50
53
|
TERMINAL_REFETCH_MS,
|
|
51
54
|
agentUpdatedAt,
|
|
55
|
+
localizeOptions,
|
|
52
56
|
matchesAgentFilters,
|
|
53
|
-
optionLabel,
|
|
54
57
|
type AgentGroup,
|
|
55
58
|
type AgentLifecycleFilter,
|
|
56
59
|
type AgentShowField,
|
|
@@ -63,11 +66,22 @@ import { MenuOptionList, MenuSubTrigger } from "./display-menu.tsx";
|
|
|
63
66
|
import { matchesAgentTitle } from "./filters.ts";
|
|
64
67
|
import { RankSection } from "./rank-section.tsx";
|
|
65
68
|
import { TerminalsSection, type TerminalListItem } from "./terminals-section.tsx";
|
|
69
|
+
import {
|
|
70
|
+
CONTROL,
|
|
71
|
+
FONT_WEIGHT,
|
|
72
|
+
ICON_SIZE,
|
|
73
|
+
RADIUS,
|
|
74
|
+
ROW_PADDING,
|
|
75
|
+
TEXT,
|
|
76
|
+
iconButton,
|
|
77
|
+
pageLayout,
|
|
78
|
+
pillRadius,
|
|
79
|
+
sectionTitle,
|
|
80
|
+
titleGap,
|
|
81
|
+
} from "../design-tokens.ts";
|
|
66
82
|
|
|
67
83
|
type RankKind = "skills" | "mcp";
|
|
68
84
|
|
|
69
|
-
const MONO = Platform.select({ ios: "Menlo", default: "monospace" });
|
|
70
|
-
|
|
71
85
|
/** Workspace-scoped Activity for the Explorer (024 / 031). */
|
|
72
86
|
export function WorkspaceActivityPanel({
|
|
73
87
|
theme,
|
|
@@ -94,6 +108,7 @@ export function WorkspaceActivityPanel({
|
|
|
94
108
|
() => new Set(displayValues.lifecycle),
|
|
95
109
|
[displayValues.lifecycle],
|
|
96
110
|
);
|
|
111
|
+
const rankView = displayValues.rankView;
|
|
97
112
|
const [menuOpen, setMenuOpen] = useState(false);
|
|
98
113
|
const [menuFlyout, setMenuFlyout] = useState<MenuFlyout | null>(null);
|
|
99
114
|
const [menuAnchor, setMenuAnchor] = useState<{ top: number; right: number } | null>(null);
|
|
@@ -101,12 +116,14 @@ export function WorkspaceActivityPanel({
|
|
|
101
116
|
const [rankKind, setRankKind] = useState<RankKind>("skills");
|
|
102
117
|
const [busyAgentId, setBusyAgentId] = useState<string | null>(null);
|
|
103
118
|
const [busyTerminalId, setBusyTerminalId] = useState<string | null>(null);
|
|
104
|
-
const
|
|
119
|
+
const page = pageLayout("panel", layout.compact);
|
|
105
120
|
const locale = useAppLanguage();
|
|
121
|
+
const m = messagesFor(locale);
|
|
106
122
|
const toast = useToast();
|
|
107
123
|
const queryClient = useQueryClient();
|
|
108
124
|
const openAgent = navigation?.openAgent;
|
|
109
125
|
useRegisterOpenAgent(openAgent);
|
|
126
|
+
usePanelPresenceReport(workspaceId);
|
|
110
127
|
const rootRef = useRef<View>(null);
|
|
111
128
|
const triggerRef = useRef<View>(null);
|
|
112
129
|
|
|
@@ -119,7 +136,9 @@ export function WorkspaceActivityPanel({
|
|
|
119
136
|
const agentsRpc = useRpc(usageAgentsRpc);
|
|
120
137
|
const unarchiveAgentRpc = useRpc(usageAgentUnarchiveRpc);
|
|
121
138
|
const skillsRpc = useRpc(usageSkillsByNameRpc);
|
|
139
|
+
const recentSkillCallsRpc = useRpc(usageRecentSkillCallsRpc);
|
|
122
140
|
const mcpRpc = useRpc(usageMcpByToolRpc);
|
|
141
|
+
const recentMcpCallsRpc = useRpc(usageRecentMcpCallsRpc);
|
|
123
142
|
const hostInfoRpc = useRpc(usageHostInfoRpc);
|
|
124
143
|
|
|
125
144
|
const agentsQueryKey = useMemo(
|
|
@@ -152,6 +171,13 @@ export function WorkspaceActivityPanel({
|
|
|
152
171
|
queryFn: () => skillsRpc({ workspaceId }),
|
|
153
172
|
});
|
|
154
173
|
|
|
174
|
+
const recentSkillCalls = useQuery({
|
|
175
|
+
refetchInterval: 15_000,
|
|
176
|
+
retry: false,
|
|
177
|
+
queryKey: ["activity", "workspace-recent-skills", workspaceId],
|
|
178
|
+
queryFn: () => recentSkillCallsRpc({ workspaceId, limit: ACTIVITY_LIST_LIMIT }),
|
|
179
|
+
});
|
|
180
|
+
|
|
155
181
|
const mcp = useQuery({
|
|
156
182
|
refetchInterval: 15_000,
|
|
157
183
|
retry: false,
|
|
@@ -159,6 +185,13 @@ export function WorkspaceActivityPanel({
|
|
|
159
185
|
queryFn: () => mcpRpc({ workspaceId }),
|
|
160
186
|
});
|
|
161
187
|
|
|
188
|
+
const recentMcpCalls = useQuery({
|
|
189
|
+
refetchInterval: 15_000,
|
|
190
|
+
retry: false,
|
|
191
|
+
queryKey: ["activity", "workspace-recent-mcp", workspaceId],
|
|
192
|
+
queryFn: () => recentMcpCallsRpc({ workspaceId, limit: ACTIVITY_LIST_LIMIT }),
|
|
193
|
+
});
|
|
194
|
+
|
|
162
195
|
const paseo = usePaseo();
|
|
163
196
|
const terminals = useQuery({
|
|
164
197
|
refetchInterval: TERMINAL_REFETCH_MS,
|
|
@@ -184,15 +217,30 @@ export function WorkspaceActivityPanel({
|
|
|
184
217
|
void queryClient.invalidateQueries({
|
|
185
218
|
queryKey: ["activity", "workspace-skills", workspaceId],
|
|
186
219
|
});
|
|
220
|
+
void queryClient.invalidateQueries({
|
|
221
|
+
queryKey: ["activity", "workspace-recent-skills", workspaceId],
|
|
222
|
+
});
|
|
187
223
|
void queryClient.invalidateQueries({
|
|
188
224
|
queryKey: ["activity", "workspace-mcp", workspaceId],
|
|
189
225
|
});
|
|
226
|
+
void queryClient.invalidateQueries({
|
|
227
|
+
queryKey: ["activity", "workspace-recent-mcp", workspaceId],
|
|
228
|
+
});
|
|
190
229
|
});
|
|
191
230
|
|
|
192
231
|
const agentItems = useMemo(
|
|
193
232
|
() => reconcileHostArchive(agents.data?.items ?? [], statuses.data),
|
|
194
233
|
[agents.data, statuses.data],
|
|
195
234
|
);
|
|
235
|
+
const archivedAgentIds = useMemo(
|
|
236
|
+
() =>
|
|
237
|
+
new Set(
|
|
238
|
+
agentItems
|
|
239
|
+
.filter((item) => item.archivedAt != null)
|
|
240
|
+
.map((item) => item.agentId),
|
|
241
|
+
),
|
|
242
|
+
[agentItems],
|
|
243
|
+
);
|
|
196
244
|
const visibleAgentItems = useMemo(() => {
|
|
197
245
|
const byId = statuses.data;
|
|
198
246
|
const filtered = agentItems
|
|
@@ -243,21 +291,36 @@ export function WorkspaceActivityPanel({
|
|
|
243
291
|
[mcp.data],
|
|
244
292
|
);
|
|
245
293
|
const skillItems = useMemo(() => allSkills.slice(0, ACTIVITY_LIST_LIMIT), [allSkills]);
|
|
294
|
+
const recentSkillItems = recentSkillCalls.data?.items ?? [];
|
|
246
295
|
const mcpItems = useMemo(() => allMcp.slice(0, ACTIVITY_LIST_LIMIT), [allMcp]);
|
|
296
|
+
const recentMcpItems = recentMcpCalls.data?.items ?? [];
|
|
247
297
|
|
|
248
298
|
const loading =
|
|
249
|
-
summary.isLoading ||
|
|
250
|
-
|
|
299
|
+
summary.isLoading ||
|
|
300
|
+
agents.isLoading ||
|
|
301
|
+
skills.isLoading ||
|
|
302
|
+
recentSkillCalls.isLoading ||
|
|
303
|
+
mcp.isLoading ||
|
|
304
|
+
recentMcpCalls.isLoading;
|
|
305
|
+
const error =
|
|
306
|
+
summary.error ??
|
|
307
|
+
agents.error ??
|
|
308
|
+
skills.error ??
|
|
309
|
+
recentSkillCalls.error ??
|
|
310
|
+
mcp.error ??
|
|
311
|
+
recentMcpCalls.error;
|
|
251
312
|
|
|
252
313
|
const kpi = [
|
|
253
|
-
{ label:
|
|
254
|
-
{ label:
|
|
255
|
-
{ label:
|
|
256
|
-
{
|
|
257
|
-
label: "Messages",
|
|
258
|
-
value: (summary.data?.messageCount ?? 0).toLocaleString(),
|
|
259
|
-
},
|
|
314
|
+
{ label: m.kpi.shellCalls, value: (summary.data?.shellCalls ?? 0).toLocaleString(locale) },
|
|
315
|
+
{ label: m.kpi.fileReads, value: (summary.data?.fileReads ?? 0).toLocaleString(locale) },
|
|
316
|
+
{ label: m.kpi.fileWrites, value: (summary.data?.fileWrites ?? 0).toLocaleString(locale) },
|
|
317
|
+
{ label: m.kpi.prompts, value: (summary.data?.messageCount ?? 0).toLocaleString(locale) },
|
|
260
318
|
];
|
|
319
|
+
const retry = () => {
|
|
320
|
+
for (const query of [summary, agents, skills, recentSkillCalls, mcp, recentMcpCalls]) {
|
|
321
|
+
if (query.error) void query.refetch();
|
|
322
|
+
}
|
|
323
|
+
};
|
|
261
324
|
|
|
262
325
|
const terminalItems = terminals.data?.entries ?? [];
|
|
263
326
|
const showAgents = agentItems.length > 0;
|
|
@@ -284,7 +347,7 @@ export function WorkspaceActivityPanel({
|
|
|
284
347
|
minHeight: 0,
|
|
285
348
|
minWidth: 0,
|
|
286
349
|
overflow: "hidden" as const,
|
|
287
|
-
backgroundColor:
|
|
350
|
+
backgroundColor: "transparent",
|
|
288
351
|
},
|
|
289
352
|
scroll: {
|
|
290
353
|
flex: 1,
|
|
@@ -295,9 +358,9 @@ export function WorkspaceActivityPanel({
|
|
|
295
358
|
: null),
|
|
296
359
|
},
|
|
297
360
|
content: {
|
|
298
|
-
padding,
|
|
299
|
-
paddingBottom: padding + 24,
|
|
300
|
-
gap:
|
|
361
|
+
padding: page.padding,
|
|
362
|
+
paddingBottom: page.padding + 24,
|
|
363
|
+
gap: page.gap,
|
|
301
364
|
maxWidth: 1000,
|
|
302
365
|
width: "100%" as const,
|
|
303
366
|
alignSelf: "center" as const,
|
|
@@ -320,14 +383,7 @@ export function WorkspaceActivityPanel({
|
|
|
320
383
|
justifyContent: "flex-end" as const,
|
|
321
384
|
overflow: "hidden" as const,
|
|
322
385
|
},
|
|
323
|
-
titleAction:
|
|
324
|
-
width: 24,
|
|
325
|
-
height: 24,
|
|
326
|
-
alignItems: "center" as const,
|
|
327
|
-
justifyContent: "center" as const,
|
|
328
|
-
borderRadius: 6,
|
|
329
|
-
flexShrink: 0,
|
|
330
|
-
},
|
|
386
|
+
titleAction: iconButton,
|
|
331
387
|
headerActions: {
|
|
332
388
|
flexDirection: "row" as const,
|
|
333
389
|
alignItems: "center" as const,
|
|
@@ -341,7 +397,7 @@ export function WorkspaceActivityPanel({
|
|
|
341
397
|
gap: 6,
|
|
342
398
|
height: AGENT_HEADER_HEIGHT,
|
|
343
399
|
paddingHorizontal: 10,
|
|
344
|
-
borderRadius: AGENT_HEADER_HEIGHT
|
|
400
|
+
borderRadius: pillRadius(AGENT_HEADER_HEIGHT),
|
|
345
401
|
borderWidth: 1,
|
|
346
402
|
borderColor: theme.colors.border,
|
|
347
403
|
backgroundColor: theme.colors.surface1,
|
|
@@ -352,17 +408,15 @@ export function WorkspaceActivityPanel({
|
|
|
352
408
|
minWidth: 0,
|
|
353
409
|
padding: 0,
|
|
354
410
|
margin: 0,
|
|
411
|
+
...TEXT.small,
|
|
355
412
|
color: theme.colors.foreground,
|
|
356
|
-
fontSize: 13,
|
|
357
413
|
lineHeight: 18,
|
|
358
414
|
...(Platform.OS === "web" ? ({ outlineStyle: "none" } as object) : null),
|
|
359
415
|
},
|
|
360
416
|
sectionTitle: {
|
|
417
|
+
...sectionTitle(layout.compact),
|
|
361
418
|
color: theme.colors.foreground,
|
|
362
|
-
fontSize: 16,
|
|
363
|
-
fontWeight: "600" as const,
|
|
364
419
|
flexShrink: 0,
|
|
365
|
-
letterSpacing: -0.3,
|
|
366
420
|
lineHeight: AGENT_HEADER_HEIGHT,
|
|
367
421
|
},
|
|
368
422
|
panel: {
|
|
@@ -373,17 +427,43 @@ export function WorkspaceActivityPanel({
|
|
|
373
427
|
flexDirection: "row" as const,
|
|
374
428
|
alignItems: "center" as const,
|
|
375
429
|
gap: 12,
|
|
376
|
-
paddingVertical:
|
|
430
|
+
paddingVertical: ROW_PADDING.dense,
|
|
431
|
+
},
|
|
432
|
+
timelineMarker: {
|
|
433
|
+
width: 18,
|
|
434
|
+
alignSelf: "stretch" as const,
|
|
435
|
+
alignItems: "center" as const,
|
|
436
|
+
justifyContent: "center" as const,
|
|
437
|
+
},
|
|
438
|
+
timelineLineTop: {
|
|
439
|
+
position: "absolute" as const,
|
|
440
|
+
top: -7,
|
|
441
|
+
bottom: "50%" as const,
|
|
442
|
+
width: 1,
|
|
443
|
+
backgroundColor: theme.colors.border,
|
|
444
|
+
},
|
|
445
|
+
timelineLineBottom: {
|
|
446
|
+
position: "absolute" as const,
|
|
447
|
+
top: "50%" as const,
|
|
448
|
+
bottom: -7,
|
|
449
|
+
width: 1,
|
|
450
|
+
backgroundColor: theme.colors.border,
|
|
451
|
+
},
|
|
452
|
+
timelineDot: {
|
|
453
|
+
zIndex: 1,
|
|
454
|
+
width: 7,
|
|
455
|
+
height: 7,
|
|
456
|
+
borderRadius: pillRadius(7),
|
|
377
457
|
},
|
|
378
458
|
agentListRow: {
|
|
379
459
|
flexDirection: "row" as const,
|
|
380
460
|
alignItems: "center" as const,
|
|
381
461
|
gap: 10,
|
|
382
|
-
paddingVertical:
|
|
462
|
+
paddingVertical: ROW_PADDING.dense,
|
|
383
463
|
},
|
|
384
464
|
agentIconWrap: {
|
|
385
|
-
width:
|
|
386
|
-
height:
|
|
465
|
+
width: ICON_SIZE.leading,
|
|
466
|
+
height: ICON_SIZE.leading,
|
|
387
467
|
alignItems: "center" as const,
|
|
388
468
|
justifyContent: "center" as const,
|
|
389
469
|
},
|
|
@@ -393,7 +473,7 @@ export function WorkspaceActivityPanel({
|
|
|
393
473
|
bottom: -4,
|
|
394
474
|
width: 13,
|
|
395
475
|
height: 13,
|
|
396
|
-
borderRadius:
|
|
476
|
+
borderRadius: pillRadius(13),
|
|
397
477
|
alignItems: "center" as const,
|
|
398
478
|
justifyContent: "center" as const,
|
|
399
479
|
backgroundColor: theme.colors.surface0,
|
|
@@ -405,7 +485,7 @@ export function WorkspaceActivityPanel({
|
|
|
405
485
|
minWidth: 14,
|
|
406
486
|
height: 14,
|
|
407
487
|
paddingHorizontal: 3,
|
|
408
|
-
borderRadius:
|
|
488
|
+
borderRadius: pillRadius(14),
|
|
409
489
|
alignItems: "center" as const,
|
|
410
490
|
justifyContent: "center" as const,
|
|
411
491
|
backgroundColor: theme.colors.surface0,
|
|
@@ -413,11 +493,8 @@ export function WorkspaceActivityPanel({
|
|
|
413
493
|
borderColor: theme.colors.border,
|
|
414
494
|
},
|
|
415
495
|
subAgentBadgeText: {
|
|
496
|
+
...TEXT.iconBadge,
|
|
416
497
|
color: theme.colors.foregroundMuted,
|
|
417
|
-
fontSize: 9,
|
|
418
|
-
fontWeight: "700" as const,
|
|
419
|
-
fontVariant: ["tabular-nums" as const],
|
|
420
|
-
lineHeight: 11,
|
|
421
498
|
},
|
|
422
499
|
listMain: {
|
|
423
500
|
flex: 1,
|
|
@@ -425,76 +502,69 @@ export function WorkspaceActivityPanel({
|
|
|
425
502
|
gap: 3,
|
|
426
503
|
},
|
|
427
504
|
listTitle: {
|
|
505
|
+
...TEXT.rowTitle,
|
|
428
506
|
color: theme.colors.foreground,
|
|
429
|
-
fontSize: 14,
|
|
430
|
-
fontWeight: "500" as const,
|
|
431
507
|
},
|
|
432
508
|
listLink: {
|
|
509
|
+
...TEXT.rowTitle,
|
|
433
510
|
color: theme.colors.foreground,
|
|
434
|
-
fontSize: 14,
|
|
435
|
-
fontWeight: "500" as const,
|
|
436
511
|
},
|
|
437
512
|
listMeta: {
|
|
513
|
+
...TEXT.meta,
|
|
438
514
|
color: theme.colors.foregroundMuted,
|
|
439
|
-
fontSize: 12,
|
|
440
515
|
},
|
|
441
516
|
permissionBadge: {
|
|
442
517
|
flexDirection: "row" as const,
|
|
443
518
|
alignItems: "center" as const,
|
|
444
519
|
gap: 3,
|
|
445
|
-
height:
|
|
520
|
+
height: CONTROL.pillBadgeHeight,
|
|
446
521
|
paddingHorizontal: 5,
|
|
447
|
-
borderRadius:
|
|
522
|
+
borderRadius: pillRadius(CONTROL.pillBadgeHeight),
|
|
448
523
|
borderWidth: 1,
|
|
449
524
|
borderColor: theme.colors.border,
|
|
450
525
|
backgroundColor: theme.colors.surface1,
|
|
451
526
|
flexShrink: 0,
|
|
452
527
|
},
|
|
453
528
|
permissionBadgeText: {
|
|
529
|
+
...TEXT.pillBadge,
|
|
454
530
|
color: theme.colors.statusWarning,
|
|
455
|
-
fontSize: 11,
|
|
456
|
-
fontWeight: "600" as const,
|
|
457
|
-
fontVariant: ["tabular-nums" as const],
|
|
458
531
|
},
|
|
459
532
|
terminalRow: {
|
|
460
533
|
flexDirection: "row" as const,
|
|
461
534
|
alignItems: "center" as const,
|
|
462
535
|
gap: 10,
|
|
463
|
-
paddingVertical:
|
|
536
|
+
paddingVertical: ROW_PADDING.dense,
|
|
464
537
|
},
|
|
465
538
|
terminalPreview: {
|
|
466
539
|
marginLeft: 28,
|
|
467
540
|
marginBottom: 4,
|
|
468
541
|
paddingVertical: 8,
|
|
469
542
|
paddingHorizontal: 10,
|
|
470
|
-
borderRadius:
|
|
543
|
+
borderRadius: RADIUS.control,
|
|
471
544
|
backgroundColor: theme.colors.surface1,
|
|
472
545
|
gap: 2,
|
|
473
546
|
},
|
|
474
547
|
terminalLine: {
|
|
548
|
+
...TEXT.terminal,
|
|
475
549
|
color: theme.colors.foregroundMuted,
|
|
476
|
-
fontFamily: MONO,
|
|
477
|
-
fontSize: 11,
|
|
478
|
-
lineHeight: 15,
|
|
479
550
|
},
|
|
480
551
|
countText: {
|
|
552
|
+
...TEXT.count,
|
|
481
553
|
color: theme.colors.foregroundMuted,
|
|
482
|
-
fontSize: 13,
|
|
483
|
-
fontVariant: ["tabular-nums" as const],
|
|
484
554
|
minWidth: 24,
|
|
485
555
|
textAlign: "right" as const,
|
|
486
556
|
},
|
|
487
557
|
empty: {
|
|
558
|
+
...TEXT.small,
|
|
488
559
|
color: theme.colors.foregroundMuted,
|
|
489
|
-
fontSize: 13,
|
|
490
560
|
},
|
|
491
561
|
agentGroup: {
|
|
492
562
|
gap: 4,
|
|
493
563
|
},
|
|
494
564
|
groupLabel: {
|
|
565
|
+
...TEXT.meta,
|
|
495
566
|
color: theme.colors.foregroundMuted,
|
|
496
|
-
|
|
497
|
-
fontWeight: "600" as const,
|
|
567
|
+
fontWeight: FONT_WEIGHT.semibold,
|
|
498
568
|
paddingTop: 12,
|
|
499
569
|
paddingBottom: 2,
|
|
500
570
|
},
|
|
@@ -506,20 +576,13 @@ export function WorkspaceActivityPanel({
|
|
|
506
576
|
paddingTop: 8,
|
|
507
577
|
paddingBottom: 4,
|
|
508
578
|
},
|
|
509
|
-
pagerButton:
|
|
510
|
-
width: 28,
|
|
511
|
-
height: 28,
|
|
512
|
-
alignItems: "center" as const,
|
|
513
|
-
justifyContent: "center" as const,
|
|
514
|
-
borderRadius: 6,
|
|
515
|
-
},
|
|
579
|
+
pagerButton: iconButton,
|
|
516
580
|
pagerButtonDisabled: {
|
|
517
581
|
opacity: 0.35,
|
|
518
582
|
},
|
|
519
583
|
pagerLabel: {
|
|
584
|
+
...TEXT.tabularMeta,
|
|
520
585
|
color: theme.colors.foregroundMuted,
|
|
521
|
-
fontSize: 12,
|
|
522
|
-
fontVariant: ["tabular-nums" as const],
|
|
523
586
|
},
|
|
524
587
|
menuPage: {
|
|
525
588
|
paddingVertical: 4,
|
|
@@ -534,7 +597,7 @@ export function WorkspaceActivityPanel({
|
|
|
534
597
|
paddingVertical: 4,
|
|
535
598
|
borderWidth: 1,
|
|
536
599
|
borderColor: "transparent",
|
|
537
|
-
borderRadius:
|
|
600
|
+
borderRadius: RADIUS.control,
|
|
538
601
|
},
|
|
539
602
|
menuRowHighlighted: {
|
|
540
603
|
backgroundColor: theme.colors.surface2,
|
|
@@ -542,15 +605,12 @@ export function WorkspaceActivityPanel({
|
|
|
542
605
|
menuLabel: {
|
|
543
606
|
flexShrink: 1,
|
|
544
607
|
minWidth: 0,
|
|
608
|
+
...TEXT.menu,
|
|
545
609
|
color: theme.colors.foreground,
|
|
546
|
-
fontSize: 14,
|
|
547
|
-
lineHeight: 18,
|
|
548
|
-
fontWeight: "normal" as const,
|
|
549
610
|
},
|
|
550
611
|
menuValue: {
|
|
612
|
+
...TEXT.menu,
|
|
551
613
|
color: theme.colors.foregroundMuted,
|
|
552
|
-
fontSize: 14,
|
|
553
|
-
lineHeight: 18,
|
|
554
614
|
flexShrink: 1,
|
|
555
615
|
},
|
|
556
616
|
menuTrailing: {
|
|
@@ -570,23 +630,24 @@ export function WorkspaceActivityPanel({
|
|
|
570
630
|
paddingVertical: 4,
|
|
571
631
|
borderWidth: 1,
|
|
572
632
|
borderColor: "transparent",
|
|
573
|
-
borderRadius:
|
|
633
|
+
borderRadius: RADIUS.control,
|
|
574
634
|
},
|
|
575
635
|
menuOptionLabel: {
|
|
576
636
|
flexShrink: 1,
|
|
577
637
|
minWidth: 0,
|
|
638
|
+
...TEXT.menu,
|
|
578
639
|
color: theme.colors.foreground,
|
|
579
|
-
fontSize: 14,
|
|
580
|
-
lineHeight: 18,
|
|
581
|
-
fontWeight: "normal" as const,
|
|
582
640
|
},
|
|
583
641
|
menuLeadingSlot: {
|
|
584
642
|
width: 16,
|
|
585
643
|
alignItems: "center" as const,
|
|
586
644
|
justifyContent: "center" as const,
|
|
587
645
|
},
|
|
646
|
+
section: {
|
|
647
|
+
gap: titleGap(layout.compact),
|
|
648
|
+
},
|
|
588
649
|
agentsSection: {
|
|
589
|
-
gap:
|
|
650
|
+
gap: titleGap(layout.compact),
|
|
590
651
|
position: "relative" as const,
|
|
591
652
|
},
|
|
592
653
|
agentsHeaderWrap: {
|
|
@@ -602,7 +663,7 @@ export function WorkspaceActivityPanel({
|
|
|
602
663
|
},
|
|
603
664
|
menuSurface: {
|
|
604
665
|
width: MENU_WIDTH,
|
|
605
|
-
borderRadius:
|
|
666
|
+
borderRadius: RADIUS.overlay,
|
|
606
667
|
borderWidth: 1,
|
|
607
668
|
borderColor: theme.colors.border,
|
|
608
669
|
backgroundColor: theme.colors.surface1,
|
|
@@ -628,7 +689,7 @@ export function WorkspaceActivityPanel({
|
|
|
628
689
|
backgroundColor: theme.colors.border,
|
|
629
690
|
},
|
|
630
691
|
}),
|
|
631
|
-
[theme, layout.compact, padding],
|
|
692
|
+
[theme, layout.compact, page.padding, page.gap],
|
|
632
693
|
);
|
|
633
694
|
|
|
634
695
|
const rowHeight = layout.compact ? 40 : 28;
|
|
@@ -639,15 +700,15 @@ export function WorkspaceActivityPanel({
|
|
|
639
700
|
: 0;
|
|
640
701
|
const flyoutOptions: ReadonlyArray<MenuOption> =
|
|
641
702
|
menuFlyout === "sort"
|
|
642
|
-
? SORT_OPTIONS
|
|
703
|
+
? localizeOptions(SORT_OPTIONS, m.workspace.options.sort)
|
|
643
704
|
: menuFlyout === "group"
|
|
644
|
-
? GROUP_OPTIONS
|
|
705
|
+
? localizeOptions(GROUP_OPTIONS, m.workspace.options.group)
|
|
645
706
|
: menuFlyout === "show"
|
|
646
|
-
? SHOW_FIELD_OPTIONS
|
|
707
|
+
? localizeOptions(SHOW_FIELD_OPTIONS, m.workspace.options.show)
|
|
647
708
|
: menuFlyout === "status"
|
|
648
|
-
? STATUS_FILTER_OPTIONS
|
|
709
|
+
? localizeOptions(STATUS_FILTER_OPTIONS, m.workspace.options.status)
|
|
649
710
|
: menuFlyout === "lifecycle"
|
|
650
|
-
? LIFECYCLE_FILTER_OPTIONS
|
|
711
|
+
? localizeOptions(LIFECYCLE_FILTER_OPTIONS, m.workspace.options.lifecycle)
|
|
651
712
|
: [];
|
|
652
713
|
const flyoutSelectedId: string | undefined =
|
|
653
714
|
menuFlyout === "sort"
|
|
@@ -827,15 +888,11 @@ export function WorkspaceActivityPanel({
|
|
|
827
888
|
showsVerticalScrollIndicator={false}
|
|
828
889
|
showsHorizontalScrollIndicator={false}
|
|
829
890
|
>
|
|
830
|
-
{loading ? <
|
|
831
|
-
{error ?
|
|
832
|
-
<Text style={{ color: theme.colors.statusDanger }}>
|
|
833
|
-
{error instanceof Error ? error.message : String(error)}
|
|
834
|
-
</Text>
|
|
835
|
-
) : null}
|
|
891
|
+
{loading ? <LoadingState color={theme.colors.accent} /> : null}
|
|
892
|
+
{error ? <ErrorState error={error} onRetry={retry} colors={theme.colors} /> : null}
|
|
836
893
|
|
|
837
894
|
{!loading && !error && !showContent ? (
|
|
838
|
-
<
|
|
895
|
+
<InlineEmpty text={m.workspace.empty} color={theme.colors.foregroundMuted} />
|
|
839
896
|
) : null}
|
|
840
897
|
|
|
841
898
|
{!loading && !error && showContent ? (
|
|
@@ -892,10 +949,25 @@ export function WorkspaceActivityPanel({
|
|
|
892
949
|
onToggleKind={() =>
|
|
893
950
|
setRankKind((prev) => (prev === "skills" ? "mcp" : "skills"))
|
|
894
951
|
}
|
|
952
|
+
rankView={rankView}
|
|
953
|
+
onToggleRankView={() =>
|
|
954
|
+
persistDisplay({
|
|
955
|
+
...displayValues,
|
|
956
|
+
rankView: rankView === "ranked" ? "timeline" : "ranked",
|
|
957
|
+
})
|
|
958
|
+
}
|
|
895
959
|
showToggle={showRankToggle}
|
|
896
960
|
skillItems={skillItems}
|
|
961
|
+
recentSkillCalls={recentSkillItems}
|
|
897
962
|
mcpItems={mcpItems}
|
|
963
|
+
recentMcpCalls={recentMcpItems}
|
|
964
|
+
archivedAgentIds={archivedAgentIds}
|
|
965
|
+
openAgent={openAgent}
|
|
966
|
+
activeAgentColor={theme.colors.accent}
|
|
967
|
+
archivedAgentColor={theme.colors.foregroundMuted}
|
|
898
968
|
mutedColor={theme.colors.foregroundMuted}
|
|
969
|
+
activeTitleColor={theme.colors.foreground}
|
|
970
|
+
compact={layout.compact}
|
|
899
971
|
styles={styles}
|
|
900
972
|
/>
|
|
901
973
|
) : null}
|
|
@@ -905,7 +977,7 @@ export function WorkspaceActivityPanel({
|
|
|
905
977
|
{menuOpen ? (
|
|
906
978
|
<Pressable
|
|
907
979
|
accessibilityRole="button"
|
|
908
|
-
accessibilityLabel=
|
|
980
|
+
accessibilityLabel={m.workspace.closeDisplayOptions}
|
|
909
981
|
onPress={closeMenu}
|
|
910
982
|
style={styles.menuBackdrop}
|
|
911
983
|
/>
|
|
@@ -919,23 +991,23 @@ export function WorkspaceActivityPanel({
|
|
|
919
991
|
<View style={styles.menuSurface}>
|
|
920
992
|
<View style={styles.menuPage}>
|
|
921
993
|
<MenuSubTrigger
|
|
922
|
-
label=
|
|
923
|
-
value={
|
|
994
|
+
label={m.workspace.menu.sort}
|
|
995
|
+
value={m.workspace.options.sort[agentSort]}
|
|
924
996
|
active={menuFlyout === "sort"}
|
|
925
997
|
onOpen={() => setMenuFlyout("sort")}
|
|
926
998
|
styles={styles}
|
|
927
999
|
chevronColor={theme.colors.foregroundMuted}
|
|
928
1000
|
/>
|
|
929
1001
|
<MenuSubTrigger
|
|
930
|
-
label=
|
|
931
|
-
value={
|
|
1002
|
+
label={m.workspace.menu.group}
|
|
1003
|
+
value={m.workspace.options.group[agentGroup]}
|
|
932
1004
|
active={menuFlyout === "group"}
|
|
933
1005
|
onOpen={() => setMenuFlyout("group")}
|
|
934
1006
|
styles={styles}
|
|
935
1007
|
chevronColor={theme.colors.foregroundMuted}
|
|
936
1008
|
/>
|
|
937
1009
|
<MenuSubTrigger
|
|
938
|
-
label=
|
|
1010
|
+
label={m.workspace.menu.show}
|
|
939
1011
|
active={menuFlyout === "show"}
|
|
940
1012
|
onOpen={() => setMenuFlyout("show")}
|
|
941
1013
|
styles={styles}
|
|
@@ -943,14 +1015,14 @@ export function WorkspaceActivityPanel({
|
|
|
943
1015
|
/>
|
|
944
1016
|
<View style={styles.menuSeparator} />
|
|
945
1017
|
<MenuSubTrigger
|
|
946
|
-
label=
|
|
1018
|
+
label={m.workspace.menu.status}
|
|
947
1019
|
active={menuFlyout === "status"}
|
|
948
1020
|
onOpen={() => setMenuFlyout("status")}
|
|
949
1021
|
styles={styles}
|
|
950
1022
|
chevronColor={theme.colors.foregroundMuted}
|
|
951
1023
|
/>
|
|
952
1024
|
<MenuSubTrigger
|
|
953
|
-
label=
|
|
1025
|
+
label={m.workspace.menu.lifecycle}
|
|
954
1026
|
active={menuFlyout === "lifecycle"}
|
|
955
1027
|
onOpen={() => setMenuFlyout("lifecycle")}
|
|
956
1028
|
styles={styles}
|