@leitwerk-dev/ui 0.1.7 → 0.1.9

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 (70) hide show
  1. package/dist/assets/{ChronicleMarkdown-iH1VLv7x.js → ChronicleMarkdown-B1hD4HFS.js} +2 -2
  2. package/dist/assets/FutureLaunchDetailPage-Dy3FlLih.js +1 -0
  3. package/dist/assets/FutureLaunchDetailPage-UFgp7Ju4.css +1 -0
  4. package/dist/assets/GenericLauncher-BPEQjJ1J.js +1 -0
  5. package/dist/assets/HomePage-4Q7aqPBl.css +1 -0
  6. package/dist/assets/HomePage-E41Krxko.js +1 -0
  7. package/dist/assets/PageHeader-DDgWPeHS.js +1 -0
  8. package/dist/assets/{PageHeader-6PdvYODN.css → PageHeader-vhyfX7xT.css} +1 -1
  9. package/dist/assets/ProcessActionsMenu-BWlFe5c4.css +1 -0
  10. package/dist/assets/ProcessActionsMenu-cI0j2LWe.js +1 -0
  11. package/dist/assets/ProcessDetailPage-DVHldJgi.js +12 -0
  12. package/dist/assets/{ProcessDetailPage-CSrjzajF.css → ProcessDetailPage-Oh6ld320.css} +1 -1
  13. package/dist/assets/ProcessFlowDiagram-C6m6V_cB.js +2 -0
  14. package/dist/assets/ProcessesPage-B2QGyCZO.js +1 -0
  15. package/dist/assets/ScheduleDateTimePicker-aey_oMiH.js +1 -0
  16. package/dist/assets/SkillsPage-MPITMvhn.css +1 -0
  17. package/dist/assets/SkillsPage-iB4sbq7r.js +2 -0
  18. package/dist/assets/WatchersPage-BOSgjtw0.css +1 -0
  19. package/dist/assets/WatchersPage-l0rwv-Nx.js +1 -0
  20. package/dist/assets/{api-HGtUzekR.js → api-CtKbU0lT.js} +1 -1
  21. package/dist/assets/{dist-DVNpSD5l.js → dist-eOPUi0B8.js} +2 -2
  22. package/dist/assets/index-B4flHG_s.js +7 -0
  23. package/dist/assets/index-DunTIQSW.css +1 -0
  24. package/dist/assets/{index-client-BqF3_t3P.js → index-client-CnG8mWmF.js} +2 -2
  25. package/dist/assets/retry-config.svelte-WukHimiy.js +1 -0
  26. package/dist/assets/{router.svelte-C2wi6I7k.js → router.svelte-2RvxUvs5.js} +1 -1
  27. package/dist/index.html +7 -7
  28. package/package.json +6 -6
  29. package/src/App.svelte +5 -2
  30. package/src/chronicle/components/ChronicleFlow.svelte +2 -0
  31. package/src/chronicle/components/ChronicleRecoverySection.svelte +21 -16
  32. package/src/chronicle/components/ChronicleTurnCluster.svelte +3 -0
  33. package/src/chronicle/components/ChronicleTurnProgress.svelte +71 -0
  34. package/src/chronicle/components/ChronicleTurnRail.svelte +12 -3
  35. package/src/chronicle/lib/chronicle-projection.ts +11 -0
  36. package/src/components/ModalShell.svelte +31 -8
  37. package/src/components/PageHeader.svelte +29 -2
  38. package/src/components/ProcessActionsMenu.svelte +38 -6
  39. package/src/lib/api.ts +7 -0
  40. package/src/pages/FutureLaunchDetailPage.svelte +1 -3
  41. package/src/pages/HomePage.svelte +1 -4
  42. package/src/pages/ProcessDetailPage.svelte +3 -0
  43. package/src/pages/ProcessGallery.svelte +0 -2
  44. package/src/pages/SkillsPage.svelte +10 -13
  45. package/src/pages/WatchersPage.svelte +0 -2
  46. package/src/pages/process-detail/ProcessDetailChronicle.svelte +307 -8
  47. package/src/pages/process-detail/ProcessDetailHeader.svelte +43 -24
  48. package/src/pages/process-detail/process-detail-view-model.ts +1 -0
  49. package/src/shell/AppShell.svelte +256 -5
  50. package/src/shell/RouteLoadBoundary.svelte +48 -12
  51. package/src/shell/Sidebar.svelte +254 -85
  52. package/dist/assets/FutureLaunchDetailPage-BJphZBFH.js +0 -1
  53. package/dist/assets/FutureLaunchDetailPage-VPMBtpYc.css +0 -1
  54. package/dist/assets/GenericLauncher-tr1to52a.js +0 -1
  55. package/dist/assets/HomePage-CSHVQefI.js +0 -1
  56. package/dist/assets/HomePage-DYh_QHXv.css +0 -1
  57. package/dist/assets/PageHeader-C4j3zJKF.js +0 -1
  58. package/dist/assets/ProcessActionsMenu-BT2r9vO8.css +0 -1
  59. package/dist/assets/ProcessActionsMenu-gNiZGUCZ.js +0 -1
  60. package/dist/assets/ProcessDetailPage-CGyVxjeH.js +0 -12
  61. package/dist/assets/ProcessFlowDiagram-BX_Zjm2n.js +0 -2
  62. package/dist/assets/ProcessesPage-D3jjufse.js +0 -1
  63. package/dist/assets/ScheduleDateTimePicker-D72J6EhE.js +0 -1
  64. package/dist/assets/SkillsPage-B30FAFia.css +0 -1
  65. package/dist/assets/SkillsPage-CcYm4ATy.js +0 -2
  66. package/dist/assets/WatchersPage-Bac86WLp.js +0 -1
  67. package/dist/assets/WatchersPage-Dnfi1zUK.css +0 -1
  68. package/dist/assets/index-66T4Gmbl.css +0 -1
  69. package/dist/assets/index-ChVsVf6R.js +0 -7
  70. package/dist/assets/retry-config.svelte-DFKCJtCe.js +0 -1
