@poodle64/ui 2026.11.11 → 2026.11.12
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/README.md +4 -0
- package/dist/components/settings/settings-page.svelte +1 -1
- package/dist/components/ui/app-identity/app-identity.svelte +5 -6
- package/dist/components/ui/app-identity/app-identity.svelte.d.ts +3 -4
- package/dist/components/ui/app-shell/app-nav.svelte +1 -1
- package/dist/components/ui/app-shell/app-shell.svelte +9 -9
- package/dist/components/ui/app-shell/app-shell.svelte.d.ts +6 -6
- package/dist/components/ui/app-shell/shell-data.d.ts +3 -3
- package/dist/updater.svelte.d.ts +36 -0
- package/dist/updater.svelte.js +129 -0
- package/package.json +23 -4
- package/registry/component-map.json +1 -1
- package/registry/component-map.md +1 -1
package/README.md
CHANGED
|
@@ -1595,6 +1595,10 @@ one is bound to Xero tax codes besides. Relative time ("2 hours ago") is out
|
|
|
1595
1595
|
too — it rides on `date-fns` in the one app that has it, and a display formatter
|
|
1596
1596
|
is not worth making that a dependency of every consumer.
|
|
1597
1597
|
|
|
1598
|
+
## Desktop self-update
|
|
1599
|
+
|
|
1600
|
+
`@poodle64/ui/updater` is the Tauri-only self-update: `onMount(startUpdateChecks)` in the root layout checks the app's signed GitHub releases at launch and every six hours, and offers the update in a toast. `getUpdaterState()` and `checkForUpdate()` drive a Settings-pane control. It needs the optional peers `@tauri-apps/api`, `@tauri-apps/plugin-updater` and `@tauri-apps/plugin-process`, and the host's `tauri-plugin-telemetry`. Setup, keys and adoption: `docs/development/desktop-updater.md` in app-factory.
|
|
1601
|
+
|
|
1598
1602
|
## Browser telemetry and the feedback widget
|
|
1599
1603
|
|
|
1600
1604
|
Two exports are app machinery rather than page chrome: `@poodle64/ui/telemetry`
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Setting, rendered from the JSON Schema `GET <endpoint>/` returns, nested by
|
|
4
4
|
dot path and laid out one group per domain (`nest.ts`), so an app that
|
|
5
5
|
declares a setting adds no code here. `<SchemaForm>` has no per-field reset,
|
|
6
|
-
so "default versus override, reset in one act" (the
|
|
6
|
+
so "default versus override, reset in one act" (the page's purpose) is
|
|
7
7
|
the panel below it. An app mounts it as its settings route's whole body.
|
|
8
8
|
-->
|
|
9
9
|
<script lang="ts" module>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* The signed-in user surface for AppShell's `identity` slot.
|
|
4
4
|
*
|
|
5
5
|
* Graduated from the shell lab (`packages/console/src/routes/lab/+page.svelte`,
|
|
6
|
-
* the `identity === 'avatar'` shape) —
|
|
6
|
+
* the `identity === 'avatar'` shape) — avatar
|
|
7
7
|
* only at rest, no name, no chevron, and no prop reintroduces a variant.
|
|
8
8
|
* Opening it answers who is signed in, which workspace they act in, and the
|
|
9
9
|
* ways out — identity first, because a menu that opens on a list of actions
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* `onManageMembers` exists for the caller a workspace switcher has nothing
|
|
28
28
|
* to show: `WorkspaceMenu` (the factory template) renders nothing in the
|
|
29
29
|
* bar for a single-member workspace, and this is where Members lands
|
|
30
|
-
* instead (
|
|
30
|
+
* instead (master-project#291's org-of-one
|
|
31
31
|
* case). Wire it whenever the app has a members route, whether or not it
|
|
32
32
|
* also renders a switcher.
|
|
33
33
|
*
|
|
@@ -69,8 +69,7 @@
|
|
|
69
69
|
* `workspace` is unset.
|
|
70
70
|
*
|
|
71
71
|
* A workspace holding exactly one member has nothing to switch, so the
|
|
72
|
-
* app's own workspace switcher renders nothing for it
|
|
73
|
-
* 07/09/2026) — and Members was that switcher's one non-switching act,
|
|
72
|
+
* app's own workspace switcher renders nothing for it — and Members was that switcher's one non-switching act,
|
|
74
73
|
* the route an org-of-one needs to make its first grant. This is where
|
|
75
74
|
* that act lives once the switcher is gone; a switcher still showing for
|
|
76
75
|
* several workspaces keeps its own Members entry too, so the two never
|
|
@@ -121,7 +120,7 @@
|
|
|
121
120
|
*
|
|
122
121
|
* A handle has no word boundaries a name has: `initialsOf` slicing the
|
|
123
122
|
* first two characters of one unbroken token produces a pair that reads
|
|
124
|
-
* as real initials while meaning nothing
|
|
123
|
+
* as real initials while meaning nothing.
|
|
125
124
|
* Where the handle itself encodes two parts — `firstname.lastname`,
|
|
126
125
|
* `firstname-lastname` — one letter from each reads the same as a real
|
|
127
126
|
* name's initials; where it does not, only the first letter is honest.
|
|
@@ -133,7 +132,7 @@
|
|
|
133
132
|
return (parts[0][0] + parts[parts.length - 1][0]).toUpperCase();
|
|
134
133
|
}
|
|
135
134
|
|
|
136
|
-
// Never text in the bar
|
|
135
|
+
// Never text in the bar: with no display
|
|
137
136
|
// name, the trigger below still renders only this avatar, initialled off
|
|
138
137
|
// the handle rather than off `shown`, which for this branch just IS the
|
|
139
138
|
// handle.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* The signed-in user surface for AppShell's `identity` slot.
|
|
3
3
|
*
|
|
4
4
|
* Graduated from the shell lab (`packages/console/src/routes/lab/+page.svelte`,
|
|
5
|
-
* the `identity === 'avatar'` shape) —
|
|
5
|
+
* the `identity === 'avatar'` shape) — avatar
|
|
6
6
|
* only at rest, no name, no chevron, and no prop reintroduces a variant.
|
|
7
7
|
* Opening it answers who is signed in, which workspace they act in, and the
|
|
8
8
|
* ways out — identity first, because a menu that opens on a list of actions
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
* `onManageMembers` exists for the caller a workspace switcher has nothing
|
|
27
27
|
* to show: `WorkspaceMenu` (the factory template) renders nothing in the
|
|
28
28
|
* bar for a single-member workspace, and this is where Members lands
|
|
29
|
-
* instead (
|
|
29
|
+
* instead (master-project#291's org-of-one
|
|
30
30
|
* case). Wire it whenever the app has a members route, whether or not it
|
|
31
31
|
* also renders a switcher.
|
|
32
32
|
*
|
|
@@ -57,8 +57,7 @@ type $$ComponentProps = {
|
|
|
57
57
|
* `workspace` is unset.
|
|
58
58
|
*
|
|
59
59
|
* A workspace holding exactly one member has nothing to switch, so the
|
|
60
|
-
* app's own workspace switcher renders nothing for it
|
|
61
|
-
* 07/09/2026) — and Members was that switcher's one non-switching act,
|
|
60
|
+
* app's own workspace switcher renders nothing for it — and Members was that switcher's one non-switching act,
|
|
62
61
|
* the route an org-of-one needs to make its first grant. This is where
|
|
63
62
|
* that act lives once the switcher is gone; a switcher still showing for
|
|
64
63
|
* several workspaces keeps its own Members entry too, so the two never
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*
|
|
12
12
|
* It is no longer how an app gets a second navigation COLUMN, because there
|
|
13
13
|
* is no longer such a thing: AppShell's `sidebar` slot was removed in
|
|
14
|
-
* 2026.8.11 (
|
|
14
|
+
* 2026.8.11 (no app supports an additional
|
|
15
15
|
* sidebar). An item carrying `children` discloses them in place, beneath
|
|
16
16
|
* itself, and that is where a section's own pages go at every width. See
|
|
17
17
|
* `types.ts` on `children` for why the nested rail won over
|
|
@@ -14,13 +14,13 @@
|
|
|
14
14
|
* permanent side rail on md+ (an overlay drawer below it) carrying primary
|
|
15
15
|
* navigation and the brand, PLUS a
|
|
16
16
|
* real top navbar (search, leading/trailing slots, theme toggle, identity) —
|
|
17
|
-
* always both together.
|
|
17
|
+
* always both together. Every household app
|
|
18
18
|
* renders one shell shape; apps do not choose variants.
|
|
19
19
|
*
|
|
20
20
|
* The bar, left to right: the breadcrumbs (where you are; the last crumb names
|
|
21
21
|
* the page), the app's context and the page's own controls, then from the far
|
|
22
22
|
* right the account, the day/night toggle, the alerts, the report button and
|
|
23
|
-
* a small search
|
|
23
|
+
* a small search. The collapse toggle is the
|
|
24
24
|
* sidebar's own, on its top (30/10/2026 and 03/11/2026: a control that works
|
|
25
25
|
* the sidebar belongs on the sidebar, not the bar). Settings are the account
|
|
26
26
|
* menu's. None of it is a prop an app tunes: an app declares data, and the
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
* `reading`, `panel`, `tool` or `bare`, see page.ts) and the shell owns everything
|
|
31
31
|
* that follows from it: the column's width and centring, the gutters, the
|
|
32
32
|
* pane flush against the rail, the aside beside the content, and which of
|
|
33
|
-
* them scrolls. The less an app decides, the better
|
|
33
|
+
* them scrolls. The less an app decides, the better.
|
|
34
34
|
*
|
|
35
35
|
* Content TEXTURE came back the same way, on the same kind of evidence. Two
|
|
36
36
|
* apps had separately built one picture — a faint dot-grid floor with a soft
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
* `sidebar` was such a slot until 2026.8.11, and what it produced was two
|
|
54
54
|
* apps rendering a module's own pages beside the rail while the other seven
|
|
55
55
|
* rendered them inside it — the shell shape differing per app, and in one app
|
|
56
|
-
* per MODULE, which is the thing this component exists to stop.
|
|
57
|
-
*
|
|
56
|
+
* per MODULE, which is the thing this component exists to stop. The
|
|
57
|
+
* rule, from seeing one app's two modules disagree: no app
|
|
58
58
|
* supports an additional sidebar; a section's own pages roll out beneath it
|
|
59
59
|
* in the rail. That is `NavItem.children` (see types.ts), which the rail
|
|
60
60
|
* already discloses at every width and folds into the one drawer on a phone.
|
|
@@ -152,7 +152,7 @@
|
|
|
152
152
|
* Defaults ON. It was opt-in while the control was being introduced, and
|
|
153
153
|
* two of nine household apps opted in — so seven rails could not be
|
|
154
154
|
* collapsed, for no reason anyone had chosen. The shell shape is not an
|
|
155
|
-
* app's to pick
|
|
155
|
+
* app's to pick; set `false` only where a
|
|
156
156
|
* rail genuinely must not collapse.
|
|
157
157
|
*/
|
|
158
158
|
collapsible?: boolean;
|
|
@@ -726,8 +726,8 @@
|
|
|
726
726
|
|
|
727
727
|
<!--
|
|
728
728
|
The rail's head: the brand and, from md, the collapse toggle, on the
|
|
729
|
-
sidebar's top (
|
|
730
|
-
sidebar itself, at its top, not on the rail
|
|
729
|
+
sidebar's top (the sidebar toggle sits on the
|
|
730
|
+
sidebar itself, at its top, not on the rail). Collapsed (to icons, or
|
|
731
731
|
peeking) the two stack, the toggle under the mark, so no row moves when
|
|
732
732
|
the rail peeks.
|
|
733
733
|
-->
|
|
@@ -855,7 +855,7 @@
|
|
|
855
855
|
<!-- The bar, left to right: where you are (the breadcrumbs), the app's own
|
|
856
856
|
context (a workspace switch), the page's controls, then, from the far
|
|
857
857
|
right, the search, the report, the alerts, the day/night toggle and the
|
|
858
|
-
account
|
|
858
|
+
account. `min-w-0` lets the trail shrink
|
|
859
859
|
under crowding rather than floor at its own content and push the
|
|
860
860
|
trailing controls past the bar's edge (design-system#111). The trail
|
|
861
861
|
stays inline from sm; the page's controls take a second row of the bar
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
* permanent side rail on md+ (an overlay drawer below it) carrying primary
|
|
14
14
|
* navigation and the brand, PLUS a
|
|
15
15
|
* real top navbar (search, leading/trailing slots, theme toggle, identity) —
|
|
16
|
-
* always both together.
|
|
16
|
+
* always both together. Every household app
|
|
17
17
|
* renders one shell shape; apps do not choose variants.
|
|
18
18
|
*
|
|
19
19
|
* The bar, left to right: the breadcrumbs (where you are; the last crumb names
|
|
20
20
|
* the page), the app's context and the page's own controls, then from the far
|
|
21
21
|
* right the account, the day/night toggle, the alerts, the report button and
|
|
22
|
-
* a small search
|
|
22
|
+
* a small search. The collapse toggle is the
|
|
23
23
|
* sidebar's own, on its top (30/10/2026 and 03/11/2026: a control that works
|
|
24
24
|
* the sidebar belongs on the sidebar, not the bar). Settings are the account
|
|
25
25
|
* menu's. None of it is a prop an app tunes: an app declares data, and the
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
* `reading`, `panel`, `tool` or `bare`, see page.ts) and the shell owns everything
|
|
30
30
|
* that follows from it: the column's width and centring, the gutters, the
|
|
31
31
|
* pane flush against the rail, the aside beside the content, and which of
|
|
32
|
-
* them scrolls. The less an app decides, the better
|
|
32
|
+
* them scrolls. The less an app decides, the better.
|
|
33
33
|
*
|
|
34
34
|
* Content TEXTURE came back the same way, on the same kind of evidence. Two
|
|
35
35
|
* apps had separately built one picture — a faint dot-grid floor with a soft
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
* `sidebar` was such a slot until 2026.8.11, and what it produced was two
|
|
53
53
|
* apps rendering a module's own pages beside the rail while the other seven
|
|
54
54
|
* rendered them inside it — the shell shape differing per app, and in one app
|
|
55
|
-
* per MODULE, which is the thing this component exists to stop.
|
|
56
|
-
*
|
|
55
|
+
* per MODULE, which is the thing this component exists to stop. The
|
|
56
|
+
* rule, from seeing one app's two modules disagree: no app
|
|
57
57
|
* supports an additional sidebar; a section's own pages roll out beneath it
|
|
58
58
|
* in the rail. That is `NavItem.children` (see types.ts), which the rail
|
|
59
59
|
* already discloses at every width and folds into the one drawer on a phone.
|
|
@@ -93,7 +93,7 @@ type $$ComponentProps = {
|
|
|
93
93
|
* Defaults ON. It was opt-in while the control was being introduced, and
|
|
94
94
|
* two of nine household apps opted in — so seven rails could not be
|
|
95
95
|
* collapsed, for no reason anyone had chosen. The shell shape is not an
|
|
96
|
-
* app's to pick
|
|
96
|
+
* app's to pick; set `false` only where a
|
|
97
97
|
* rail genuinely must not collapse.
|
|
98
98
|
*/
|
|
99
99
|
collapsible?: boolean;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* What an app declares about its shell: data, never markup. The factory's frame
|
|
3
3
|
* (the template's `app-frame.svelte`) reads it and lays the rail, the sidebar
|
|
4
|
-
* and the page frame out
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* and the page frame out. Apps declare what they need in the sidebar; they own
|
|
5
|
+
* their domain logic and what they put on the screens, not what the screens
|
|
6
|
+
* look like.
|
|
7
7
|
*
|
|
8
8
|
* export const shell: ShellData<typeof auth> = {
|
|
9
9
|
* workspaceLabel: 'Household',
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A desktop app's self-update, over `tauri-plugin-updater`: check the app's own
|
|
3
|
+
* signed GitHub releases, download, install, relaunch. Toasts (svelte-sonner)
|
|
4
|
+
* tell the person what is on offer; `getUpdaterState()` is what an app's
|
|
5
|
+
* Settings pane reads to show the check. Tauri-only: import it from a desktop
|
|
6
|
+
* app's layout, never from a web app.
|
|
7
|
+
*/
|
|
8
|
+
import { type Update } from '@tauri-apps/plugin-updater';
|
|
9
|
+
export type UpdateState = 'idle' | 'checking' | 'available' | 'downloading' | 'up-to-date' | 'error';
|
|
10
|
+
export interface UpdaterState {
|
|
11
|
+
state: UpdateState;
|
|
12
|
+
update: Update | null;
|
|
13
|
+
updateVersion: string | null;
|
|
14
|
+
error: string | null;
|
|
15
|
+
}
|
|
16
|
+
/** How often a running app checks again: it stays up for weeks between launches. */
|
|
17
|
+
export declare const UPDATE_RECHECK_MS: number;
|
|
18
|
+
/** The updater's state, reactive. */
|
|
19
|
+
export declare function getUpdaterState(): UpdaterState;
|
|
20
|
+
/** Download and install the update on offer, then relaunch. */
|
|
21
|
+
export declare function downloadAndInstall(): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Check for an update. A found update raises a toast that stays until acted
|
|
24
|
+
* on; a failure raises one unless `quiet`. The outcome is reported to the host
|
|
25
|
+
* process (`tauri-plugin-telemetry`), the one thing allowed to emit telemetry.
|
|
26
|
+
*/
|
|
27
|
+
export declare function checkForUpdate({ quiet }?: {
|
|
28
|
+
quiet?: boolean;
|
|
29
|
+
}): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Check now, then again every {@link UPDATE_RECHECK_MS} while the app runs, so a
|
|
32
|
+
* release published after launch is still offered. A re-check is skipped while
|
|
33
|
+
* an update is on offer or a check is in flight, and fails quietly: an offline
|
|
34
|
+
* Mac raises no error toast. Returns the function that stops the schedule.
|
|
35
|
+
*/
|
|
36
|
+
export declare function startUpdateChecks(): () => void;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A desktop app's self-update, over `tauri-plugin-updater`: check the app's own
|
|
3
|
+
* signed GitHub releases, download, install, relaunch. Toasts (svelte-sonner)
|
|
4
|
+
* tell the person what is on offer; `getUpdaterState()` is what an app's
|
|
5
|
+
* Settings pane reads to show the check. Tauri-only: import it from a desktop
|
|
6
|
+
* app's layout, never from a web app.
|
|
7
|
+
*/
|
|
8
|
+
import { check } from '@tauri-apps/plugin-updater';
|
|
9
|
+
import { relaunch } from '@tauri-apps/plugin-process';
|
|
10
|
+
import { invoke } from '@tauri-apps/api/core';
|
|
11
|
+
import { toast } from 'svelte-sonner';
|
|
12
|
+
const updaterState = $state({
|
|
13
|
+
state: 'idle',
|
|
14
|
+
update: null,
|
|
15
|
+
updateVersion: null,
|
|
16
|
+
error: null
|
|
17
|
+
});
|
|
18
|
+
/** How often a running app checks again: it stays up for weeks between launches. */
|
|
19
|
+
export const UPDATE_RECHECK_MS = 6 * 60 * 60 * 1000;
|
|
20
|
+
/** The updater's state, reactive. */
|
|
21
|
+
export function getUpdaterState() {
|
|
22
|
+
return updaterState;
|
|
23
|
+
}
|
|
24
|
+
/** Translate a raw update error into a message a person can act on. */
|
|
25
|
+
function describeUpdateError(err) {
|
|
26
|
+
const raw = err instanceof Error ? err.message : String(err);
|
|
27
|
+
const lower = raw.toLowerCase();
|
|
28
|
+
if (lower.includes('permission') || lower.includes('privilege') || lower.includes('cancel')) {
|
|
29
|
+
return 'Update requires administrator access. Try again and enter your password when prompted.';
|
|
30
|
+
}
|
|
31
|
+
if (lower.includes('network') || lower.includes('connect') || lower.includes('timed out') || lower.includes('fetch')) {
|
|
32
|
+
return 'Download interrupted. Check your internet connection and try again.';
|
|
33
|
+
}
|
|
34
|
+
if (lower.includes('signature') || lower.includes('verify')) {
|
|
35
|
+
return 'Update signature verification failed. The download may be corrupted. Try again.';
|
|
36
|
+
}
|
|
37
|
+
return `Update failed: ${raw}`;
|
|
38
|
+
}
|
|
39
|
+
/** Download and install the update on offer, then relaunch. */
|
|
40
|
+
export async function downloadAndInstall() {
|
|
41
|
+
if (!updaterState.update)
|
|
42
|
+
return;
|
|
43
|
+
const toastId = toast.loading('Downloading update...');
|
|
44
|
+
try {
|
|
45
|
+
updaterState.state = 'downloading';
|
|
46
|
+
let downloaded = 0;
|
|
47
|
+
let total = 0;
|
|
48
|
+
await updaterState.update.downloadAndInstall((event) => {
|
|
49
|
+
if (event.event === 'Started') {
|
|
50
|
+
total = event.data.contentLength ?? 0;
|
|
51
|
+
}
|
|
52
|
+
else if (event.event === 'Progress') {
|
|
53
|
+
downloaded += event.data.chunkLength;
|
|
54
|
+
if (total > 0) {
|
|
55
|
+
const pct = Math.min(99, Math.round((downloaded / total) * 100));
|
|
56
|
+
toast.loading(`Downloading update... ${pct}%`, { id: toastId });
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
else if (event.event === 'Finished') {
|
|
60
|
+
toast.success('Update installed. Restarting...', { id: toastId });
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
await relaunch();
|
|
64
|
+
}
|
|
65
|
+
catch (err) {
|
|
66
|
+
const message = describeUpdateError(err);
|
|
67
|
+
updaterState.state = 'error';
|
|
68
|
+
updaterState.error = message;
|
|
69
|
+
toast.error('Update failed', {
|
|
70
|
+
id: toastId,
|
|
71
|
+
description: message,
|
|
72
|
+
action: { label: 'Retry', onClick: () => void checkForUpdate() }
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Check for an update. A found update raises a toast that stays until acted
|
|
78
|
+
* on; a failure raises one unless `quiet`. The outcome is reported to the host
|
|
79
|
+
* process (`tauri-plugin-telemetry`), the one thing allowed to emit telemetry.
|
|
80
|
+
*/
|
|
81
|
+
export async function checkForUpdate({ quiet = false } = {}) {
|
|
82
|
+
updaterState.state = 'checking';
|
|
83
|
+
updaterState.error = null;
|
|
84
|
+
updaterState.update = null;
|
|
85
|
+
updaterState.updateVersion = null;
|
|
86
|
+
try {
|
|
87
|
+
const update = await check();
|
|
88
|
+
if (update) {
|
|
89
|
+
updaterState.state = 'available';
|
|
90
|
+
updaterState.update = update;
|
|
91
|
+
updaterState.updateVersion = update.version;
|
|
92
|
+
void invoke('plugin:telemetry|report_update_check', { available: true, failed: false });
|
|
93
|
+
toast.info(`Update available: v${update.version}`, {
|
|
94
|
+
description: `Version ${update.version} is ready to install`,
|
|
95
|
+
duration: Infinity,
|
|
96
|
+
action: { label: 'Update Now', onClick: () => void downloadAndInstall() },
|
|
97
|
+
cancel: { label: 'Later', onClick: () => { } }
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
updaterState.state = 'up-to-date';
|
|
102
|
+
void invoke('plugin:telemetry|report_update_check', { available: false, failed: false });
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
catch (err) {
|
|
106
|
+
updaterState.state = 'error';
|
|
107
|
+
updaterState.error = err instanceof Error ? err.message : 'Failed to check for updates';
|
|
108
|
+
console.error('Update check failed:', err);
|
|
109
|
+
void invoke('plugin:telemetry|report_update_check', { available: false, failed: true });
|
|
110
|
+
if (quiet)
|
|
111
|
+
return;
|
|
112
|
+
toast.error('Failed to check for updates', { description: updaterState.error });
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Check now, then again every {@link UPDATE_RECHECK_MS} while the app runs, so a
|
|
117
|
+
* release published after launch is still offered. A re-check is skipped while
|
|
118
|
+
* an update is on offer or a check is in flight, and fails quietly: an offline
|
|
119
|
+
* Mac raises no error toast. Returns the function that stops the schedule.
|
|
120
|
+
*/
|
|
121
|
+
export function startUpdateChecks() {
|
|
122
|
+
void checkForUpdate({ quiet: true });
|
|
123
|
+
const timer = setInterval(() => {
|
|
124
|
+
if (!['checking', 'available', 'downloading'].includes(updaterState.state)) {
|
|
125
|
+
void checkForUpdate({ quiet: true });
|
|
126
|
+
}
|
|
127
|
+
}, UPDATE_RECHECK_MS);
|
|
128
|
+
return () => clearInterval(timer);
|
|
129
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@poodle64/ui",
|
|
3
|
-
"version": "2026.11.
|
|
3
|
+
"version": "2026.11.12",
|
|
4
4
|
"description": "Household shared component layer: shadcn-svelte primitives (bits-ui) plus the composed page chrome every app builds its routes from, restyled by each app's @poodle64/design-tokens alias layer. One fix reaches every app.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,6 +34,10 @@
|
|
|
34
34
|
"types": "./dist/telemetry.d.ts",
|
|
35
35
|
"svelte": "./dist/telemetry.js"
|
|
36
36
|
},
|
|
37
|
+
"./updater": {
|
|
38
|
+
"types": "./dist/updater.svelte.d.ts",
|
|
39
|
+
"svelte": "./dist/updater.svelte.js"
|
|
40
|
+
},
|
|
37
41
|
"./feedback": {
|
|
38
42
|
"types": "./dist/components/feedback/index.d.ts",
|
|
39
43
|
"svelte": "./dist/components/feedback/index.js"
|
|
@@ -55,6 +59,9 @@
|
|
|
55
59
|
"ds-check-colour-surface": "bin/check-colour-surface.mjs"
|
|
56
60
|
},
|
|
57
61
|
"peerDependencies": {
|
|
62
|
+
"@tauri-apps/api": "^2.0.0",
|
|
63
|
+
"@tauri-apps/plugin-process": "^2.0.0",
|
|
64
|
+
"@tauri-apps/plugin-updater": "^2.0.0",
|
|
58
65
|
"bits-ui": "^2.18.1",
|
|
59
66
|
"formsnap": "^2.1.0",
|
|
60
67
|
"mode-watcher": "^1.1.0",
|
|
@@ -63,15 +70,24 @@
|
|
|
63
70
|
"sveltekit-superforms": "^2.30.0 || ^3.0.0"
|
|
64
71
|
},
|
|
65
72
|
"peerDependenciesMeta": {
|
|
66
|
-
"
|
|
73
|
+
"@tauri-apps/api": {
|
|
67
74
|
"optional": true
|
|
68
75
|
},
|
|
69
|
-
"
|
|
76
|
+
"@tauri-apps/plugin-process": {
|
|
77
|
+
"optional": true
|
|
78
|
+
},
|
|
79
|
+
"@tauri-apps/plugin-updater": {
|
|
70
80
|
"optional": true
|
|
71
81
|
},
|
|
72
82
|
"formsnap": {
|
|
73
83
|
"optional": true
|
|
74
84
|
},
|
|
85
|
+
"mode-watcher": {
|
|
86
|
+
"optional": true
|
|
87
|
+
},
|
|
88
|
+
"svelte-sonner": {
|
|
89
|
+
"optional": true
|
|
90
|
+
},
|
|
75
91
|
"sveltekit-superforms": {
|
|
76
92
|
"optional": true
|
|
77
93
|
}
|
|
@@ -97,6 +113,9 @@
|
|
|
97
113
|
"@sveltejs/package": "^3.0.0",
|
|
98
114
|
"@sveltejs/vite-plugin-svelte": "^7.1.2",
|
|
99
115
|
"@tailwindcss/cli": "^4.3.2",
|
|
116
|
+
"@tauri-apps/api": "^2.11.1",
|
|
117
|
+
"@tauri-apps/plugin-process": "^2.3.1",
|
|
118
|
+
"@tauri-apps/plugin-updater": "^2.14.1",
|
|
100
119
|
"@testing-library/jest-dom": "^7.0.0",
|
|
101
120
|
"@testing-library/svelte": "^5.4.2",
|
|
102
121
|
"@types/d3-force": "^3.0.10",
|
|
@@ -128,7 +147,7 @@
|
|
|
128
147
|
"harness:build": "vite build --config harness/vite.config.ts && tailwindcss -i harness/harness.css -o harness/dist/app.css --minify",
|
|
129
148
|
"harness:serve": "python3 -m http.server 4180 --directory harness/dist"
|
|
130
149
|
},
|
|
131
|
-
"packageManager": "pnpm@12.
|
|
150
|
+
"packageManager": "pnpm@12.18.0",
|
|
132
151
|
"imports": {
|
|
133
152
|
"#lib": "./src/lib/index.js",
|
|
134
153
|
"#lib/*": "./src/lib/*"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @poodle64/ui — situation → component map
|
|
2
2
|
|
|
3
3
|
<!-- GENERATED by scripts/generate-registry.mjs from scripts/situations.json + package source. DO NOT EDIT. -->
|
|
4
|
-
Generated from `@poodle64/ui@2026.11.
|
|
4
|
+
Generated from `@poodle64/ui@2026.11.12`. 76 components, 20 situations.
|
|
5
5
|
|
|
6
6
|
**Read this before writing a `<div>`.** Find the SITUATION you are in below, then compose the component named for it — do not hand-build it from raw `Card` or utility classes. Import is `import { Name } from '<import path>'`. Props marked `?` are optional. This map is the retrieval step the [`design-frontend` skill] makes mandatory; the [CHI 2026 study] measured composing-from-a-registry at 95% design-system compliance against 71% for writing the CSS from a prose style guide.
|
|
7
7
|
|