@fungi.computer/tourtois 0.12.10 → 0.12.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.
@@ -162,19 +162,15 @@ function ArrangedDesktop({ owner, ...props }) {
162
162
  .filter((item) => item.row <= row && row < item.row + item.h)
163
163
  .map((item) => {
164
164
  const declaration = snapshot.layout.items.find((entry) => entry.id === item.id);
165
+ const canonical = item.h * rowHeight + (item.h - 1) * gap;
166
+ const natural = contentHeights.get(item.id) ?? canonical;
165
167
  const isLauncher = declaration !== undefined &&
166
168
  catalog.some((gill) => gill.kind === "launcher" &&
167
169
  gill.surfaceId === declaration.surfaceId &&
168
170
  gill.gillId === declaration.gillId);
169
- const canonical = item.h * rowHeight + (item.h - 1) * gap;
170
- const natural = contentHeights.get(item.id) ?? canonical;
171
- const height = isLauncher
172
- ? props.phone
173
- ? natural
174
- : Math.max(canonical, natural)
175
- : props.phone
176
- ? Math.min(natural, canonical)
177
- : canonical;
171
+ // Launchers grow to show their Apps; row Gills stay bounded and
172
+ // scroll once populated. Both fit their content when it is short.
173
+ const height = isLauncher ? natural : Math.min(natural, canonical);
178
174
  return Math.max(0, height - (item.h - 1) * gap) / item.h;
179
175
  })));
