@leitwerk-dev/ui 0.3.1 → 0.4.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/dist/assets/ApiTokensPage-DCmYvZdE.js +1 -0
- package/dist/assets/ChronicleMarkdown-CDe1jngc.js +1 -0
- package/dist/assets/DashboardPage-BRxe3uuy.css +1 -0
- package/dist/assets/DashboardPage-LiQ0_72g.js +1 -0
- package/dist/assets/FutureLaunchDetailPage-DvyW_J5d.js +1 -0
- package/dist/assets/GenericLauncher-D1qQy9hq.js +4 -0
- package/dist/assets/GenericLauncher-DRUMMTd7.css +1 -0
- package/dist/assets/HomePage-Cnmp6osB.js +1 -0
- package/dist/assets/ProcessActionsMenu-DEQynjFa.js +1 -0
- package/dist/assets/ProcessDetailPage-DvjQQTDj.js +14 -0
- package/dist/assets/ProcessDetailPage-km76G8wj.css +1 -0
- package/dist/assets/ProcessFlowDiagram-DI5KZ2Qj.js +1 -0
- package/dist/assets/ProcessFlowDiagram-NQ6oEZi7.css +1 -0
- package/dist/assets/ProcessesPage-B4BMXJT7.js +1 -0
- package/dist/assets/ScheduleDateTimePicker-2eJ0jBQ-.css +1 -0
- package/dist/assets/ScheduleDateTimePicker-fg0Vau5Z.js +3 -0
- package/dist/assets/SettingsPage-BHSV4rl7.css +1 -0
- package/dist/assets/SettingsPage-w1RHZ2l6.js +2 -0
- package/dist/assets/SkillsPage-Ber36rAD.js +2 -0
- package/dist/assets/WatchersPage-Btq_SIk3.js +1 -0
- package/dist/assets/WikiPage-BjncVYf1.js +1 -0
- package/dist/assets/WikiPage-Bvnhxl3m.css +1 -0
- package/dist/assets/http-client-Cvi3zOou.js +2 -0
- package/dist/assets/http-contracts-public-BUgTIHYG.js +1 -0
- package/dist/assets/index-Dz0T5gKc.js +21 -0
- package/dist/assets/index-DzKWCM-z.css +1 -0
- package/dist/assets/{index-client-BYQviCtQ.js → index-client-BSAA7n1a.js} +2 -2
- package/dist/assets/mermaid-render.worker-BN0bcvGc.js +6398 -0
- package/dist/assets/retry-config.svelte-HNNF65qc.js +1 -0
- package/dist/assets/settings-Dk5UoSQa.js +1 -0
- package/dist/index.html +4 -7
- package/package.json +10 -9
- package/src/App.svelte +9 -0
- package/src/chronicle/components/ChronicleActionSection.svelte +10 -2
- package/src/chronicle/components/ChronicleEntryHeader.svelte +4 -16
- package/src/chronicle/components/ChronicleFlow.svelte +24 -6
- package/src/chronicle/components/ChronicleLiveTail.svelte +52 -24
- package/src/chronicle/components/ChronicleProcessErrorSection.svelte +14 -0
- package/src/chronicle/components/ChronicleQuestionRequest.svelte +1 -1
- package/src/chronicle/components/ChronicleRecoverySection.svelte +14 -10
- package/src/chronicle/components/ChronicleStartupRecoverySection.svelte +22 -10
- package/src/chronicle/components/ChronicleThinkingSection.svelte +8 -2
- package/src/chronicle/components/ChronicleToolApproval.svelte +120 -17
- package/src/chronicle/components/ChronicleToolCallItem.svelte +32 -6
- package/src/chronicle/components/ChronicleTurnCluster.svelte +6 -6
- package/src/chronicle/components/ChronicleTurnProgress.svelte +10 -4
- package/src/chronicle/components/ChronicleTurnRail.svelte +1 -0
- package/src/chronicle/components/RecoveryModelControl.svelte +14 -13
- package/src/chronicle/lib/chronicle-projection.ts +74 -376
- package/src/chronicle/lib/chronicle-selectable-items.ts +23 -3
- package/src/chronicle/lib/recovery-model.ts +17 -0
- package/src/components/ConversationTreeDiagram.svelte +93 -30
- package/src/components/FormFieldRenderer.svelte +184 -27
- package/src/components/GenericLauncher.svelte +438 -259
- package/src/components/NamedSelectionList.svelte +77 -0
- package/src/components/ProcessActionsMenu.svelte +37 -59
- package/src/components/ProcessSettings.svelte +110 -0
- package/src/components/ScheduleDateTimePicker.svelte +9 -4
- package/src/components/SettingsField.svelte +317 -0
- package/src/components/SettingsOverview.svelte +237 -0
- package/src/components/SkillSelector.svelte +15 -3
- package/src/components/launcher-form-copy.ts +2 -1
- package/src/components/launcher-model-config.ts +8 -7
- package/src/components/launcher-selections.ts +123 -0
- package/src/lib/api.ts +100 -43
- package/src/lib/dashboard-refresh.ts +47 -0
- package/src/lib/http-client.ts +20 -1
- package/src/lib/instance-tree-layout.ts +41 -10
- package/src/lib/primary-path-detail.ts +56 -341
- package/src/lib/primary-path-replay.ts +8 -9
- package/src/lib/process-history.ts +57 -0
- package/src/lib/processes.svelte.ts +71 -79
- package/src/lib/reasoning-history.ts +31 -23
- package/src/lib/router-logic.ts +127 -56
- package/src/lib/router.svelte.ts +10 -6
- package/src/lib/settings.ts +114 -0
- package/src/lib/wiki.ts +34 -0
- package/src/pages/DashboardPage.svelte +194 -0
- package/src/pages/FutureLaunchDetailPage.svelte +2 -2
- package/src/pages/HomePage.svelte +4 -4
- package/src/pages/ProcessDetailPage.svelte +55 -344
- package/src/pages/ProcessFlowDiagram.svelte +39 -684
- package/src/pages/SettingsPage.svelte +265 -0
- package/src/pages/SkillsPage.svelte +26 -12
- package/src/pages/WikiPage.svelte +9 -0
- package/src/pages/process-detail/ProcessDetailChronicle.svelte +57 -13
- package/src/pages/process-detail/ProcessDetailHeader.svelte +9 -3
- package/src/pages/process-detail/TicketCreationComposer.svelte +49 -10
- package/src/pages/process-detail/inspector/ExecutionDetails.svelte +210 -0
- package/src/pages/process-detail/inspector/InspectionEvidence.svelte +48 -0
- package/src/pages/process-detail/inspector/InspectionMessage.svelte +71 -0
- package/src/pages/process-detail/inspector/ProcessInspector.svelte +144 -0
- package/src/pages/process-detail/inspector/ProcessModelEditor.svelte +161 -0
- package/src/pages/process-detail/inspector/ProcessReference.svelte +166 -0
- package/src/pages/process-detail/inspector/inspection-activity.ts +118 -0
- package/src/pages/process-detail/inspector/inspection-data.svelte.ts +107 -0
- package/src/pages/process-detail/inspector/inspection-tool-call.ts +30 -0
- package/src/pages/process-detail/inspector/inspector-navigation.ts +190 -0
- package/src/pages/process-detail/inspector/model-source-label.ts +17 -0
- package/src/pages/process-detail/process-detail-actions.svelte.ts +10 -0
- package/src/pages/process-detail/process-detail-chronicle-scroll.svelte.ts +18 -2
- package/src/pages/process-detail/process-detail-view-model.ts +2 -2
- package/src/shell/AppShell.svelte +55 -56
- package/src/shell/Sidebar.svelte +136 -232
- package/src/test-support/mount.ts +34 -0
- package/src/test-support/wait.ts +19 -0
- package/dist/assets/ApiTokensPage-ClJp9PYr.js +0 -1
- package/dist/assets/ChronicleMarkdown-lqwX9Ywa.js +0 -16
- package/dist/assets/FutureLaunchDetailPage-ygp-IdXC.js +0 -1
- package/dist/assets/GenericLauncher-CExW6wei.css +0 -1
- package/dist/assets/GenericLauncher-DOwsERpB.js +0 -1
- package/dist/assets/HomePage-D1J-Rmsw.js +0 -1
- package/dist/assets/PageHeader-DPuQInDo.css +0 -1
- package/dist/assets/PageHeader-sphJnWL1.js +0 -1
- package/dist/assets/ProcessActionsMenu-DV9zaxNS.js +0 -1
- package/dist/assets/ProcessDetailPage-BW1M2IH8.js +0 -14
- package/dist/assets/ProcessDetailPage-Cth6A0DN.css +0 -1
- package/dist/assets/ProcessFlowDiagram-Cz8wNicU.css +0 -1
- package/dist/assets/ProcessFlowDiagram-Dx2wheGN.js +0 -2
- package/dist/assets/ProcessesPage-CSPH5L7E.js +0 -1
- package/dist/assets/ScheduleDateTimePicker-DmojMRxN.js +0 -1
- package/dist/assets/ScheduleDateTimePicker-uacJAkIq.css +0 -1
- package/dist/assets/SkillsPage-KnLql0n1.js +0 -2
- package/dist/assets/WatchersPage-B4jf3Ywp.js +0 -1
- package/dist/assets/http-client-VpPXJwbR.js +0 -2
- package/dist/assets/index-DPCokDbS.js +0 -6
- package/dist/assets/index-DtEI5gsQ.css +0 -1
- package/dist/assets/mermaid-render.worker-QW2WZpEE.js +0 -6393
- package/dist/assets/process-terminal-display-BQRQwGod.js +0 -1
- package/dist/assets/router.svelte-EEldxHlO.js +0 -1
- package/src/chronicle/components/ChronicleReasoningDetailsOverlay.svelte +0 -855
- package/src/components/ProcessInfoOverlay.svelte +0 -1221
- package/src/lib/flow-layout.ts +0 -319
- package/src/pages/process-detail/OverlayFrame.svelte +0 -58
package/src/shell/Sidebar.svelte
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Actor } from "@leitwerk-dev/domain";
|
|
3
|
+
import type { Snippet } from "svelte";
|
|
3
4
|
import { type FutureActionSummary, type FutureExecutionSummary, logout } from "../lib/api.js";
|
|
4
5
|
|
|
5
6
|
import {
|
|
@@ -17,6 +18,7 @@ import {
|
|
|
17
18
|
} from "../lib/processes.svelte";
|
|
18
19
|
import type { Route } from "../lib/router.svelte";
|
|
19
20
|
import {
|
|
21
|
+
buildCreateProcessPath,
|
|
20
22
|
buildFutureLaunchPath,
|
|
21
23
|
buildHomePath,
|
|
22
24
|
buildProcessesPath,
|
|
@@ -45,6 +47,7 @@ let {
|
|
|
45
47
|
}: Props = $props();
|
|
46
48
|
|
|
47
49
|
const homePath = buildHomePath();
|
|
50
|
+
const createProcessPath = buildCreateProcessPath();
|
|
48
51
|
const processesPath = buildProcessesPath();
|
|
49
52
|
const watchersPath = buildWatchersPath();
|
|
50
53
|
const skillsPath = buildSkillsPath();
|
|
@@ -69,9 +72,8 @@ const runningRows = $derived(
|
|
|
69
72
|
const futureRows = $derived($futureExecutions);
|
|
70
73
|
let observedReconnectCount = $state<number | null>(null);
|
|
71
74
|
let sidebarCollapsed = $state(false);
|
|
72
|
-
|
|
73
|
-
let
|
|
74
|
-
let userPopoverOpen = $state(false);
|
|
75
|
+
type Popover = "current" | "future" | "user";
|
|
76
|
+
let openPopover = $state<Popover | null>(null);
|
|
75
77
|
let logoutPending = $state(false);
|
|
76
78
|
let logoutError = $state<string | null>(null);
|
|
77
79
|
let collapseSupported = $state(
|
|
@@ -103,11 +105,11 @@ const connectionIssue = $derived.by(() => {
|
|
|
103
105
|
const effectiveSidebarCollapsed = $derived(collapseSupported && sidebarCollapsed);
|
|
104
106
|
const currentProcessesControlActive = $derived(
|
|
105
107
|
effectiveSidebarCollapsed &&
|
|
106
|
-
(
|
|
108
|
+
(openPopover === "current" || currentRoute.page === "process-detail"),
|
|
107
109
|
);
|
|
108
110
|
const futureExecutionsControlActive = $derived(
|
|
109
111
|
effectiveSidebarCollapsed &&
|
|
110
|
-
(
|
|
112
|
+
(openPopover === "future" || currentRoute.page === "future-launch-detail"),
|
|
111
113
|
);
|
|
112
114
|
const userName = $derived(authEnabled ? (actor.displayName ?? actor.id) : "Anonymous");
|
|
113
115
|
|
|
@@ -141,18 +143,14 @@ $effect(() => {
|
|
|
141
143
|
return;
|
|
142
144
|
}
|
|
143
145
|
sidebarCollapsed = false;
|
|
144
|
-
|
|
145
|
-
futureExecutionsPopoverOpen = false;
|
|
146
|
-
userPopoverOpen = false;
|
|
146
|
+
openPopover = null;
|
|
147
147
|
});
|
|
148
148
|
|
|
149
149
|
$effect(() => {
|
|
150
150
|
if (effectiveSidebarCollapsed) {
|
|
151
151
|
return;
|
|
152
152
|
}
|
|
153
|
-
|
|
154
|
-
futureExecutionsPopoverOpen = false;
|
|
155
|
-
userPopoverOpen = false;
|
|
153
|
+
openPopover = null;
|
|
156
154
|
});
|
|
157
155
|
|
|
158
156
|
$effect(() => {
|
|
@@ -161,22 +159,18 @@ $effect(() => {
|
|
|
161
159
|
return;
|
|
162
160
|
}
|
|
163
161
|
observedRouteKey = routeKey;
|
|
164
|
-
|
|
165
|
-
futureExecutionsPopoverOpen = false;
|
|
166
|
-
userPopoverOpen = false;
|
|
162
|
+
openPopover = null;
|
|
167
163
|
});
|
|
168
164
|
|
|
169
165
|
$effect(() => {
|
|
170
|
-
if (!
|
|
166
|
+
if (!openPopover) {
|
|
171
167
|
return;
|
|
172
168
|
}
|
|
173
169
|
|
|
174
170
|
const handleDocumentClick = (event: MouseEvent) => {
|
|
175
171
|
const target = event.target as Node | null;
|
|
176
172
|
if (!target) {
|
|
177
|
-
|
|
178
|
-
futureExecutionsPopoverOpen = false;
|
|
179
|
-
userPopoverOpen = false;
|
|
173
|
+
openPopover = null;
|
|
180
174
|
return;
|
|
181
175
|
}
|
|
182
176
|
if (
|
|
@@ -193,23 +187,20 @@ $effect(() => {
|
|
|
193
187
|
) {
|
|
194
188
|
return;
|
|
195
189
|
}
|
|
196
|
-
|
|
197
|
-
futureExecutionsPopoverOpen = false;
|
|
198
|
-
userPopoverOpen = false;
|
|
190
|
+
openPopover = null;
|
|
199
191
|
};
|
|
200
192
|
|
|
201
193
|
const handleDocumentKeydown = (event: KeyboardEvent) => {
|
|
202
194
|
if (event.key !== "Escape") {
|
|
203
195
|
return;
|
|
204
196
|
}
|
|
205
|
-
const focusTarget =
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
userPopoverOpen = false;
|
|
197
|
+
const focusTarget =
|
|
198
|
+
openPopover === "current"
|
|
199
|
+
? currentProcessesTriggerRef
|
|
200
|
+
: openPopover === "future"
|
|
201
|
+
? futureExecutionsTriggerRef
|
|
202
|
+
: userTriggerRef;
|
|
203
|
+
openPopover = null;
|
|
213
204
|
focusTarget?.focus();
|
|
214
205
|
};
|
|
215
206
|
|
|
@@ -221,10 +212,6 @@ $effect(() => {
|
|
|
221
212
|
};
|
|
222
213
|
});
|
|
223
214
|
|
|
224
|
-
function processPath(instanceId: string): string {
|
|
225
|
-
return buildProcessPath(instanceId);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
215
|
function isSelectedRow(row: ProcessRowView): boolean {
|
|
229
216
|
return (
|
|
230
217
|
currentRoute.page === "process-detail" && currentRoute.params.instanceId === row.instanceId
|
|
@@ -249,7 +236,7 @@ function stateKind(row: ProcessRowView): string {
|
|
|
249
236
|
|
|
250
237
|
function futurePath(item: FutureExecutionSummary): string {
|
|
251
238
|
if (item.kind === "action") {
|
|
252
|
-
return
|
|
239
|
+
return buildProcessPath(item.instanceId);
|
|
253
240
|
}
|
|
254
241
|
return buildFutureLaunchPath(item.id);
|
|
255
242
|
}
|
|
@@ -307,56 +294,31 @@ function futureStateKind(item: FutureExecutionSummary): string {
|
|
|
307
294
|
|
|
308
295
|
function openFutureItem(item: FutureExecutionSummary, event: MouseEvent) {
|
|
309
296
|
event.preventDefault();
|
|
310
|
-
|
|
297
|
+
if (openPopover === "future") openPopover = null;
|
|
311
298
|
navigate(futurePath(item));
|
|
312
299
|
}
|
|
313
300
|
|
|
314
|
-
function closePopovers() {
|
|
315
|
-
currentProcessesPopoverOpen = false;
|
|
316
|
-
futureExecutionsPopoverOpen = false;
|
|
317
|
-
userPopoverOpen = false;
|
|
318
|
-
}
|
|
319
|
-
|
|
320
301
|
function toggleSidebar() {
|
|
321
302
|
if (!collapseSupported) {
|
|
322
303
|
return;
|
|
323
304
|
}
|
|
324
305
|
sidebarCollapsed = !sidebarCollapsed;
|
|
325
|
-
|
|
306
|
+
openPopover = null;
|
|
326
307
|
}
|
|
327
308
|
|
|
328
309
|
function openSidebar() {
|
|
329
310
|
sidebarCollapsed = false;
|
|
330
|
-
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
function toggleCurrentProcessesPopover() {
|
|
334
|
-
if (!effectiveSidebarCollapsed) {
|
|
335
|
-
return;
|
|
336
|
-
}
|
|
337
|
-
currentProcessesPopoverOpen = !currentProcessesPopoverOpen;
|
|
338
|
-
futureExecutionsPopoverOpen = false;
|
|
339
|
-
userPopoverOpen = false;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
function toggleFutureExecutionsPopover() {
|
|
343
|
-
if (!effectiveSidebarCollapsed) {
|
|
344
|
-
return;
|
|
345
|
-
}
|
|
346
|
-
futureExecutionsPopoverOpen = !futureExecutionsPopoverOpen;
|
|
347
|
-
currentProcessesPopoverOpen = false;
|
|
348
|
-
userPopoverOpen = false;
|
|
311
|
+
openPopover = null;
|
|
349
312
|
}
|
|
350
313
|
|
|
351
|
-
function
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
logoutError = null;
|
|
314
|
+
function togglePopover(popover: Popover) {
|
|
315
|
+
if (popover !== "user" && !effectiveSidebarCollapsed) return;
|
|
316
|
+
openPopover = openPopover === popover ? null : popover;
|
|
317
|
+
if (popover === "user") logoutError = null;
|
|
356
318
|
}
|
|
357
319
|
|
|
358
320
|
function showHelp() {
|
|
359
|
-
|
|
321
|
+
openPopover = null;
|
|
360
322
|
openKeyboardShortcutHelp();
|
|
361
323
|
}
|
|
362
324
|
|
|
@@ -375,15 +337,78 @@ async function logOut() {
|
|
|
375
337
|
}
|
|
376
338
|
|
|
377
339
|
function openCurrentProcessRow(row: ProcessRowView, event: MouseEvent) {
|
|
378
|
-
|
|
379
|
-
followLink(event,
|
|
340
|
+
if (openPopover === "current") openPopover = null;
|
|
341
|
+
followLink(event, buildProcessPath(row.instanceId));
|
|
380
342
|
}
|
|
381
343
|
</script>
|
|
382
344
|
|
|
345
|
+
{#snippet primaryLink(page: Route["page"], href: string, label: string, action: string | null, icon: Snippet, railLabel = label, railTitle = label)}
|
|
346
|
+
{@const rail = effectiveSidebarCollapsed}
|
|
347
|
+
{@const active = currentRoute.page === page}
|
|
348
|
+
<a
|
|
349
|
+
href={href}
|
|
350
|
+
class={rail ? "rail-icon-control" : "sidebar-nav-link"}
|
|
351
|
+
data-action={action ?? undefined}
|
|
352
|
+
data-pressable={action ? "true" : undefined}
|
|
353
|
+
class:is-active={active}
|
|
354
|
+
aria-current={active ? "page" : undefined}
|
|
355
|
+
aria-label={rail ? railTitle : page === "dashboard" ? label : undefined}
|
|
356
|
+
title={rail ? railTitle : page === "dashboard" ? label : undefined}
|
|
357
|
+
onclick={(event) => followLink(event, href)}
|
|
358
|
+
>
|
|
359
|
+
<span class={rail ? "rail-control-icon" : "sidebar-nav-icon"} aria-hidden="true">{@render icon()}</span>
|
|
360
|
+
<span class={rail ? "rail-control-label" : "sidebar-nav-label"}>{rail ? railLabel : label}</span>
|
|
361
|
+
</a>
|
|
362
|
+
{/snippet}
|
|
363
|
+
|
|
364
|
+
{#snippet dashboardIcon()}
|
|
365
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
366
|
+
<rect x="3.5" y="3.5" width="6.5" height="6.5" rx="1"></rect><rect x="14" y="3.5" width="6.5" height="6.5" rx="1"></rect>
|
|
367
|
+
<rect x="3.5" y="14" width="6.5" height="6.5" rx="1"></rect><rect x="14" y="14" width="6.5" height="6.5" rx="1"></rect>
|
|
368
|
+
</svg>
|
|
369
|
+
{/snippet}
|
|
370
|
+
|
|
371
|
+
{#snippet createProcessIcon()}
|
|
372
|
+
{#if effectiveSidebarCollapsed}
|
|
373
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
374
|
+
<circle cx="12" cy="12" r="8"></circle>
|
|
375
|
+
<path d="M12 8v8"></path><path d="M8 12h8"></path>
|
|
376
|
+
</svg>
|
|
377
|
+
{:else}+{/if}
|
|
378
|
+
{/snippet}
|
|
379
|
+
|
|
380
|
+
{#snippet watchersIcon()}
|
|
381
|
+
{#if effectiveSidebarCollapsed}
|
|
382
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
383
|
+
<path d="M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6z"></path>
|
|
384
|
+
<circle cx="12" cy="12" r="2.5"></circle>
|
|
385
|
+
</svg>
|
|
386
|
+
{:else}◌{/if}
|
|
387
|
+
{/snippet}
|
|
388
|
+
|
|
389
|
+
{#snippet processesIcon()}
|
|
390
|
+
{#if effectiveSidebarCollapsed}
|
|
391
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
392
|
+
<path d="M5 5.5h14"></path><path d="M5 12h14"></path>
|
|
393
|
+
<path d="M5 18.5h9"></path><path d="M17 17l2 2 2-2"></path>
|
|
394
|
+
</svg>
|
|
395
|
+
{:else}⌘{/if}
|
|
396
|
+
{/snippet}
|
|
397
|
+
|
|
398
|
+
{#snippet wikiIcon()}
|
|
399
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M12 5v15M12 5C9 3 5 3 2 4v15c3-1 7-1 10 1 3-2 7-2 10-1V4c-3-1-7-1-10 1Z"></path></svg>
|
|
400
|
+
{/snippet}
|
|
401
|
+
|
|
402
|
+
{#snippet skillsIcon()}
|
|
403
|
+
<svg viewBox="0 0 20 20" fill="none">
|
|
404
|
+
<path d="M4 5.5h12M4 10h12M4 14.5h8" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" />
|
|
405
|
+
</svg>
|
|
406
|
+
{/snippet}
|
|
407
|
+
|
|
383
408
|
{#snippet processRowList(rows: readonly ProcessRowView[], extraListClass = "")}
|
|
384
409
|
<div class="process-list {extraListClass}">
|
|
385
410
|
{#each rows as row (row.instanceId)}
|
|
386
|
-
{@const href =
|
|
411
|
+
{@const href = buildProcessPath(row.instanceId)}
|
|
387
412
|
<a
|
|
388
413
|
href={href}
|
|
389
414
|
class="process-row"
|
|
@@ -458,68 +483,11 @@ function openCurrentProcessRow(row: ProcessRowView, event: MouseEvent) {
|
|
|
458
483
|
<span class="rail-control-label">Open</span>
|
|
459
484
|
</button>
|
|
460
485
|
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
class:is-active={currentRoute.page === "home"}
|
|
467
|
-
aria-current={currentRoute.page === "home" ? "page" : undefined}
|
|
468
|
-
aria-label="Start process"
|
|
469
|
-
title="Start process"
|
|
470
|
-
onclick={(event) => followLink(event, homePath)}
|
|
471
|
-
>
|
|
472
|
-
<span class="rail-control-icon" aria-hidden="true">
|
|
473
|
-
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
474
|
-
<circle cx="12" cy="12" r="8"></circle>
|
|
475
|
-
<path d="M12 8v8"></path>
|
|
476
|
-
<path d="M8 12h8"></path>
|
|
477
|
-
</svg>
|
|
478
|
-
</span>
|
|
479
|
-
<span class="rail-control-label">New</span>
|
|
480
|
-
</a>
|
|
481
|
-
|
|
482
|
-
<a
|
|
483
|
-
href={watchersPath}
|
|
484
|
-
class="rail-icon-control"
|
|
485
|
-
data-action="view-watchers"
|
|
486
|
-
data-pressable="true"
|
|
487
|
-
class:is-active={currentRoute.page === "watchers"}
|
|
488
|
-
aria-current={currentRoute.page === "watchers" ? "page" : undefined}
|
|
489
|
-
aria-label="Watchers"
|
|
490
|
-
title="Watchers"
|
|
491
|
-
onclick={(event) => followLink(event, watchersPath)}
|
|
492
|
-
>
|
|
493
|
-
<span class="rail-control-icon" aria-hidden="true">
|
|
494
|
-
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
495
|
-
<path d="M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6z"></path>
|
|
496
|
-
<circle cx="12" cy="12" r="2.5"></circle>
|
|
497
|
-
</svg>
|
|
498
|
-
</span>
|
|
499
|
-
<span class="rail-control-label">Watch</span>
|
|
500
|
-
</a>
|
|
501
|
-
|
|
502
|
-
<a
|
|
503
|
-
href={processesPath}
|
|
504
|
-
class="rail-icon-control"
|
|
505
|
-
data-action="view-all-processes"
|
|
506
|
-
data-pressable="true"
|
|
507
|
-
class:is-active={currentRoute.page === "processes"}
|
|
508
|
-
aria-current={currentRoute.page === "processes" ? "page" : undefined}
|
|
509
|
-
aria-label="All processes"
|
|
510
|
-
title="All processes"
|
|
511
|
-
onclick={(event) => followLink(event, processesPath)}
|
|
512
|
-
>
|
|
513
|
-
<span class="rail-control-icon" aria-hidden="true">
|
|
514
|
-
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
515
|
-
<path d="M5 5.5h14"></path>
|
|
516
|
-
<path d="M5 12h14"></path>
|
|
517
|
-
<path d="M5 18.5h9"></path>
|
|
518
|
-
<path d="M17 17l2 2 2-2"></path>
|
|
519
|
-
</svg>
|
|
520
|
-
</span>
|
|
521
|
-
<span class="rail-control-label">All</span>
|
|
522
|
-
</a>
|
|
486
|
+
{@render primaryLink("dashboard", homePath, "Dashboard", "view-dashboard", dashboardIcon)}
|
|
487
|
+
{@render primaryLink("home", createProcessPath, "Start a process", "create-process", createProcessIcon, "New", "Start process")}
|
|
488
|
+
{@render primaryLink("watchers", watchersPath, "Watchers", "view-watchers", watchersIcon, "Watch")}
|
|
489
|
+
{@render primaryLink("wiki", "/wiki", "Solution wikis", null, wikiIcon, "Wikis")}
|
|
490
|
+
{@render primaryLink("processes", processesPath, "All processes", "view-all-processes", processesIcon, "All")}
|
|
523
491
|
|
|
524
492
|
<div class="current-processes-anchor">
|
|
525
493
|
<button
|
|
@@ -531,11 +499,11 @@ function openCurrentProcessRow(row: ProcessRowView, event: MouseEvent) {
|
|
|
531
499
|
data-pressable="true"
|
|
532
500
|
aria-haspopup="dialog"
|
|
533
501
|
aria-controls="current-processes-popover"
|
|
534
|
-
aria-expanded={
|
|
502
|
+
aria-expanded={openPopover === "current"}
|
|
535
503
|
aria-label="Waiting and running processes"
|
|
536
504
|
title={connectionIssue ? `Waiting and running processes — ${connectionIssue}` : "Waiting and running processes"}
|
|
537
505
|
bind:this={currentProcessesTriggerRef}
|
|
538
|
-
onclick={
|
|
506
|
+
onclick={() => togglePopover("current")}
|
|
539
507
|
>
|
|
540
508
|
<span class="rail-control-icon" aria-hidden="true">
|
|
541
509
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
@@ -548,7 +516,7 @@ function openCurrentProcessRow(row: ProcessRowView, event: MouseEvent) {
|
|
|
548
516
|
<span class="rail-control-label">Work</span>
|
|
549
517
|
</button>
|
|
550
518
|
|
|
551
|
-
{#if
|
|
519
|
+
{#if openPopover === "current"}
|
|
552
520
|
<div
|
|
553
521
|
id="current-processes-popover"
|
|
554
522
|
class="current-processes-popover"
|
|
@@ -573,28 +541,20 @@ function openCurrentProcessRow(row: ProcessRowView, event: MouseEvent) {
|
|
|
573
541
|
{:else if currentRows.length === 0}
|
|
574
542
|
<div class="empty-state">No waiting or running processes. Start one above and it will appear here.</div>
|
|
575
543
|
{:else}
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
<
|
|
544
|
+
{#each [{ label: "Waiting", rows: waitingRows }, { label: "Running", rows: runningRows }] as group (group.label)}
|
|
545
|
+
{@const kind = group.label.toLowerCase()}
|
|
546
|
+
<div class="popover-section">
|
|
547
|
+
<div class="group-header compact">
|
|
548
|
+
<div class="group-heading">{group.label}</div>
|
|
549
|
+
<span class="group-count" aria-label={`${group.rows.length} ${kind} process${group.rows.length === 1 ? "" : "es"}`}>{group.rows.length}</span>
|
|
550
|
+
</div>
|
|
551
|
+
{#if group.rows.length === 0}
|
|
552
|
+
<div class="empty-state">No {kind} processes.</div>
|
|
553
|
+
{:else}
|
|
554
|
+
{@render processRowList(group.rows, "popover-process-list")}
|
|
555
|
+
{/if}
|
|
580
556
|
</div>
|
|
581
|
-
|
|
582
|
-
<div class="empty-state">No waiting processes.</div>
|
|
583
|
-
{:else}
|
|
584
|
-
{@render processRowList(waitingRows, "popover-process-list")}
|
|
585
|
-
{/if}
|
|
586
|
-
</div>
|
|
587
|
-
<div class="popover-section">
|
|
588
|
-
<div class="group-header compact">
|
|
589
|
-
<div class="group-heading">Running</div>
|
|
590
|
-
<span class="group-count" aria-label={`${runningRows.length} running process${runningRows.length === 1 ? "" : "es"}`}>{runningRows.length}</span>
|
|
591
|
-
</div>
|
|
592
|
-
{#if runningRows.length === 0}
|
|
593
|
-
<div class="empty-state">No running processes.</div>
|
|
594
|
-
{:else}
|
|
595
|
-
{@render processRowList(runningRows, "popover-process-list")}
|
|
596
|
-
{/if}
|
|
597
|
-
</div>
|
|
557
|
+
{/each}
|
|
598
558
|
{/if}
|
|
599
559
|
</div>
|
|
600
560
|
</div>
|
|
@@ -610,11 +570,11 @@ function openCurrentProcessRow(row: ProcessRowView, event: MouseEvent) {
|
|
|
610
570
|
data-pressable="true"
|
|
611
571
|
aria-haspopup="dialog"
|
|
612
572
|
aria-controls="future-executions-popover"
|
|
613
|
-
aria-expanded={
|
|
573
|
+
aria-expanded={openPopover === "future"}
|
|
614
574
|
aria-label="Future scheduled work"
|
|
615
575
|
title="Future scheduled work"
|
|
616
576
|
bind:this={futureExecutionsTriggerRef}
|
|
617
|
-
onclick={
|
|
577
|
+
onclick={() => togglePopover("future")}
|
|
618
578
|
>
|
|
619
579
|
<span class="rail-control-icon" aria-hidden="true">
|
|
620
580
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
@@ -628,7 +588,7 @@ function openCurrentProcessRow(row: ProcessRowView, event: MouseEvent) {
|
|
|
628
588
|
<span class="rail-control-label">Future</span>
|
|
629
589
|
</button>
|
|
630
590
|
|
|
631
|
-
{#if
|
|
591
|
+
{#if openPopover === "future"}
|
|
632
592
|
<div
|
|
633
593
|
id="future-executions-popover"
|
|
634
594
|
class="current-processes-popover"
|
|
@@ -683,58 +643,15 @@ function openCurrentProcessRow(row: ProcessRowView, event: MouseEvent) {
|
|
|
683
643
|
</div>
|
|
684
644
|
|
|
685
645
|
<nav class="sidebar-primary-nav" aria-label="Primary sidebar">
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
class
|
|
692
|
-
aria-current={currentRoute.page === "home" ? "page" : undefined}
|
|
693
|
-
onclick={(event) => followLink(event, homePath)}
|
|
694
|
-
>
|
|
695
|
-
<span class="sidebar-nav-icon" aria-hidden="true">+</span>
|
|
696
|
-
<span class="sidebar-nav-label">Start a process</span>
|
|
697
|
-
</a>
|
|
698
|
-
<a
|
|
699
|
-
href={processesPath}
|
|
700
|
-
class="sidebar-nav-link"
|
|
701
|
-
class:is-active={currentRoute.page === "processes"}
|
|
702
|
-
data-action="view-all-processes"
|
|
703
|
-
data-pressable="true"
|
|
704
|
-
aria-current={currentRoute.page === "processes" ? "page" : undefined}
|
|
705
|
-
onclick={(event) => followLink(event, processesPath)}
|
|
706
|
-
>
|
|
707
|
-
<span class="sidebar-nav-icon" aria-hidden="true">⌘</span>
|
|
708
|
-
<span class="sidebar-nav-label">All processes</span>
|
|
709
|
-
</a>
|
|
710
|
-
<a
|
|
711
|
-
href={skillsPath}
|
|
712
|
-
class="sidebar-nav-link"
|
|
713
|
-
data-action="view-skills"
|
|
714
|
-
data-pressable="true"
|
|
715
|
-
class:is-active={currentRoute.page === "skills"}
|
|
716
|
-
aria-current={currentRoute.page === "skills" ? "page" : undefined}
|
|
717
|
-
onclick={(event) => followLink(event, skillsPath)}
|
|
718
|
-
>
|
|
719
|
-
<span class="sidebar-nav-icon" aria-hidden="true">
|
|
720
|
-
<svg viewBox="0 0 20 20" fill="none">
|
|
721
|
-
<path d="M4 5.5h12M4 10h12M4 14.5h8" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" />
|
|
722
|
-
</svg>
|
|
723
|
-
</span>
|
|
724
|
-
<span class="sidebar-nav-label">Skills</span>
|
|
725
|
-
</a>
|
|
726
|
-
<a
|
|
727
|
-
href={watchersPath}
|
|
728
|
-
class="sidebar-nav-link"
|
|
729
|
-
data-action="view-watchers"
|
|
730
|
-
data-pressable="true"
|
|
731
|
-
class:is-active={currentRoute.page === "watchers"}
|
|
732
|
-
aria-current={currentRoute.page === "watchers" ? "page" : undefined}
|
|
733
|
-
onclick={(event) => followLink(event, watchersPath)}
|
|
734
|
-
>
|
|
735
|
-
<span class="sidebar-nav-icon" aria-hidden="true">◌</span>
|
|
736
|
-
<span class="sidebar-nav-label">Watchers</span>
|
|
646
|
+
{@render primaryLink("dashboard", homePath, "Dashboard", "view-dashboard", dashboardIcon)}
|
|
647
|
+
{@render primaryLink("home", createProcessPath, "Start a process", "create-process", createProcessIcon)}
|
|
648
|
+
{@render primaryLink("processes", processesPath, "All processes", "view-all-processes", processesIcon)}
|
|
649
|
+
{@render primaryLink("wiki", "/wiki", "Solution wikis", null, wikiIcon)}
|
|
650
|
+
<a href="/settings" class="sidebar-nav-link" data-action="view-settings" data-pressable="true" class:is-active={currentRoute.page === "settings"} aria-current={currentRoute.page === "settings" ? "page" : undefined} onclick={(event) => followLink(event, "/settings")}>
|
|
651
|
+
<span class="sidebar-nav-icon" aria-hidden="true"><svg viewBox="0 0 20 20" fill="none"><path d="M4 5h12M4 10h12M4 15h12M7 3v4M13 8v4M8 13v4" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" /></svg></span><span class="sidebar-nav-label">Settings</span>
|
|
737
652
|
</a>
|
|
653
|
+
{@render primaryLink("skills", skillsPath, "Skills", "view-skills", skillsIcon)}
|
|
654
|
+
{@render primaryLink("watchers", watchersPath, "Watchers", "view-watchers", watchersIcon)}
|
|
738
655
|
</nav>
|
|
739
656
|
</div>
|
|
740
657
|
|
|
@@ -787,11 +704,11 @@ function openCurrentProcessRow(row: ProcessRowView, event: MouseEvent) {
|
|
|
787
704
|
data-pressable="true"
|
|
788
705
|
aria-haspopup="dialog"
|
|
789
706
|
aria-controls="user-menu-popover"
|
|
790
|
-
aria-expanded={
|
|
707
|
+
aria-expanded={openPopover === "user"}
|
|
791
708
|
aria-label={`User menu for ${userName}`}
|
|
792
709
|
title={userName}
|
|
793
710
|
bind:this={userTriggerRef}
|
|
794
|
-
onclick={
|
|
711
|
+
onclick={() => togglePopover("user")}
|
|
795
712
|
>
|
|
796
713
|
<span class="footer-icon" aria-hidden="true">
|
|
797
714
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
@@ -802,7 +719,7 @@ function openCurrentProcessRow(row: ProcessRowView, event: MouseEvent) {
|
|
|
802
719
|
{#if !effectiveSidebarCollapsed}<span class="user-name">{userName}</span>{/if}
|
|
803
720
|
</button>
|
|
804
721
|
|
|
805
|
-
{#if
|
|
722
|
+
{#if openPopover === "user"}
|
|
806
723
|
<div
|
|
807
724
|
id="user-menu-popover"
|
|
808
725
|
class="user-popover"
|
|
@@ -813,7 +730,7 @@ function openCurrentProcessRow(row: ProcessRowView, event: MouseEvent) {
|
|
|
813
730
|
aria-label={`User options for ${userName}`}
|
|
814
731
|
bind:this={userPopoverRef}
|
|
815
732
|
>
|
|
816
|
-
<a class="user-popover-action" href="/account/api-tokens" onclick={(event) => {
|
|
733
|
+
<a class="user-popover-action" href="/account/api-tokens" onclick={(event) => { openPopover = null; followLink(event, "/account/api-tokens"); }}>API tokens</a>
|
|
817
734
|
<button type="button" class="user-popover-action" onclick={showHelp}>Show help</button>
|
|
818
735
|
{#if authEnabled}
|
|
819
736
|
<button
|
|
@@ -908,7 +825,11 @@ function openCurrentProcessRow(row: ProcessRowView, event: MouseEvent) {
|
|
|
908
825
|
|
|
909
826
|
.rail-icon-control:hover,
|
|
910
827
|
.rail-icon-control.is-active,
|
|
911
|
-
.rail-icon-control[aria-expanded="true"]
|
|
828
|
+
.rail-icon-control[aria-expanded="true"],
|
|
829
|
+
.sidebar-nav-link:hover,
|
|
830
|
+
.sidebar-nav-link.is-active,
|
|
831
|
+
.user-trigger:hover,
|
|
832
|
+
.user-trigger[aria-expanded="true"] {
|
|
912
833
|
border-color: color-mix(in srgb, var(--chronicle-border) 72%, transparent 28%);
|
|
913
834
|
background: color-mix(in srgb, var(--chronicle-card-surface) 78%, transparent 22%);
|
|
914
835
|
color: var(--chronicle-text);
|
|
@@ -971,13 +892,6 @@ function openCurrentProcessRow(row: ProcessRowView, event: MouseEvent) {
|
|
|
971
892
|
text-decoration: none;
|
|
972
893
|
}
|
|
973
894
|
|
|
974
|
-
.sidebar-nav-link:hover,
|
|
975
|
-
.sidebar-nav-link.is-active {
|
|
976
|
-
background: color-mix(in srgb, var(--chronicle-card-surface) 78%, transparent 22%);
|
|
977
|
-
border-color: color-mix(in srgb, var(--chronicle-border) 72%, transparent 28%);
|
|
978
|
-
color: var(--chronicle-text);
|
|
979
|
-
}
|
|
980
|
-
|
|
981
895
|
.sidebar-nav-link.is-active {
|
|
982
896
|
background: color-mix(in srgb, var(--chronicle-accent) 9%, var(--chronicle-card-surface) 91%);
|
|
983
897
|
border-color: color-mix(in srgb, var(--chronicle-accent) 25%, var(--chronicle-border) 75%);
|
|
@@ -1124,13 +1038,6 @@ function openCurrentProcessRow(row: ProcessRowView, event: MouseEvent) {
|
|
|
1124
1038
|
cursor: pointer;
|
|
1125
1039
|
}
|
|
1126
1040
|
|
|
1127
|
-
.user-trigger:hover,
|
|
1128
|
-
.user-trigger[aria-expanded="true"] {
|
|
1129
|
-
border-color: color-mix(in srgb, var(--chronicle-border) 72%, transparent 28%);
|
|
1130
|
-
background: color-mix(in srgb, var(--chronicle-card-surface) 78%, transparent 22%);
|
|
1131
|
-
color: var(--chronicle-text);
|
|
1132
|
-
}
|
|
1133
|
-
|
|
1134
1041
|
.user-trigger.is-collapsed {
|
|
1135
1042
|
display: grid;
|
|
1136
1043
|
grid-template-columns: 1fr;
|
|
@@ -1400,10 +1307,7 @@ function openCurrentProcessRow(row: ProcessRowView, event: MouseEvent) {
|
|
|
1400
1307
|
}
|
|
1401
1308
|
|
|
1402
1309
|
.empty-state {
|
|
1403
|
-
font-size: 0.875rem;
|
|
1404
|
-
line-height: 1.55;
|
|
1405
1310
|
color: var(--chronicle-text-muted);
|
|
1406
|
-
padding: 2px 0;
|
|
1407
1311
|
}
|
|
1408
1312
|
|
|
1409
1313
|
.connection-overlay {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type Component, mount, unmount } from "svelte";
|
|
2
|
+
import { afterEach } from "vitest";
|
|
3
|
+
|
|
4
|
+
const mounted = new Set<ReturnType<typeof mount>>();
|
|
5
|
+
|
|
6
|
+
/** @internal */
|
|
7
|
+
export async function unmountTests() {
|
|
8
|
+
for (const app of [...mounted]) {
|
|
9
|
+
mounted.delete(app);
|
|
10
|
+
await unmount(app);
|
|
11
|
+
}
|
|
12
|
+
document.body.replaceChildren();
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
afterEach(unmountTests);
|
|
16
|
+
|
|
17
|
+
/** @internal */
|
|
18
|
+
export function mountTest<Props extends Record<string, unknown>>(
|
|
19
|
+
component: Component<Props>,
|
|
20
|
+
props: Props,
|
|
21
|
+
) {
|
|
22
|
+
const target = document.createElement("div");
|
|
23
|
+
document.body.append(target);
|
|
24
|
+
const app = mount(component, { target, props });
|
|
25
|
+
mounted.add(app);
|
|
26
|
+
return {
|
|
27
|
+
app,
|
|
28
|
+
target,
|
|
29
|
+
/** @internal */
|
|
30
|
+
async dispose() {
|
|
31
|
+
if (mounted.delete(app)) await unmount(app);
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { vi } from "vitest";
|
|
2
|
+
|
|
3
|
+
/** Drain pending microtasks and yield once to the UI. @internal */
|
|
4
|
+
export async function flushUi() {
|
|
5
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/** @internal */
|
|
9
|
+
export function waitForSelector(target: HTMLElement, selector: string, timeoutMs = 250) {
|
|
10
|
+
return vi.waitFor(
|
|
11
|
+
() => {
|
|
12
|
+
const element = target.querySelector(selector);
|
|
13
|
+
if (!(element instanceof HTMLElement))
|
|
14
|
+
throw new Error(`Timed out waiting for selector: ${selector}`);
|
|
15
|
+
return element;
|
|
16
|
+
},
|
|
17
|
+
{ timeout: timeoutMs, interval: 1 },
|
|
18
|
+
);
|
|
19
|
+
}
|