@fungi.computer/tourtois 0.13.3 → 0.14.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 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, onChooseComputer, }: {
11
+ export declare function AppPane({ projection, nextLaunch, icon, manager, onError, index, focusWindow, afterHide, onBack, onForward, onSelectComputer, onChooseComputer, }: {
12
12
  projection: AppWindowProjection;
13
13
  nextLaunch?: AppLaunchDescriptor | null;
14
14
  icon: string | null | undefined;
@@ -18,6 +18,7 @@ export declare function AppPane({ projection, nextLaunch, icon, manager, onError
18
18
  focusWindow: (id: string) => void;
19
19
  afterHide: (id: string) => void;
20
20
  onBack: (id: string) => void;
21
+ onForward: (id: string) => void;
21
22
  /** The person chose another of this window's offered Computers. */
22
23
  onSelectComputer: (windowId: string, computerId: string) => void;
23
24
  /** No Computer is granted: open the App's permissions to grant one. */
package/dist/AppPane.js CHANGED
@@ -15,7 +15,7 @@ import { AppError, } from "@fungi.computer/agar";
15
15
  import { useEffect, useRef, useState } from "react";
16
16
  import { AppIcon } from "./app-icon.js";
17
17
  import { useWindowMotion } from "./use-window-motion.js";
18
- import { backHint } from "./shell-commands.js";
18
+ import { backHint, forwardHint } from "./shell-commands.js";
19
19
  import { createAppWindowManager, } from "./app-windows.js";
20
20
  import { useDismissOverlays } from "./layers.js";
21
21
  import { launchComputerId } from "./app-launch.js";
@@ -121,7 +121,26 @@ function AppWindowControls({ phone, navigation, onAction, popover, ...actions })
121
121
  onAction({ kind: "action", actionId: command.id });
122
122
  }, children: command.label }, command.id))), actions.onPromote ? (_jsx(DropdownMenuItem, { onSelect: actions.onPromote, children: "Make main window" })) : null, _jsx(DropdownMenuItem, { onSelect: actions.onToggleMaximize, children: actions.maximized ? "Restore window" : "Maximize window" }), _jsx(DropdownMenuItem, { onSelect: actions.onMinimize, children: "Minimize window" }), _jsx(DropdownMenuItem, { variant: "destructive", onSelect: actions.onClose, children: "Close window" })] })] }));
123
123
  }