180
176
  const binding = useMaosaicoBento({
@@ -65,17 +65,24 @@ export function LauncherGill({ items, size = "M", onAllApps, loading = false, un
65
65
  const ready = !loading && !unavailable;
66
66
  return (_jsxs(GillFrame, { title: "Launcher", size: size, onContentHeight: onContentHeight, editHandle: editHandle ?? (_jsx(Button, { size: "xs", variant: "outline", "aria-expanded": editing, onClick: () => {
67
67
  setEditing(!editing);
68
- }, 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: [
68
+ }, children: editing ? "Done" : "Edit launcher" })), children: [loading ? _jsx(LoadingState, { message: "Loading Apps\u2026" }) : null, unavailable ? (_jsx(FailureLine, { role: "alert", message: "App directory unavailable.", ...(onRetry ? { onRetry } : {}) })) : null, ready ? (_jsxs(_Fragment, { children: [welcome.visible && shown.length > 0 ? (_jsx(FirstRunWelcome, { items: items, onDismiss: welcome.dismiss })) : null, items.length === 0 ? (_jsx(EmptyState, { variant: "hint", title: "No Apps available", description: "Open All Apps to find what you can use.", primaryAction: { label: "Open All Apps", onSelect: onAllApps } })) : null, items.length > 0 && shown.length === 0 && !editing ? (_jsx(EmptyState, { variant: "quiet", title: "Choose the Apps you want here", description: "Your Apps are hidden from the launcher.", primaryAction: {
69
+ label: "Show Apps",
70
+ onSelect: () => {
71
+ setEditing(true);
72
+ },
73
+ } })) : null, items.length > 0 ||
74
+ pendingTiles.length > 0 ||
75
+ warnings.length > 0 ? (_jsx(AppGrid, { "aria-label": "Apps", items: [
69
76
  ...tiles,
70
77
  ...pendingTiles,
71
78
  ...warnings,
72
79
  {
73
80
  id: "all-apps",
74
- label: "All Apps ›",
81
+ label: "All Apps",
75
82
  icon: _jsx(Sigil, { name: "allApps" }),
76
83
  onSelect: onAllApps,
77
84
  },
78
- ], size: "lg" }), _jsx("div", { className: "tourtois-install-notes", children: installing.map((entry) => entry.state === "installing" ? null : (_jsx(InstallNote, { entry: entry, onRetry: onRetryInstall, onOpen: starterItem(items, entry.installationId)?.onSelect }, entry.installationId))) }), _jsx("div", { className: "tourtois-launcher-more", children: _jsxs(Button, { size: "sm", variant: "ghost", onClick: () => {
85
+ ], size: "lg" })) : null, _jsx("div", { className: "tourtois-install-notes", children: installing.map((entry) => entry.state === "installing" ? null : (_jsx(InstallNote, { entry: entry, onRetry: onRetryInstall, onOpen: starterItem(items, entry.installationId)?.onSelect }, entry.installationId))) }), _jsx("div", { className: "tourtois-launcher-more", children: _jsxs(Button, { size: "sm", variant: "ghost", onClick: () => {
79
86
  window.open(installDocs, "_blank", "noopener,noreferrer");
80
87
  }, 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) => {
81
88
  const value = event.currentTarget.value;
@@ -7,6 +7,8 @@ import { ActionRow } from "@fungi.computer/caps/components/action-row";
7
7
  import { Button } from "@fungi.computer/caps/components/button";
8
8
  import { EmptyState } from "@fungi.computer/caps/blocks/empty-state";
9
9
  import { Status } from "@fungi.computer/caps/components/status";
10
+ import { LoadingState } from "@fungi.computer/caps/blocks/loading-state";
11
+ import { FailureLine } from "@fungi.computer/caps/components/failure-line";
10
12
  import { GillFrame } from "./gill-frame.js";
11
13
  function detail(row) {
12
14
  return row.tone === "error" && row.detail ? (_jsx(Badge, { size: "sm", variant: "quiet", tone: "error", children: row.detail })) : (row.detail);
@@ -119,13 +121,19 @@ export function RowGill({ surfaceId, appHeader, declaration, params, size, pause
119
121
  (recovery === undefined &&
120
122
  response?.state === "error" &&
121
123
  response.reason === "exec_isolation_required");
122
- return (_jsxs(GillFrame, { title: response?.title ?? declaration.title, appHeader: appHeader, size: size, onContentHeight: onContentHeight, editHandle: editHandle, children: [error ? (_jsxs("p", { role: "alert", children: [error, " ", _jsx(Button, { size: "sm", variant: "ghost", onClick: () => {
123
- setRetry((value) => value + 1);
124
- }, children: "Retry" })] })) : null, !response && !error ? (_jsxs("p", { role: "status", children: ["Loading ", declaration.title, "\u2026"] })) : null, response?.state === "error" ? (_jsxs("div", { children: [_jsx("p", { role: "alert", children: response.reason === "exec_isolation_required" && launch
124
+ return (_jsxs(GillFrame, { title: response?.title ?? declaration.title, appHeader: appHeader, size: size, onContentHeight: onContentHeight, editHandle: editHandle, children: [error ? (_jsx(FailureLine, { role: "alert", message: error, onRetry: () => {
125
+ setRetry((value) => value + 1);
126
+ } })) : null, !response && !error ? (_jsx(LoadingState, { message: `Loading ${declaration.title}…` })) : null, !error && response?.state === "error" ? (_jsxs("div", { children: [_jsx(FailureLine, { role: "alert", message: response.reason === "exec_isolation_required" && launch
125
127
  ? `${response.title} isn't available on this preview. Open ${launch.label}.`
126
- : response.error }), recoveryParam && onConfigure ? (_jsxs(Button, { size: "sm", variant: "primary", onClick: onConfigure, children: ["Choose ", recoveryParam.label] })) : null, opensApp && launch ? (_jsxs(Button, { size: "sm", variant: "primary", onClick: () => {
128
+ : response.error, ...(!recovery && !opensApp
129
+ ? {
130
+ onRetry: () => {
131
+ setRetry((value) => value + 1);
132
+ },
133
+ }
134
+ : {}) }), recoveryParam && onConfigure ? (_jsxs(Button, { size: "sm", variant: "primary", onClick: onConfigure, children: ["Choose ", recoveryParam.label] })) : null, opensApp && launch ? (_jsxs(Button, { size: "sm", variant: "primary", onClick: () => {
127
135
  launch.onSelect();
128
- }, children: ["Open ", launch.label] })) : null] })) : null, response?.state === "empty" ? (_jsx(EmptyState, { variant: "quiet", title: response.emptyText ?? "Nothing here yet.", description: null, actions: launch &&
136
+ }, children: ["Open ", launch.label] })) : null] })) : null, !error && response?.state === "empty" ? (_jsx(EmptyState, { variant: "quiet", title: response.emptyText ?? "Nothing here yet.", description: null, actions: launch &&
129
137
  (response.action?.kind === "open" ||
130
138
  response.emptyText === undefined) ? (_jsxs(Button, { size: "sm", variant: "outline", onClick: () => {
131
139
  launch.onSelect();
@@ -1,16 +1,12 @@
1
- /* The first-run welcome: one compact card across the Launcher. */
1
+ /* The first-run welcome shares the Launcher surface. */
2
2
  .tourtois-welcome {
3
3
  display: flex;
4
4
  align-items: center;
5
5
  gap: var(--spacing-lg);
6
- padding: var(--spacing-md) var(--spacing-lg);
7
- margin-block-end: var(--spacing-lg);
8
- /* The App tiles sit 9px inside the Launcher; the card shares their left edge. */
6
+ padding: var(--spacing-sm) 0;
7
+ margin-block-end: var(--spacing-md);
8
+ /* Align the invitation with the App tiles inside the Launcher. */
9
9
  margin-inline: calc(var(--spacing-sm) + 1px);
10
- border: var(--border) solid
11
- color-mix(in oklab, var(--color-base-content) 12%, transparent);
12
- border-radius: var(--radius-box);
13
- background: color-mix(in oklab, var(--color-base-100) 70%, transparent);
14
10
  }
15
11
  .tourtois-welcome-mascot {
16
12
  display: block;
@@ -32,7 +28,7 @@
32
28
  margin: 0;
33
29
  color: var(--stipe-fg-muted);
34
30
  font-size: var(--text-sm);
35
- line-height: 1.4;
31
+ line-height: 1.5;
36
32
  }
37
33
  .tourtois-welcome-text .tourtois-welcome-hint {
38
34
  margin-block-start: var(--spacing-2xs);
@@ -70,7 +66,7 @@
70
66
  display: flex;
71
67
  justify-content: flex-end;
72
68
  /* The ghost button's own padding would pull its text off the grid's edge. */
73
- margin-inline-end: calc(-1 * (var(--spacing-md) + 1px));
69
+ margin-inline-end: 0;
74
70
  margin-block-start: var(--spacing-sm);
75
71
  }
76
72
 
@@ -53,7 +53,7 @@ export function FirstRunWelcome({ items, onDismiss, }) {
53
53
  const lead = starterItem(items, "grove") ?? hello;
54
54
  if (!lead)
55
55
  return null;
56
- return (_jsxs("section", { className: "tourtois-welcome", "aria-labelledby": "tourtois-welcome-title", children: [_jsx("span", { className: "tourtois-welcome-mascot", "aria-hidden": "true", children: _jsx(ShiitakeAvatar, { className: "h-full w-full", state: { activity: "idle", expression: "normal" } }) }), _jsxs("div", { className: "tourtois-welcome-text", children: [_jsx("h3", { id: "tourtois-welcome-title", children: "This is your Oyster" }), _jsx("p", { children: "A place to talk to Agents, make things, and keep your work together." }), _jsxs("p", { className: "tourtois-welcome-hint", children: [_jsx(Keycap, { size: "hint", children: isMac() ? "⌘" : "Ctrl" }), " ", _jsx(Keycap, { size: "hint", children: "K" }), " then ", _jsx(Keycap, { size: "hint", children: "O" }), " ", "opens any App"] })] }), _jsxs("div", { className: "tourtois-welcome-actions", children: [_jsxs(Button, { size: "sm", variant: "primary", onClick: () => {
56
+ return (_jsxs("section", { className: "tourtois-welcome", "aria-labelledby": "tourtois-welcome-title", children: [_jsx("span", { className: "tourtois-welcome-mascot", "aria-hidden": "true", children: _jsx(ShiitakeAvatar, { className: "h-full w-full", state: { activity: "idle", expression: "normal" } }) }), _jsxs("div", { className: "tourtois-welcome-text", children: [_jsx("h3", { id: "tourtois-welcome-title", children: "This is your Oyster" }), _jsx("p", { children: "Open an App to chat with AI helpers, write, or make something." }), _jsxs("p", { className: "tourtois-welcome-hint", children: [_jsx(Keycap, { size: "hint", children: isMac() ? "⌘" : "Ctrl" }), " ", _jsx(Keycap, { size: "hint", children: "K" }), " then ", _jsx(Keycap, { size: "hint", children: "O" }), " ", "opens any App"] })] }), _jsxs("div", { className: "tourtois-welcome-actions", children: [_jsxs(Button, { size: "sm", variant: "primary", onClick: () => {
57
57
  lead.onSelect();
58
58
  }, children: ["Open ", lead.label] }), _jsx(Button, { size: "sm", variant: "ghost", onClick: onDismiss, children: "Not now" })] })] }));
59
59
  }
@@ -128,31 +128,30 @@ export function availableDesktopLayout(layout, catalog) {
128
128
  export function initialDesktopLayout(catalog, inboxSurfaceId) {
129
129
  const inbox = catalog.find((gill) => gill.kind === "app" &&
130
130
  gill.surfaceId === inboxSurfaceId &&
131
- gill.sizes.includes("L"));
131
+ (gill.sizes.includes("M") || gill.sizes.includes("L")));
132
132
  return {
133
133
  version: 1,
134
134
  items: [
135
+ {
136
+ id: "launcher",
137
+ surfaceId: "tourtois",
138
+ gillId: "launcher",
139
+ size: "L",
140
+ col: inbox ? 0 : 1,
141
+ row: 0,
142
+ },
135
143
  ...(inbox
136
144
  ? [
137
145
  {
138
146
  id: "inbox",
139
147
  surfaceId: inbox.surfaceId,
140
148
  gillId: inbox.gillId,
141
- size: "L",
142
- col: 0,
149
+ size: inbox.sizes.includes("M") ? "M" : "L",
150
+ col: 2,
143
151
  row: 0,
144
152
  },
145
153
  ]
146
154
  : []),
147
- {
148
- id: "launcher",
149
- surfaceId: "tourtois",
150
- gillId: "launcher",
151
- // Alone, the Launcher is the desktop: wide and centred in four columns.
152
- size: inbox ? "M" : "L",
153
- col: inbox ? 2 : 1,
154
- row: 0,
155
- },
156
155
  ],
157
156
  launcher: { pinned: [], hidden: [] },
158
157
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fungi.computer/tourtois",
3
- "version": "0.12.10",
3
+ "version": "0.12.12",
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",
@@ -106,7 +106,7 @@
106
106
  "react": "^18.3.1 || ^19.2.0"
107
107
  },
108
108
  "devDependencies": {
109
- "@fungi.computer/oyster": "0.19.13",
109
+ "@fungi.computer/oyster": "0.19.22",
110
110
  "@cloudflare/workers-types": "5.20260828.1",
111
111
  "@fungi.computer/forage": "0.3.5",
112
112
  "@fungi.computer/mycelium": "0.3.8",