@xpufx/paseo-top 0.4.4 → 0.4.5
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/OVERVIEW.md +17 -0
- package/client/host-ui.tsx +184 -0
- package/client/multi-host-view.tsx +57 -43
- package/client/multi-host.ts +36 -13
- package/client/pill-labels.ts +94 -1
- package/client/pill.tsx +690 -614
- package/client/resources-query.ts +1 -1
- package/client/settings-events.ts +1 -1
- package/client/settings-ui.tsx +86 -9
- package/client/surface.tsx +308 -276
- package/client/telemetry-copy.ts +8 -2
- package/client/telemetry.tsx +372 -321
- package/client/turn-panel.tsx +126 -104
- package/client/vendor/paseo-plugin-helper/{host.ts → core/host.ts} +9 -3
- package/client/vendor/paseo-plugin-helper/core/index.ts +76 -0
- package/client/vendor/paseo-plugin-helper/core/plugin-load-count.ts +89 -0
- package/client/vendor/paseo-plugin-helper/{query-refresh.ts → core/query-refresh.ts} +2 -2
- package/client/vendor/paseo-plugin-helper/{query.ts → core/query.ts} +2 -2
- package/client/vendor/paseo-plugin-helper/{settings.ts → core/settings.ts} +1 -1
- package/client/vendor/paseo-plugin-helper/{shared-settings.ts → core/shared-settings.ts} +2 -2
- package/client/vendor/paseo-plugin-helper/{utils → lifecycle}/clipboard.ts +2 -2
- package/client/vendor/paseo-plugin-helper/lifecycle/flair.ts +26 -0
- package/client/vendor/paseo-plugin-helper/{theme/color-utils.ts → lifecycle/host-color.ts} +95 -38
- package/client/vendor/paseo-plugin-helper/lifecycle/host-theme.tsx +109 -0
- package/client/vendor/paseo-plugin-helper/lifecycle/index.ts +23 -0
- package/client/vendor/paseo-plugin-helper/lifecycle/multi-host.ts +66 -0
- package/client/vendor/paseo-plugin-helper/{panel.tsx → lifecycle/panel.tsx} +7 -7
- package/client/vendor/paseo-plugin-helper/{pill.tsx → lifecycle/pill.tsx} +51 -18
- package/client/vendor/paseo-plugin-helper/lifecycle/providers.tsx +46 -0
- package/client/vendor/paseo-plugin-helper/lifecycle/scroll-owner.ts +26 -0
- package/client/vendor/paseo-plugin-helper/{surface.tsx → lifecycle/surface.tsx} +6 -6
- package/client/vendor/paseo-plugin-helper/ui/color.ts +1 -0
- package/client/vendor/paseo-plugin-helper/ui/content.tsx +1326 -0
- package/client/vendor/paseo-plugin-helper/ui/controls.tsx +1018 -0
- package/client/vendor/paseo-plugin-helper/{components/DataTable.tsx → ui/data.tsx} +50 -58
- package/client/vendor/paseo-plugin-helper/ui/index.ts +44 -0
- package/client/vendor/paseo-plugin-helper/ui/layout.tsx +263 -0
- package/client/vendor/paseo-plugin-helper/ui/modal.tsx +111 -0
- package/client/vendor/paseo-plugin-helper/ui/plugin-reload-banner.tsx +119 -0
- package/client/vendor/paseo-plugin-helper/{settings-screen.tsx → ui/settings-screen.tsx} +3 -3
- package/client/vendor/paseo-plugin-helper/ui/settings.ts +36 -0
- package/client/vendor/paseo-plugin-helper/ui/text.tsx +821 -0
- package/client/vendor/paseo-plugin-helper/ui/theme.tsx +1 -0
- package/client/vendor/permission-audit/client.tsx +706 -0
- package/client/vendor/permission-audit/index.tsx +1 -0
- package/index.client.tsx +58 -37
- package/index.server.ts +256 -234
- package/package.json +7 -4
- package/paseo-plugin.json +2 -0
- package/screenshots/1-paseo-top-modal-system.jpg +0 -0
- package/screenshots/2-paseo-top-modal-workspace.jpg +0 -0
- package/screenshots/3-paseo-top-modal-settings.jpg +0 -0
- package/screenshots/4-paseo-top-modal-about.jpg +0 -0
- package/screenshots/paseo-top-dashboard.jpg +0 -0
- package/screenshots/paseo-top-general-view.jpg +0 -0
- package/server/resources.ts +98 -0
- package/server/vendor/paseo-plugin-helper/custom-pills.ts +70 -0
- package/server/vendor/paseo-plugin-helper/index.ts +2 -0
- package/server/vendor/paseo-plugin-helper/logger.ts +5 -16
- package/server/vendor/paseo-plugin-helper/rpc-guard.ts +2 -2
- package/server/vendor/paseo-plugin-helper/storage-guard.ts +294 -0
- package/server/vendor/paseo-plugin-helper/storage.ts +36 -2
- package/server/vendor/paseo-plugin-helper/telemetry.ts +486 -0
- package/server/vendor/paseo-plugin-helper/tickets.ts +18 -67
- package/server/vendor/permission-audit/index.ts +1 -0
- package/server/vendor/permission-audit/server.ts +839 -0
- package/shared/helper-version.ts +1 -1
- package/shared/multi-host.ts +153 -159
- package/shared/resources.ts +145 -0
- package/shared/vendor/paseo-plugin-helper/async.ts +14 -7
- package/shared/vendor/paseo-plugin-helper/features.ts +244 -0
- package/shared/vendor/paseo-plugin-helper/forge.ts +27 -0
- package/shared/vendor/paseo-plugin-helper/index.ts +1 -0
- package/shared/vendor/paseo-plugin-helper/tickets.ts +122 -28
- package/shared/vendor/permission-audit/filter.ts +61 -0
- package/shared/vendor/permission-audit/index.ts +2 -0
- package/shared/vendor/permission-audit/shared.ts +119 -0
- package/shared/version.ts +1 -1
- package/client/vendor/paseo-plugin-helper/components/AboutSection.tsx +0 -493
- package/client/vendor/paseo-plugin-helper/components/AttentionBeacon.tsx +0 -250
- package/client/vendor/paseo-plugin-helper/components/Badge.tsx +0 -168
- package/client/vendor/paseo-plugin-helper/components/Button.tsx +0 -204
- package/client/vendor/paseo-plugin-helper/components/Card.tsx +0 -257
- package/client/vendor/paseo-plugin-helper/components/CodeBlock.tsx +0 -196
- package/client/vendor/paseo-plugin-helper/components/Collapsible.tsx +0 -277
- package/client/vendor/paseo-plugin-helper/components/CommandBox.tsx +0 -172
- package/client/vendor/paseo-plugin-helper/components/CopyButton.tsx +0 -180
- package/client/vendor/paseo-plugin-helper/components/EmptyState.tsx +0 -97
- package/client/vendor/paseo-plugin-helper/components/HighlightedText.tsx +0 -70
- package/client/vendor/paseo-plugin-helper/components/InlineButton.tsx +0 -88
- package/client/vendor/paseo-plugin-helper/components/InteractiveRow.tsx +0 -142
- package/client/vendor/paseo-plugin-helper/components/KeyValue.tsx +0 -446
- package/client/vendor/paseo-plugin-helper/components/MetricGauge.tsx +0 -247
- package/client/vendor/paseo-plugin-helper/components/ProgressBar.tsx +0 -117
- package/client/vendor/paseo-plugin-helper/components/Responsive.tsx +0 -53
- package/client/vendor/paseo-plugin-helper/components/SearchInput.tsx +0 -132
- package/client/vendor/paseo-plugin-helper/components/SectionHeader.tsx +0 -87
- package/client/vendor/paseo-plugin-helper/components/Select.tsx +0 -283
- package/client/vendor/paseo-plugin-helper/components/StatusDot.tsx +0 -80
- package/client/vendor/paseo-plugin-helper/components/Tabs.tsx +0 -319
- package/client/vendor/paseo-plugin-helper/components/TextInput.tsx +0 -150
- package/client/vendor/paseo-plugin-helper/components/Toggle.tsx +0 -163
- package/client/vendor/paseo-plugin-helper/components/TruncatedText.tsx +0 -157
- package/client/vendor/paseo-plugin-helper/components/index.ts +0 -26
- package/client/vendor/paseo-plugin-helper/custom-pills.tsx +0 -225
- package/client/vendor/paseo-plugin-helper/forge-icon.tsx +0 -79
- package/client/vendor/paseo-plugin-helper/icon.tsx +0 -39
- package/client/vendor/paseo-plugin-helper/index.ts +0 -30
- package/client/vendor/paseo-plugin-helper/layout/ActionBar.tsx +0 -49
- package/client/vendor/paseo-plugin-helper/layout/FormRow.tsx +0 -103
- package/client/vendor/paseo-plugin-helper/layout/Grid.tsx +0 -65
- package/client/vendor/paseo-plugin-helper/layout/ModalBody.tsx +0 -368
- package/client/vendor/paseo-plugin-helper/layout/ModalContent.tsx +0 -51
- package/client/vendor/paseo-plugin-helper/layout/Row.tsx +0 -39
- package/client/vendor/paseo-plugin-helper/layout/Stack.tsx +0 -39
- package/client/vendor/paseo-plugin-helper/layout/index.ts +0 -7
- package/client/vendor/paseo-plugin-helper/styles/index.ts +0 -1
- package/client/vendor/paseo-plugin-helper/styles/recipes.ts +0 -550
- package/client/vendor/paseo-plugin-helper/theme/flair.ts +0 -76
- package/client/vendor/paseo-plugin-helper/theme/host-variables.ts +0 -121
- package/client/vendor/paseo-plugin-helper/theme/index.ts +0 -7
- package/client/vendor/paseo-plugin-helper/theme/provider.tsx +0 -178
- package/client/vendor/paseo-plugin-helper/theme/responsive.ts +0 -213
- package/client/vendor/paseo-plugin-helper/theme/tokens.ts +0 -200
- package/client/vendor/paseo-plugin-helper/theme/useResponsive.ts +0 -57
- package/client/vendor/paseo-plugin-helper/tickets.tsx +0 -766
- /package/client/vendor/paseo-plugin-helper/{command-center.ts → core/command-center.ts} +0 -0
- /package/client/vendor/paseo-plugin-helper/{snapshot.ts → core/snapshot.ts} +0 -0
- /package/client/vendor/paseo-plugin-helper/{utils → lifecycle}/haptics.ts +0 -0
package/client/surface.tsx
CHANGED
|
@@ -2,57 +2,54 @@ import React, { useState } from "react";
|
|
|
2
2
|
import { Text, View } from "react-native";
|
|
3
3
|
import type { PluginSurfaceProps } from "@getpaseo/plugin/client";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
} from "./
|
|
5
|
+
HostAboutSection,
|
|
6
|
+
HostButton,
|
|
7
|
+
HostCard,
|
|
8
|
+
HostCardHeader,
|
|
9
|
+
HostGrid,
|
|
10
|
+
HostKeyValue,
|
|
11
|
+
HostLayoutProvider,
|
|
12
|
+
HostMetricGauge,
|
|
13
|
+
HostRow,
|
|
14
|
+
HostScroll,
|
|
15
|
+
HostStack,
|
|
16
|
+
HostTabs,
|
|
17
|
+
HostThemeProvider,
|
|
18
|
+
HostToggle,
|
|
19
|
+
} from "./host-ui";
|
|
20
|
+
import { usePluginSettings } from "./vendor/paseo-plugin-helper/core/index";
|
|
20
21
|
import { formatBytes, formatUptime } from "../shared/vendor/paseo-plugin-helper/index";
|
|
21
|
-
import { PermissionAuditView } from "permission-audit
|
|
22
|
+
import { PermissionAuditView } from "./vendor/permission-audit";
|
|
22
23
|
import {
|
|
23
24
|
topSettingsContract,
|
|
24
25
|
checkboxesFromTarget,
|
|
25
26
|
targetFromCheckboxes,
|
|
27
|
+
isPillEnabled,
|
|
28
|
+
isTimelineEnabled,
|
|
26
29
|
METRIC_DEFINITIONS,
|
|
30
|
+
CPU_THRESHOLDS,
|
|
31
|
+
MEM_THRESHOLDS,
|
|
32
|
+
SURFACE_TABS,
|
|
33
|
+
aboutExtraItems,
|
|
27
34
|
type PillMode,
|
|
28
35
|
type TopSettings,
|
|
29
36
|
} from "../shared/resources";
|
|
30
37
|
import { PLUGIN_VERSION } from "../shared/version";
|
|
31
38
|
import { notifySettingsChanged } from "./settings-events";
|
|
32
|
-
import { ChoiceChips } from "./settings-ui";
|
|
39
|
+
import { ChoiceChips, MultiChoiceChips } from "./settings-ui";
|
|
33
40
|
import { useTopResourceQuery } from "./resources-query";
|
|
34
41
|
import { FleetView } from "./multi-host-view";
|
|
35
42
|
|
|
36
43
|
type SurfaceTab = "system" | "fleet" | "permissions" | "settings" | "about";
|
|
37
44
|
|
|
38
|
-
const TABS = [
|
|
39
|
-
{ id: "system", label: "Activity", shortLabel: "Activity", icon: "Activity" },
|
|
40
|
-
{ id: "fleet", label: "Fleet", shortLabel: "Fleet", icon: "Server" },
|
|
41
|
-
{ id: "permissions", label: "Permissions", shortLabel: "Permissions", icon: "ShieldCheck" },
|
|
42
|
-
{ id: "settings", label: "Settings", shortLabel: "Settings", icon: "Sliders" },
|
|
43
|
-
{ id: "about", label: "About", shortLabel: "About", icon: "Info" },
|
|
44
|
-
];
|
|
45
|
-
|
|
46
45
|
const TIMELINE_CADENCE_OPTIONS = Array.from({ length: 11 }, (_, n) => ({
|
|
47
46
|
id: n,
|
|
48
47
|
label: n === 0 ? "Never" : n === 1 ? "Every turn" : `${n}`,
|
|
49
48
|
}));
|
|
50
49
|
|
|
51
|
-
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
export function TopDashboardSurface(_props: PluginSurfaceProps) {
|
|
55
|
-
const { colors } = usePluginTheme();
|
|
50
|
+
export function TopDashboardSurface(props: PluginSurfaceProps) {
|
|
51
|
+
const { theme, layout } = props;
|
|
52
|
+
const { colors } = theme;
|
|
56
53
|
const [activeTab, setActiveTab] = useState<SurfaceTab>("system");
|
|
57
54
|
// No background settings poll: mount/focus verification plus mutation
|
|
58
55
|
// invalidation keep the dashboard in sync without daemon churn.
|
|
@@ -78,266 +75,297 @@ export function TopDashboardSurface(_props: PluginSurfaceProps) {
|
|
|
78
75
|
};
|
|
79
76
|
|
|
80
77
|
return (
|
|
81
|
-
<
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
78
|
+
<HostThemeProvider theme={theme}>
|
|
79
|
+
<HostLayoutProvider layout={layout}>
|
|
80
|
+
<View style={[styles.root, { backgroundColor: colors.surface0 }]}>
|
|
81
|
+
{/*
|
|
82
|
+
* The sidebar host supplies no scroller for plugin surfaces, so the
|
|
83
|
+
* dashboard owns exactly one: HostScroll below the pinned tab
|
|
84
|
+
* strip (the header stays fixed because it sits outside the scroller).
|
|
85
|
+
*/}
|
|
86
|
+
<HostTabs
|
|
87
|
+
tabs={[...SURFACE_TABS]}
|
|
87
88
|
activeTab={activeTab}
|
|
88
89
|
onTabChange={(id) => setActiveTab(id as SurfaceTab)}
|
|
89
90
|
/>
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
>
|
|
105
|
-
{activeTab === "system" && (
|
|
106
|
-
<Stack gap={12}>
|
|
107
|
-
<Text style={{ fontSize: 16, fontWeight: "700", color: colors.foreground }}>
|
|
108
|
-
Host System Resources
|
|
109
|
-
</Text>
|
|
91
|
+
<HostScroll
|
|
92
|
+
style={styles.scroll}
|
|
93
|
+
contentContainerStyle={{
|
|
94
|
+
gap: 12,
|
|
95
|
+
paddingHorizontal: 12,
|
|
96
|
+
paddingBottom: 12,
|
|
97
|
+
paddingTop: 6,
|
|
98
|
+
}}
|
|
99
|
+
>
|
|
100
|
+
{activeTab === "system" && (
|
|
101
|
+
<HostStack gap={12}>
|
|
102
|
+
<Text style={{ fontSize: 16, fontWeight: "700", color: colors.foreground }}>
|
|
103
|
+
Host System Resources
|
|
104
|
+
</Text>
|
|
110
105
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
106
|
+
{pillHidden && (
|
|
107
|
+
<HostCard variant="elevated">
|
|
108
|
+
<Text
|
|
109
|
+
style={{ fontSize: 12, fontWeight: "600", color: colors.foregroundMuted }}
|
|
110
|
+
>
|
|
111
|
+
Composer pill is hidden in trackbar. You can re-enable it from the Settings
|
|
112
|
+
tab above.
|
|
113
|
+
</Text>
|
|
114
|
+
</HostCard>
|
|
115
|
+
)}
|
|
118
116
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
117
|
+
<HostCard variant="elevated">
|
|
118
|
+
<HostRow justify="between" align="center" style={styles.gaugeContainer}>
|
|
119
|
+
<HostMetricGauge
|
|
120
|
+
value={data?.cpuUsagePercent ?? 0}
|
|
121
|
+
thresholds={CPU_THRESHOLDS}
|
|
122
|
+
label="CPU Load"
|
|
123
|
+
size={72}
|
|
124
|
+
/>
|
|
125
|
+
<HostMetricGauge
|
|
126
|
+
value={data?.memoryUsedPercent ?? 0}
|
|
127
|
+
thresholds={MEM_THRESHOLDS}
|
|
128
|
+
label="RAM Used"
|
|
129
|
+
size={72}
|
|
130
|
+
/>
|
|
131
|
+
</HostRow>
|
|
132
|
+
</HostCard>
|
|
135
133
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
134
|
+
<HostCard variant="elevated">
|
|
135
|
+
<HostGrid columns={2} gap={12}>
|
|
136
|
+
<HostKeyValue
|
|
137
|
+
label="CPU"
|
|
138
|
+
value={data?.cpuUsagePercent !== undefined ? `${data.cpuUsagePercent}%` : "--"}
|
|
139
|
+
/>
|
|
140
|
+
<HostKeyValue
|
|
141
|
+
label="Memory"
|
|
142
|
+
value={
|
|
143
|
+
data?.memoryUsedBytes !== undefined
|
|
144
|
+
? `${formatBytes(data.memoryUsedBytes, { compact: true, decimals: 1 })} (${data.memoryUsedPercent ?? "--"}%)`
|
|
145
|
+
: "--"
|
|
146
|
+
}
|
|
147
|
+
/>
|
|
148
|
+
<HostKeyValue
|
|
149
|
+
label="Load"
|
|
150
|
+
value={data?.loadAvg?.[0] !== undefined ? data.loadAvg[0].toFixed(2) : "--"}
|
|
151
|
+
/>
|
|
152
|
+
<HostKeyValue
|
|
153
|
+
label="Uptime"
|
|
154
|
+
value={data?.uptimeSeconds ? formatUptime(data.uptimeSeconds) : "--"}
|
|
155
|
+
/>
|
|
156
|
+
<HostKeyValue label="Branch" value={data?.branch ?? "--"} copyable />
|
|
157
|
+
<HostKeyValue
|
|
158
|
+
label="MCP"
|
|
159
|
+
value={
|
|
160
|
+
data?.mcp && typeof data.mcp.total === "number"
|
|
161
|
+
? `${data.mcp.healthy}/${data.mcp.total} healthy`
|
|
162
|
+
: "MCP --"
|
|
163
|
+
}
|
|
164
|
+
/>
|
|
165
|
+
</HostGrid>
|
|
166
|
+
</HostCard>
|
|
167
|
+
{isLoading && !data ? (
|
|
168
|
+
<Text style={{ fontSize: 12, color: colors.foregroundMuted }}>
|
|
169
|
+
Loading live snapshot...
|
|
170
|
+
</Text>
|
|
171
|
+
) : null}
|
|
172
|
+
</HostStack>
|
|
173
|
+
)}
|
|
176
174
|
|
|
177
|
-
|
|
175
|
+
{activeTab === "fleet" && <FleetView />}
|
|
178
176
|
|
|
179
|
-
|
|
177
|
+
{activeTab === "permissions" && <PermissionAuditView variant="compact" theme={theme} layout={layout} />}
|
|
180
178
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
</View>
|
|
207
|
-
</Card>
|
|
208
|
-
|
|
209
|
-
<Card variant="elevated">
|
|
210
|
-
<CardHeader
|
|
211
|
-
title="Metric Surfaces"
|
|
212
|
-
icon="Sliders"
|
|
213
|
-
subtitle="Choose where each metric appears (pill vs timeline)"
|
|
214
|
-
/>
|
|
215
|
-
<Stack gap={12}>
|
|
216
|
-
{METRIC_DEFINITIONS.map((def) => {
|
|
217
|
-
const boxes = checkboxesFromTarget(settings.metricSurfaces?.[def.id]);
|
|
218
|
-
const setBox = (which: "pill" | "timeline", val: boolean) => {
|
|
219
|
-
const nextBoxes = { ...boxes, [which]: val };
|
|
220
|
-
if (def.pillOnly) nextBoxes.timeline = false;
|
|
221
|
-
applySettings({
|
|
222
|
-
metricSurfaces: {
|
|
223
|
-
...settings.metricSurfaces,
|
|
224
|
-
[def.id]: targetFromCheckboxes(nextBoxes.pill, nextBoxes.timeline),
|
|
225
|
-
} as TopSettings["metricSurfaces"],
|
|
226
|
-
});
|
|
227
|
-
};
|
|
228
|
-
return (
|
|
229
|
-
<View key={def.id}>
|
|
230
|
-
<Text style={{ fontSize: 11, fontWeight: "700", color: colors.foreground }}>
|
|
231
|
-
{def.title}
|
|
232
|
-
</Text>
|
|
233
|
-
<Row gap={24} align="center" style={styles.metricTargets}>
|
|
234
|
-
<Row gap={6} align="center">
|
|
235
|
-
<Text style={[styles.metricTargetLabel, { color: colors.foreground }]}>
|
|
236
|
-
Pill
|
|
237
|
-
</Text>
|
|
238
|
-
<Toggle value={boxes.pill} onValueChange={(val) => setBox("pill", val)} />
|
|
239
|
-
</Row>
|
|
240
|
-
<Row gap={6} align="center">
|
|
241
|
-
<Text style={[styles.metricTargetLabel, { color: colors.foreground }]}>
|
|
242
|
-
Timeline
|
|
243
|
-
</Text>
|
|
244
|
-
<Toggle
|
|
245
|
-
value={boxes.timeline && !def.pillOnly}
|
|
246
|
-
disabled={!!def.pillOnly}
|
|
247
|
-
onValueChange={(val) => setBox("timeline", val)}
|
|
248
|
-
/>
|
|
249
|
-
</Row>
|
|
250
|
-
</Row>
|
|
179
|
+
{activeTab === "settings" && (
|
|
180
|
+
<HostStack gap={12}>
|
|
181
|
+
<HostCard variant="elevated">
|
|
182
|
+
<HostCardHeader
|
|
183
|
+
title="Pill Display Mode"
|
|
184
|
+
icon="LayoutGrid"
|
|
185
|
+
subtitle="How active items appear in the composer trackbar"
|
|
186
|
+
/>
|
|
187
|
+
<ChoiceChips
|
|
188
|
+
options={[
|
|
189
|
+
{ id: "cycle", label: "Cycle", description: "Rotate one at a time" },
|
|
190
|
+
{ id: "all", label: "All in One", description: "Combined into one pill" },
|
|
191
|
+
{ id: "multiple", label: "Multiple", description: "Dedicated pills" },
|
|
192
|
+
]}
|
|
193
|
+
value={settings.pillMode ?? "cycle"}
|
|
194
|
+
showActiveDescription
|
|
195
|
+
onChange={(pillMode: PillMode) => applySettings({ pillMode })}
|
|
196
|
+
/>
|
|
197
|
+
<View style={styles.settingsSpacer}>
|
|
198
|
+
<HostToggle
|
|
199
|
+
label="Show Composer Pill"
|
|
200
|
+
description="Hide the composer pill entirely; the dashboard stays available from the sidebar"
|
|
201
|
+
value={settings.showComposerPill ?? true}
|
|
202
|
+
onValueChange={(val) => applySettings({ showComposerPill: val })}
|
|
203
|
+
/>
|
|
251
204
|
</View>
|
|
252
|
-
|
|
253
|
-
})}
|
|
254
|
-
</Stack>
|
|
255
|
-
</Card>
|
|
205
|
+
</HostCard>
|
|
256
206
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
207
|
+
<HostCard variant="elevated">
|
|
208
|
+
<HostCardHeader
|
|
209
|
+
title="Active Pill Items"
|
|
210
|
+
icon="Sliders"
|
|
211
|
+
value={
|
|
212
|
+
<Text style={{ fontWeight: "600", color: colors.accent }}>
|
|
213
|
+
{`${METRIC_DEFINITIONS.filter((d) => isPillEnabled(settings.metricSurfaces?.[d.id])).length} active`}
|
|
214
|
+
</Text>
|
|
215
|
+
}
|
|
216
|
+
subtitle="Choose which items appear in the composer pill"
|
|
217
|
+
/>
|
|
218
|
+
<MultiChoiceChips
|
|
219
|
+
options={METRIC_DEFINITIONS.map((def) => ({
|
|
220
|
+
id: def.id,
|
|
221
|
+
label: def.title,
|
|
222
|
+
icon: def.icon,
|
|
223
|
+
}))}
|
|
224
|
+
selected={METRIC_DEFINITIONS.filter((d) => isPillEnabled(settings.metricSurfaces?.[d.id])).map((d) => d.id)}
|
|
225
|
+
onToggle={(metricId) => {
|
|
226
|
+
const boxes = checkboxesFromTarget(settings.metricSurfaces?.[metricId]);
|
|
227
|
+
applySettings({
|
|
228
|
+
metricSurfaces: {
|
|
229
|
+
...settings.metricSurfaces,
|
|
230
|
+
[metricId]: targetFromCheckboxes(!boxes.pill, boxes.timeline),
|
|
231
|
+
} as TopSettings["metricSurfaces"],
|
|
232
|
+
});
|
|
233
|
+
}}
|
|
234
|
+
onSelectAll={() => {
|
|
235
|
+
const next = { ...settings.metricSurfaces };
|
|
236
|
+
for (const def of METRIC_DEFINITIONS) {
|
|
237
|
+
const boxes = checkboxesFromTarget(settings.metricSurfaces?.[def.id]);
|
|
238
|
+
next[def.id] = targetFromCheckboxes(true, boxes.timeline);
|
|
239
|
+
}
|
|
240
|
+
applySettings({ metricSurfaces: next as TopSettings["metricSurfaces"] });
|
|
241
|
+
}}
|
|
242
|
+
onClearAll={() => {
|
|
243
|
+
const next = { ...settings.metricSurfaces };
|
|
244
|
+
for (const def of METRIC_DEFINITIONS) {
|
|
245
|
+
const boxes = checkboxesFromTarget(settings.metricSurfaces?.[def.id]);
|
|
246
|
+
next[def.id] = targetFromCheckboxes(false, boxes.timeline);
|
|
247
|
+
}
|
|
248
|
+
applySettings({ metricSurfaces: next as TopSettings["metricSurfaces"] });
|
|
249
|
+
}}
|
|
250
|
+
/>
|
|
251
|
+
</HostCard>
|
|
273
252
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
253
|
+
<HostCard variant="elevated">
|
|
254
|
+
<HostCardHeader
|
|
255
|
+
title="Timeline Card Metrics"
|
|
256
|
+
icon="GitCommitHorizontal"
|
|
257
|
+
value={
|
|
258
|
+
<Text style={{ fontWeight: "600", color: colors.accent }}>
|
|
259
|
+
{`${METRIC_DEFINITIONS.filter((d) => !d.pillOnly && isTimelineEnabled(settings.metricSurfaces?.[d.id])).length} active`}
|
|
260
|
+
</Text>
|
|
261
|
+
}
|
|
262
|
+
subtitle="Choose which metrics appear on turn timeline cards"
|
|
263
|
+
/>
|
|
264
|
+
<MultiChoiceChips
|
|
265
|
+
options={METRIC_DEFINITIONS.filter((d) => !d.pillOnly).map((def) => ({
|
|
266
|
+
id: def.id,
|
|
267
|
+
label: def.title,
|
|
268
|
+
icon: def.icon,
|
|
269
|
+
}))}
|
|
270
|
+
selected={METRIC_DEFINITIONS.filter((d) => !d.pillOnly && isTimelineEnabled(settings.metricSurfaces?.[d.id])).map((d) => d.id)}
|
|
271
|
+
onToggle={(metricId) => {
|
|
272
|
+
const boxes = checkboxesFromTarget(settings.metricSurfaces?.[metricId]);
|
|
273
|
+
applySettings({
|
|
274
|
+
metricSurfaces: {
|
|
275
|
+
...settings.metricSurfaces,
|
|
276
|
+
[metricId]: targetFromCheckboxes(boxes.pill, !boxes.timeline),
|
|
277
|
+
} as TopSettings["metricSurfaces"],
|
|
278
|
+
});
|
|
279
|
+
}}
|
|
280
|
+
onSelectAll={() => {
|
|
281
|
+
const next = { ...settings.metricSurfaces };
|
|
282
|
+
for (const def of METRIC_DEFINITIONS) {
|
|
283
|
+
if (def.pillOnly) continue;
|
|
284
|
+
const boxes = checkboxesFromTarget(settings.metricSurfaces?.[def.id]);
|
|
285
|
+
next[def.id] = targetFromCheckboxes(boxes.pill, true);
|
|
286
|
+
}
|
|
287
|
+
applySettings({ metricSurfaces: next as TopSettings["metricSurfaces"] });
|
|
288
|
+
}}
|
|
289
|
+
onClearAll={() => {
|
|
290
|
+
const next = { ...settings.metricSurfaces };
|
|
291
|
+
for (const def of METRIC_DEFINITIONS) {
|
|
292
|
+
if (def.pillOnly) continue;
|
|
293
|
+
const boxes = checkboxesFromTarget(settings.metricSurfaces?.[def.id]);
|
|
294
|
+
next[def.id] = targetFromCheckboxes(boxes.pill, false);
|
|
295
|
+
}
|
|
296
|
+
applySettings({ metricSurfaces: next as TopSettings["metricSurfaces"] });
|
|
297
|
+
}}
|
|
298
|
+
/>
|
|
299
|
+
</HostCard>
|
|
295
300
|
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
301
|
+
<HostCard variant="elevated">
|
|
302
|
+
<HostCardHeader
|
|
303
|
+
title="Rotation Speed"
|
|
304
|
+
icon="Clock"
|
|
305
|
+
value={
|
|
306
|
+
<Text style={{ color: colors.accent, fontWeight: "600" }}>
|
|
307
|
+
{`${settings.intervalSeconds}s`}
|
|
308
|
+
</Text>
|
|
309
|
+
}
|
|
310
|
+
/>
|
|
311
|
+
<ChoiceChips
|
|
312
|
+
options={[2, 3, 4, 6].map((sec) => ({ id: sec, label: `${sec}s` }))}
|
|
313
|
+
value={settings.intervalSeconds}
|
|
314
|
+
onChange={(intervalSeconds) => applySettings({ intervalSeconds })}
|
|
315
|
+
/>
|
|
316
|
+
</HostCard>
|
|
308
317
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
318
|
+
<HostCard variant="elevated">
|
|
319
|
+
<HostCardHeader
|
|
320
|
+
title="Timeline Cadence"
|
|
321
|
+
icon="Clock"
|
|
322
|
+
value={
|
|
323
|
+
<Text style={{ color: colors.accent, fontWeight: "600" }}>
|
|
324
|
+
{(settings.timelineCadence ?? 1) === 0
|
|
325
|
+
? "Never"
|
|
326
|
+
: (settings.timelineCadence ?? 1) === 1
|
|
327
|
+
? "Every turn"
|
|
328
|
+
: `Every ${(settings.timelineCadence ?? 1)} turns`}
|
|
329
|
+
</Text>
|
|
330
|
+
}
|
|
331
|
+
subtitle="How often a card is stamped into the timeline view (0 = never)"
|
|
332
|
+
/>
|
|
333
|
+
<ChoiceChips
|
|
334
|
+
options={TIMELINE_CADENCE_OPTIONS}
|
|
335
|
+
value={settings.timelineCadence ?? 1}
|
|
336
|
+
onChange={(timelineCadence) => applySettings({ timelineCadence })}
|
|
337
|
+
/>
|
|
338
|
+
</HostCard>
|
|
339
|
+
|
|
340
|
+
<HostButton
|
|
341
|
+
label="Reset to Defaults"
|
|
342
|
+
variant="secondary"
|
|
343
|
+
size="sm"
|
|
344
|
+
onPress={() => {
|
|
345
|
+
void resetSettings().then((defaults) => {
|
|
346
|
+
notifySettingsChanged(defaults ?? topSettingsContract.defaultSettings);
|
|
347
|
+
});
|
|
348
|
+
}}
|
|
349
|
+
/>
|
|
350
|
+
</HostStack>
|
|
351
|
+
)}
|
|
352
|
+
|
|
353
|
+
{activeTab === "about" && (
|
|
354
|
+
<HostAboutSection
|
|
355
|
+
name="paseo-top"
|
|
356
|
+
description="Live host system and workspace monitor for Paseo composer trackbar."
|
|
357
|
+
version={data?.version ?? PLUGIN_VERSION}
|
|
358
|
+
author="xpufx"
|
|
359
|
+
repository="https://github.com/xpufx/paseo-top"
|
|
360
|
+
issues="https://github.com/xpufx/paseo-top/issues"
|
|
361
|
+
license="MIT"
|
|
362
|
+
extraItems={aboutExtraItems(data)}
|
|
363
|
+
/>
|
|
364
|
+
)}
|
|
365
|
+
</HostScroll>
|
|
366
|
+
</View>
|
|
367
|
+
</HostLayoutProvider>
|
|
368
|
+
</HostThemeProvider>
|
|
341
369
|
);
|
|
342
370
|
}
|
|
343
371
|
|
|
@@ -347,6 +375,10 @@ const styles = {
|
|
|
347
375
|
minHeight: 0,
|
|
348
376
|
width: "100%",
|
|
349
377
|
},
|
|
378
|
+
scroll: {
|
|
379
|
+
flex: 1,
|
|
380
|
+
minHeight: 0,
|
|
381
|
+
},
|
|
350
382
|
gaugeContainer: {
|
|
351
383
|
paddingVertical: 12,
|
|
352
384
|
width: "100%",
|