@iloveagents/foundry-web-shell 0.13.0 → 0.14.1

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.
@@ -89,11 +89,22 @@ export function ShellLayout({ modules, baseThemeLayers }) {
89
89
  else
90
90
  return;
91
91
  event.preventDefault();
92
- }, className: cn("hidden w-1.5 shrink-0 cursor-col-resize touch-none xl:block", "bg-transparent hover:bg-primary/30 focus-visible:bg-primary", "focus:outline-none") })), !isExpanded && _jsx(ChatHeader, {}), _jsxs("div", { className: cn(isExpanded
93
- ? cn("h-full shrink-0 border-l border-border bg-background xl:flex xl:flex-col",
94
- // Below xl (or with the panel off) the chat owns the
95
- // full width: keep the page mounted, just hidden.
96
- showPagePanel ? "hidden" : "hidden xl:hidden")
92
+ }, className: cn("hidden w-1.5 shrink-0 cursor-col-resize touch-none min-[780px]:block", "bg-transparent hover:bg-primary/30 focus-visible:bg-primary", "focus:outline-none") })), !isExpanded && _jsx(ChatHeader, {}), _jsxs("div", { className: cn(isExpanded
93
+ ? cn("h-full shrink-0 border-l border-border bg-background",
94
+ // 780px === SIDE_BY_SIDE_BREAKPOINT_PX, which a
95
+ // test pins to MIN_PAGE_PANEL_WIDTH + MIN_CHAT_WIDTH.
96
+ // The literal cannot be interpolated — Tailwind only
97
+ // sees static class strings — so the two are tied by
98
+ // that test rather than by the compiler.
99
+ // 780px = MIN_PAGE_PANEL_WIDTH + MIN_CHAT_WIDTH, the
100
+ // narrowest viewport where both columns fit. This was
101
+ // `xl` (1280px), which hid the document on every
102
+ // window between the two — expanding the chat beside
103
+ // an open editor made the editor disappear.
104
+ "min-[780px]:flex min-[780px]:flex-col",
105
+ // Genuinely too narrow (or panel off): chat owns the
106
+ // width and the page stays mounted, just hidden.
107
+ showPagePanel ? "hidden" : "hidden min-[780px]:hidden")
97
108
  : "flex min-h-0 flex-1 flex-col overflow-hidden"), style: isExpanded && showPagePanel ? { width: pagePanelWidth } : undefined, children: [isExpanded && showPagePanel && _jsx(PagePanelActions, {}), _jsx("div", { className: "flex-1 flex flex-col min-h-0 overflow-hidden", children: page })] })] }) })] }), _jsx(ChatBubble, {}), _jsx(GlobalSelectionPopover, {})] }) }));
98
109
  }