124
- export function AppPane({ projection, nextLaunch, icon, manager, onError, index, focusWindow, afterHide, onBack, onSelectComputer, onChooseComputer, }) {
124
+ /** Back and Forward for an App that keeps history; neither for one that does not. */
125
+ function historyProps(navigation, title, onBack, onForward) {
126
+ if (navigation === null || !(navigation.canGoBack || navigation.canGoForward))
127
+ return {};
128
+ return {
129
+ back: {
130
+ label: `Back in ${title}`,
131
+ hint: backHint(),
132
+ disabled: !navigation.canGoBack,
133
+ onBack,
134
+ },
135
+ forward: {
136
+ label: `Forward in ${title}`,
137
+ hint: forwardHint(),
138
+ disabled: !navigation.canGoForward,
139
+ onForward,
140
+ },
141
+ };
142
+ }
143
+ export function AppPane({ projection, nextLaunch, icon, manager, onError, index, focusWindow, afterHide, onBack, onForward, onSelectComputer, onChooseComputer, }) {
125
144
  const phone = usePhone();
126
145
  const containerRef = useRef(null);
127
146
  const popover = useLayer("popover");
@@ -190,13 +209,18 @@ export function AppPane({ projection, nextLaunch, icon, manager, onError, index,
190
209
  }, onPointerDownCapture: () => {
191
210
  binding.focus();
192
211
  },
193
- // The mouse back button over this window's chrome is its App's Back;
194
- // inside the App, Agar maps it the same way.
212
+ // The mouse back and forward buttons over this window's chrome are its
213
+ // App's Back and Forward; inside the App, Agar maps them the same way.
195
214
  onMouseUp: (event) => {
196
- if (event.button !== 3 || projection.navigation?.canGoBack !== true)
197
- return;
198
- event.preventDefault();
199
- onBack(projection.windowId);
215
+ if (event.button === 3 && projection.navigation?.canGoBack === true) {
216
+ event.preventDefault();
217
+ onBack(projection.windowId);
218
+ }
219
+ else if (event.button === 4 &&
220
+ projection.navigation?.canGoForward === true) {
221
+ event.preventDefault();
222
+ onForward(projection.windowId);
223
+ }
200
224
  }, style: binding.stackingStyle, children: [_jsx(WindowHeader, { title: projection.launch.title, "data-phone-compact": phone || undefined, ...(projection.navigation?.title === undefined
201
225
  ? {}
202
226
  : { subtitle: projection.navigation.title }), ...headerContent(projection.navigation, popover, (activation) => {
@@ -206,17 +230,11 @@ export function AppPane({ projection, nextLaunch, icon, manager, onError, index,
206
230
  console.error("App workbench operation failed", cause);
207
231
  onError("App could not handle that action.");
208
232
  });
209
- }, phone), density: layout.mode === "tiled" ? "compact" : "regular", icon: _jsx(AppIcon, { roles: projection.launch.roles, icon: icon }), ...(projection.navigation?.canGoBack === true
210
- ? {
211
- back: {
212
- label: `Back in ${projection.launch.title}`,
213
- hint: backHint(),
214
- onBack: () => {
215
- onBack(projection.windowId);
216
- },
217
- },
218
- }
219
- : {}), handleProps: {
233
+ }, phone), density: layout.mode === "tiled" ? "compact" : "regular", icon: _jsx(AppIcon, { roles: projection.launch.roles, icon: icon }), ...historyProps(projection.navigation, projection.launch.title, () => {
234
+ onBack(projection.windowId);
235
+ }, () => {
236
+ onForward(projection.windowId);
237
+ }), handleProps: {
220
238
  ...binding.props,
221
239
  onClick: binding.focus,
222
240
  onDoubleClick: zoom,
@@ -202,6 +202,11 @@ export function AppWorkbench({ paneLayerRef, phone, teamId, teamName, initialCom
202
202
  console.error("App workbench operation failed", cause);
203
203
  });
204
204
  };
205
+ const goForward = (windowId) => {
206
+ void appWindows.forward(windowId).catch((cause) => {
207
+ console.error("App workbench operation failed", cause);
208
+ });
209
+ };
205
210
  // The shell's window keys run through Whistle so /keys, the `:` line and
206
211
  // which-key list them; these are the behaviors behind those commands.
207
212
  const stepTarget = (step) => order.length < 2
@@ -606,7 +611,7 @@ export function AppWorkbench({ paneLayerRef, phone, teamId, teamName, initialCom
606
611
  void appsQuery.refetch();
607
612
  } }) }), _jsxs(MaosaicoRegion, { layer: "windows", style: { height: "100%", pointerEvents: "none" }, ref: paneLayerRef, className: "tourtois-pane-layer", "data-layout-mode": mode, children: [appProjection.windows.map((projection, index) => {
608
613
  const app = directory.find((item) => item.surfaceId === projection.launch.surfaceId);
609
- 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) => {
614
+ return (_jsx(AppPane, { index: index, focusWindow: focusWindow, afterHide: afterHide, onBack: goBack, onForward: goForward, manager: appWindows, projection: projection, nextLaunch: app ? launchFor(app, projection.launch) : null, icon: app?.icon, onError: setAppStatus, onSelectComputer: (windowId, computerId) => {
610
615
  void selectWindowComputer(windowId, computerId);
611
616
  }, onChooseComputer: openAppPermissions }, projection.windowId));
612
617
  }), extraPanes?.({ activeId, order, focus }), layout.snapPreview && (_jsx(WindowSnapPreview, { "data-snap-side": layout.snapPreview.side, style: {
@@ -98,6 +98,7 @@ export declare const hasVisibleAppWindows: (projection: Readonly<{
98
98
  cleanupError?: unknown;
99
99
  navigation: Readonly<{
100
100
  canGoBack: boolean;
101
+ canGoForward: boolean;
101
102
  title?: string;
102
103
  crumbs?: readonly Readonly<{
103
104
  id: string;
@@ -3,6 +3,8 @@ import { type ShellActions } from "@fungi.computer/nacre/commands";
3
3
  import type { TourtoisAppSurfaceHost } from "./app-surface.js";
4
4
  /** The Back hint for this platform, e.g. "Back (Ctrl K, then [)". */
5
5
  export declare function backHint(): string;
6
+ /** The Forward hint for this platform; the App maps these keys itself. */
7
+ export declare function forwardHint(): string;
6
8
  /**
7
9
  * Register the shell's commands, dispatch their direct chords from the host
8
10
  * document, and own the which-key and `:` line open state.
@@ -11,6 +11,10 @@ export function backHint() {
11
11
  const key = backBinding.slice("<leader>".length);
12
12
  return `Back (${isMac() ? "⌘K" : "Ctrl K"}, then ${key})`;
13
13
  }
14
+ /** The Forward hint for this platform; the App maps these keys itself. */
15
+ export function forwardHint() {
16
+ return isMac() ? "Forward (⌘])" : "Forward (Alt+→)";
17
+ }
14
18
  const emptySnapshot = Object.freeze({
15
19
  bindings: Object.freeze([]),
16
20
  palette: Object.freeze([]),
@@ -55,6 +55,7 @@ const relayCommands = (maximum) => z
55
55
  const navigationRelaySchema = z
56
56
  .strictObject({
57
57
  canGoBack: z.boolean(),
58
+ canGoForward: z.boolean(),
58
59
  title: z.string().trim().min(1).max(APP_NAVIGATION_TITLE_MAX).optional(),
59
60
  crumbs: z
60
61
  .array(z.strictObject({
@@ -87,7 +88,10 @@ function parseNavigationRelay(value) {
87
88
  const state = navigationRelaySchema.parse(value);
88
89
  if (state === null)
89
90
  return null;
90
- let parsed = { canGoBack: state.canGoBack };
91
+ let parsed = {
92
+ canGoBack: state.canGoBack,
93
+ canGoForward: state.canGoForward,
94
+ };
91
95
  if (state.title !== undefined)
92
96
  parsed = { ...parsed, title: state.title };
93
97
  if (state.crumbs !== undefined)
@@ -238,6 +242,7 @@ export function createTourtoisShell(workbench) {
238
242
  reconfigure: (nextLaunch) => handle.reconfigure(childLaunch(nextLaunch)),
239
243
  requestClose: () => handle.requestClose(),
240
244
  requestBack: () => handle.requestBack(),
245
+ requestForward: () => handle.requestForward(),
241
246
  activateNavigation: (activation) => handle.activateNavigation(activation),
242
247
  activateStatus: (action) => handle.activateStatus(action),
243
248
  dispose: close,
@@ -253,6 +253,7 @@ export declare function useAppWindowManager(host: TourtoisAppSurfaceHost | null,
253
253
  }>[];
254
254
  }>) => Promise<void>;
255
255
  back: (windowId: string) => Promise<boolean>;
256
+ forward: (windowId: string) => Promise<boolean>;
256
257
  activateNavigation: (windowId: string, activation: import("@fungi.computer/agar").AppNavigationActivation) => Promise<boolean>;
257
258
  activateStatus: (windowId: string, action: import("@fungi.computer/agar").AppStatusAction) => Promise<boolean>;
258
259
  registerComputerChoice: (windowId: string, handler: () => void) => () => void;
@@ -315,6 +316,7 @@ export declare function useAppWindowManager(host: TourtoisAppSurfaceHost | null,
315
316
  cleanupError?: unknown;
316
317
  navigation: Readonly<{
317
318
  canGoBack: boolean;
319
+ canGoForward: boolean;
318
320
  title?: string;
319
321
  crumbs?: readonly Readonly<{
320
322
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fungi.computer/tourtois",
3
- "version": "0.13.3",
3
+ "version": "0.14.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",
@@ -77,15 +77,15 @@
77
77
  "LICENSE"
78
78
  ],
79
79
  "dependencies": {
80
- "@fungi.computer/agar": "0.9.1",
80
+ "@fungi.computer/agar": "0.10.0",
81
81
  "@fungi.computer/cairn": "0.1.0",
82
- "@fungi.computer/caps": "0.10.7",
82
+ "@fungi.computer/caps": "0.11.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.2",
86
- "@fungi.computer/parakeet": "0.11.16",
86
+ "@fungi.computer/parakeet": "0.11.18",
87
87
  "@fungi.computer/puffball": "0.5.5",
88
- "@fungi.computer/shiitake": "0.13.0",
88
+ "@fungi.computer/shiitake": "0.13.1",
89
89
  "@fungi.computer/sigils": "0.3.1",
90
90
  "@fungi.computer/sprite": "0.2.2",
91
91
  "@fungi.computer/sprite-zdog": "0.3.2",
@@ -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.4.6"
103
+ "@fungi.computer/nacre": "0.5.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.20.8",
109
+ "@fungi.computer/oyster": "0.21.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",