@leitwerk-dev/ui 0.1.9 → 0.2.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.
Files changed (170) hide show
  1. package/dist/assets/ApiTokensPage-B15IzsLp.css +1 -0
  2. package/dist/assets/ApiTokensPage-ClJp9PYr.js +1 -0
  3. package/dist/assets/ChronicleMarkdown-lqwX9Ywa.js +16 -0
  4. package/dist/assets/ChronicleMarkdown-wsUF8Z75.css +1 -0
  5. package/dist/assets/FutureLaunchDetailPage-BOoZaG11.css +1 -0
  6. package/dist/assets/FutureLaunchDetailPage-Bdlgm4cJ.js +1 -0
  7. package/dist/assets/GenericLauncher-Bf7Eb1Rw.js +1 -0
  8. package/dist/assets/GenericLauncher-CExW6wei.css +1 -0
  9. package/dist/assets/HomePage-CSkNdC4m.js +1 -0
  10. package/dist/assets/PageHeader-DPuQInDo.css +1 -0
  11. package/dist/assets/PageHeader-sphJnWL1.js +1 -0
  12. package/dist/assets/ProcessActionsMenu-DLMywI9c.js +1 -0
  13. package/dist/assets/ProcessActionsMenu-VKT7PE6z.css +1 -0
  14. package/dist/assets/ProcessDetailPage-Cth6A0DN.css +1 -0
  15. package/dist/assets/ProcessDetailPage-fvvdvO19.js +14 -0
  16. package/dist/assets/ProcessFlowDiagram-Dx2wheGN.js +2 -0
  17. package/dist/assets/ProcessesPage-uLl7LXp8.js +1 -0
  18. package/dist/assets/ProcessesPage-yPjjrzjg.css +1 -0
  19. package/dist/assets/ScheduleDateTimePicker-DmojMRxN.js +1 -0
  20. package/dist/assets/{ScheduleDateTimePicker-CadXN9z7.css → ScheduleDateTimePicker-uacJAkIq.css} +1 -1
  21. package/dist/assets/SkillsPage-CJrtt8xU.css +1 -0
  22. package/dist/assets/SkillsPage-CotbGUxm.js +2 -0
  23. package/dist/assets/WatchersPage-ByWGNJet.js +1 -0
  24. package/dist/assets/WatchersPage-cRBnmTAD.css +1 -0
  25. package/dist/assets/external-links-CX92-VRP.js +1 -0
  26. package/dist/assets/http-client-VpPXJwbR.js +2 -0
  27. package/dist/assets/index-C7zNe3je.js +6 -0
  28. package/dist/assets/index-DtEI5gsQ.css +1 -0
  29. package/dist/assets/index-client-BYQviCtQ.js +2 -0
  30. package/dist/assets/{mermaid-render.worker-DAVgiVRG.js → mermaid-render.worker-QW2WZpEE.js} +12 -12
  31. package/dist/assets/process-terminal-display-BQRQwGod.js +1 -0
  32. package/dist/assets/router.svelte-EEldxHlO.js +1 -0
  33. package/dist/index.html +8 -8
  34. package/package.json +8 -8
  35. package/src/App.svelte +36 -0
  36. package/src/chronicle/components/ChronicleActionSection.svelte +70 -143
  37. package/src/chronicle/components/ChronicleCreateIssueButton.svelte +22 -0
  38. package/src/chronicle/components/ChronicleEntryHeader.svelte +76 -0
  39. package/src/chronicle/components/ChronicleExpandButton.svelte +11 -34
  40. package/src/chronicle/components/ChronicleFailureMessage.svelte +41 -0
  41. package/src/chronicle/components/ChronicleFlow.svelte +133 -28
  42. package/src/chronicle/components/ChronicleLeafOutcomeRendererHost.svelte +1 -8
  43. package/src/chronicle/components/ChronicleLeafOutcomeSection.svelte +25 -52
  44. package/src/chronicle/components/ChronicleLiveChip.svelte +1 -35
  45. package/src/chronicle/components/ChronicleLiveTail.svelte +55 -154
  46. package/src/chronicle/components/ChronicleMarkdown.svelte +6 -6
  47. package/src/chronicle/components/ChronicleOperatorInputSection.svelte +5 -18
  48. package/src/chronicle/components/ChronicleProcessErrorSection.svelte +10 -107
  49. package/src/chronicle/components/ChroniclePromptSection.svelte +6 -26
  50. package/src/chronicle/components/ChronicleQuestionRequest.svelte +22 -5
  51. package/src/chronicle/components/ChronicleReasoningDetailsOverlay.svelte +71 -109
  52. package/src/chronicle/components/ChronicleRecoverySection.svelte +96 -264
  53. package/src/chronicle/components/ChronicleScheduledActionSection.svelte +1 -1
  54. package/src/chronicle/components/ChronicleSectionHeader.svelte +1 -4
  55. package/src/chronicle/components/ChronicleStartupHistory.svelte +63 -0
  56. package/src/chronicle/components/ChronicleStartupRecoverySection.svelte +10 -26
  57. package/src/chronicle/components/ChronicleThinkingSection.svelte +25 -165
  58. package/src/chronicle/components/ChronicleThinkingText.svelte +1 -0
  59. package/src/chronicle/components/ChronicleToolApproval.svelte +40 -0
  60. package/src/chronicle/components/ChronicleToolCallItem.svelte +1 -1
  61. package/src/chronicle/components/ChronicleTurnCluster.svelte +208 -284
  62. package/src/chronicle/components/ChronicleTurnDetailsButton.svelte +16 -0
  63. package/src/chronicle/components/ChronicleTurnProgress.svelte +77 -54
  64. package/src/chronicle/components/ChronicleTurnRail.svelte +327 -391
  65. package/src/chronicle/components/CompactActionComposer.svelte +36 -13
  66. package/src/chronicle/components/ReadonlyJsonValue.svelte +30 -0
  67. package/src/chronicle/lib/action-bindings.ts +1 -1
  68. package/src/chronicle/lib/action-model-display.ts +2 -2
  69. package/src/chronicle/lib/action-preview.ts +1 -1
  70. package/src/chronicle/lib/chronicle-projection.ts +125 -109
  71. package/src/chronicle/lib/chronicle-rail-groups.ts +158 -0
  72. package/src/chronicle/lib/chronicle-selectable-items.ts +16 -11
  73. package/src/chronicle/lib/chronicle-ticket-artifact.ts +7 -0
  74. package/src/chronicle/lib/formatting.ts +19 -0
  75. package/src/chronicle/lib/leaf-outcome-loader.ts +30 -111
  76. package/src/chronicle/lib/leaf-outcome-runtime.ts +3 -15
  77. package/src/chronicle/lib/result-presentation.ts +40 -0
  78. package/src/chronicle/lib/retry-groups.ts +24 -0
  79. package/src/chronicle/lib/scroll-sync.ts +1 -0
  80. package/src/chronicle/lib/tool-call-summary.ts +1 -9
  81. package/src/chronicle/ticket-selection.ts +23 -0
  82. package/src/components/ElapsedTime.svelte +31 -0
  83. package/src/components/ExternalLink.svelte +39 -0
  84. package/src/components/FormFieldRenderer.svelte +4 -1
  85. package/src/components/GenericLauncher.svelte +40 -15
  86. package/src/components/KeyboardShortcutsModal.svelte +2 -2
  87. package/src/components/LaunchChecklist.svelte +184 -0
  88. package/src/components/ModalShell.svelte +43 -32
  89. package/src/components/PageHeader.svelte +7 -33
  90. package/src/components/ProcessActionsMenu.svelte +217 -140
  91. package/src/components/ProcessInfoOverlay.svelte +13 -21
  92. package/src/components/ProgressChecklist.svelte +46 -0
  93. package/src/components/ProgressChecklistRows.svelte +80 -0
  94. package/src/components/launcher-form-copy.ts +4 -1
  95. package/src/components/launcher-model-config.ts +1 -1
  96. package/src/extension-ui-dev-server.ts +2 -5
  97. package/src/lib/api-tokens.ts +34 -0
  98. package/src/lib/api.ts +323 -455
  99. package/src/lib/elapsed-time.ts +19 -0
  100. package/src/lib/external-links.ts +81 -0
  101. package/src/lib/flow-layout.ts +1 -8
  102. package/src/lib/format.ts +3 -26
  103. package/src/lib/future-launch-detail.ts +1 -1
  104. package/src/lib/http-client.ts +79 -0
  105. package/src/lib/launch-updates.ts +17 -0
  106. package/src/lib/markdown.ts +8 -1
  107. package/src/lib/primary-path-detail.ts +97 -3
  108. package/src/lib/primary-path-replay.ts +13 -7
  109. package/src/lib/process-row-view.ts +1 -1
  110. package/src/lib/process-terminal-display.ts +4 -7
  111. package/src/lib/processes.svelte.ts +41 -9
  112. package/src/lib/reasoning-history.ts +95 -0
  113. package/src/lib/retry-config.svelte.ts +1 -1
  114. package/src/lib/rich-markdown-elements.ts +2 -2
  115. package/src/lib/router-logic.ts +3 -0
  116. package/src/lib/runtime-config.ts +1 -3
  117. package/src/lib/test-fixtures.ts +1 -1
  118. package/src/lib/tool-call-rendering.ts +4 -1
  119. package/src/lib/ui-extensions.svelte.ts +78 -127
  120. package/src/lib/ws-classifier.ts +8 -1
  121. package/src/pages/ApiTokensPage.svelte +213 -0
  122. package/src/pages/FutureLaunchDetailPage.svelte +7 -35
  123. package/src/pages/HomePage.svelte +7 -7
  124. package/src/pages/ProcessCard.svelte +1 -1
  125. package/src/pages/ProcessDetailPage.svelte +158 -62
  126. package/src/pages/ProcessGallery.svelte +1 -1
  127. package/src/pages/ProcessesPage.svelte +7 -42
  128. package/src/pages/SkillsPage.svelte +37 -26
  129. package/src/pages/WatchersPage.svelte +31 -53
  130. package/src/pages/process-detail/ProcessDetailChronicle.svelte +125 -28
  131. package/src/pages/process-detail/ProcessDetailHeader.svelte +24 -2
  132. package/src/pages/process-detail/ProcessSummary.svelte +35 -0
  133. package/src/pages/process-detail/TicketCreationComposer.svelte +219 -0
  134. package/src/pages/process-detail/process-detail-action-drafts.svelte.ts +5 -5
  135. package/src/pages/process-detail/process-detail-actions.svelte.ts +4 -2
  136. package/src/pages/process-detail/process-detail-chronicle-dom.ts +39 -14
  137. package/src/pages/process-detail/process-detail-chronicle-scroll.svelte.ts +68 -10
  138. package/src/pages/process-detail/process-detail-view-model.ts +10 -24
  139. package/src/shell/AppShell.svelte +4 -1
  140. package/src/shell/Sidebar.svelte +88 -125
  141. package/src/styles/controls.css +188 -0
  142. package/dist/assets/ChronicleMarkdown-B1hD4HFS.js +0 -16
  143. package/dist/assets/ChronicleMarkdown-D6hFzERy.css +0 -1
  144. package/dist/assets/FutureLaunchDetailPage-Dy3FlLih.js +0 -1
  145. package/dist/assets/FutureLaunchDetailPage-UFgp7Ju4.css +0 -1
  146. package/dist/assets/GenericLauncher-BPEQjJ1J.js +0 -1
  147. package/dist/assets/GenericLauncher-D_GMtsQ5.css +0 -1
  148. package/dist/assets/HomePage-E41Krxko.js +0 -1
  149. package/dist/assets/PageHeader-DDgWPeHS.js +0 -1
  150. package/dist/assets/PageHeader-vhyfX7xT.css +0 -1
  151. package/dist/assets/ProcessActionsMenu-BWlFe5c4.css +0 -1
  152. package/dist/assets/ProcessActionsMenu-cI0j2LWe.js +0 -1
  153. package/dist/assets/ProcessDetailPage-DVHldJgi.js +0 -12
  154. package/dist/assets/ProcessDetailPage-Oh6ld320.css +0 -1
  155. package/dist/assets/ProcessFlowDiagram-C6m6V_cB.js +0 -2
  156. package/dist/assets/ProcessesPage-B2QGyCZO.js +0 -1
  157. package/dist/assets/ProcessesPage-BcM38HMs.css +0 -1
  158. package/dist/assets/ScheduleDateTimePicker-aey_oMiH.js +0 -1
  159. package/dist/assets/SkillsPage-MPITMvhn.css +0 -1
  160. package/dist/assets/SkillsPage-iB4sbq7r.js +0 -2
  161. package/dist/assets/WatchersPage-BOSgjtw0.css +0 -1
  162. package/dist/assets/WatchersPage-l0rwv-Nx.js +0 -1
  163. package/dist/assets/api-CtKbU0lT.js +0 -1
  164. package/dist/assets/dist-eOPUi0B8.js +0 -2
  165. package/dist/assets/index-B4flHG_s.js +0 -7
  166. package/dist/assets/index-DunTIQSW.css +0 -1
  167. package/dist/assets/index-client-CnG8mWmF.js +0 -2
  168. package/dist/assets/retry-config.svelte-WukHimiy.js +0 -1
  169. package/dist/assets/router.svelte-2RvxUvs5.js +0 -1
  170. package/src/lib/process-initial-prompt.ts +0 -7
