@leitwerk-dev/ui 0.1.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/dist/LICENSE +13 -0
- package/dist/assets/ChronicleMarkdown-BLgtHeEE.js +16 -0
- package/dist/assets/ChronicleMarkdown-D6hFzERy.css +1 -0
- package/dist/assets/FutureLaunchDetailPage-KrXSGzHM.js +1 -0
- package/dist/assets/FutureLaunchDetailPage-VPMBtpYc.css +1 -0
- package/dist/assets/GenericLauncher-Cv38FByt.js +1 -0
- package/dist/assets/GenericLauncher-D_GMtsQ5.css +1 -0
- package/dist/assets/HomePage-Cd3lEtwZ.js +1 -0
- package/dist/assets/HomePage-DYh_QHXv.css +1 -0
- package/dist/assets/PageHeader-6PdvYODN.css +1 -0
- package/dist/assets/PageHeader-D6pP4hIh.js +1 -0
- package/dist/assets/ProcessActionsMenu-1QySGNy9.js +1 -0
- package/dist/assets/ProcessActionsMenu-BT2r9vO8.css +1 -0
- package/dist/assets/ProcessDetailPage-BLuc7sjV.js +12 -0
- package/dist/assets/ProcessDetailPage-CSrjzajF.css +1 -0
- package/dist/assets/ProcessFlowDiagram-BAh_M_rb.js +2 -0
- package/dist/assets/ProcessFlowDiagram-Cz8wNicU.css +1 -0
- package/dist/assets/ProcessesPage-BcM38HMs.css +1 -0
- package/dist/assets/ProcessesPage-DtPweRU-.js +1 -0
- package/dist/assets/ScheduleDateTimePicker-CQGvY-Rc.js +1 -0
- package/dist/assets/ScheduleDateTimePicker-CadXN9z7.css +1 -0
- package/dist/assets/SkillsPage-B30FAFia.css +1 -0
- package/dist/assets/SkillsPage-bXuv0kEE.js +2 -0
- package/dist/assets/WatchersPage-DNyUsU1y.js +1 -0
- package/dist/assets/WatchersPage-Dnfi1zUK.css +1 -0
- package/dist/assets/api-CqECFdii.js +1 -0
- package/dist/assets/browser-storage-LbKCyf_w.js +1 -0
- package/dist/assets/dist-B7WNbObw.js +2 -0
- package/dist/assets/index-66T4Gmbl.css +1 -0
- package/dist/assets/index-C8qCggeq.js +7 -0
- package/dist/assets/index-client-BqF3_t3P.js +2 -0
- package/dist/assets/mermaid-render.worker-DAVgiVRG.js +6393 -0
- package/dist/assets/retry-config.svelte-DFKCJtCe.js +1 -0
- package/dist/assets/router.svelte-COr45o9R.js +1 -0
- package/dist/fonts/OFL-Public-Sans.txt +115 -0
- package/dist/fonts/OFL-Spectral.txt +93 -0
- package/dist/fonts/README.md +38 -0
- package/dist/fonts/fonts.css +85 -0
- package/dist/fonts/public-sans-latin-cd00287f.woff2 +0 -0
- package/dist/fonts/public-sans-latin-ext-d025d4ba.woff2 +0 -0
- package/dist/fonts/spectral-latin-89d48951.woff2 +0 -0
- package/dist/fonts/spectral-latin-b7578f14.woff2 +0 -0
- package/dist/fonts/spectral-latin-c4e0a00d.woff2 +0 -0
- package/dist/fonts/spectral-latin-ext-260738f4.woff2 +0 -0
- package/dist/fonts/spectral-latin-ext-ab18ac17.woff2 +0 -0
- package/dist/fonts/spectral-latin-ext-f58c1db3.woff2 +0 -0
- package/dist/index.html +32 -0
- package/package.json +47 -0
- package/src/App.svelte +257 -0
- package/src/chronicle/components/ChronicleActionSection.svelte +1035 -0
- package/src/chronicle/components/ChronicleExpandButton.svelte +70 -0
- package/src/chronicle/components/ChronicleFlow.svelte +289 -0
- package/src/chronicle/components/ChronicleLeafOutcomePlaceholder.svelte +44 -0
- package/src/chronicle/components/ChronicleLeafOutcomeRendererHost.svelte +408 -0
- package/src/chronicle/components/ChronicleLeafOutcomeSection.svelte +253 -0
- package/src/chronicle/components/ChronicleLiveChip.svelte +96 -0
- package/src/chronicle/components/ChronicleLiveTail.svelte +376 -0
- package/src/chronicle/components/ChronicleMarkdown.svelte +168 -0
- package/src/chronicle/components/ChronicleOperatorInputSection.svelte +41 -0
- package/src/chronicle/components/ChronicleProcessErrorSection.svelte +131 -0
- package/src/chronicle/components/ChroniclePromptSection.svelte +54 -0
- package/src/chronicle/components/ChronicleQuestionRequest.svelte +167 -0
- package/src/chronicle/components/ChronicleReasoningDetailsOverlay.svelte +893 -0
- package/src/chronicle/components/ChronicleRecoverySection.svelte +338 -0
- package/src/chronicle/components/ChronicleScheduledActionSection.svelte +192 -0
- package/src/chronicle/components/ChronicleSectionHeader.svelte +135 -0
- package/src/chronicle/components/ChronicleStartupRecoverySection.svelte +138 -0
- package/src/chronicle/components/ChronicleTerminalSummary.svelte +127 -0
- package/src/chronicle/components/ChronicleThinkingSection.svelte +191 -0
- package/src/chronicle/components/ChronicleThinkingText.svelte +46 -0
- package/src/chronicle/components/ChronicleToolCallItem.svelte +477 -0
- package/src/chronicle/components/ChronicleTurnCluster.svelte +325 -0
- package/src/chronicle/components/ChronicleTurnRail.svelte +584 -0
- package/src/chronicle/components/ChronicleUsageStats.svelte +107 -0
- package/src/chronicle/components/CompactActionComposer.svelte +417 -0
- package/src/chronicle/components/ModelProfileOptions.svelte +20 -0
- package/src/chronicle/components/ProviderOptionsEditor.svelte +171 -0
- package/src/chronicle/components/RecoveryModelControl.svelte +95 -0
- package/src/chronicle/lib/action-bindings.ts +90 -0
- package/src/chronicle/lib/action-model-display.ts +133 -0
- package/src/chronicle/lib/action-preview.ts +16 -0
- package/src/chronicle/lib/chronicle-projection.ts +1342 -0
- package/src/chronicle/lib/chronicle-selectable-items.ts +352 -0
- package/src/chronicle/lib/chronicle-view-model.ts +121 -0
- package/src/chronicle/lib/formatting.ts +18 -0
- package/src/chronicle/lib/leaf-outcome-loader.ts +214 -0
- package/src/chronicle/lib/leaf-outcome-runtime.ts +37 -0
- package/src/chronicle/lib/prompt-highlighting.ts +78 -0
- package/src/chronicle/lib/scroll-sync.ts +88 -0
- package/src/chronicle/lib/tool-call-summary.ts +64 -0
- package/src/components/BrowserUiExtensionIndicatorHost.svelte +34 -0
- package/src/components/ConversationTreeDiagram.svelte +393 -0
- package/src/components/FormFieldRenderer.svelte +359 -0
- package/src/components/GenericLauncher.svelte +1970 -0
- package/src/components/KeyboardShortcutsModal.svelte +52 -0
- package/src/components/ModalShell.svelte +105 -0
- package/src/components/PageHeader.svelte +146 -0
- package/src/components/ProcessActionsMenu.svelte +514 -0
- package/src/components/ProcessInfoOverlay.svelte +1229 -0
- package/src/components/ScheduleDateTimePicker.svelte +155 -0
- package/src/components/SkillSelector.svelte +45 -0
- package/src/components/ToastContainer.svelte +192 -0
- package/src/components/launcher-form-copy.ts +172 -0
- package/src/components/launcher-model-config.ts +263 -0
- package/src/components/launcher-schedule.ts +127 -0
- package/src/extension-ui-dev-server.ts +98 -0
- package/src/lib/api.ts +970 -0
- package/src/lib/beautiful-mermaid-elk-instance.ts +54 -0
- package/src/lib/browser-storage.ts +11 -0
- package/src/lib/cost-estimates.ts +41 -0
- package/src/lib/elk-bundled-worker.ts +41 -0
- package/src/lib/flow-layout.ts +326 -0
- package/src/lib/format.ts +96 -0
- package/src/lib/future-executions-logic.ts +12 -0
- package/src/lib/future-launch-detail.ts +145 -0
- package/src/lib/instance-tree-layout.ts +158 -0
- package/src/lib/keyboard-shortcuts-help.ts +20 -0
- package/src/lib/keyboard.ts +40 -0
- package/src/lib/launcher-recent-values.ts +68 -0
- package/src/lib/markdown.ts +94 -0
- package/src/lib/mermaid-render.worker.ts +36 -0
- package/src/lib/pi-stream.ts +3 -0
- package/src/lib/primary-path-detail.ts +337 -0
- package/src/lib/primary-path-replay.ts +27 -0
- package/src/lib/process-browser.ts +179 -0
- package/src/lib/process-initial-prompt.ts +7 -0
- package/src/lib/process-launch-notices.svelte.ts +25 -0
- package/src/lib/process-row-view.ts +60 -0
- package/src/lib/process-terminal-display.ts +17 -0
- package/src/lib/process-toast-focus.svelte.ts +18 -0
- package/src/lib/processes-logic.ts +2 -0
- package/src/lib/processes.svelte.ts +334 -0
- package/src/lib/request-guard.ts +20 -0
- package/src/lib/retry-config.svelte.ts +19 -0
- package/src/lib/rich-markdown-elements.ts +173 -0
- package/src/lib/router-logic.ts +190 -0
- package/src/lib/router.svelte.ts +56 -0
- package/src/lib/runtime-config.ts +96 -0
- package/src/lib/test-fixtures.ts +13 -0
- package/src/lib/toasts.svelte.ts +104 -0
- package/src/lib/tool-call-rendering.ts +66 -0
- package/src/lib/ui-extensions.svelte.ts +381 -0
- package/src/lib/usage-snapshot.ts +9 -0
- package/src/lib/ws-classifier.ts +80 -0
- package/src/lib/ws.svelte.ts +281 -0
- package/src/main.ts +8 -0
- package/src/pages/FutureLaunchDetailPage.svelte +479 -0
- package/src/pages/HomePage.svelte +306 -0
- package/src/pages/ProcessCard.svelte +99 -0
- package/src/pages/ProcessDetailPage.svelte +599 -0
- package/src/pages/ProcessFlowDiagram.svelte +696 -0
- package/src/pages/ProcessGallery.svelte +252 -0
- package/src/pages/ProcessesPage.svelte +994 -0
- package/src/pages/SkillsPage.svelte +665 -0
- package/src/pages/WatchersPage.svelte +330 -0
- package/src/pages/process-detail/OverlayFrame.svelte +58 -0
- package/src/pages/process-detail/ProcessDetailChronicle.svelte +460 -0
- package/src/pages/process-detail/ProcessDetailHeader.svelte +167 -0
- package/src/pages/process-detail/process-detail-action-drafts.svelte.ts +211 -0
- package/src/pages/process-detail/process-detail-actions.svelte.ts +548 -0
- package/src/pages/process-detail/process-detail-chronicle-dom.ts +102 -0
- package/src/pages/process-detail/process-detail-chronicle-scroll.svelte.ts +711 -0
- package/src/pages/process-detail/process-detail-mutations.svelte.ts +91 -0
- package/src/pages/process-detail/process-detail-view-model.ts +149 -0
- package/src/shell/AppShell.svelte +249 -0
- package/src/shell/RouteLoadBoundary.svelte +43 -0
- package/src/shell/Sidebar.svelte +1358 -0
- package/src/shell/test-fixtures/RouteLoadTestComponent.svelte +5 -0
- package/src/vite-env.d.ts +2 -0
- package/src/vite-server-config.ts +27 -0
|
@@ -0,0 +1,514 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { tick } from "svelte";
|
|
3
|
+
import {
|
|
4
|
+
fetchProcessRetryConfig,
|
|
5
|
+
postProcessAbort,
|
|
6
|
+
deleteProcess as requestProcessDeletion,
|
|
7
|
+
} from "../lib/api.js";
|
|
8
|
+
import { keyboardShortcutHelpOpen } from "../lib/keyboard-shortcuts-help.js";
|
|
9
|
+
import { setPendingRetryConfig } from "../lib/retry-config.svelte.js";
|
|
10
|
+
import { buildHomePath, navigate } from "../lib/router.svelte.js";
|
|
11
|
+
import { resolveApiUrl } from "../lib/runtime-config.js";
|
|
12
|
+
|
|
13
|
+
interface Props {
|
|
14
|
+
instanceId: string;
|
|
15
|
+
lifecycleStatus: string | null;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
hasSessionFile?: boolean;
|
|
18
|
+
processLabel: string;
|
|
19
|
+
onDeleted?: () => void;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
let {
|
|
23
|
+
instanceId,
|
|
24
|
+
lifecycleStatus,
|
|
25
|
+
disabled = false,
|
|
26
|
+
hasSessionFile = false,
|
|
27
|
+
processLabel,
|
|
28
|
+
onDeleted,
|
|
29
|
+
}: Props = $props();
|
|
30
|
+
|
|
31
|
+
let menuOpen = $state(false);
|
|
32
|
+
let confirmation = $state<"abort" | "abort-and-retry" | "delete" | null>(null);
|
|
33
|
+
let busy = $state(false);
|
|
34
|
+
let error = $state<string | null>(null);
|
|
35
|
+
|
|
36
|
+
let menuRef = $state<HTMLDivElement | null>(null);
|
|
37
|
+
let triggerRef = $state<HTMLButtonElement | null>(null);
|
|
38
|
+
let dropdownRef = $state<HTMLDivElement | null>(null);
|
|
39
|
+
|
|
40
|
+
const isFinished = $derived(lifecycleStatus === "completed" || lifecycleStatus === "aborted");
|
|
41
|
+
const actionTarget = $derived(processLabel.trim() || `process ${instanceId}`);
|
|
42
|
+
const triggerId = $derived(`process-actions-trigger-${instanceId}`);
|
|
43
|
+
const menuId = $derived(`process-actions-menu-${instanceId}`);
|
|
44
|
+
const confirmationView = $derived({
|
|
45
|
+
message:
|
|
46
|
+
confirmation === "abort"
|
|
47
|
+
? `Abort ${actionTarget}? This can’t be undone.`
|
|
48
|
+
: confirmation === "delete"
|
|
49
|
+
? `Permanently delete ${actionTarget}? ${isFinished ? "" : "Active work will be stopped first. "}History and managed stored artifacts will be permanently removed. This can’t be undone.`
|
|
50
|
+
: `Abort ${actionTarget}, then prepare a new process with the same setup. Existing history will remain available.`,
|
|
51
|
+
cancelLabel: confirmation === "abort" ? "Keep process running" : "Keep current process",
|
|
52
|
+
buttonLabel:
|
|
53
|
+
confirmation === "abort"
|
|
54
|
+
? busy
|
|
55
|
+
? "Aborting…"
|
|
56
|
+
: "Abort process"
|
|
57
|
+
: confirmation === "delete"
|
|
58
|
+
? busy
|
|
59
|
+
? "Deleting…"
|
|
60
|
+
: "Delete process"
|
|
61
|
+
: busy
|
|
62
|
+
? "Working…"
|
|
63
|
+
: "Abort & retry",
|
|
64
|
+
action:
|
|
65
|
+
confirmation === "abort"
|
|
66
|
+
? handleAbort
|
|
67
|
+
: confirmation === "delete"
|
|
68
|
+
? handleDelete
|
|
69
|
+
: handleAbortAndRetry,
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
function toggleMenu() {
|
|
73
|
+
if (disabled || busy) return;
|
|
74
|
+
menuOpen = !menuOpen;
|
|
75
|
+
confirmation = null;
|
|
76
|
+
error = null;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function closeMenu(options: { restoreFocus?: boolean } = {}) {
|
|
80
|
+
menuOpen = false;
|
|
81
|
+
confirmation = null;
|
|
82
|
+
error = null;
|
|
83
|
+
if (options.restoreFocus) {
|
|
84
|
+
queueMicrotask(() => triggerRef?.focus());
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function handleClickOutside(event: MouseEvent) {
|
|
89
|
+
if (menuRef && !menuRef.contains(event.target as Node)) {
|
|
90
|
+
closeMenu();
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function handleKeydown(event: KeyboardEvent) {
|
|
95
|
+
if (event.defaultPrevented || $keyboardShortcutHelpOpen) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
if (event.key === "Escape") {
|
|
99
|
+
closeMenu({ restoreFocus: true });
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function focusFirstMenuControl() {
|
|
104
|
+
const firstControl = dropdownRef?.querySelector<HTMLButtonElement>("button:not([disabled])");
|
|
105
|
+
firstControl?.focus();
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function handleMenuKeydown(event: KeyboardEvent) {
|
|
109
|
+
if (event.key === "Escape") {
|
|
110
|
+
event.preventDefault();
|
|
111
|
+
closeMenu({ restoreFocus: true });
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
if (event.key !== "ArrowDown" && event.key !== "ArrowUp") {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
const controls = dropdownRef
|
|
118
|
+
? [...dropdownRef.querySelectorAll<HTMLButtonElement>("button:not([disabled])")]
|
|
119
|
+
: [];
|
|
120
|
+
if (controls.length === 0) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
const currentIndex = controls.indexOf(document.activeElement as HTMLButtonElement);
|
|
124
|
+
const nextIndex =
|
|
125
|
+
event.key === "ArrowDown"
|
|
126
|
+
? currentIndex < controls.length - 1
|
|
127
|
+
? currentIndex + 1
|
|
128
|
+
: 0
|
|
129
|
+
: currentIndex > 0
|
|
130
|
+
? currentIndex - 1
|
|
131
|
+
: controls.length - 1;
|
|
132
|
+
event.preventDefault();
|
|
133
|
+
controls[nextIndex]?.focus();
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
$effect(() => {
|
|
137
|
+
if (menuOpen) {
|
|
138
|
+
void tick().then(focusFirstMenuControl);
|
|
139
|
+
document.addEventListener("click", handleClickOutside, true);
|
|
140
|
+
document.addEventListener("keydown", handleKeydown);
|
|
141
|
+
return () => {
|
|
142
|
+
document.removeEventListener("click", handleClickOutside, true);
|
|
143
|
+
document.removeEventListener("keydown", handleKeydown);
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
async function runBusy(work: () => Promise<void>, fallbackError: string) {
|
|
149
|
+
busy = true;
|
|
150
|
+
error = null;
|
|
151
|
+
try {
|
|
152
|
+
await work();
|
|
153
|
+
} catch (e) {
|
|
154
|
+
error = e instanceof Error ? e.message : fallbackError;
|
|
155
|
+
} finally {
|
|
156
|
+
busy = false;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
async function handleAbort() {
|
|
161
|
+
if (confirmation !== "abort") {
|
|
162
|
+
confirmation = "abort";
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
await runBusy(async () => {
|
|
166
|
+
await postProcessAbort(instanceId);
|
|
167
|
+
closeMenu();
|
|
168
|
+
}, "Couldn't abort process");
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
function cancelConfirmation() {
|
|
172
|
+
confirmation = null;
|
|
173
|
+
error = null;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
async function handleDelete() {
|
|
177
|
+
if (confirmation !== "delete") {
|
|
178
|
+
confirmation = "delete";
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
await runBusy(async () => {
|
|
182
|
+
await requestProcessDeletion(instanceId);
|
|
183
|
+
closeMenu();
|
|
184
|
+
onDeleted?.();
|
|
185
|
+
}, "Couldn't delete process");
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
async function handleRetry() {
|
|
189
|
+
await runBusy(async () => {
|
|
190
|
+
const config = await fetchProcessRetryConfig(instanceId);
|
|
191
|
+
setPendingRetryConfig(config);
|
|
192
|
+
navigate(buildHomePath(config.launcherId));
|
|
193
|
+
}, "Couldn't load retry config");
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
async function handleAbortAndRetry() {
|
|
197
|
+
if (confirmation !== "abort-and-retry") {
|
|
198
|
+
confirmation = "abort-and-retry";
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
await runBusy(async () => {
|
|
202
|
+
const config = await fetchProcessRetryConfig(instanceId);
|
|
203
|
+
await postProcessAbort(instanceId);
|
|
204
|
+
setPendingRetryConfig(config);
|
|
205
|
+
navigate(buildHomePath(config.launcherId));
|
|
206
|
+
}, "Couldn't abort and retry");
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
function handleDownloadSession() {
|
|
210
|
+
const url = resolveApiUrl(`/api/processes/${encodeURIComponent(instanceId)}/session`);
|
|
211
|
+
window.open(url, "_blank");
|
|
212
|
+
closeMenu();
|
|
213
|
+
}
|
|
214
|
+
</script>
|
|
215
|
+
|
|
216
|
+
<div class="process-actions-menu" bind:this={menuRef}>
|
|
217
|
+
<button
|
|
218
|
+
bind:this={triggerRef}
|
|
219
|
+
id={triggerId}
|
|
220
|
+
type="button"
|
|
221
|
+
class="menu-trigger"
|
|
222
|
+
data-pressable="true"
|
|
223
|
+
aria-haspopup="menu"
|
|
224
|
+
aria-controls={menuOpen ? menuId : undefined}
|
|
225
|
+
aria-expanded={menuOpen}
|
|
226
|
+
disabled={disabled || busy}
|
|
227
|
+
onclick={toggleMenu}
|
|
228
|
+
aria-label={`Open actions for ${actionTarget}`}
|
|
229
|
+
title={`Actions for ${actionTarget}`}
|
|
230
|
+
>
|
|
231
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
232
|
+
<circle cx="12" cy="12" r="3"></circle>
|
|
233
|
+
<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path>
|
|
234
|
+
</svg>
|
|
235
|
+
<span class="menu-trigger-label">More actions</span>
|
|
236
|
+
</button>
|
|
237
|
+
|
|
238
|
+
{#if menuOpen}
|
|
239
|
+
<div
|
|
240
|
+
id={menuId}
|
|
241
|
+
class="menu-dropdown"
|
|
242
|
+
role="menu"
|
|
243
|
+
aria-labelledby={triggerId}
|
|
244
|
+
tabindex="-1"
|
|
245
|
+
bind:this={dropdownRef}
|
|
246
|
+
onkeydown={handleMenuKeydown}
|
|
247
|
+
>
|
|
248
|
+
<p class="menu-context">Actions for {actionTarget}.</p>
|
|
249
|
+
{#if error}
|
|
250
|
+
<p class="menu-error" role="alert">{error}</p>
|
|
251
|
+
{/if}
|
|
252
|
+
|
|
253
|
+
{#if confirmation}
|
|
254
|
+
<div class="confirm-panel">
|
|
255
|
+
<p class="confirm-message">{confirmationView.message}</p>
|
|
256
|
+
<div class="confirm-actions">
|
|
257
|
+
<button
|
|
258
|
+
type="button"
|
|
259
|
+
class="confirm-cancel"
|
|
260
|
+
data-pressable="true"
|
|
261
|
+
disabled={busy}
|
|
262
|
+
onclick={cancelConfirmation}
|
|
263
|
+
>
|
|
264
|
+
{confirmationView.cancelLabel}
|
|
265
|
+
</button>
|
|
266
|
+
<button
|
|
267
|
+
type="button"
|
|
268
|
+
class="confirm-danger"
|
|
269
|
+
data-pressable="true"
|
|
270
|
+
disabled={busy}
|
|
271
|
+
onclick={confirmationView.action}
|
|
272
|
+
>
|
|
273
|
+
{confirmationView.buttonLabel}
|
|
274
|
+
</button>
|
|
275
|
+
</div>
|
|
276
|
+
</div>
|
|
277
|
+
{:else}
|
|
278
|
+
{#if hasSessionFile}
|
|
279
|
+
<button
|
|
280
|
+
type="button"
|
|
281
|
+
class="menu-item"
|
|
282
|
+
role="menuitem"
|
|
283
|
+
data-pressable="true"
|
|
284
|
+
disabled={busy}
|
|
285
|
+
onclick={handleDownloadSession}
|
|
286
|
+
>
|
|
287
|
+
Download Pi session (.jsonl)
|
|
288
|
+
</button>
|
|
289
|
+
<div class="menu-divider" role="separator"></div>
|
|
290
|
+
{/if}
|
|
291
|
+
{#if !isFinished}
|
|
292
|
+
<button
|
|
293
|
+
type="button"
|
|
294
|
+
class="menu-item"
|
|
295
|
+
role="menuitem"
|
|
296
|
+
data-pressable="true"
|
|
297
|
+
disabled={busy}
|
|
298
|
+
onclick={handleAbort}
|
|
299
|
+
>
|
|
300
|
+
Abort process
|
|
301
|
+
</button>
|
|
302
|
+
{/if}
|
|
303
|
+
<button
|
|
304
|
+
type="button"
|
|
305
|
+
class="menu-item"
|
|
306
|
+
role="menuitem"
|
|
307
|
+
data-pressable="true"
|
|
308
|
+
disabled={busy}
|
|
309
|
+
onclick={handleRetry}
|
|
310
|
+
>
|
|
311
|
+
{busy ? "Loading…" : "Retry as new process"}
|
|
312
|
+
</button>
|
|
313
|
+
{#if !isFinished}
|
|
314
|
+
<button
|
|
315
|
+
type="button"
|
|
316
|
+
class="menu-item"
|
|
317
|
+
role="menuitem"
|
|
318
|
+
data-pressable="true"
|
|
319
|
+
disabled={busy}
|
|
320
|
+
onclick={handleAbortAndRetry}
|
|
321
|
+
>
|
|
322
|
+
Abort and retry as new process
|
|
323
|
+
</button>
|
|
324
|
+
{/if}
|
|
325
|
+
<div class="menu-divider" role="separator"></div>
|
|
326
|
+
<button
|
|
327
|
+
type="button"
|
|
328
|
+
class="menu-item menu-item-danger"
|
|
329
|
+
role="menuitem"
|
|
330
|
+
data-pressable="true"
|
|
331
|
+
disabled={busy}
|
|
332
|
+
onclick={handleDelete}
|
|
333
|
+
>
|
|
334
|
+
Delete process
|
|
335
|
+
</button>
|
|
336
|
+
{/if}
|
|
337
|
+
</div>
|
|
338
|
+
{/if}
|
|
339
|
+
</div>
|
|
340
|
+
|
|
341
|
+
<style>
|
|
342
|
+
.process-actions-menu {
|
|
343
|
+
position: relative;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.menu-trigger {
|
|
347
|
+
display: inline-flex;
|
|
348
|
+
align-items: center;
|
|
349
|
+
justify-content: center;
|
|
350
|
+
gap: 7px;
|
|
351
|
+
min-height: 38px;
|
|
352
|
+
padding: 0 12px;
|
|
353
|
+
border: 1px solid color-mix(in srgb, var(--chronicle-border) 88%, transparent 12%);
|
|
354
|
+
border-radius: 999px;
|
|
355
|
+
background: color-mix(in srgb, var(--chronicle-card-surface) 76%, transparent 24%);
|
|
356
|
+
color: var(--chronicle-text-muted);
|
|
357
|
+
font: inherit;
|
|
358
|
+
font-size: var(--type-body-sm, 13px);
|
|
359
|
+
font-weight: 620;
|
|
360
|
+
white-space: nowrap;
|
|
361
|
+
cursor: pointer;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
.menu-trigger:hover:not(:disabled) {
|
|
365
|
+
background: color-mix(in srgb, var(--chronicle-panel-muted) 60%, transparent 40%);
|
|
366
|
+
color: var(--chronicle-text);
|
|
367
|
+
border-color: var(--chronicle-border);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
.menu-trigger:disabled {
|
|
371
|
+
opacity: 0.5;
|
|
372
|
+
cursor: default;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
.menu-trigger[aria-expanded="true"] {
|
|
376
|
+
background: var(--chronicle-panel-muted);
|
|
377
|
+
color: var(--chronicle-text);
|
|
378
|
+
border-color: var(--chronicle-border-strong);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
.menu-dropdown {
|
|
382
|
+
position: absolute;
|
|
383
|
+
top: calc(100% + 6px);
|
|
384
|
+
right: 0;
|
|
385
|
+
z-index: 100;
|
|
386
|
+
min-width: 248px;
|
|
387
|
+
padding: 8px;
|
|
388
|
+
border: 1px solid var(--chronicle-border-strong);
|
|
389
|
+
border-radius: 12px;
|
|
390
|
+
background: var(--chronicle-card-surface);
|
|
391
|
+
box-shadow: var(--chronicle-shadow);
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
.menu-context {
|
|
395
|
+
margin: 0 0 6px;
|
|
396
|
+
padding: 6px 8px 8px;
|
|
397
|
+
border-bottom: 1px solid var(--chronicle-border);
|
|
398
|
+
font-size: var(--type-caption, 12px);
|
|
399
|
+
font-weight: 700;
|
|
400
|
+
line-height: 1.35;
|
|
401
|
+
color: var(--chronicle-text-faint);
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
.menu-item {
|
|
405
|
+
display: block;
|
|
406
|
+
width: 100%;
|
|
407
|
+
padding: 10px 12px;
|
|
408
|
+
border: none;
|
|
409
|
+
border-radius: 8px;
|
|
410
|
+
background: transparent;
|
|
411
|
+
color: var(--chronicle-text);
|
|
412
|
+
font: inherit;
|
|
413
|
+
font-size: var(--type-body-sm, 13px);
|
|
414
|
+
font-weight: 750;
|
|
415
|
+
text-align: left;
|
|
416
|
+
cursor: pointer;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
.menu-item:hover:not(:disabled) {
|
|
420
|
+
background: var(--chronicle-panel-muted);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
.menu-item-danger {
|
|
424
|
+
color: var(--chronicle-danger-text);
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
.menu-item-danger:hover:not(:disabled) {
|
|
428
|
+
background: var(--chronicle-danger-surface);
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
.menu-item:disabled {
|
|
432
|
+
opacity: 0.5;
|
|
433
|
+
cursor: default;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
.menu-divider {
|
|
437
|
+
height: 1px;
|
|
438
|
+
margin: 6px 0;
|
|
439
|
+
background: var(--chronicle-border);
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
.menu-error {
|
|
443
|
+
margin: 0 0 8px;
|
|
444
|
+
padding: 10px 12px;
|
|
445
|
+
border-radius: 10px;
|
|
446
|
+
background: var(--chronicle-danger-surface);
|
|
447
|
+
border: 1px solid var(--chronicle-danger-border);
|
|
448
|
+
font-size: 13px;
|
|
449
|
+
line-height: 1.45;
|
|
450
|
+
color: var(--chronicle-danger-text);
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
.confirm-panel {
|
|
454
|
+
padding: 12px;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
.confirm-message {
|
|
458
|
+
margin: 0 0 12px;
|
|
459
|
+
font-size: var(--type-body-sm, 13px);
|
|
460
|
+
font-weight: 650;
|
|
461
|
+
line-height: 1.5;
|
|
462
|
+
color: var(--chronicle-text);
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
.confirm-actions {
|
|
466
|
+
display: flex;
|
|
467
|
+
gap: 8px;
|
|
468
|
+
justify-content: flex-end;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
.confirm-cancel,
|
|
472
|
+
.confirm-danger {
|
|
473
|
+
min-height: 36px;
|
|
474
|
+
padding: 0 14px;
|
|
475
|
+
border-radius: 999px;
|
|
476
|
+
font: inherit;
|
|
477
|
+
font-size: 13px;
|
|
478
|
+
font-weight: 600;
|
|
479
|
+
cursor: pointer;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
.confirm-cancel {
|
|
483
|
+
border: 1px solid var(--chronicle-border-strong);
|
|
484
|
+
background: var(--chronicle-card-surface);
|
|
485
|
+
color: var(--chronicle-text);
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
.confirm-cancel:hover:not(:disabled) {
|
|
489
|
+
background: var(--chronicle-panel-muted);
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
.confirm-danger {
|
|
493
|
+
border: 1px solid var(--chronicle-danger-border);
|
|
494
|
+
background: var(--chronicle-danger);
|
|
495
|
+
color: var(--chronicle-text-on-accent);
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
.confirm-danger:hover:not(:disabled) {
|
|
499
|
+
opacity: 0.9;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
.confirm-cancel:disabled,
|
|
503
|
+
.confirm-danger:disabled {
|
|
504
|
+
opacity: 0.5;
|
|
505
|
+
cursor: default;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
@media (max-width: 720px) {
|
|
509
|
+
.process-actions-menu,
|
|
510
|
+
.menu-trigger {
|
|
511
|
+
width: 100%;
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
</style>
|