99
110
  function ModuleExtra({ children }) {
@@ -101,5 +112,5 @@ function ModuleExtra({ children }) {
101
112
  }
102
113
  function PagePanelActions() {
103
114
  const togglePagePanel = useChatBubbleStore((s) => s.togglePagePanel);
104
- return (_jsx("div", { className: "shrink-0 flex items-center justify-end px-4 py-3 border-b border-border", children: _jsxs("div", { className: "flex items-center gap-0.5", children: [_jsx(ContextPins, { compact: true, flyoutDirection: "down" }), _jsx(TooltipIconButton, { tooltip: "Close panel", size: "icon", onClick: togglePagePanel, children: _jsx(X, { className: "size-4" }) })] }) }));
115
+ return (_jsx("div", { className: "shrink-0 flex items-center justify-end px-4 py-3 border-b border-border", children: _jsxs("div", { className: "flex items-center gap-0.5", children: [_jsx(ContextPins, { compact: true, flyoutDirection: "down", showPinButton: true }), _jsx(TooltipIconButton, { tooltip: "Close panel", size: "icon", onClick: togglePagePanel, children: _jsx(X, { className: "size-4" }) })] }) }));
105
116
  }
@@ -1,4 +1,25 @@
1
1
  export declare const MIN_PAGE_PANEL_WIDTH = 360;
2
+ /**
3
+ * Narrowest viewport that can show chat and page side by side.
4
+ *
5
+ * Both minimums have to fit, so this IS the breakpoint — the layout used a
6
+ * hand-picked `xl` (1280px) instead, which hid the page on every window
7
+ * between 780 and 1280. Expanding the chat next to an open document made the
8
+ * document vanish, on a perfectly ordinary laptop width.
9
+ *
10
+ * `shell-layout.tsx` cannot interpolate this into a Tailwind class (they must
11
+ * be static strings), so it hardcodes `min-[780px]:` and a unit test asserts
12
+ * the two agree.
13
+ */
14
+ export declare const SIDE_BY_SIDE_MIN_VIEWPORT: number;
15
+ /**
16
+ * The width literally written into `shell-layout.tsx`'s `min-[780px]:`
17
+ * classes. Tailwind only sees static class strings, so the number cannot be
18
+ * interpolated from {@link SIDE_BY_SIDE_MIN_VIEWPORT} — it is duplicated by
19
+ * necessity, and `side-by-side-breakpoint` fails the build if the two ever
20
+ * disagree. Change one, change the class, or the test stops you.
21
+ */
22
+ export declare const SIDE_BY_SIDE_BREAKPOINT_PX = 780;
2
23
  export declare function clampPagePanelWidth(desired: number, viewport: number): number;
3
24
  export declare function usePagePanelWidth(): {
4
25
  width: number;
@@ -10,6 +10,27 @@ import { useCallback, useEffect, useRef, useState } from "react";
10
10
  export const MIN_PAGE_PANEL_WIDTH = 360;
11
11
  /** The chat column must stay usable too. */
12
12
  const MIN_CHAT_WIDTH = 420;
13
+ /**
14
+ * Narrowest viewport that can show chat and page side by side.
15
+ *
16
+ * Both minimums have to fit, so this IS the breakpoint — the layout used a
17
+ * hand-picked `xl` (1280px) instead, which hid the page on every window
18
+ * between 780 and 1280. Expanding the chat next to an open document made the
19
+ * document vanish, on a perfectly ordinary laptop width.
20
+ *
21
+ * `shell-layout.tsx` cannot interpolate this into a Tailwind class (they must
22
+ * be static strings), so it hardcodes `min-[780px]:` and a unit test asserts
23
+ * the two agree.
24
+ */
25
+ export const SIDE_BY_SIDE_MIN_VIEWPORT = MIN_PAGE_PANEL_WIDTH + MIN_CHAT_WIDTH;
26
+ /**
27
+ * The width literally written into `shell-layout.tsx`'s `min-[780px]:`
28
+ * classes. Tailwind only sees static class strings, so the number cannot be
29
+ * interpolated from {@link SIDE_BY_SIDE_MIN_VIEWPORT} — it is duplicated by
30
+ * necessity, and `side-by-side-breakpoint` fails the build if the two ever
31
+ * disagree. Change one, change the class, or the test stops you.
32
+ */
33
+ export const SIDE_BY_SIDE_BREAKPOINT_PX = 780;
13
34
  const DEFAULT_PAGE_PANEL_WIDTH = 600;
14
35
  const STORAGE_KEY = "foundry.pagePanel.width";
15
36
  export function clampPagePanelWidth(desired, viewport) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iloveagents/foundry-web-shell",
3
- "version": "0.13.0",
3
+ "version": "0.14.1",
4
4
  "license": "MIT",
5
5
  "description": "Browser bootstrap and layout shell for Foundry UI — bootstrapShell({ modules, pages, theme, authProvider }) mounts the SPA around foundry-web-ui. Module-agnostic.",
6
6
  "keywords": [
@@ -45,9 +45,9 @@
45
45
  "zustand": "^5.0.0"
46
46
  },
47
47
  "dependencies": {
48
- "@iloveagents/foundry-agent": "^0.13.0",
49
- "@iloveagents/foundry-web-ui": "^0.13.0",
50
- "@iloveagents/foundry-web-primitives": "^0.13.0"
48
+ "@iloveagents/foundry-agent": "^0.14.1",
49
+ "@iloveagents/foundry-web-primitives": "^0.14.1",
50
+ "@iloveagents/foundry-web-ui": "^0.14.1"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@assistant-ui/react": "^0.15.1",