@fungi.computer/tourtois 0.11.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AppPane.d.ts +6 -2
- package/dist/AppPane.js +43 -30
- package/dist/AppWorkbench.js +4 -2
- package/dist/app-directory.d.ts +9 -0
- package/dist/app-directory.js +4 -1
- package/dist/desktop/Desktop.d.ts +4 -0
- package/dist/desktop/Desktop.js +1 -1
- package/dist/desktop/launcher-gill.d.ts +6 -1
- package/dist/desktop/launcher-gill.js +53 -7
- package/dist/desktop/welcome.css +17 -0
- package/dist/oyster-platform-controls.js +8 -0
- package/dist/platform-controls.d.ts +2 -0
- package/dist/shell.css +20 -20
- package/package.json +5 -5
package/dist/AppPane.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export declare function FocusedWindowControls({ app, onOpenSettings, onOpenPermi
|
|
|
8
8
|
onOpenPermissions: () => void;
|
|
9
9
|
projection: AppWindowProjection;
|
|
10
10
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
-
export declare function AppPane({ projection, nextLaunch, icon, manager, onError, index, focusWindow, afterHide, onBack, onSelectComputer, }: {
|
|
11
|
+
export declare function AppPane({ projection, nextLaunch, icon, manager, onError, index, focusWindow, afterHide, onBack, onSelectComputer, onChooseComputer, }: {
|
|
12
12
|
projection: AppWindowProjection;
|
|
13
13
|
nextLaunch?: AppLaunchDescriptor | null;
|
|
14
14
|
icon: string | null | undefined;
|
|
@@ -20,6 +20,8 @@ export declare function AppPane({ projection, nextLaunch, icon, manager, onError
|
|
|
20
20
|
onBack: (id: string) => void;
|
|
21
21
|
/** The person chose another of this window's offered Computers. */
|
|
22
22
|
onSelectComputer: (windowId: string, computerId: string) => void;
|
|
23
|
+
/** No Computer is granted: open the App's permissions to grant one. */
|
|
24
|
+
onChooseComputer: (surfaceId: string) => void;
|
|
23
25
|
}): import("react/jsx-runtime").JSX.Element;
|
|
24
26
|
/**
|
|
25
27
|
* One window's status bar, owned by the shell like its title bar: the
|
|
@@ -31,7 +33,7 @@ export declare function AppPane({ projection, nextLaunch, icon, manager, onError
|
|
|
31
33
|
* a shorter notice takes precedence over Inkcap's low-value file count, never
|
|
32
34
|
* over the App's save state. Desktop presentation stays unchanged.
|
|
33
35
|
*/
|
|
34
|
-
export declare function WindowStatusBar({ projection, onSelectComputer, onAction, surface, computerPickerOpen, onComputerPickerOpenChange, onReload, }: {
|
|
36
|
+
export declare function WindowStatusBar({ projection, onSelectComputer, onAction, surface, computerPickerOpen, onComputerPickerOpenChange, onReload, onChooseComputer, }: {
|
|
35
37
|
projection: AppWindowProjection;
|
|
36
38
|
onSelectComputer: (computerId: string) => void;
|
|
37
39
|
onAction: (action: AppStatusAction) => void;
|
|
@@ -41,4 +43,6 @@ export declare function WindowStatusBar({ projection, onSelectComputer, onAction
|
|
|
41
43
|
onComputerPickerOpenChange?: (open: boolean) => void;
|
|
42
44
|
/** Uses the window manager's ordinary, veto-respecting replacement. */
|
|
43
45
|
onReload?: (() => void) | undefined;
|
|
46
|
+
/** With no Computer granted, the chip that opens the App's permissions. */
|
|
47
|
+
onChooseComputer?: (() => void) | undefined;
|
|
44
48
|
}): import("react/jsx-runtime").JSX.Element | null;
|
package/dist/AppPane.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { LoadingState } from "@fungi.computer/caps/blocks/loading-state";
|
|
3
|
+
import { ResultState } from "@fungi.computer/caps/blocks/result-state";
|
|
3
4
|
import { Button } from "@fungi.computer/caps/components/button";
|
|
4
5
|
import { IconButton } from "@fungi.computer/caps/components/icon-button";
|
|
5
6
|
import { AppStatusBar, AppStatusItem, StatusBarChip, StatusBarPicker, } from "@fungi.computer/caps/blocks/app-status-bar";
|
|
@@ -44,22 +45,23 @@ function headerContent(navigation, popover, activate) {
|
|
|
44
45
|
content = { ...content, status: navigation.status };
|
|
45
46
|
return content;
|
|
46
47
|
}
|
|
47
|
-
const windowStatusLabel = (projection) => {
|
|
48
|
-
if (projection.status === "error")
|
|
49
|
-
return describeAppError(projection.error).message;
|
|
50
|
-
if (projection.status === "loading")
|
|
51
|
-
return `${projection.launch.title} opening…`;
|
|
52
|
-
if (projection.status === "getting-ready")
|
|
53
|
-
return "Getting ready…";
|
|
54
|
-
return projection.launch.title;
|
|
55
|
-
};
|
|
56
48
|
/** The focused window's App-level settings; its Computer lives in its status bar. */
|
|
57
49
|
export function FocusedWindowControls({ app, onOpenSettings, onOpenPermissions, projection, }) {
|
|
58
50
|
if (!app)
|
|
59
51
|
return null;
|
|
60
52
|
return (_jsxs("div", { className: "tourtois-focused-controls", role: "group", "aria-label": `${projection.launch.title} settings`, children: [_jsx(IconButton, { size: "responsive", "aria-label": `Permissions for ${projection.launch.title}`, title: "App permissions", icon: _jsx(ShieldCheck, {}), onClick: onOpenPermissions }), _jsx(IconButton, { size: "responsive", "aria-label": `Settings for ${projection.launch.title}`, title: "App settings", icon: _jsx(Settings, {}), onClick: onOpenSettings })] }));
|
|
61
53
|
}
|
|
62
|
-
|
|
54
|
+
/** The window's failure card: what happened, what to try, one primary way out. */
|
|
55
|
+
function WindowFailure({ projection, onReopen, }) {
|
|
56
|
+
const { title: appTitle } = projection.launch;
|
|
57
|
+
const lost = projection.error instanceof AppError &&
|
|
58
|
+
projection.error.code === "DISCONNECTED";
|
|
59
|
+
const described = describeAppError(projection.error);
|
|
60
|
+
return (_jsx(ResultState, { className: "tourtois-window-failure", tone: "failed", headingLevel: 3, title: lost ? "This App lost its connection" : described.title, description: _jsxs(_Fragment, { children: [lost ? `${appTitle} stopped answering.` : described.message, _jsx("span", { className: "tourtois-window-failure-note", children: "A request may have finished even if its reply did not arrive, so check before repeating it." })] }), actions: _jsxs(_Fragment, { children: [_jsxs(Button, { type: "button", variant: "primary", onClick: onReopen, children: ["Reopen ", appTitle] }), _jsx(Button, { type: "button", variant: "outline", onClick: () => {
|
|
61
|
+
window.location.reload();
|
|
62
|
+
}, children: "Reload workspace" })] }) }));
|
|
63
|
+
}
|
|
64
|
+
export function AppPane({ projection, nextLaunch, icon, manager, onError, index, focusWindow, afterHide, onBack, onSelectComputer, onChooseComputer, }) {
|
|
63
65
|
const containerRef = useRef(null);
|
|
64
66
|
const popover = useLayer("popover");
|
|
65
67
|
const [computerPickerOpen, setComputerPickerOpen] = useState(false);
|
|
@@ -178,14 +180,16 @@ export function AppPane({ projection, nextLaunch, icon, manager, onError, index,
|
|
|
178
180
|
onError("App could not be minimized.");
|
|
179
181
|
});
|
|
180
182
|
}, onClose: close }) }) }), projection.status === "loading" ||
|
|
181
|
-
projection.status === "getting-ready" ? (
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
183
|
+
projection.status === "getting-ready" ? (_jsx(LoadingState, { className: "tourtois-app-loading", framed: false, icon: _jsx(AppIcon, { roles: projection.launch.roles, icon: icon }), variant: projection.status === "getting-ready" ? "square" : "line", message: projection.status === "getting-ready"
|
|
184
|
+
? `Getting ${projection.launch.title} ready…`
|
|
185
|
+
: `Opening ${projection.launch.title}…`, detail: "Preparing this App for your workspace." })) : null, projection.status === "error" ? (_jsx("div", { className: "tourtois-window-status", children: _jsx(WindowFailure, { projection: projection, onReopen: () => {
|
|
186
|
+
void manager
|
|
187
|
+
.replace(projection.windowId, projection.launch)
|
|
188
|
+
.catch((cause) => {
|
|
189
|
+
console.error("App reopen failed", cause);
|
|
190
|
+
onError("App could not be reopened.");
|
|
191
|
+
});
|
|
192
|
+
} }) })) : null, _jsx(WindowBody, { ref: containerRef, className: "tourtois-pane-body", hidden: projection.status === "error" }), _jsx(WindowStatusBar, { projection: projection, onReload: nextLaunch && nextLaunch.releaseId !== projection.launch.releaseId
|
|
189
193
|
? () => {
|
|
190
194
|
void manager
|
|
191
195
|
.replace(projection.windowId, nextLaunch)
|
|
@@ -194,7 +198,9 @@ export function AppPane({ projection, nextLaunch, icon, manager, onError, index,
|
|
|
194
198
|
onError("App could not be reloaded.");
|
|
195
199
|
});
|
|
196
200
|
}
|
|
197
|
-
: undefined,
|
|
201
|
+
: undefined, onChooseComputer: () => {
|
|
202
|
+
onChooseComputer(projection.launch.surfaceId);
|
|
203
|
+
}, computerPickerOpen: computerPickerOpen, onComputerPickerOpenChange: (open) => {
|
|
198
204
|
if (open)
|
|
199
205
|
dismissOthers();
|
|
200
206
|
setComputerPickerOpen(open);
|
|
@@ -219,7 +225,7 @@ export function AppPane({ projection, nextLaunch, icon, manager, onError, index,
|
|
|
219
225
|
* a shorter notice takes precedence over Inkcap's low-value file count, never
|
|
220
226
|
* over the App's save state. Desktop presentation stays unchanged.
|
|
221
227
|
*/
|
|
222
|
-
export function WindowStatusBar({ projection, onSelectComputer, onAction, surface, computerPickerOpen, onComputerPickerOpenChange, onReload, }) {
|
|
228
|
+
export function WindowStatusBar({ projection, onSelectComputer, onAction, surface, computerPickerOpen, onComputerPickerOpenChange, onReload, onChooseComputer, }) {
|
|
223
229
|
const popover = useLayer("popover");
|
|
224
230
|
const [phone, setPhone] = useState(false);
|
|
225
231
|
useEffect(() => {
|
|
@@ -237,7 +243,10 @@ export function WindowStatusBar({ projection, onSelectComputer, onAction, surfac
|
|
|
237
243
|
const { computers, title } = projection.launch;
|
|
238
244
|
const items = projection.statusItems;
|
|
239
245
|
if (computers === undefined && items.length === 0 && !onReload)
|
|
240
|
-
|
|
246
|
+
// While the App opens, an empty bar holds the footer's height so the
|
|
247
|
+
// window does not jump when the readouts arrive.
|
|
248
|
+
return projection.status === "loading" ||
|
|
249
|
+
projection.status === "getting-ready" ? (_jsx(AppStatusBar, { "aria-hidden": "true", className: "tourtois-window-status-bar" })) : null;
|
|
241
250
|
const anchorFor = (key) => {
|
|
242
251
|
const origin = surface?.()?.getBoundingClientRect();
|
|
243
252
|
if (!origin)
|
|
@@ -251,14 +260,17 @@ export function WindowStatusBar({ projection, onSelectComputer, onAction, surfac
|
|
|
251
260
|
const render = (item) => (_jsx(WindowStatusItem, { item: item, container: popover, onAction: onAction, anchorFor: anchorFor }, item.id));
|
|
252
261
|
const end = items.filter((item) => item.end === true);
|
|
253
262
|
const start = items.filter((item) => item.end !== true &&
|
|
254
|
-
!(phone &&
|
|
255
|
-
projection.launch.appId === "inkcap" &&
|
|
256
|
-
item.kind === "text" &&
|
|
257
|
-
item.id === "documents"));
|
|
263
|
+
!(phone && item.kind === "text" && item.priority === "low"));
|
|
258
264
|
const appReadouts = end.length === 0 ? undefined : end.map(render);
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
265
|
+
// Zero Computers: a chip to grant one. One is not a choice, so the picker
|
|
266
|
+
// appears from two.
|
|
267
|
+
let attachment;
|
|
268
|
+
if (computers === undefined || computers.length === 1)
|
|
269
|
+
attachment = undefined;
|
|
270
|
+
else if (computers.length === 0)
|
|
271
|
+
attachment = (_jsx(StatusBarChip, { label: "Choose Computer", onClick: onChooseComputer }));
|
|
272
|
+
else
|
|
273
|
+
attachment = (_jsx(StatusBarPicker, { ...(computerPickerOpen === undefined
|
|
262
274
|
? {}
|
|
263
275
|
: { open: computerPickerOpen }), ...(onComputerPickerOpenChange === undefined
|
|
264
276
|
? {}
|
|
@@ -266,7 +278,8 @@ export function WindowStatusBar({ projection, onSelectComputer, onAction, surfac
|
|
|
266
278
|
id: computer.computerId,
|
|
267
279
|
label: computer.name,
|
|
268
280
|
})), value: launchComputerId(projection.launch.href), emptyMessage: "No Computers are granted to this App", disabled: projection.status === "loading" ||
|
|
269
|
-
projection.status === "getting-ready", onSelect: onSelectComputer }))
|
|
281
|
+
projection.status === "getting-ready", onSelect: onSelectComputer }));
|
|
282
|
+
return (_jsx(AppStatusBar, { className: "tourtois-window-status-bar", "aria-label": `${title} status`, attachment: attachment, end: onReload ? (_jsxs("span", { className: phone
|
|
270
283
|
? "flex min-w-0 items-center gap-xs"
|
|
271
284
|
: "flex min-w-0 flex-wrap items-center gap-xs", children: [appReadouts, _jsxs(AppStatusItem, { children: [_jsx("span", { role: "status", children: phone ? "Update ready" : "New version available" }), _jsx(StatusBarChip, { label: "Reload", "aria-label": `Reload ${title}`, onClick: onReload })] })] })) : (appReadouts), children: start.length === 0 ? undefined : start.map(render) }));
|
|
272
285
|
}
|
package/dist/AppWorkbench.js
CHANGED
|
@@ -45,6 +45,8 @@ function announceFloating(tiled, projection) {
|
|
|
45
45
|
toasterId: "workbench-notices",
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
|
+
/** The trial's starter Apps that are still being set up, if the host says so. */
|
|
49
|
+
const installingApps = (directory) => directory?.installing;
|
|
48
50
|
/** Windows cover the desktop, so Show desktop runs before arranging it. */
|
|
49
51
|
function arrangeDesktop(hide, arrange, onFailure) {
|
|
50
52
|
const hiding = hide();
|
|
@@ -587,7 +589,7 @@ export function AppWorkbench({ paneLayerRef, phone, teamId, teamName, initialCom
|
|
|
587
589
|
? createPortal(_jsx(Toaster, { id: "workbench-notices", position: "bottom-right", offset: 24, mobileOffset: 24, style: { fontFamily: "var(--font-sans)" }, closeButton: true }), noticeContainer)
|
|
588
590
|
: null, _jsxs("div", { className: "relative min-h-0 flex-1", children: [_jsx(MaosaicoRegion, { layer: "desktop", style: { position: "absolute", inset: 0 }, "data-desktop-visibility": visibility, ref: desktopRef, "aria-hidden": covered ? true : undefined, children: _jsx(Desktop, { phone: phone, editing: desktopEditing, onEditingChange: setDesktopEditing, onOwner: receiveDesktopOwner, launcherItems: launchableItems, onAllApps: () => {
|
|
589
591
|
setAppDialOpen(true);
|
|
590
|
-
}, paused: covered, apps: windowApps, needsUpdate: needsUpdate, onAppSettings: (app) => {
|
|
592
|
+
}, installing: installingApps(appsQuery.data), onRetryInstall: platform.retryInstall, paused: covered, apps: windowApps, needsUpdate: needsUpdate, onAppSettings: (app) => {
|
|
591
593
|
setSettingsLocation({
|
|
592
594
|
category: "apps",
|
|
593
595
|
appKey: addressKey(app.address),
|
|
@@ -607,7 +609,7 @@ export function AppWorkbench({ paneLayerRef, phone, teamId, teamName, initialCom
|
|
|
607
609
|
const app = directory.find((item) => item.surfaceId === projection.launch.surfaceId);
|
|
608
610
|
return (_jsx(AppPane, { index: index, focusWindow: focusWindow, afterHide: afterHide, onBack: goBack, manager: appWindows, projection: projection, nextLaunch: app ? launchFor(app, projection.launch) : null, icon: app?.icon, onError: setAppStatus, onSelectComputer: (windowId, computerId) => {
|
|
609
611
|
void selectWindowComputer(windowId, computerId);
|
|
610
|
-
} }, projection.windowId));
|
|
612
|
+
}, onChooseComputer: openAppPermissions }, projection.windowId));
|
|
611
613
|
}), extraPanes?.({ activeId, order, focus }), layout.snapPreview && (_jsx(WindowSnapPreview, { "data-snap-side": layout.snapPreview.side, style: {
|
|
612
614
|
left: layout.snapPreview.frame.x,
|
|
613
615
|
top: layout.snapPreview.frame.y,
|
package/dist/app-directory.d.ts
CHANGED
|
@@ -105,6 +105,15 @@ export declare function useAppDirectory(teamId: string, directoryReader: () => P
|
|
|
105
105
|
appId: string | null;
|
|
106
106
|
displayName: string;
|
|
107
107
|
}[] | undefined;
|
|
108
|
+
installing?: {
|
|
109
|
+
installationId: string;
|
|
110
|
+
displayName: string;
|
|
111
|
+
state: "failed" | "installing" | "needs-runtime";
|
|
112
|
+
reason?: {
|
|
113
|
+
code: "unknown" | "build_failed" | "network" | "unsupported";
|
|
114
|
+
message: string;
|
|
115
|
+
} | undefined;
|
|
116
|
+
}[] | undefined;
|
|
108
117
|
}, Error>;
|
|
109
118
|
apps: {
|
|
110
119
|
address: {
|
package/dist/app-directory.js
CHANGED
|
@@ -15,7 +15,10 @@ export function useAppDirectory(teamId, directoryReader) {
|
|
|
15
15
|
// is refused. Every directory read costs the host a Registry read, and
|
|
16
16
|
// explicit mutations already invalidate this query, so the poll is a slow
|
|
17
17
|
// backstop. React Query pauses it while the page is hidden.
|
|
18
|
-
|
|
18
|
+
// While a trial installs its starter Apps the list changes, so poll quickly.
|
|
19
|
+
refetchInterval: (current) => current.state.data?.installing?.some((entry) => entry.state === "installing")
|
|
20
|
+
? 3_000
|
|
21
|
+
: 60_000,
|
|
19
22
|
});
|
|
20
23
|
return {
|
|
21
24
|
query,
|
|
@@ -4,6 +4,7 @@ import type { AppStorage } from "@fungi.computer/agar/storage";
|
|
|
4
4
|
import type { AppBarItem } from "@fungi.computer/caps/blocks/app-bar";
|
|
5
5
|
import type { WorkbenchDirectory } from "@fungi.computer/nacre/workbench-directory";
|
|
6
6
|
import { type DesktopLayoutClient } from "../desktop-client.js";
|
|
7
|
+
import type { InstallingApp } from "@fungi.computer/nacre/workbench-directory";
|
|
7
8
|
import { type DesktopGillTransport } from "./row-gill.js";
|
|
8
9
|
export type DesktopProps = {
|
|
9
10
|
phone: boolean;
|
|
@@ -19,6 +20,9 @@ export type DesktopProps = {
|
|
|
19
20
|
unavailable: boolean;
|
|
20
21
|
onRetryApps: () => void;
|
|
21
22
|
onAllApps: () => void;
|
|
23
|
+
/** Starter Apps a trial is still setting up, or could not set up. */
|
|
24
|
+
installing?: readonly InstallingApp[] | undefined;
|
|
25
|
+
onRetryInstall?: ((installationId: string) => Promise<void>) | undefined;
|
|
22
26
|
onOpen: (target: AppOpenInput) => void;
|
|
23
27
|
computersForGill?: ((surfaceId: string) => readonly {
|
|
24
28
|
computerId: string;
|
package/dist/desktop/Desktop.js
CHANGED
|
@@ -334,7 +334,7 @@ function ArrangedDesktop({ owner, ...props }) {
|
|
|
334
334
|
}, children: [_jsx("div", { className: "tourtois-desktop-tile-body", ref: (node) => {
|
|
335
335
|
if (node)
|
|
336
336
|
node.inert = editing;
|
|
337
|
-
}, children: gill.kind === "launcher" ? (_jsx(LauncherGill, { items: props.launcherItems, size: item.size, onAllApps: props.onAllApps, loading: props.loading, unavailable: props.unavailable, onRetry: props.onRetryApps, warnings: warnings, preferences: snapshot.layout.launcher, onPreference: (id, state) => {
|
|
337
|
+
}, children: gill.kind === "launcher" ? (_jsx(LauncherGill, { items: props.launcherItems, size: item.size, onAllApps: props.onAllApps, installing: props.installing ?? [], onRetryInstall: props.onRetryInstall, loading: props.loading, unavailable: props.unavailable, onRetry: props.onRetryApps, warnings: warnings, preferences: snapshot.layout.launcher, onPreference: (id, state) => {
|
|
338
338
|
void save("layout.launcher", { appId: id, state });
|
|
339
339
|
}, editHandle: editing ? _jsx("span", { "aria-hidden": "true" }) : undefined, onContentHeight: onContentHeight })) : declaration && app ? (_jsx(RowGill, { surfaceId: item.surfaceId, appHeader: {
|
|
340
340
|
name: app.displayName ?? "App",
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { AppGridItem } from "@fungi.computer/caps/blocks/launcher-grid";
|
|
2
2
|
import type { AppBarItem } from "@fungi.computer/caps/blocks/app-bar";
|
|
3
3
|
import type { AppGillDesktopSize } from "@fungi.computer/gills";
|
|
4
|
+
import type { InstallingApp } from "@fungi.computer/nacre/workbench-directory";
|
|
4
5
|
/** Trusted shell Gill. Defaults to the same complete launchable set/order as the AppBar. */
|
|
5
|
-
export declare function LauncherGill({ items, size, onAllApps, loading, unavailable, onRetry, warnings, preferences, onPreference, editHandle, onContentHeight, }: {
|
|
6
|
+
export declare function LauncherGill({ items, size, onAllApps, loading, unavailable, onRetry, warnings, preferences, onPreference, editHandle, onContentHeight, installing, onRetryInstall, }: {
|
|
6
7
|
items: readonly AppBarItem[];
|
|
7
8
|
size?: AppGillDesktopSize;
|
|
8
9
|
onAllApps: () => void;
|
|
@@ -17,4 +18,8 @@ export declare function LauncherGill({ items, size, onAllApps, loading, unavaila
|
|
|
17
18
|
onPreference: (id: string, state: "Pinned" | "Shown" | "Hidden") => void;
|
|
18
19
|
onContentHeight?: ((height: number) => void) | undefined;
|
|
19
20
|
editHandle?: React.ReactNode;
|
|
21
|
+
/** Starter Apps a trial is still setting up, or could not set up. */
|
|
22
|
+
installing?: readonly InstallingApp[];
|
|
23
|
+
/** Ask the trial to try one failed App again. */
|
|
24
|
+
onRetryInstall?: ((installationId: string) => Promise<void>) | undefined;
|
|
20
25
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -7,12 +7,16 @@ import { Select } from "@fungi.computer/caps/components/select";
|
|
|
7
7
|
import { EmptyState } from "@fungi.computer/caps/blocks/empty-state";
|
|
8
8
|
import { Sigil } from "@fungi.computer/sigils";
|
|
9
9
|
import { ExternalLink } from "lucide-react";
|
|
10
|
+
import { SetupNotice } from "@fungi.computer/caps/blocks/setup-notice";
|
|
11
|
+
import { FailureLine } from "@fungi.computer/caps/components/failure-line";
|
|
12
|
+
import { Badge } from "@fungi.computer/caps/components/badge";
|
|
13
|
+
import { Loader } from "@fungi.computer/caps/components/loader";
|
|
10
14
|
import { GillFrame } from "./gill-frame.js";
|
|
11
15
|
import { FirstRunWelcome, useWelcome } from "./welcome.js";
|
|
12
16
|
import { LoadingState } from "@fungi.computer/caps/blocks/loading-state";
|
|
13
17
|
const installDocs = "https://docs.fungi.computer/oyster-quickstart/";
|
|
14
18
|
/** Trusted shell Gill. Defaults to the same complete launchable set/order as the AppBar. */
|
|
15
|
-
export function LauncherGill({ items, size = "M", onAllApps, loading = false, unavailable = false, onRetry, warnings = [], preferences, onPreference, editHandle, onContentHeight, }) {
|
|
19
|
+
export function LauncherGill({ items, size = "M", onAllApps, loading = false, unavailable = false, onRetry, warnings = [], preferences, onPreference, editHandle, onContentHeight, installing = [], onRetryInstall, }) {
|
|
16
20
|
const [editing, setEditing] = useState(false);
|
|
17
21
|
const welcome = useWelcome();
|
|
18
22
|
const stateFor = (id) => preferences.hidden.includes(id)
|
|
@@ -25,17 +29,41 @@ export function LauncherGill({ items, size = "M", onAllApps, loading = false, un
|
|
|
25
29
|
...shown.filter((item) => stateFor(item.id) === "Pinned"),
|
|
26
30
|
...shown.filter((item) => stateFor(item.id) !== "Pinned"),
|
|
27
31
|
];
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
const needsRuntime = new Set(installing
|
|
33
|
+
.filter((entry) => entry.state === "needs-runtime")
|
|
34
|
+
.map((entry) => `app:${entry.installationId}`));
|
|
35
|
+
const tiles = ordered.map((item) => {
|
|
36
|
+
const tile = {
|
|
37
|
+
id: item.id,
|
|
38
|
+
label: item.label,
|
|
39
|
+
icon: item.icon,
|
|
40
|
+
onSelect: item.onSelect,
|
|
41
|
+
};
|
|
42
|
+
return needsRuntime.has(item.id)
|
|
43
|
+
? {
|
|
44
|
+
...tile,
|
|
45
|
+
muted: true,
|
|
46
|
+
status: (_jsx(Badge, { tone: "warning", variant: "quiet", size: "sm", className: "whitespace-nowrap", title: `${item.label} needs a Computer runtime this trial doesn't have`, children: "Needs Computer" })),
|
|
47
|
+
}
|
|
48
|
+
: tile;
|
|
49
|
+
});
|
|
50
|
+
const pendingTiles = installing
|
|
51
|
+
.filter((entry) => entry.state === "installing")
|
|
52
|
+
.map((entry) => ({
|
|
53
|
+
id: `installing:${entry.installationId}`,
|
|
54
|
+
label: entry.displayName,
|
|
55
|
+
icon: _jsx(Loader, { decorative: true, variant: "square", size: "md" }),
|
|
56
|
+
muted: true,
|
|
57
|
+
disabled: true,
|
|
58
|
+
status: (_jsx(Badge, { tone: "neutral", variant: "quiet", size: "sm", className: "whitespace-nowrap", title: `Getting ${entry.displayName} ready…`, children: "Getting ready" })),
|
|
59
|
+
onSelect: () => undefined,
|
|
33
60
|
}));
|
|
34
61
|
const ready = !loading && !unavailable;
|
|
35
62
|
return (_jsxs(GillFrame, { title: "Launcher", size: size, onContentHeight: onContentHeight, editHandle: editHandle ?? (_jsx(Button, { size: "xs", variant: "outline", "aria-expanded": editing, onClick: () => {
|
|
36
63
|
setEditing(!editing);
|
|
37
64
|
}, children: editing ? "Done" : "Edit launcher" })), children: [loading ? _jsx(LoadingState, { message: "Loading Apps\u2026" }) : null, unavailable ? (_jsxs("p", { role: "alert", children: ["App directory unavailable.", " ", onRetry ? (_jsx(Button, { size: "sm", variant: "ghost", onClick: onRetry, children: "Retry" })) : null] })) : null, ready ? (_jsxs(_Fragment, { children: [welcome.visible ? (_jsx(FirstRunWelcome, { items: items, onDismiss: welcome.dismiss })) : null, items.length === 0 ? (_jsx(EmptyState, { variant: "hint", title: "No Apps available", description: "Installed launchable Apps appear here." })) : null, items.length > 0 && shown.length === 0 ? (_jsx("p", { children: "No Apps shown. Edit the launcher to show them again." })) : null, _jsx(AppGrid, { "aria-label": "Apps", items: [
|
|
38
65
|
...tiles,
|
|
66
|
+
...pendingTiles,
|
|
39
67
|
...warnings,
|
|
40
68
|
{
|
|
41
69
|
id: "all-apps",
|
|
@@ -43,7 +71,7 @@ export function LauncherGill({ items, size = "M", onAllApps, loading = false, un
|
|
|
43
71
|
icon: _jsx(Sigil, { name: "allApps" }),
|
|
44
72
|
onSelect: onAllApps,
|
|
45
73
|
},
|
|
46
|
-
], size: "lg" }), _jsx("div", { className: "tourtois-launcher-more", children: _jsxs(Button, { size: "sm", variant: "ghost", onClick: () => {
|
|
74
|
+
], size: "lg" }), _jsx("div", { className: "tourtois-install-notes", children: installing.map((entry) => entry.state === "installing" ? null : (_jsx(InstallNote, { entry: entry, onRetry: onRetryInstall, onOpen: items.find((item) => item.id === `app:${entry.installationId}`)?.onSelect }, entry.installationId))) }), _jsx("div", { className: "tourtois-launcher-more", children: _jsxs(Button, { size: "sm", variant: "ghost", onClick: () => {
|
|
47
75
|
window.open(installDocs, "_blank", "noopener,noreferrer");
|
|
48
76
|
}, children: ["More Apps", _jsx(ExternalLink, { "aria-hidden": "true", size: 14 })] }) }), editing ? (_jsx(DataList, { "aria-label": "Launcher preferences", children: items.map((item) => (_jsx(DataRow, { children: _jsxs("div", { className: "tourtois-launcher-preference", children: [_jsx("span", { "aria-hidden": "true", className: "grid size-6 place-items-center [&_svg]:size-full", children: item.icon ?? _jsx(Sigil, { name: "installApps" }) }), _jsx("div", { className: "tourtois-launcher-preference-identity", children: _jsx("span", { children: item.label }) }), _jsxs(Select, { "aria-label": `Launcher state for ${item.label}`, value: stateFor(item.id), onChange: (event) => {
|
|
49
77
|
const value = event.currentTarget.value;
|
|
@@ -54,3 +82,21 @@ export function LauncherGill({ items, size = "M", onAllApps, loading = false, un
|
|
|
54
82
|
onPreference(item.id, value);
|
|
55
83
|
}, children: [_jsx("option", { value: "Shown", children: "Shown" }), _jsx("option", { value: "Pinned", children: "Pinned" }), _jsx("option", { value: "Hidden", children: "Hidden" })] })] }) }, item.id))) })) : null] })) : null] }));
|
|
56
84
|
}
|
|
85
|
+
/** A starter App the trial could not set up, or that needs what the trial lacks. */
|
|
86
|
+
function InstallNote({ entry, onRetry, onOpen, }) {
|
|
87
|
+
const [asked, setAsked] = useState(false);
|
|
88
|
+
if (entry.state === "needs-runtime")
|
|
89
|
+
return onOpen ? (_jsx(SetupNotice, { variant: "inline", need: `${entry.displayName} needs a Computer`, cause: entry.reason?.message ??
|
|
90
|
+
`${entry.displayName} is installed, but it needs a Computer runtime this trial doesn't have.`, fix: { label: `Open ${entry.displayName}`, onSelect: onOpen } })) : null;
|
|
91
|
+
return (_jsx(FailureLine, { message: `${entry.displayName} couldn't be installed${entry.reason ? `: ${entry.reason.message}` : "."}`, retryLabel: asked ? "Retrying…" : "Retry", ...(onRetry && !asked
|
|
92
|
+
? {
|
|
93
|
+
onRetry: () => {
|
|
94
|
+
setAsked(true);
|
|
95
|
+
void onRetry(entry.installationId).catch((cause) => {
|
|
96
|
+
console.error("Retry was not accepted", cause);
|
|
97
|
+
setAsked(false);
|
|
98
|
+
});
|
|
99
|
+
},
|
|
100
|
+
}
|
|
101
|
+
: {}) }));
|
|
102
|
+
}
|
package/dist/desktop/welcome.css
CHANGED
|
@@ -68,3 +68,20 @@
|
|
|
68
68
|
margin-inline-end: calc(-1 * (var(--spacing-md) + 1px));
|
|
69
69
|
margin-block-start: var(--spacing-sm);
|
|
70
70
|
}
|
|
71
|
+
|
|
72
|
+
/* Trial starter Apps that failed or need a runtime stack under the grid. */
|
|
73
|
+
.tourtois-install-notes {
|
|
74
|
+
display: grid;
|
|
75
|
+
gap: var(--spacing-sm);
|
|
76
|
+
margin-block-start: var(--spacing-md);
|
|
77
|
+
}
|
|
78
|
+
.tourtois-install-notes:empty {
|
|
79
|
+
display: none;
|
|
80
|
+
}
|
|
81
|
+
/* One-line failures centre the Retry button on the text. */
|
|
82
|
+
.tourtois-install-notes .caps-failure-line {
|
|
83
|
+
align-items: center;
|
|
84
|
+
}
|
|
85
|
+
.tourtois-install-notes .caps-failure-line > .caps-status {
|
|
86
|
+
margin-block-start: 0;
|
|
87
|
+
}
|
|
@@ -318,6 +318,14 @@ export const mountPlatformControls = (root, input) => {
|
|
|
318
318
|
...controls,
|
|
319
319
|
setup,
|
|
320
320
|
parseSettings: (value) => S.decodeUnknownSync(S.Json)(settingsLocationSchema.parse(value)),
|
|
321
|
+
retryInstall: async (installationId) => {
|
|
322
|
+
const response = await fetch(`/api/trial/starters/${encodeURIComponent(installationId)}/retry`, { method: "POST", credentials: "same-origin" });
|
|
323
|
+
if (!response.ok)
|
|
324
|
+
throw new AppError("The retry was not accepted", {
|
|
325
|
+
code: "HOST_FAILURE",
|
|
326
|
+
retryable: true,
|
|
327
|
+
});
|
|
328
|
+
},
|
|
321
329
|
openSettings: (value, options) => {
|
|
322
330
|
controls.openSettings(settingsLocationSchema.parse(value), options);
|
|
323
331
|
},
|
|
@@ -20,6 +20,8 @@ export type PlatformControls = Readonly<{
|
|
|
20
20
|
openSettings: (location: SettingsLocation) => void;
|
|
21
21
|
/** Settings the host backs with real data; undefined means all of them. */
|
|
22
22
|
sections?: readonly SettingsLocation["category"][] | undefined;
|
|
23
|
+
/** Ask a trial Oyster to retry one starter App that failed to install. */
|
|
24
|
+
retryInstall?: ((installationId: string) => Promise<void>) | undefined;
|
|
23
25
|
registerDesktopSettings: (handler: WorkbenchDesktopSettings) => Promise<WorkbenchDesktopRegistration>;
|
|
24
26
|
/** Observe Team App changes these controls made, to refresh a directory. */
|
|
25
27
|
subscribeChanges: (listener: () => void) => () => void;
|
package/dist/shell.css
CHANGED
|
@@ -588,35 +588,35 @@
|
|
|
588
588
|
min-width: 0;
|
|
589
589
|
width: 100%;
|
|
590
590
|
}
|
|
591
|
+
/* The failure fills the body so the footer stays at the window's bottom. */
|
|
591
592
|
.tourtois-window-status {
|
|
592
|
-
|
|
593
|
-
|
|
593
|
+
display: grid;
|
|
594
|
+
flex: 1 1 auto;
|
|
595
|
+
min-height: 0;
|
|
596
|
+
padding: var(--spacing-lg);
|
|
597
|
+
place-items: center;
|
|
598
|
+
}
|
|
599
|
+
.tourtois-window-failure {
|
|
600
|
+
inline-size: min(100%, 36rem);
|
|
601
|
+
}
|
|
602
|
+
.tourtois-window-failure-note {
|
|
594
603
|
color: var(--stipe-fg-muted);
|
|
604
|
+
display: block;
|
|
605
|
+
font-size: var(--text-xs);
|
|
606
|
+
margin-block-start: var(--spacing-xs);
|
|
595
607
|
}
|
|
608
|
+
/* The loader covers the App's body but sits beneath the window's header and
|
|
609
|
+
footer, which stay in place so the window can be closed or minimised. */
|
|
596
610
|
.tourtois-app-loading {
|
|
597
|
-
align-items: center;
|
|
598
611
|
background: var(--color-base-100);
|
|
599
|
-
color: var(--color-base-content);
|
|
600
|
-
display: flex;
|
|
601
|
-
gap: var(--spacing-md);
|
|
602
612
|
inset: 0;
|
|
603
|
-
justify-content: center;
|
|
604
|
-
padding: var(--spacing-lg);
|
|
605
613
|
position: absolute;
|
|
606
614
|
z-index: 1;
|
|
607
615
|
}
|
|
608
|
-
.tourtois-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
}
|
|
613
|
-
.tourtois-app-loading > div {
|
|
614
|
-
display: grid;
|
|
615
|
-
gap: var(--spacing-xs);
|
|
616
|
-
}
|
|
617
|
-
.tourtois-app-loading span {
|
|
618
|
-
color: var(--stipe-fg-muted);
|
|
619
|
-
font-size: var(--text-sm);
|
|
616
|
+
.tourtois-pane .caps-window-header,
|
|
617
|
+
.tourtois-pane .tourtois-window-status-bar {
|
|
618
|
+
position: relative;
|
|
619
|
+
z-index: 2;
|
|
620
620
|
}
|
|
621
621
|
|
|
622
622
|
.tourtois-team-git {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fungi.computer/tourtois",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"author": "Levi <levi@technomancy.dev>",
|
|
5
5
|
"description": "Tourtois: the trusted desktop shell for Oyster and Fungi, with host-supplied Settings sections",
|
|
6
6
|
"type": "module",
|
|
@@ -79,11 +79,11 @@
|
|
|
79
79
|
"dependencies": {
|
|
80
80
|
"@fungi.computer/agar": "0.9.0",
|
|
81
81
|
"@fungi.computer/cairn": "0.1.0",
|
|
82
|
-
"@fungi.computer/caps": "0.
|
|
82
|
+
"@fungi.computer/caps": "0.10.0",
|
|
83
83
|
"@fungi.computer/ear-tag": "0.1.0",
|
|
84
84
|
"@fungi.computer/gills": "0.3.0",
|
|
85
85
|
"@fungi.computer/maosaico": "0.1.1",
|
|
86
|
-
"@fungi.computer/parakeet": "0.
|
|
86
|
+
"@fungi.computer/parakeet": "0.11.0",
|
|
87
87
|
"@fungi.computer/puffball": "0.5.5",
|
|
88
88
|
"@fungi.computer/shiitake": "0.12.3",
|
|
89
89
|
"@fungi.computer/sigils": "0.3.0",
|
|
@@ -100,13 +100,13 @@
|
|
|
100
100
|
"lucide-react": "0.460.0",
|
|
101
101
|
"react-dom": "18.3.1",
|
|
102
102
|
"zod": "4.4.3",
|
|
103
|
-
"@fungi.computer/nacre": "0.
|
|
103
|
+
"@fungi.computer/nacre": "0.4.0"
|
|
104
104
|
},
|
|
105
105
|
"peerDependencies": {
|
|
106
106
|
"react": "^18.3.1 || ^19.2.0"
|
|
107
107
|
},
|
|
108
108
|
"devDependencies": {
|
|
109
|
-
"@fungi.computer/oyster": "0.
|
|
109
|
+
"@fungi.computer/oyster": "0.17.0",
|
|
110
110
|
"@cloudflare/workers-types": "5.20260828.1",
|
|
111
111
|
"@fungi.computer/forage": "0.3.5",
|
|
112
112
|
"@fungi.computer/mycelium": "0.3.8",
|