@hachej/boring-workspace 0.1.79 → 0.1.81

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 CHANGED
@@ -71,6 +71,51 @@ do not set `lazy: true`.
71
71
  | `@hachej/boring-workspace/app/server` | Node | App composition: `createWorkspaceAgentServer` |
72
72
  | `@hachej/boring-workspace/globals.css` | Browser | Global CSS for the workspace chrome |
73
73
 
74
+ ## Files panel: multi-root filesystems
75
+
76
+ The built-in `FileTreePane` shows a single filesystem root by default (today's
77
+ behavior — no dropdown, no extra chrome). Host apps that expose additional
78
+ governed filesystems (e.g. a shared `company_context`) can pass a `roots` list;
79
+ the panel then renders a **dropdown** at the top to switch the active filesystem
80
+ and shows one root's tree at a time.
81
+
82
+ ```tsx
83
+ import { FileTreePane, type FileTreeRootConfig } from "@hachej/boring-workspace"
84
+
85
+ const roots: FileTreeRootConfig[] = [
86
+ { filesystem: "user", label: "Workspace", rootDir: ".", access: "readwrite" },
87
+ { filesystem: "company_context", label: "Company", rootDir: "/", access: "readonly" },
88
+ ]
89
+
90
+ <FileTreePane roots={roots} />
91
+ ```
92
+
93
+ `FileTreeRootConfig`:
94
+
95
+ | Field | Required | Meaning |
96
+ | --- | --- | --- |
97
+ | `filesystem` | yes | Filesystem id threaded to the file routes (`?filesystem=…`). `"user"` is the default workspace root. |
98
+ | `label` | yes | Text shown in the switcher dropdown. |
99
+ | `rootDir` | no | Root directory for the tree (defaults to `.` for `user`, `/` otherwise). |
100
+ | `access` | no | `"readonly"` hides all mutating affordances (new/rename/delete/drag) for that root; defaults to `"readwrite"`. |
101
+ | `searchPlaceholder` | no | Per-root placeholder for the search input. |
102
+
103
+ Notes:
104
+
105
+ - **Additive & backward-compatible.** Omitting `roots` (or passing a single
106
+ entry) preserves the exact single-root UI — the switcher is hidden.
107
+ - **Governance-agnostic.** The workspace package never imports governance. The
108
+ host supplies the roots list — a governed app (e.g. via
109
+ `boring-governance` bindings or a tenant `…/governance/usage` response) maps
110
+ its per-user filesystem access into `FileTreeRootConfig[]`.
111
+ - **Isolated errors.** A `403`/`404` on one root renders an inline "Failed to
112
+ load files" state inside the pane while the dropdown stays usable to switch
113
+ to another root — it never blanks the whole panel.
114
+
115
+ See the multi-filesystem playground fixture in
116
+ `apps/workspace-playground/src/front/App.tsx` (guarded by
117
+ `VITE_PLAYGROUND_MULTI_FS=1`) for a working consumer.
118
+
74
119
  ## Documentation
75
120
 
76
121
  See [`docs/README.md`](./docs/README.md) for the architecture overview, key
@@ -1,5 +1,5 @@
1
1
  import { n as e } from "./rolldown-runtime-Dqa2HsxW.js";
2
- import { At as t } from "./WorkspaceProvider-DcOiZU24.js";
2
+ import { At as t } from "./WorkspaceProvider-DH-yiJZ8.js";
3
3
  import { t as n } from "./utils-BRcxFdrz.js";
4
4
  import { createContext as r, useCallback as i, useContext as a, useEffect as o, useMemo as s, useRef as c } from "react";
5
5
  import { jsx as l, jsxs as u } from "react/jsx-runtime";
@@ -1,5 +1,5 @@
1
1
  import { n as e } from "./rolldown-runtime-Dqa2HsxW.js";
2
- import { Ft as t, Nt as n, Rt as r, nn as i } from "./WorkspaceProvider-DcOiZU24.js";
2
+ import { Ft as t, Nt as n, Rt as r, nn as i } from "./WorkspaceProvider-DH-yiJZ8.js";
3
3
  import { t as a } from "./utils-BRcxFdrz.js";
4
4
  import { useCallback as o, useEffect as s, useMemo as c, useRef as l, useState as u } from "react";
5
5
  import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
@@ -1,4 +1,4 @@
1
- import { Kt as e, S as t, Vt as n, Wt as r, X as i, _ as a, at as o, mn as s, o as c, pn as l, v as u, x as ee, zt as te } from "./WorkspaceProvider-DcOiZU24.js";
1
+ import { Kt as e, S as t, Vt as n, Wt as r, X as i, _ as a, at as o, mn as s, o as c, pn as l, v as u, x as ee, zt as te } from "./WorkspaceProvider-DH-yiJZ8.js";
2
2
  import { t as d } from "./utils-BRcxFdrz.js";
3
3
  import { Suspense as ne, createContext as f, createElement as p, useCallback as m, useContext as h, useEffect as g, useMemo as _, useRef as v, useState as y, useSyncExternalStore as re } from "react";
4
4
  import { Fragment as ie, jsx as b, jsxs as x } from "react/jsx-runtime";