package/src/App.svelte CHANGED
@@ -1,4 +1,5 @@
1
1
  <script lang="ts">
2
+ import type { AuthMeResponseBody } from "@leitwerk-dev/protocol/http-contracts";
2
3
  import { onMount } from "svelte";
3
4
  import ToastContainer from "./components/ToastContainer.svelte";
4
5
  import { fetchAuthMeWithRetry } from "./lib/api.js";
@@ -20,6 +21,7 @@ let authState = $state<"loading" | "reconnecting" | "authenticated" | "unauthent
20
21
  "loading",
21
22
  );
22
23
  let authError = $state<string | null>(null);
24
+ let authMe = $state<AuthMeResponseBody | null>(null);
23
25
  let realtimeStarted = false;
24
26
 
25
27
  onMount(() => {
@@ -33,6 +35,7 @@ onMount(() => {
33
35
  },
34
36
  })
35
37
  .then((me) => {
38
+ authMe = me;
36
39
  authState = me.actor ? "authenticated" : "unauthenticated";
37
40
  })
38
41
  .catch((error: unknown) => {
@@ -80,8 +83,8 @@ $effect(() => {
80
83
  </div>
81
84
  {:else if authState === "error"}
82
85
  <div class="auth-gate" role="alert">{authError ?? "Could not load authentication status."}</div>
83
- {:else}
84
- <AppShell route={$routeStore} />
86
+ {:else if authMe?.actor}
87
+ <AppShell route={$routeStore} authEnabled={authMe.authEnabled} actor={authMe.actor} />
85
88
  {/if}
86
89
 
87
90
  <style>
@@ -54,6 +54,7 @@ interface Props {
54
54
  technicalDetail?: string | null;
55
55
  defaultContinuePrompt: string;
56
56
  canContinue: boolean;
57
+ supportsModelOverride: boolean;
57
58
  defaultModelProfileId: string | null;
58
59
  providerOptions: Record<string, string>;
59
60
  } | null;
@@ -172,6 +173,7 @@ function shouldRenderActionSection(item: ChronicleTimelineItem): boolean {
172
173
  technicalDetail={recovery.technicalDetail}
173
174
  turnRecordId={recovery.turnRecordId}
174
175
  canContinue={recovery.canContinue}
176
+ supportsModelOverride={recovery.supportsModelOverride}
175
177
  continueBusy={recoveryController.continueBusyTurnRecordId === recovery.turnRecordId}
176
178
  continueError={
177
179
  recoveryController.continueError?.turnRecordId === recovery.turnRecordId
@@ -13,6 +13,7 @@ interface Props {
13
13
  technicalDetail?: string | null;
14
14
  turnRecordId: string;
15
15
  canContinue: boolean;
16
+ supportsModelOverride: boolean;
16
17
  continueBusy?: boolean;
17
18
  continueError?: string | null;
18
19
  continuePrompt?: string;
@@ -38,10 +39,11 @@ let {
38
39
  isFocused,
39
40
  title,
40
41
  summary,
41
- guidance = "Review the latest attempt, then continue from the saved work or retry the step from the beginning.",
42
+ guidance = "Review the latest attempt, then continue from saved work or retry only the failed turn as a new attempt.",
42
43
  technicalDetail = null,
43
44
  turnRecordId,
44
45
  canContinue,
46
+ supportsModelOverride,
45
47
  continueBusy = false,
46
48
  continueError = null,
47
49
  continuePrompt = "",
@@ -95,20 +97,23 @@ const selectedModelUsable = $derived(
95
97
  {/if}
96
98
 
97
99
  <div class="recovery-actions" role="group" aria-label="Recovery actions">
98
- <RecoveryModelControl
99
- {instanceId}
100
- {modelProfiles}
101
- defaultModelProfileId={defaultModelProfileId ?? null}
102
- initialProviderOptions={defaultProviderOptions}
103
- disabled={controlsBusy}
104
- selectId={`recovery-model-${turnRecordId}`}
105
- selectLabel="Model for the new attempt"
106
- selectDataField="recovery-model"
107
- onModelChange={(profileId, _usable) => {
108
- modelProfileDraft = profileId ?? "";
109
- }}
110
- onProviderOptionsChange={(values) => (providerOptionsDraft = values ? { ...values } : undefined)}
111
- />
100
+ {#if supportsModelOverride}
101
+ <RecoveryModelControl
102
+ {instanceId}
103
+ {modelProfiles}
104
+ defaultModelProfileId={defaultModelProfileId ?? null}
105
+ initialProviderOptions={defaultProviderOptions}
106
+ disabled={controlsBusy}
107
+ selectId={`recovery-model-${turnRecordId}`}
108
+ selectLabel="Model for the new attempt"
109
+ selectDataField="recovery-model"
110
+ onModelChange={(profileId, _usable) => {
111
+ modelProfileDraft = profileId ?? "";
112
+ }}
113
+ onProviderOptionsChange={(values) =>
114
+ (providerOptionsDraft = values ? { ...values } : undefined)}
115
+ />
116
+ {/if}
112
117
  {#if canContinue}
113
118
  <div class="continue-editor">
114
119
  <label class="continue-label" for={`continue-prompt-${turnRecordId}`}>Message before continuing</label>
@@ -155,7 +160,7 @@ const selectedModelUsable = $derived(
155
160
  disabled={controlsBusy || !selectedModelUsable}
156
161
  onclick={() => onRetry(modelProfileDraft || undefined, providerOptionsDraft)}
157
162
  >
158
- {retryBusy ? "Retrying…" : "Retry from beginning"}
163
+ {retryBusy ? "Retrying failed turn…" : "Retry failed turn"}
159
164
  </button>
160
165
  </div>
161
166
 
@@ -9,6 +9,7 @@ import ChronicleExpandButton from "./ChronicleExpandButton.svelte";
9
9
  import ChronicleMarkdown from "./ChronicleMarkdown.svelte";
10
10
  import ChronicleSectionHeader from "./ChronicleSectionHeader.svelte";
11
11
  import ChronicleThinkingSection from "./ChronicleThinkingSection.svelte";
12
+ import ChronicleTurnProgress from "./ChronicleTurnProgress.svelte";
12
13
  import ChronicleUsageStats from "./ChronicleUsageStats.svelte";
13
14
 
14
15
  interface Props {
@@ -103,6 +104,8 @@ function expandHistoryResult() {
103
104
  </dl>
104
105
  </section>
105
106
  {/if}
107
+ {:else if section.kind === "turn_progress"}
108
+ <ChronicleTurnProgress report={section.report} />
106
109
  {:else if section.kind === "turn_result"}
107
110
  <section
108
111
  class="content-section result-section"
@@ -0,0 +1,71 @@
1
+ <script lang="ts">
2
+ import type { TurnProgressReport, TurnProgressStepStatus } from "@leitwerk-dev/domain";
3
+
4
+ interface Props {
5
+ report: TurnProgressReport;
6
+ }
7
+ let { report }: Props = $props();
8
+ const componentId = $props.id();
9
+ const titleId = `${componentId}-title`;
10
+
11
+ const statusLabels: Record<TurnProgressStepStatus, string> = {
12
+ incomplete: "Incomplete",
13
+ in_progress: "In progress",
14
+ completed: "Complete",
15
+ failed: "Failed",
16
+ };
17
+ const statusMarks: Record<TurnProgressStepStatus, string> = {
18
+ incomplete: "○",
19
+ in_progress: "◐",
20
+ completed: "✓",
21
+ failed: "×",
22
+ };
23
+ </script>
24
+
25
+ <section class="progress-report" data-section="turn-progress" aria-labelledby={titleId}>
26
+ <h4 id={titleId}>{report.title}</h4>
27
+ <ol aria-live="polite">
28
+ {#each report.steps as step (step.id)}
29
+ <li data-progress-step={step.id} data-progress-status={step.status}>
30
+ <span class="status-mark" aria-hidden="true">{statusMarks[step.status]}</span>
31
+ <span class="step-copy">
32
+ <span class="step-label">{step.label}</span>
33
+ {#if step.detail}<span class="step-detail">{step.detail}</span>{/if}
34
+ </span>
35
+ <span class="status-label">{statusLabels[step.status]}</span>
36
+ </li>
37
+ {/each}
38
+ </ol>
39
+ {#if report.links?.length}
40
+ <div class="created-changes">
41
+ <h5>Created changes</h5>
42
+ <ul>
43
+ {#each report.links as link (link.id)}
44
+ <li><a href={link.url} target="_blank" rel="noreferrer">{link.label}<span class="external" aria-hidden="true">↗</span></a></li>
45
+ {/each}
46
+ </ul>
47
+ </div>
48
+ {/if}
49
+ </section>
50
+
51
+ <style>
52
+ .progress-report { display: grid; gap: var(--space-md); 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%); }
53
+ h4, h5 { margin: 0; color: var(--chronicle-text); }
54
+ h4 { font-size: var(--type-body); font-weight: 700; }
55
+ h5 { font-size: var(--type-body-sm); font-weight: 700; }
56
+ ol, ul { display: grid; gap: var(--space-sm); margin: 0; padding: 0; list-style: none; }
57
+ ol li { display: grid; grid-template-columns: 1.25rem minmax(0, 1fr) auto; gap: var(--space-sm); align-items: start; }
58
+ .status-mark { display: grid; place-items: center; width: 1.25rem; height: 1.25rem; color: var(--chronicle-text-muted); font-weight: 800; }
59
+ [data-progress-status="completed"] .status-mark, [data-progress-status="completed"] .status-label { color: var(--chronicle-success); }
60
+ [data-progress-status="in_progress"] .status-mark, [data-progress-status="in_progress"] .status-label { color: var(--chronicle-accent); }
61
+ [data-progress-status="failed"] .status-mark, [data-progress-status="failed"] .status-label { color: var(--chronicle-danger); }
62
+ .step-copy { display: grid; gap: 2px; min-width: 0; }
63
+ .step-label { color: var(--chronicle-text); font-weight: 600; }
64
+ .step-detail, .status-label { color: var(--chronicle-text-muted); font-size: var(--type-body-sm); }
65
+ .status-label { white-space: nowrap; }
66
+ .created-changes { display: grid; gap: var(--space-sm); padding-top: var(--space-sm); border-top: 1px solid var(--chronicle-border); }
67
+ .created-changes ul { display: flex; flex-wrap: wrap; }
68
+ a { color: var(--chronicle-link); font-weight: 600; text-decoration-thickness: 1px; text-underline-offset: 3px; }
69
+ .external { margin-inline-start: 0.3em; }
70
+ @media (max-width: 600px) { ol li { grid-template-columns: 1.25rem minmax(0, 1fr); } .status-label { grid-column: 2; } }
71
+ </style>
@@ -9,9 +9,18 @@ interface Props {
9
9
  railItems: readonly ChronicleSelectableItem[];
10
10
  activeAnchorId: string | null;
11
11
  onSelectAnchor: (anchorId: string) => void;
12
+ headingId?: string;
12
13
  }
13
14
 
14
- let { detail, loading, error, railItems, activeAnchorId, onSelectAnchor }: Props = $props();
15
+ let {
16
+ detail,
17
+ loading,
18
+ error,
19
+ railItems,
20
+ activeAnchorId,
21
+ onSelectAnchor,
22
+ headingId = "process-navigation-heading",
23
+ }: Props = $props();
15
24
  let railListElement = $state<HTMLDivElement | null>(null);
16
25
 
17
26
  $effect(() => {
@@ -128,8 +137,8 @@ function itemAriaLabel(item: ChronicleSelectableItem): string | undefined {
128
137
  }
129
138
  </script>
130
139
 
131
- <section class="turn-rail" data-column="turn-rail" aria-labelledby="process-navigation-heading">
132
- <h2 id="process-navigation-heading" class="sr-only">Process navigation</h2>
140
+ <section class="turn-rail" data-column="turn-rail" aria-labelledby={headingId}>
141
+ <h2 id={headingId} class="sr-only">Process navigation</h2>
133
142
  {#if loading && !detail}
134
143
  <div class="rail-state">Loading this process timeline…</div>
135
144
  {:else if error && !detail}
@@ -3,6 +3,7 @@ import {
3
3
  type ProcessInput,
4
4
  type ProcessLeafOutcomeSnapshot,
5
5
  type ProcessTurnRecord,
6
+ type TurnProgressReport,
6
7
  trimToNull,
7
8
  } from "@leitwerk-dev/domain";
8
9
  import {
@@ -121,9 +122,15 @@ export interface ChronicleTurnResultSection {
121
122
  markdown: string;
122
123
  }
123
124
 
125
+ export interface ChronicleTurnProgressSection {
126
+ kind: "turn_progress";
127
+ report: TurnProgressReport;
128
+ }
129
+
124
130
  export type ChronicleTurnClusterSection =
125
131
  | ChronicleThinkingSection
126
132
  | ChronicleOperatorDecisionSection
133
+ | ChronicleTurnProgressSection
127
134
  | ChronicleTurnResultSection;
128
135
 
129
136
  export interface ChronicleTurnClusterItem {
@@ -646,6 +653,10 @@ function buildTurnClusterItem(input: {
646
653
  ? turnRecord.output.trim()
647
654
  : "";
648
655
 
656
+ if (turnRecord.progress) {
657
+ sections.push({ kind: "turn_progress", report: turnRecord.progress });
658
+ }
659
+
649
660
  if (assistantText.length === 0 && fallbackText.length > 0) {
650
661
  sections.push({
651
662
  kind: "operator_decision",
@@ -12,6 +12,9 @@ interface Props {
12
12
  panelId?: string;
13
13
  width?: string;
14
14
  maxHeight?: string;
15
+ presentation?: "default" | "bottom-sheet";
16
+ initialFocus?: string;
17
+ returnFocus?: string;
15
18
  }
16
19
 
17
20
  let {
@@ -24,6 +27,9 @@ let {
24
27
  panelId,
25
28
  width = "min(100% - 32px, 600px)",
26
29
  maxHeight = "85vh",
30
+ presentation = "default",
31
+ initialFocus,
32
+ returnFocus,
27
33
  }: Props = $props();
28
34
 
29
35
  const showModal: Attachment<HTMLDialogElement> = (dialog) => {
@@ -54,20 +60,26 @@ const showModal: Attachment<HTMLDialogElement> = (dialog) => {
54
60
  };
55
61
  dialog.addEventListener("cancel", handleCancel);
56
62
  dialog.addEventListener("keydown", handleKeydown);
63
+ const previousOverflow = document.body.style.overflow;
64
+ if (presentation === "bottom-sheet") document.body.style.overflow = "hidden";
57
65
  if (typeof dialog.showModal === "function") dialog.showModal();
58
66
  else dialog.setAttribute("open", "");
59
- queueMicrotask(() =>
60
- dialog
61
- .querySelector<HTMLElement>(
62
- "[autofocus], button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])",
63
- )
64
- ?.focus(),
65
- );
67
+ queueMicrotask(() => {
68
+ const fallbackSelector =
69
+ "[autofocus], button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])";
70
+ (
71
+ dialog.querySelector<HTMLElement>(initialFocus ?? fallbackSelector) ??
72
+ dialog.querySelector<HTMLElement>(fallbackSelector)
73
+ )?.focus();
74
+ });
66
75
  return () => {
67
76
  dialog.removeEventListener("cancel", handleCancel);
68
77
  dialog.removeEventListener("keydown", handleKeydown);
78
+ if (presentation === "bottom-sheet") document.body.style.overflow = previousOverflow;
69
79
  if (typeof dialog.close === "function" && dialog.open) dialog.close();
70
- queueMicrotask(() => previous?.focus());
80
+ queueMicrotask(() =>
81
+ (returnFocus ? document.querySelector<HTMLElement>(returnFocus) : previous)?.focus(),
82
+ );
71
83
  };
72
84
  };
73
85
  </script>
@@ -77,6 +89,7 @@ const showModal: Attachment<HTMLDialogElement> = (dialog) => {
77
89
  {@attach showModal}
78
90
  data-section={dataSection}
79
91
  class="modal-panel"
92
+ data-presentation={presentation}
80
93
  id={panelId}
81
94
  aria-labelledby={titleId}
82
95
  onclick={(event) => {
@@ -99,6 +112,16 @@ const showModal: Attachment<HTMLDialogElement> = (dialog) => {
99
112
  .modal-close:focus-visible { outline: 2px solid var(--chronicle-accent); outline-offset: 2px; }
100
113
  .modal-close svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.7; fill: none; }
101
114
 
115
+ .modal-panel[data-presentation="bottom-sheet"] { inset: auto 0 0; width: min(100%, 560px); height: min(82svh, 720px); max-height: calc(100svh - max(48px, env(safe-area-inset-top))); margin: 0 auto; gap: 0; padding: 20px 16px max(14px, env(safe-area-inset-bottom)); border: 1px solid var(--chronicle-border-strong); border-bottom: 0; border-radius: 22px 22px 0 0; background: var(--chronicle-card-surface); animation: bottom-sheet-in 220ms cubic-bezier(0.16, 1, 0.3, 1); }
116
+ .modal-panel[data-presentation="bottom-sheet"]::backdrop { background: color-mix(in srgb, var(--chronicle-text) 38%, transparent 62%); backdrop-filter: none; -webkit-backdrop-filter: none; }
117
+ .modal-panel[data-presentation="bottom-sheet"] .modal-close { top: 16px; right: 16px; width: 40px; height: 40px; border: 1px solid var(--chronicle-border); background: var(--chronicle-panel-muted); }
118
+
119
+ @keyframes bottom-sheet-in { from { transform: translateY(18px); opacity: 0.88; } }
120
+
121
+ @media (prefers-reduced-motion: reduce) {
122
+ .modal-panel[data-presentation="bottom-sheet"] { animation: none; }
123
+ }
124
+
102
125
  @media (max-width: 640px) {
103
126
  .modal-panel { padding: var(--space-lg); }
104
127
  }
@@ -7,12 +7,24 @@ interface Props {
7
7
  subtitle?: string | null;
8
8
  actions?: Snippet;
9
9
  titleSuffix?: Snippet;
10
+ compactOnMobile?: boolean;
10
11
  }
11
12
 
12
- let { title, titleId = undefined, subtitle = null, actions, titleSuffix }: Props = $props();
13
+ let {
14
+ title,
15
+ titleId = undefined,
16
+ subtitle = null,
17
+ actions,
18
+ titleSuffix,
19
+ compactOnMobile = false,
20
+ }: Props = $props();
13
21
  </script>
14
22
 
15
- <header class="page-header" data-section="page-header">
23
+ <header
24
+ class="page-header"
25
+ data-section="page-header"
26
+ data-mobile-layout={compactOnMobile ? "compact" : undefined}
27
+ >
16
28
  <div class="page-header-row">
17
29
  <div class="page-header-copy">
18
30
  <h1 id={titleId}>
@@ -142,5 +154,20 @@ let { title, titleId = undefined, subtitle = null, actions, titleSuffix }: Props
142
154
  line-height: 1.16;
143
155
  white-space: normal;
144
156
  }
157
+
158
+ .page-header[data-mobile-layout="compact"] .page-header-row,
159
+ .page-header[data-mobile-layout="compact"] .page-header-actions {
160
+ flex-direction: row;
161
+ align-items: center;
162
+ }
163
+
164
+ .page-header[data-mobile-layout="compact"] .page-header-actions {
165
+ width: auto;
166
+ flex: 0 0 auto;
167
+ }
168
+
169
+ .page-header[data-mobile-layout="compact"] h1 {
170
+ white-space: nowrap;
171
+ }
145
172
  }
146
173
  </style>
@@ -17,6 +17,8 @@ interface Props {
17
17
  hasSessionFile?: boolean;
18
18
  processLabel: string;
19
19
  onDeleted?: () => void;
20
+ presentation?: "default" | "sheet";
21
+ idSuffix?: string;
20
22
  }
21
23
 
22
24
  let {
@@ -26,6 +28,8 @@ let {
26
28
  hasSessionFile = false,
27
29
  processLabel,
28
30
  onDeleted,
31
+ presentation = "default",
32
+ idSuffix = "",
29
33
  }: Props = $props();
30
34
 
31
35
  let menuOpen = $state(false);
@@ -39,8 +43,9 @@ let dropdownRef = $state<HTMLDivElement | null>(null);
39
43
 
40
44
  const isFinished = $derived(lifecycleStatus === "completed" || lifecycleStatus === "aborted");
41
45
  const actionTarget = $derived(processLabel.trim() || `process ${instanceId}`);
42
- const triggerId = $derived(`process-actions-trigger-${instanceId}`);
43
- const menuId = $derived(`process-actions-menu-${instanceId}`);
46
+ const idDisambiguator = $derived(idSuffix ? `-${idSuffix}` : "");
47
+ const triggerId = $derived(`process-actions-trigger-${instanceId}${idDisambiguator}`);
48
+ const menuId = $derived(`process-actions-menu-${instanceId}${idDisambiguator}`);
44
49
  const confirmationView = $derived({
45
50
  message:
46
51
  confirmation === "abort"
@@ -213,7 +218,7 @@ function handleDownloadSession() {
213
218
  }
214
219
  </script>
215
220
 
216
- <div class="process-actions-menu" bind:this={menuRef}>
221
+ <div class="process-actions-menu" data-presentation={presentation} bind:this={menuRef}>
217
222
  <button
218
223
  bind:this={triggerRef}
219
224
  id={triggerId}
@@ -232,7 +237,7 @@ function handleDownloadSession() {
232
237
  <circle cx="12" cy="12" r="3"></circle>
233
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>
234
239
  </svg>
235
- <span class="menu-trigger-label">More actions</span>
240
+ <span class:sr-only={presentation === "sheet"} class="menu-trigger-label">More actions</span>
236
241
  </button>
237
242
 
238
243
  {#if menuOpen}
@@ -343,6 +348,26 @@ function handleDownloadSession() {
343
348
  position: relative;
344
349
  }
345
350
 
351
+ .process-actions-menu[data-presentation="sheet"] .menu-trigger {
352
+ width: 40px;
353
+ min-height: 40px;
354
+ padding: 0;
355
+ border-radius: 10px;
356
+ }
357
+
358
+ .process-actions-menu[data-presentation="sheet"] .menu-trigger svg {
359
+ display: none;
360
+ }
361
+
362
+ .process-actions-menu[data-presentation="sheet"] .menu-trigger::before {
363
+ content: "";
364
+ width: 3px;
365
+ height: 3px;
366
+ border-radius: 999px;
367
+ background: currentColor;
368
+ box-shadow: -6px 0 currentColor, 6px 0 currentColor;
369
+ }
370
+
346
371
  .menu-trigger {
347
372
  display: inline-flex;
348
373
  align-items: center;
@@ -391,6 +416,13 @@ function handleDownloadSession() {
391
416
  box-shadow: var(--chronicle-shadow);
392
417
  }
393
418
 
419
+ .process-actions-menu[data-presentation="sheet"] .menu-dropdown {
420
+ top: auto;
421
+ bottom: calc(100% + 8px);
422
+ right: 0;
423
+ max-width: min(320px, calc(100vw - 32px));
424
+ }
425
+
394
426
  .menu-context {
395
427
  margin: 0 0 6px;
396
428
  padding: 6px 8px 8px;
@@ -506,8 +538,8 @@ function handleDownloadSession() {
506
538
  }
507
539
 
508
540
  @media (max-width: 720px) {
509
- .process-actions-menu,
510
- .menu-trigger {
541
+ .process-actions-menu:not([data-presentation="sheet"]),
542
+ .process-actions-menu:not([data-presentation="sheet"]) .menu-trigger {
511
543
  width: 100%;
512
544
  }
513
545
  }
package/src/lib/api.ts CHANGED
@@ -197,6 +197,13 @@ export async function fetchAuthMe(): Promise<AuthMeResponseBody> {
197
197
  return readJsonObject<AuthMeResponseBody>(res, "Malformed auth status response");
198
198
  }
199
199
 
200
+ export async function logout(): Promise<void> {
201
+ const res = await getFetchImpl()(resolveApiUrl("/auth/logout"), { method: "POST" });
202
+ if (!res.ok) {
203
+ throw new ApiResponseError(`Couldn't log out: ${res.status}`, res.status);
204
+ }
205
+ }
206
+
200
207
  export interface AuthMeRetryOptions {
201
208
  maxAttempts?: number;
202
209
  baseDelayMs?: number;
@@ -307,9 +307,7 @@ async function confirmCancel() {
307
307
  <style>
308
308
  .future-launch-page {
309
309
  width: 100%;
310
- height: 100%;
311
- min-height: 0;
312
- overflow-y: auto;
310
+ min-height: 100%;
313
311
  padding: var(--space-2xs) 0 var(--space-xl);
314
312
  }
315
313
 
@@ -276,8 +276,7 @@ function handleScheduled(futureExecution: FutureLaunchSummary) {
276
276
  display: flex;
277
277
  flex-direction: column;
278
278
  width: 100%;
279
- height: 100%;
280
- min-height: 0;
279
+ min-height: 100%;
281
280
  }
282
281
 
283
282
  .configure-phase {
@@ -285,8 +284,6 @@ function handleScheduled(futureExecution: FutureLaunchSummary) {
285
284
  flex-direction: column;
286
285
  gap: var(--space-lg);
287
286
  min-height: 0;
288
- overflow-y: auto;
289
- overscroll-behavior: contain;
290
287
  padding: var(--space-2xs) 2px var(--space-xl);
291
288
  outline: none;
292
289
  }
@@ -512,6 +512,9 @@ function openNextReasoningDetails() {
512
512
  onDismissLaunchWarning={dismissLaunchWarning}
513
513
  onOpenReasoningDetails={openReasoningDetails}
514
514
  onCloseBlockingDetailOverlays={closeBlockingDetailOverlays}
515
+ isProcessInfoOpen={isProcessInfoOverlayOpen}
516
+ onToggleProcessInfo={toggleProcessInfoOverlay}
517
+ onDeleted={handleProcessDeleted}
515
518
  />
516
519
  </div>
517
520
 
@@ -168,8 +168,6 @@ function handleGalleryKeydown(event: KeyboardEvent) {
168
168
  flex-direction: column;
169
169
  gap: clamp(var(--space-lg), 2.8vw, var(--space-2xl));
170
170
  min-height: 0;
171
- overflow-y: auto;
172
- overscroll-behavior: contain;
173
171
  padding: var(--space-2xs) 2px var(--space-xl);
174
172
  }
175
173
 
@@ -323,12 +323,11 @@ $effect(() => {
323
323
  {@const skill = item.value}
324
324
  {@const available = item.kind === "available"}
325
325
  {@const repositoryId = available ? item.value.repositoryId : item.value.sourceRepositoryId}
326
- {@const registrationKind = available ? null : item.value.registrationKind}
327
326
  {@const revision = available ? item.value.sourceRevision : item.value.activeSourceRevision}
328
327
  {@const href = available ? buildAvailableSkillPath(item.value.repositoryId, skill.id) : buildInstalledSkillPath(skill.id)}
329
328
  {@const selected = selectedKey === `${item.kind}/${available ? `${item.value.repositoryId}/` : ""}${skill.id}`}
330
329
  {@const status = skillStatus(skill)}
331
- {@const repoLabel = registrationKind === "configuration" ? "Configuration" : repositoryLabels.get(repositoryId ?? "") ?? repositoryId ?? "Repository"}
330
+ {@const repoLabel = repositoryLabels.get(repositoryId ?? "") ?? repositoryId ?? "Repository"}
332
331
  <tr
333
332
  class:selected
334
333
  onclick={(event) => {
@@ -341,6 +340,9 @@ $effect(() => {
341
340
  <a {href} onclick={(event) => followLink(event, href)}>
342
341
  <strong>{skill.label}</strong>
343
342
  <span>{skill.description ?? skill.id}</span>
343
+ <span class="model-invocation" data-model-invocable={skill.modelInvocable}>
344
+ {skill.modelInvocable ? "Callable by model" : "Not callable by model"}
345
+ </span>
344
346
  </a>
345
347
  </td>
346
348
  <td>
@@ -351,10 +353,7 @@ $effect(() => {
351
353
  : ""}{revision?.slice(0, 8) ?? "local"}
352
354
  </code>
353
355
  </td>
354
- <td>
355
- <span class={`status-chip ${status.className}`}>{status.label}</span>
356
- {#if available && item.value.conflict}<span class="conflict">ID conflict</span>{/if}
357
- </td>
356
+ <td><span class={`status-chip ${status.className}`}>{status.label}</span></td>
358
357
  <td><strong>{skill.usage.attachedLast30Days}</strong><span>30d · {skill.usage.attachedAllTime} total</span></td>
359
358
  <td><strong>{skill.usage.invokedLast30Days}</strong><span>30d · {skill.usage.invokedAllTime} total</span></td>
360
359
  </tr>
@@ -421,7 +420,7 @@ $effect(() => {
421
420
  {:else if error && installedSkills.length === 0 && availableSkills.length === 0}
422
421
  <div class="catalog-state error" role="alert"><strong>We couldn't load the skill catalog.</strong><span>{error}</span></div>
423
422
  {:else if activeView === "installed" && installedSkills.length === 0}
424
- <div class="catalog-state"><strong>No skills are installed.</strong><span>Open Available remotely to pull a skill, or configure a direct skill in <code>leitwerk.yaml</code>.</span></div>
423
+ <div class="catalog-state"><strong>No skills are installed.</strong><span>Open Available remotely to install a skill from a configured repository.</span></div>
425
424
  {:else if activeView === "available" && repositories.length === 0}
426
425
  <div class="catalog-state"><strong>No skill repositories are configured.</strong><span>Add <code>skill_repositories</code> to <code>leitwerk.yaml</code>, then restart Leitwerk.</span></div>
427
426
  {:else if activeView === "available" && availableSkills.length === 0}
@@ -470,15 +469,13 @@ $effect(() => {
470
469
  <header class="detail-header"><div><h2>{detail.value.label}</h2><p>{detail.value.description ?? detail.value.id}</p></div><span class={`status-chip ${detailStatus.className}`}>{detailStatus.label}</span></header>
471
470
  {#if actionSuccess}<div class="status-banner success detail-feedback" role="status">{actionSuccess}</div>{/if}
472
471
  {#if detail.kind === "available"}
473
- <div class="detail-actions"><button class="primary-action" type="button" disabled={actionPending || detail.value.stale || detail.value.conflict || (detail.value.registered && !detail.value.updateAvailable)} onclick={() => void activateSkill()}>{actionPending ? "Working…" : detail.value.updateAvailable ? "Update skill" : detail.value.registered ? "Already installed" : "Install skill"}</button></div>
472
+ <div class="detail-actions"><button class="primary-action" type="button" disabled={actionPending || detail.value.stale || (detail.value.registered && !detail.value.updateAvailable)} onclick={() => void activateSkill()}>{actionPending ? "Working…" : detail.value.updateAvailable ? "Update skill" : detail.value.registered ? "Already installed" : "Install skill"}</button></div>
474
473
  {#if detail.value.stale}<p class="action-note warning">This revision was not found during the latest successful repository refresh. It remains visible for history but cannot be installed or updated.</p>{/if}
475
- {#if detail.value.conflict}<p class="action-note warning">This skill ID conflicts with another repository or a configuration-managed skill. Resolve the conflict before installing it.</p>{/if}
476
474
  {:else}
477
475
  <div class="detail-actions">
478
476
  {#if detail.value.updateAvailable && detail.value.sourceRepositoryId}<button class="primary-action" type="button" disabled={actionPending} onclick={() => void activateSkill(detail.value.sourceRepositoryId)}>{actionPending ? "Updating…" : "Update skill"}</button>{/if}
479
- {#if detail.value.registrationKind === "catalog"}<button bind:this={removeButtonEl} class="secondary-action danger" type="button" disabled={actionPending} onclick={() => void requestRemove()}>Remove</button>{/if}
477
+ <button bind:this={removeButtonEl} class="secondary-action danger" type="button" disabled={actionPending} onclick={() => void requestRemove()}>Remove</button>
480
478
  </div>
481
- {#if detail.value.registrationKind === "configuration"}<p class="action-note">This skill is managed by <code>leitwerk.yaml</code>. Change configuration to remove or update it.</p>{/if}
482
479
  {#if confirmRemove}<div class="remove-confirmation" role="group" aria-label={`Remove ${detail.value.label}`}><strong>Remove {detail.value.label} from future runs?</strong><p>Existing processes and schedules keep their pinned revision.</p><div><button bind:this={confirmRemoveButtonEl} class="danger-action" type="button" disabled={actionPending} onclick={() => void deactivateSkill()}>{actionPending ? "Removing…" : "Confirm removal"}</button><button class="secondary-action" type="button" disabled={actionPending} onclick={() => void cancelRemove()}>Cancel</button></div></div>{/if}
483
480
  {/if}
484
481
  {#if actionError}<p class="action-note error" role="alert">{actionError} Try again.</p>{/if}
@@ -492,7 +489,7 @@ $effect(() => {
492
489
  {#if detail.kind === "available"}
493
490
  {@render sourceMetadata(detail.value)}
494
491
  {:else}
495
- <dl class="detail-meta"><div><dt>Managed by</dt><dd>{detail.value.registrationKind === "configuration" ? "Configuration" : repositoryLabels.get(detail.value.sourceRepositoryId ?? "") ?? detail.value.sourceRepositoryId ?? "Repository"}</dd></div><div><dt>Active revision</dt><dd><code>{detail.value.activeSourceRevision ?? detail.value.activeRevisionId}</code></dd></div><div><dt>Usage</dt><dd>{detail.value.usage.attachedAllTime} attached · {detail.value.usage.invokedAllTime} invoked</dd></div></dl>
492
+ <dl class="detail-meta"><div><dt>Managed by</dt><dd>{repositoryLabels.get(detail.value.sourceRepositoryId ?? "") ?? detail.value.sourceRepositoryId ?? "Repository"}</dd></div><div><dt>Active revision</dt><dd><code>{detail.value.activeSourceRevision ?? detail.value.activeRevisionId}</code></dd></div><div><dt>Usage</dt><dd>{detail.value.usage.attachedAllTime} attached · {detail.value.usage.invokedAllTime} invoked</dd></div></dl>
496
493
  <section class="revision-section"><h3>Revision history</h3><div class="revision-list">{#each detail.value.revisions as revision (revision.id)}<div><span><code>{revision.sourceRevision ?? revision.id}</code><small>Imported {formatLocalDateTime(revision.importedAt)}</small></span>{#if revision.active}<span class="status-chip registered">Active</span>{/if}</div>{/each}</div></section>
497
494
  {/if}
498
495
  {@render processUsage(detail.value.processes)}
@@ -593,12 +590,12 @@ $effect(() => {
593
590
  .skill-table a:hover strong { color: var(--chronicle-accent); }
594
591
  .skill-table td strong { color: var(--chronicle-text); font-size: var(--type-body); font-weight: 650; }
595
592
  .skill-table td span, .skill-table td code { display: block; }
593
+ .skill-table .model-invocation { margin-top: 3px; color: var(--chronicle-text-faint); font-size: var(--type-caption); font-weight: 600; }
596
594
  .skill-table code, .detail-meta code, .revision-list code { font-family: var(--font-mono); font-size: var(--type-caption); overflow-wrap: anywhere; }
597
595
  .status-chip { display: inline-flex !important; width: fit-content; padding: 5px 9px; border-radius: 999px; background: var(--chronicle-panel-muted); color: var(--chronicle-text-muted); font-size: var(--type-caption); font-weight: 650; white-space: nowrap; }
598
596
  .status-chip.registered { background: var(--chronicle-success-surface); color: var(--chronicle-success); }
599
597
  .status-chip.update { background: color-mix(in srgb, white 88%, var(--chronicle-attention) 12%); color: var(--chronicle-attention); }
600
598
  .status-chip.stale { background: color-mix(in srgb, white 88%, var(--chronicle-danger) 12%); color: var(--chronicle-danger-text); }
601
- .conflict { margin-top: 5px; color: var(--chronicle-danger-text); font-size: var(--type-caption); }
602
599
  .detail-pane { position: relative; width: min(500px, 38vw); min-width: 400px; height: 100%; min-height: 0; padding: var(--space-xl); overflow-y: auto; border-radius: var(--radius-lg); background: var(--chronicle-card-surface-strong); box-shadow: var(--chronicle-shadow); }
603
600
  .mobile-detail-nav { display: none; margin-bottom: var(--space-md); }
604
601
  .mobile-back-button { display: inline-flex; align-items: center; gap: var(--space-2xs); padding: 6px 12px; border-radius: var(--radius-sm); background: var(--chronicle-panel-muted); color: var(--chronicle-text); font-size: var(--type-body-sm); font-weight: 620; text-decoration: none; }