@runwisp/ui 0.12.0 → 0.13.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@runwisp/ui",
3
3
  "description": "Svelte 5 UI component library for RunWisp dashboards and admin interfaces.",
4
- "version": "0.12.0",
4
+ "version": "0.13.0",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -50,8 +50,8 @@
50
50
  "@chromatic-com/storybook": "^4.1.3",
51
51
  "@eslint/compat": "^1.4.0",
52
52
  "@eslint/js": "^9.39.1",
53
- "@runwisp/eslint-config": "0.12.0",
54
- "@runwisp/typescript-config": "0.12.0",
53
+ "@runwisp/eslint-config": "0.13.0",
54
+ "@runwisp/typescript-config": "0.13.0",
55
55
  "@storybook/addon-a11y": "^10.1.9",
56
56
  "@storybook/addon-docs": "^10.1.9",
57
57
  "@storybook/addon-svelte-csf": "^5.0.10",
@@ -99,7 +99,7 @@
99
99
  "@floating-ui/dom": "^1.7.4",
100
100
  "@fontsource/tasa-orbiter": "^5.2.2",
101
101
  "@lucide/svelte": "^0.561.0",
102
- "@runwisp/common": "0.12.0",
102
+ "@runwisp/common": "0.13.0",
103
103
  "@tanstack/svelte-virtual": "^3.13.25",
104
104
  "ansi-to-html": "^0.7.2",
105
105
  "cron-parser": "^5.4.0",
@@ -12,6 +12,11 @@
12
12
  required?: boolean;
13
13
  children: Snippet;
14
14
  class?: string;
15
+ // The id of the control this field labels. Pass the SAME id to the wrapped
16
+ // input/select so the <label for> actually points at it — otherwise the
17
+ // label is dead (clicking it does nothing; screen readers can't associate
18
+ // it). Falls back to a generated id when the field has no focusable target.
19
+ id?: string;
15
20
  }
16
21
 
17
22
  let {
@@ -22,14 +27,16 @@
22
27
  required = false,
23
28
  children,
24
29
  class: className = "",
30
+ id,
25
31
  }: Props = $props();
26
32
 
27
33
  const generatedId = `field-${Math.random().toString(36).slice(2, 10)}`;
34
+ const fieldId = $derived(id ?? generatedId);
28
35
  </script>
29
36
 
30
37
  <div class="space-y-1.5 {className}">
31
38
  {#if label}
32
- <label for={generatedId} class="block text-sm font-medium text-on-surface-muted">
39
+ <label for={fieldId} class="block text-sm font-medium text-on-surface-muted">
33
40
  {label}
34
41
  {#if required}
35
42
  <span class="text-danger-soft-text">*</span>
@@ -21,6 +21,7 @@
21
21
  Maximize2,
22
22
  Minimize2,
23
23
  TextWrap,
24
+ SearchX,
24
25
  } from "@lucide/svelte";
25
26
  import Button from "../Button.svelte";
26
27
  import EmptyState from "../EmptyState.svelte";
@@ -67,6 +68,7 @@
67
68
  historyVisible = false,
68
69
  highlightLine = null,
69
70
  getInstanceCount = () => 1,
71
+ notFound = false,
70
72
  }: {
71
73
  run: Run | undefined;
72
74
  fetchLogs: (
@@ -112,6 +114,10 @@
112
114
  // Resolves a task's currently configured instance count so multi-instance
113
115
  // services render a 1-based #N suffix. Defaults to single-instance.
114
116
  getInstanceCount?: (taskName: string) => number;
117
+ // True when a deep-linked run id resolved to no run (deleted by retention,
118
+ // or never existed). The empty state then says so plainly instead of the
119
+ // generic "Select a run" — the caller must not silently substitute another.
120
+ notFound?: boolean;
115
121
  } = $props();
116
122
 
117
123
  let canDelete = $derived.by(() => {
@@ -837,13 +843,15 @@
837
843
  class="flex min-w-0 flex-1 flex-col items-center justify-center gap-4 bg-surface-sunken/30"
838
844
  >
839
845
  <EmptyState
840
- title={onRunTask ? "No runs yet" : "Select a run"}
841
- description={onRunTask
842
- ? "This task hasn't run yet. Trigger it to see its output here."
843
- : "Pick a run from the list to view details and logs."}
844
- icon={MousePointerClick}
846
+ title={notFound ? "Run not found" : onRunTask ? "No runs yet" : "Select a run"}
847
+ description={notFound
848
+ ? "This run doesn't exist — it may have been deleted by retention, or the link is wrong. Pick a run from the list to continue."
849
+ : onRunTask
850
+ ? "This task hasn't run yet. Trigger it to see its output here."
851
+ : "Pick a run from the list to view details and logs."}
852
+ icon={notFound ? SearchX : MousePointerClick}
845
853
  />
846
- {#if onRunTask}
854
+ {#if onRunTask && !notFound}
847
855
  <button
848
856
  type="button"
849
857
  onclick={() => onRunTask()}