@@ -1,10 +1,15 @@
1
1
  <script lang="ts">
2
+ import type { SessionTransferOperationView } from "@leitwerk-dev/protocol/http-contracts";
2
3
  import { tick } from "svelte";
3
4
  import {
5
+ cancelSessionTransfer,
6
+ createSessionTransferGrant,
4
7
  fetchProcessRetryConfig,
5
8
  postProcessAbort,
6
9
  deleteProcess as requestProcessDeletion,
10
+ type SessionTransferGrantResponse,
7
11
  } from "../lib/api.js";
12
+ import { NEW_TAB_WINDOW_FEATURES } from "../lib/external-links.js";
8
13
  import { keyboardShortcutHelpOpen } from "../lib/keyboard-shortcuts-help.js";
9
14
  import { setPendingRetryConfig } from "../lib/retry-config.svelte.js";
10
15
  import { buildHomePath, navigate } from "../lib/router.svelte.js";
@@ -19,6 +24,7 @@ interface Props {
19
24
  onDeleted?: () => void;
20
25
  presentation?: "default" | "sheet";
21
26
  idSuffix?: string;
27
+ sessionTransfer?: SessionTransferOperationView | null;
22
28
  }
23
29
 
24
30
  let {
@@ -30,26 +36,64 @@ let {
30
36
  onDeleted,
31
37
  presentation = "default",
32
38
  idSuffix = "",
39
+ sessionTransfer = null,
33
40
  }: Props = $props();
34
41
 
35
42
  let menuOpen = $state(false);
36
43
  let confirmation = $state<"abort" | "abort-and-retry" | "delete" | null>(null);
37
44
  let busy = $state(false);
38
45
  let error = $state<string | null>(null);
46
+ let transferGrant = $state<SessionTransferGrantResponse | null>(null);
47
+ let copyStatus = $state<"idle" | "copied" | "failed">("idle");
48
+ let locallyCancelledAttemptId = $state<string | null>(null);
39
49
 
40
50
  let menuRef = $state<HTMLDivElement | null>(null);
41
51
  let triggerRef = $state<HTMLButtonElement | null>(null);
42
52
  let dropdownRef = $state<HTMLDivElement | null>(null);
53
+ let transferLinkRef = $state<HTMLInputElement | null>(null);
43
54
 
44
55
  const isFinished = $derived(lifecycleStatus === "completed" || lifecycleStatus === "aborted");
45
56
  const actionTarget = $derived(processLabel.trim() || `process ${instanceId}`);
57
+ const activeTransfer = $derived(
58
+ sessionTransfer?.attemptId === locallyCancelledAttemptId ? null : sessionTransfer,
59
+ );
60
+
61
+ function phaseLabel(phase: string): string {
62
+ return (
63
+ (
64
+ {
65
+ queued: "Queued",
66
+ waiting_for_execution_chain: "Waiting for execution",
67
+ stopping_worker: "Stopping worker",
68
+ starting_exporter: "Starting exporter",
69
+ scanning: "Scanning",
70
+ ready_to_stream: "Ready to stream",
71
+ streaming: "Streaming",
72
+ awaiting_ack: "Awaiting local acknowledgement",
73
+ consumed: "Consumed",
74
+ cancelled: "Cancelled",
75
+ failed: "Failed",
76
+ } as Record<string, string>
77
+ )[phase] ?? phase
78
+ );
79
+ }
80
+
81
+ function transferExpiryLabel(expiresAt: string): string {
82
+ const timestamp = Date.parse(expiresAt);
83
+ if (!Number.isFinite(timestamp)) return "Expiry unavailable";
84
+ return new Intl.DateTimeFormat(undefined, {
85
+ dateStyle: "medium",
86
+ timeStyle: "short",
87
+ }).format(timestamp);
88
+ }
89
+
46
90
  const idDisambiguator = $derived(idSuffix ? `-${idSuffix}` : "");
47
91
  const triggerId = $derived(`process-actions-trigger-${instanceId}${idDisambiguator}`);
48
92
  const menuId = $derived(`process-actions-menu-${instanceId}${idDisambiguator}`);
49
93
  const confirmationView = $derived({
50
94
  message:
51
95
  confirmation === "abort"
52
- ? `Abort ${actionTarget}? This can’t be undone.`
96
+ ? `Abort ${actionTarget}? Active work will stop. Its history will remain available. This can’t be undone.`
53
97
  : confirmation === "delete"
54
98
  ? `Permanently delete ${actionTarget}? ${isFinished ? "" : "Active work will be stopped first. "}History and managed stored artifacts will be permanently removed. This can’t be undone.`
55
99
  : `Abort ${actionTarget}, then prepare a new process with the same setup. Existing history will remain available.`,
@@ -64,8 +108,8 @@ const confirmationView = $derived({
64
108
  ? "Deleting…"
65
109
  : "Delete process"
66
110
  : busy
67
- ? "Working…"
68
- : "Abort & retry",
111
+ ? "Preparing new process…"
112
+ : "Abort and retry",
69
113
  action:
70
114
  confirmation === "abort"
71
115
  ? handleAbort
@@ -79,6 +123,7 @@ function toggleMenu() {
79
123
  menuOpen = !menuOpen;
80
124
  confirmation = null;
81
125
  error = null;
126
+ copyStatus = "idle";
82
127
  }
83
128
 
84
129
  function closeMenu(options: { restoreFocus?: boolean } = {}) {
@@ -150,6 +195,10 @@ $effect(() => {
150
195
  }
151
196
  });
152
197
 
198
+ $effect(() => {
199
+ if (menuOpen && (confirmation || transferGrant)) void tick().then(focusFirstMenuControl);
200
+ });
201
+
153
202
  async function runBusy(work: () => Promise<void>, fallbackError: string) {
154
203
  busy = true;
155
204
  error = null;
@@ -178,6 +227,40 @@ function cancelConfirmation() {
178
227
  error = null;
179
228
  }
180
229
 
230
+ async function handleCreateTransfer() {
231
+ copyStatus = "idle";
232
+ await runBusy(async () => {
233
+ transferGrant = await createSessionTransferGrant(instanceId);
234
+ await tick();
235
+ transferLinkRef?.focus();
236
+ }, "Couldn't create local transfer link");
237
+ }
238
+
239
+ async function handleCopyTransferLink() {
240
+ if (!transferGrant) return;
241
+ try {
242
+ await navigator.clipboard.writeText(transferGrant.transferUrl);
243
+ copyStatus = "copied";
244
+ } catch {
245
+ copyStatus = "failed";
246
+ }
247
+ }
248
+
249
+ async function handleCancelTransfer() {
250
+ if (!activeTransfer) return;
251
+ await runBusy(async () => {
252
+ await cancelSessionTransfer(instanceId, activeTransfer.attemptId);
253
+ locallyCancelledAttemptId = activeTransfer.attemptId;
254
+ }, "Couldn't cancel the local session transfer");
255
+ }
256
+
257
+ function showActions() {
258
+ transferGrant = null;
259
+ copyStatus = "idle";
260
+ error = null;
261
+ void tick().then(focusFirstMenuControl);
262
+ }
263
+
181
264
  async function handleDelete() {
182
265
  if (confirmation !== "delete") {
183
266
  confirmation = "delete";
@@ -213,17 +296,37 @@ async function handleAbortAndRetry() {
213
296
 
214
297
  function handleDownloadSession() {
215
298
  const url = resolveApiUrl(`/api/processes/${encodeURIComponent(instanceId)}/session`);
216
- window.open(url, "_blank");
299
+ window.open(url, "_blank", NEW_TAB_WINDOW_FEATURES);
217
300
  closeMenu();
218
301
  }
219
302
  </script>
220
303
 
304
+ {#snippet menuItem(
305
+ key: string,
306
+ label: string,
307
+ action: () => void,
308
+ danger = false,
309
+ )}
310
+ <button
311
+ type="button"
312
+ class="menu-item"
313
+ class:menu-item-danger={danger}
314
+ role="menuitem"
315
+ data-menu-item={key}
316
+ data-pressable="true"
317
+ disabled={busy}
318
+ onclick={action}
319
+ >
320
+ {label}
321
+ </button>
322
+ {/snippet}
323
+
221
324
  <div class="process-actions-menu" data-presentation={presentation} bind:this={menuRef}>
222
325
  <button
223
326
  bind:this={triggerRef}
224
327
  id={triggerId}
225
328
  type="button"
226
- class="menu-trigger"
329
+ class="ui-button menu-trigger"
227
330
  data-pressable="true"
228
331
  aria-haspopup="menu"
229
332
  aria-controls={menuOpen ? menuId : undefined}
@@ -233,9 +336,8 @@ function handleDownloadSession() {
233
336
  aria-label={`Open actions for ${actionTarget}`}
234
337
  title={`Actions for ${actionTarget}`}
235
338
  >
236
- <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">
237
- <circle cx="12" cy="12" r="3"></circle>
238
- <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>
339
+ <svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
340
+ <circle cx="5" cy="12" r="1.5" /><circle cx="12" cy="12" r="1.5" /><circle cx="19" cy="12" r="1.5" />
239
341
  </svg>
240
342
  <span class:sr-only={presentation === "sheet"} class="menu-trigger-label">More actions</span>
241
343
  </button>
@@ -254,14 +356,48 @@ function handleDownloadSession() {
254
356
  {#if error}
255
357
  <p class="menu-error" role="alert">{error}</p>
256
358
  {/if}
359
+ {#if activeTransfer}
360
+ <p class="menu-note" role="status">
361
+ <strong>Local transfer: {phaseLabel(activeTransfer.phase)}.</strong>
362
+ {activeTransfer.blocksManualTurns ? " New manual turns are blocked until streaming ends." : " The process is unblocked; streamed bytes can no longer be recalled."}
363
+ </p>
364
+ {#if activeTransfer.blocksManualTurns}
365
+ {@render menuItem("cancel-transfer", busy ? "Cancelling…" : "Cancel transfer", handleCancelTransfer)}
366
+ {/if}
367
+ <div class="menu-divider" role="separator"></div>
368
+ {/if}
257
369
 
258
- {#if confirmation}
370
+ {#if transferGrant}
371
+ <div class="confirm-panel transfer-panel" aria-label="Local Pi transfer link">
372
+ <p class="confirm-message">Open this process in local Pi</p>
373
+ <p class="transfer-note">Single use · expires {transferExpiryLabel(transferGrant.expiresAt)}</p>
374
+ <label class="transfer-field-label" for={`transfer-link-${instanceId}${idDisambiguator}`}>Transfer link</label>
375
+ <input
376
+ bind:this={transferLinkRef}
377
+ id={`transfer-link-${instanceId}${idDisambiguator}`}
378
+ class="transfer-link"
379
+ readonly
380
+ value={transferGrant.transferUrl}
381
+ onfocus={(event) => event.currentTarget.select()}
382
+ />
383
+ <p class="transfer-note">Anyone with this link can download this session and workspace.</p>
384
+ <div class="confirm-actions">
385
+ <button type="button" class="ui-button confirm-cancel" data-pressable="true" onclick={showActions}>Back</button>
386
+ <button type="button" class="ui-button confirm-cancel" data-pressable="true" onclick={handleCopyTransferLink}>
387
+ {copyStatus === "copied" ? "Copied" : "Copy link"}
388
+ </button>
389
+ </div>
390
+ <p class="transfer-note" aria-live="polite">
391
+ {copyStatus === "copied" ? "Transfer link copied." : copyStatus === "failed" ? "Copy failed. Select and copy the link manually." : ""}
392
+ </p>
393
+ </div>
394
+ {:else if confirmation}
259
395
  <div class="confirm-panel">
260
396
  <p class="confirm-message">{confirmationView.message}</p>
261
397
  <div class="confirm-actions">
262
398
  <button
263
399
  type="button"
264
- class="confirm-cancel"
400
+ class="ui-button confirm-cancel"
265
401
  data-pressable="true"
266
402
  disabled={busy}
267
403
  onclick={cancelConfirmation}
@@ -270,7 +406,7 @@ function handleDownloadSession() {
270
406
  </button>
271
407
  <button
272
408
  type="button"
273
- class="confirm-danger"
409
+ class="ui-button confirm-danger" data-variant="danger"
274
410
  data-pressable="true"
275
411
  disabled={busy}
276
412
  onclick={confirmationView.action}
@@ -281,63 +417,19 @@ function handleDownloadSession() {
281
417
  </div>
282
418
  {:else}
283
419
  {#if hasSessionFile}
284
- <button
285
- type="button"
286
- class="menu-item"
287
- role="menuitem"
288
- data-pressable="true"
289
- disabled={busy}
290
- onclick={handleDownloadSession}
291
- >
292
- Download Pi session (.jsonl)
293
- </button>
420
+ {@render menuItem("create-transfer", busy ? "Creating transfer link…" : "Create local transfer link", handleCreateTransfer)}
421
+ {@render menuItem("download-session", "Download Pi session (.jsonl)", handleDownloadSession)}
294
422
  <div class="menu-divider" role="separator"></div>
295
423
  {/if}
296
424
  {#if !isFinished}
297
- <button
298
- type="button"
299
- class="menu-item"
300
- role="menuitem"
301
- data-pressable="true"
302
- disabled={busy}
303
- onclick={handleAbort}
304
- >
305
- Abort process
306
- </button>
425
+ {@render menuItem("abort", "Abort process", handleAbort)}
307
426
  {/if}
308
- <button
309
- type="button"
310
- class="menu-item"
311
- role="menuitem"
312
- data-pressable="true"
313
- disabled={busy}
314
- onclick={handleRetry}
315
- >
316
- {busy ? "Loading…" : "Retry as new process"}
317
- </button>
427
+ {@render menuItem("retry", busy ? "Loading…" : "Retry as new process", handleRetry)}
318
428
  {#if !isFinished}
319
- <button
320
- type="button"
321
- class="menu-item"
322
- role="menuitem"
323
- data-pressable="true"
324
- disabled={busy}
325
- onclick={handleAbortAndRetry}
326
- >
327
- Abort and retry as new process
328
- </button>
429
+ {@render menuItem("abort-and-retry", "Abort and retry as new process", handleAbortAndRetry)}
329
430
  {/if}
330
431
  <div class="menu-divider" role="separator"></div>
331
- <button
332
- type="button"
333
- class="menu-item menu-item-danger"
334
- role="menuitem"
335
- data-pressable="true"
336
- disabled={busy}
337
- onclick={handleDelete}
338
- >
339
- Delete process
340
- </button>
432
+ {@render menuItem("delete", "Delete process", handleDelete, true)}
341
433
  {/if}
342
434
  </div>
343
435
  {/if}
@@ -349,8 +441,8 @@ function handleDownloadSession() {
349
441
  }
350
442
 
351
443
  .process-actions-menu[data-presentation="sheet"] .menu-trigger {
352
- width: 40px;
353
- min-height: 40px;
444
+ width: 44px;
445
+ min-height: 44px;
354
446
  padding: 0;
355
447
  border-radius: 10px;
356
448
  }
@@ -368,50 +460,18 @@ function handleDownloadSession() {
368
460
  box-shadow: -6px 0 currentColor, 6px 0 currentColor;
369
461
  }
370
462
 
371
- .menu-trigger {
372
- display: inline-flex;
373
- align-items: center;
374
- justify-content: center;
375
- gap: 7px;
376
- min-height: 38px;
377
- padding: 0 12px;
378
- border: 1px solid color-mix(in srgb, var(--chronicle-border) 88%, transparent 12%);
379
- border-radius: 999px;
380
- background: color-mix(in srgb, var(--chronicle-card-surface) 76%, transparent 24%);
381
- color: var(--chronicle-text-muted);
382
- font: inherit;
383
- font-size: var(--type-body-sm, 13px);
384
- font-weight: 620;
385
- white-space: nowrap;
386
- cursor: pointer;
387
- }
388
-
389
- .menu-trigger:hover:not(:disabled) {
390
- background: color-mix(in srgb, var(--chronicle-panel-muted) 60%, transparent 40%);
391
- color: var(--chronicle-text);
392
- border-color: var(--chronicle-border);
393
- }
394
-
395
- .menu-trigger:disabled {
396
- opacity: 0.5;
397
- cursor: default;
398
- }
399
-
400
- .menu-trigger[aria-expanded="true"] {
401
- background: var(--chronicle-panel-muted);
402
- color: var(--chronicle-text);
403
- border-color: var(--chronicle-border-strong);
404
- }
405
-
406
463
  .menu-dropdown {
407
464
  position: absolute;
408
465
  top: calc(100% + 6px);
409
466
  right: 0;
410
467
  z-index: 100;
411
- min-width: 248px;
468
+ width: min(360px, calc(100vw - 32px));
469
+ max-height: min(640px, calc(100dvh - 140px));
470
+ overflow-y: auto;
471
+ overscroll-behavior: contain;
412
472
  padding: 8px;
413
473
  border: 1px solid var(--chronicle-border-strong);
414
- border-radius: 12px;
474
+ border-radius: 14px;
415
475
  background: var(--chronicle-card-surface);
416
476
  box-shadow: var(--chronicle-shadow);
417
477
  }
@@ -438,12 +498,12 @@ function handleDownloadSession() {
438
498
  width: 100%;
439
499
  padding: 10px 12px;
440
500
  border: none;
441
- border-radius: 8px;
501
+ border-radius: 10px;
442
502
  background: transparent;
443
503
  color: var(--chronicle-text);
444
504
  font: inherit;
445
505
  font-size: var(--type-body-sm, 13px);
446
- font-weight: 750;
506
+ font-weight: 620;
447
507
  text-align: left;
448
508
  cursor: pointer;
449
509
  }
@@ -471,13 +531,66 @@ function handleDownloadSession() {
471
531
  background: var(--chronicle-border);
472
532
  }
473
533
 
534
+ .menu-note {
535
+ margin: 0;
536
+ padding: 6px 8px;
537
+ font-size: var(--type-caption, 12px);
538
+ line-height: 1.45;
539
+ color: var(--chronicle-text-muted);
540
+ }
541
+
542
+ .menu-note strong {
543
+ color: var(--chronicle-text);
544
+ }
545
+
546
+ .transfer-panel {
547
+ min-width: 0;
548
+ }
549
+
550
+ .transfer-note {
551
+ min-height: 18px;
552
+ margin: 8px 0;
553
+ font-size: var(--type-caption, 12px);
554
+ line-height: 1.45;
555
+ color: var(--chronicle-text-muted);
556
+ }
557
+
558
+ .transfer-field-label {
559
+ display: block;
560
+ margin: 12px 0 6px;
561
+ font-size: var(--type-caption, 12px);
562
+ font-weight: 700;
563
+ color: var(--chronicle-text-muted);
564
+ }
565
+
566
+ .transfer-link {
567
+ box-sizing: border-box;
568
+ width: 100%;
569
+ min-height: 42px;
570
+ padding: 10px 12px;
571
+ border: 1px solid var(--chronicle-border-strong);
572
+ border-radius: 10px;
573
+ background: var(--chronicle-panel-muted);
574
+ color: var(--chronicle-text);
575
+ font: 500 var(--type-caption, 12px) / 1.4 var(--font-mono, ui-monospace, monospace);
576
+ }
577
+
578
+ .transfer-link:focus-visible {
579
+ outline: 2px solid var(--chronicle-accent);
580
+ outline-offset: 2px;
581
+ }
582
+
583
+ .transfer-panel .confirm-actions {
584
+ margin-top: 12px;
585
+ }
586
+
474
587
  .menu-error {
475
588
  margin: 0 0 8px;
476
589
  padding: 10px 12px;
477
590
  border-radius: 10px;
478
591
  background: var(--chronicle-danger-surface);
479
592
  border: 1px solid var(--chronicle-danger-border);
480
- font-size: 13px;
593
+ font-size: var(--type-body-sm, 13px);
481
594
  line-height: 1.45;
482
595
  color: var(--chronicle-danger-text);
483
596
  }
@@ -497,46 +610,10 @@ function handleDownloadSession() {
497
610
  .confirm-actions {
498
611
  display: flex;
499
612
  gap: 8px;
613
+ flex-wrap: wrap;
500
614
  justify-content: flex-end;
501
615
  }
502
616
 
503
- .confirm-cancel,
504
- .confirm-danger {
505
- min-height: 36px;
506
- padding: 0 14px;
507
- border-radius: 999px;
508
- font: inherit;
509
- font-size: 13px;
510
- font-weight: 600;
511
- cursor: pointer;
512
- }
513
-
514
- .confirm-cancel {
515
- border: 1px solid var(--chronicle-border-strong);
516
- background: var(--chronicle-card-surface);
517
- color: var(--chronicle-text);
518
- }
519
-
520
- .confirm-cancel:hover:not(:disabled) {
521
- background: var(--chronicle-panel-muted);
522
- }
523
-
524
- .confirm-danger {
525
- border: 1px solid var(--chronicle-danger-border);
526
- background: var(--chronicle-danger);
527
- color: var(--chronicle-text-on-accent);
528
- }
529
-
530
- .confirm-danger:hover:not(:disabled) {
531
- opacity: 0.9;
532
- }
533
-
534
- .confirm-cancel:disabled,
535
- .confirm-danger:disabled {
536
- opacity: 0.5;
537
- cursor: default;
538
- }
539
-
540
617
  @media (max-width: 720px) {
541
618
  .process-actions-menu:not([data-presentation="sheet"]),
542
619
  .process-actions-menu:not([data-presentation="sheet"]) .menu-trigger {
@@ -8,11 +8,13 @@ import type { ProcessDetailData } from "../lib/api";
8
8
  import { formatRelativeTime, formatStatus } from "../lib/format";
9
9
  import ProcessFlowDiagram from "../pages/ProcessFlowDiagram.svelte";
10
10
  import ConversationTreeDiagram from "./ConversationTreeDiagram.svelte";
11
+ import ExternalLink from "./ExternalLink.svelte";
11
12
 
12
13
  interface Props {
13
14
  detail: ProcessDetailData;
14
15
  processUsageEstimate: ProcessUsageEstimateSnapshot | null;
15
16
  onClose: () => void;
17
+ onShowSummary?: () => void;
16
18
  railItems: readonly ChronicleSelectableItem[];
17
19
  }
18
20
 
@@ -35,7 +37,7 @@ const tabs: readonly { id: ProcessInfoTab; label: string }[] = [
35
37
  { id: "conversation-tree", label: "Conversation tree" },
36
38
  ];
37
39
 
38
- let { detail, processUsageEstimate, onClose, railItems }: Props = $props();
40
+ let { detail, processUsageEstimate, onClose, railItems, onShowSummary }: Props = $props();
39
41
  let closeButton: HTMLButtonElement | null = $state(null);
40
42
  let activeTab = $state<ProcessInfoTab>("overview");
41
43
 
@@ -199,7 +201,7 @@ onMount(() => {
199
201
  <button
200
202
  bind:this={closeButton}
201
203
  type="button"
202
- class="overlay-close"
204
+ class="ui-button overlay-close"
203
205
  data-pressable="true"
204
206
  onclick={() => onClose()}
205
207
  aria-label="Close process info"
@@ -240,6 +242,7 @@ onMount(() => {
240
242
  <h3>At a glance</h3>
241
243
  <p>The operational facts for this process run.</p>
242
244
  </div>
245
+ {#if onShowSummary}<button type="button" class="ui-button" onclick={onShowSummary}>Show process summary</button>{/if}
243
246
  <dl class="fact-grid">
244
247
  <div>
245
248
  <dt>Status</dt>
@@ -299,7 +302,11 @@ onMount(() => {
299
302
  {/if}
300
303
  </dl>
301
304
  {#if project.externalUrl}
302
- <a href={project.externalUrl} target="_blank" rel="noreferrer">Open external project</a>
305
+ <ExternalLink
306
+ href={project.externalUrl}
307
+ label="Open external project"
308
+ resourceType="project"
309
+ />
303
310
  {/if}
304
311
  </section>
305
312
  {/each}
@@ -608,7 +615,7 @@ onMount(() => {
608
615
  justify-content: space-between;
609
616
  gap: var(--space-md);
610
617
  align-items: start;
611
- padding: var(--space-md) 18px var(--space-sm);
618
+ padding: var(--space-lg);
612
619
  }
613
620
 
614
621
  .overlay-heading-copy {
@@ -628,7 +635,7 @@ onMount(() => {
628
635
  }
629
636
 
630
637
  .overlay-header h2 {
631
- font-size: var(--type-title-sm);
638
+ font-size: var(--type-title-md);
632
639
  line-height: 1.2;
633
640
  font-weight: 680;
634
641
  }
@@ -650,19 +657,6 @@ onMount(() => {
650
657
  color: var(--chronicle-text-muted);
651
658
  }
652
659
 
653
- .overlay-close {
654
- min-height: 36px;
655
- padding: 0 12px;
656
- border-radius: 999px;
657
- border: 1px solid color-mix(in srgb, var(--chronicle-border) 82%, white 18%);
658
- background: color-mix(in srgb, white 90%, var(--chronicle-panel-muted) 10%);
659
- font: inherit;
660
- font-size: 13px;
661
- font-weight: 620;
662
- color: var(--chronicle-text);
663
- cursor: pointer;
664
- }
665
-
666
660
  .overlay-index {
667
661
  display: flex;
668
662
  gap: var(--space-lg);
@@ -855,11 +849,9 @@ onMount(() => {
855
849
  color: var(--chronicle-text-muted);
856
850
  }
857
851
 
858
- .repository-row a {
852
+ .repository-row :global(a.external-link) {
859
853
  width: fit-content;
860
854
  font-size: 13px;
861
- font-weight: 620;
862
- color: var(--chronicle-link);
863
855
  }
864
856
 
865
857
  .usage-line {
@@ -0,0 +1,46 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from "svelte";
3
+
4
+ import ProgressChecklistRows, { type ChecklistStep } from "./ProgressChecklistRows.svelte";
5
+
6
+ interface Props {
7
+ title: string;
8
+ steps: readonly ChecklistStep[];
9
+ headingLevel?: "h3" | "h4";
10
+ description?: string | null;
11
+ summary?: string | null;
12
+ dataSection?: string;
13
+ children?: Snippet;
14
+ }
15
+
16
+ let {
17
+ title,
18
+ steps,
19
+ headingLevel = "h4",
20
+ description,
21
+ summary,
22
+ dataSection,
23
+ children,
24
+ }: Props = $props();
25
+ const titleId = $props.id();
26
+ </script>
27
+
28
+ <section class="progress-checklist" data-section={dataSection} aria-labelledby={titleId}>
29
+ <header>
30
+ <svelte:element this={headingLevel} id={titleId}>{title}</svelte:element>
31
+ {#if description}<p class="description">{description}</p>{/if}
32
+ </header>
33
+ {#if summary}<p class="summary">{summary}</p>{/if}
34
+ <ProgressChecklistRows {steps} />
35
+ {#if children}{@render children()}{/if}
36
+ </section>
37
+
38
+ <style>
39
+ .progress-checklist { display: grid; gap: var(--space-md); min-width: 0; padding: var(--space-md); border: 1px solid var(--chronicle-border); border-radius: var(--radius-md); background: color-mix(in srgb, var(--chronicle-panel-muted) 72%, white 28%); }
40
+ header { display: grid; gap: var(--space-2xs); }
41
+ header :global(h3), header :global(h4) { margin: 0; color: var(--chronicle-text); font-size: var(--type-body); font-weight: 700; line-height: 1.5; }
42
+ p { margin: 0; }
43
+ .description { color: var(--chronicle-text-muted); font-size: var(--type-body-sm); line-height: 1.5; }
44
+ .summary { max-width: 70ch; color: var(--chronicle-danger-text); font-size: var(--type-body); line-height: 1.5; overflow-wrap: anywhere; }
45
+
46
+ </style>