@elytracms/studio 0.0.98 → 0.0.100

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.
Files changed (95) hide show
  1. package/convex/cms.ts +29 -2
  2. package/convex/ingest.test.ts +84 -7
  3. package/convex/ingest.ts +110 -31
  4. package/convex/path-segment-refusal.test.ts +201 -0
  5. package/convex/records-column-transform.convex.test.ts +149 -0
  6. package/convex/records-one-write.convex.test.ts +218 -0
  7. package/convex/schema.ts +1 -1
  8. package/convex/version-kind-stamping.test.ts +118 -0
  9. package/dist/addon.d.ts +5 -3
  10. package/dist/addon.js +4 -3
  11. package/dist/addon.js.map +1 -1
  12. package/dist/components/app-views/default-modules.d.ts +10 -3
  13. package/dist/components/app-views/default-modules.js +5 -1
  14. package/dist/components/app-views/default-modules.js.map +1 -1
  15. package/dist/components/app-views/module.d.ts +15 -8
  16. package/dist/components/app-views/module.js.map +1 -1
  17. package/dist/components/builder/reuse-context.d.ts +29 -1
  18. package/dist/components/builder/reuse-context.js +58 -12
  19. package/dist/components/builder/reuse-context.js.map +1 -1
  20. package/dist/components/cms/cms-store.d.ts +3 -2
  21. package/dist/components/cms/cms-store.js +8 -2
  22. package/dist/components/cms/cms-store.js.map +1 -1
  23. package/dist/components/cms/field-control.js +15 -5
  24. package/dist/components/cms/field-control.js.map +1 -1
  25. package/dist/components/cms/use-document-draft.d.ts +4 -1
  26. package/dist/components/cms/use-document-draft.js +4 -1
  27. package/dist/components/cms/use-document-draft.js.map +1 -1
  28. package/dist/components/cms/use-publish-controller.d.ts +7 -0
  29. package/dist/components/cms/use-publish-controller.js +17 -3
  30. package/dist/components/cms/use-publish-controller.js.map +1 -1
  31. package/dist/components/cms/versions-pane.js +8 -5
  32. package/dist/components/cms/versions-pane.js.map +1 -1
  33. package/dist/components/delivery-health-banner.d.ts +34 -16
  34. package/dist/components/delivery-health-banner.js +59 -27
  35. package/dist/components/delivery-health-banner.js.map +1 -1
  36. package/dist/components/issue-severity.d.ts +3 -2
  37. package/dist/components/issue-severity.js.map +1 -1
  38. package/dist/components/nav-issues-registry.d.ts +39 -24
  39. package/dist/components/nav-issues-registry.js +50 -21
  40. package/dist/components/nav-issues-registry.js.map +1 -1
  41. package/dist/components/nav-issues.d.ts +23 -50
  42. package/dist/components/nav-issues.js +31 -59
  43. package/dist/components/nav-issues.js.map +1 -1
  44. package/dist/components/notifications/notice-center.d.ts +61 -0
  45. package/dist/components/notifications/notice-center.js +119 -0
  46. package/dist/components/notifications/notice-center.js.map +1 -0
  47. package/dist/components/notifications/notice-model.d.ts +137 -0
  48. package/dist/components/notifications/notice-model.js +107 -0
  49. package/dist/components/notifications/notice-model.js.map +1 -0
  50. package/dist/components/notifications/outcome-notice.d.ts +16 -0
  51. package/dist/components/notifications/outcome-notice.js +34 -0
  52. package/dist/components/notifications/outcome-notice.js.map +1 -0
  53. package/dist/components/notifications/shell-findings.d.ts +36 -0
  54. package/dist/components/notifications/shell-findings.js +140 -0
  55. package/dist/components/notifications/shell-findings.js.map +1 -0
  56. package/dist/components/rail-view-source.js +5 -0
  57. package/dist/components/rail-view-source.js.map +1 -1
  58. package/dist/components/records/record-rail.d.ts +10 -2
  59. package/dist/components/records/record-rail.js +85 -4
  60. package/dist/components/records/record-rail.js.map +1 -1
  61. package/dist/components/section-nav.d.ts +15 -3
  62. package/dist/components/section-nav.js +39 -147
  63. package/dist/components/section-nav.js.map +1 -1
  64. package/dist/components/studio-project-screen.js.map +1 -1
  65. package/dist/components/studio-shell.js +8 -3
  66. package/dist/components/studio-shell.js.map +1 -1
  67. package/dist/components/use-narrow-viewport.d.ts +11 -0
  68. package/dist/components/use-narrow-viewport.js +25 -0
  69. package/dist/components/use-narrow-viewport.js.map +1 -0
  70. package/dist/components/users/role-policy-drift-issues.d.ts +14 -7
  71. package/dist/components/users/role-policy-drift-issues.js +17 -8
  72. package/dist/components/users/role-policy-drift-issues.js.map +1 -1
  73. package/dist/lib/collection-view/collection-view-source.d.ts +4 -2
  74. package/dist/lib/collection-view/collection-view-source.js.map +1 -1
  75. package/dist/lib/engine-version.d.ts +1 -1
  76. package/dist/lib/engine-version.js +1 -1
  77. package/dist/lib/engine-version.js.map +1 -1
  78. package/dist/lib/i18n/messages.de.js +22 -3
  79. package/dist/lib/i18n/messages.de.js.map +1 -1
  80. package/dist/lib/i18n/messages.en.d.ts +20 -2
  81. package/dist/lib/i18n/messages.en.js +25 -4
  82. package/dist/lib/i18n/messages.en.js.map +1 -1
  83. package/dist/lib/notices/toast-store.d.ts +61 -0
  84. package/dist/lib/notices/toast-store.js +116 -0
  85. package/dist/lib/notices/toast-store.js.map +1 -0
  86. package/dist/lib/operations/cms-persistence.d.ts +24 -4
  87. package/dist/lib/operations/cms-persistence.js +411 -80
  88. package/dist/lib/operations/cms-persistence.js.map +1 -1
  89. package/dist/lib/persistence/convex-adapter.d.ts +2 -0
  90. package/dist/lib/persistence/convex-adapter.js +127 -31
  91. package/dist/lib/persistence/convex-adapter.js.map +1 -1
  92. package/dist/ui/toast.d.ts +24 -16
  93. package/dist/ui/toast.js +23 -32
  94. package/dist/ui/toast.js.map +1 -1
  95. package/package.json +3 -3
@@ -4,6 +4,11 @@ export interface SectionNavProps {
4
4
  /** User-toggled collapse (EC-214) — icons only when collapsed, persisted by the shell. */
5
5
  collapsed: boolean;
6
6
  onToggleCollapsed: () => void;
7
+ /**
8
+ * EC-690: whether the collapse toggle is offered. `false` on a narrow viewport, where the
9
+ * shell keeps the rail icons-only whatever the stored preference (the content needs the room).
10
+ */
11
+ toggleable?: boolean;
7
12
  }
8
13
  /**
9
14
  * Vertical section rail (brief §8.1), driven by the configurable sidebar (EC-237):
@@ -12,7 +17,14 @@ export interface SectionNavProps {
12
17
  * EC-221); the active item is matched by the VIEW ID in the URL, so two views
13
18
  * backed by the same surface (Content vs. a focused Categories) highlight
14
19
  * independently. The preference-persisted collapse and the strong active marker
15
- * (EC-214) are preserved. Customization issues (duplicate view id, invalid view,
16
- * non-component renderers) render at the rail foot — visible, never silent.
20
+ * (EC-214) are preserved.
21
+ *
22
+ * EC-690: the rail renders NO findings any more — they live in the shell header's issues
23
+ * badge and tray (owner ruling (a), 2026-10-28: one badge, in the header, none at the rail
24
+ * foot). Measured before (wave-0100): two duplicate-redirect cards took 478 px of the foot,
25
+ * and because the rail had no scroll container flex-shrink squashed every link from 36 to
26
+ * 20 px and pushed the collapse toggle off-screen, at 1280×800 as at 390×844. Now the views
27
+ * scroll in their own region (`min-h-0` + `overflow-y-auto`, links `shrink-0`), and the
28
+ * collapse toggle is pinned below it.
17
29
  */
18
- export declare function SectionNav({ project, collapsed, onToggleCollapsed }: SectionNavProps): import("react").JSX.Element;
30
+ export declare function SectionNav({ project, collapsed, onToggleCollapsed, toggleable }: SectionNavProps): import("react").JSX.Element;
@@ -1,22 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { Fragment, useCallback, useEffect, useMemo, useState, useSyncExternalStore } from 'react';
2
+ import { Fragment, useCallback, useEffect, useState } from 'react';
3
3
  import { Link, STUDIO_PROJECT_ROUTE, useLocation } from '@elytracms/studio/router';
4
4
  import { ChevronDown, PanelLeftClose, PanelLeftOpen } from 'lucide-react';
5
5
  import { cn } from '../lib/utils.js';
6
6
  import { readCollapsedViews, storeCollapsedViews } from '../lib/rail.js';
7
- import { getStudioRegistry } from '../lib/registry/index.js';
8
- import { projectConfigIssues, resolveDeploymentCollections, resolveDeploymentReuse, resolveDeploymentRoutes, } from '../lib/workspace/index.js';
9
- import { routeValidationIssues } from '../lib/routes/route-issues.js';
10
- import { contentSessionOrphans, serverContentSessionOrphans, subscribeContentSession, } from '../lib/data/index.js';
11
7
  import { translate } from '../lib/i18n/index.js';
12
8
  import { Text } from '@elytracms/studio/ui';
13
- import { NavIssues, customizationItems, orphanedCollectionItems, routeIssueItems } from './nav-issues.js';
14
9
  import { activeViewIdFromPath, isNavViewVisible, useStudioNav } from './app-views/sidebar.js';
15
- import { resolveReuse } from './builder/reuse.js';
16
- import { redirectRecordKind } from '@elytracms/core/persistence';
17
- import { useRecordList } from './records/record-rail.js';
18
- import { useContributedNavIssues, useNavIssues } from './nav-issues-registry.js';
19
- import { useFieldRenderers } from './cms/field-renderer.js';
20
10
  import { useProjectRole } from './auth-context.js';
21
11
  /**
22
12
  * Vertical section rail (brief §8.1), driven by the configurable sidebar (EC-237):
@@ -25,31 +15,21 @@ import { useProjectRole } from './auth-context.js';
25
15
  * EC-221); the active item is matched by the VIEW ID in the URL, so two views
26
16
  * backed by the same surface (Content vs. a focused Categories) highlight
27
17
  * independently. The preference-persisted collapse and the strong active marker
28
- * (EC-214) are preserved. Customization issues (duplicate view id, invalid view,
29
- * non-component renderers) render at the rail foot — visible, never silent.
18
+ * (EC-214) are preserved.
19
+ *
20
+ * EC-690: the rail renders NO findings any more — they live in the shell header's issues
21
+ * badge and tray (owner ruling (a), 2026-10-28: one badge, in the header, none at the rail
22
+ * foot). Measured before (wave-0100): two duplicate-redirect cards took 478 px of the foot,
23
+ * and because the rail had no scroll container flex-shrink squashed every link from 36 to
24
+ * 20 px and pushed the collapse toggle off-screen, at 1280×800 as at 390×844. Now the views
25
+ * scroll in their own region (`min-h-0` + `overflow-y-auto`, links `shrink-0`), and the
26
+ * collapse toggle is pinned below it.
30
27
  */
31
- export function SectionNav({ project, collapsed, onToggleCollapsed }) {
28
+ export function SectionNav({ project, collapsed, onToggleCollapsed, toggleable = true }) {
32
29
  const { pathname } = useLocation();
33
30
  const activeViewId = activeViewIdFromPath(pathname);
34
- const { nodes, issues: navIssues, registry } = useStudioNav(project);
35
- const { issues: rendererIssues } = useFieldRenderers();
36
- const configIssues = useProjectConfigIssues();
37
- const reuseIssues = useReuseIssues();
31
+ const { nodes } = useStudioNav(project);
38
32
  const projectId = project.id;
39
- const routeIssues = useRouteIssues(projectId);
40
- const orphanIssues = useOrphanedCollectionIssues();
41
- // EC-616: findings contributed by views and addons (`useNavIssues`), and the views that
42
- // declare always-on findings (`useIssues`) — mounted below, whether or not they are open.
43
- const contributedIssues = useContributedNavIssues();
44
- const issueViews = useMemo(() => registry.views.filter((view) => view.useIssues), [registry]);
45
- // Config issues lead: "this project declares no collections" explains every
46
- // other emptiness on the screen, so it is the first thing to read.
47
- const issues = [
48
- ...customizationItems([...configIssues, ...navIssues, ...rendererIssues, ...reuseIssues]),
49
- ...routeIssues,
50
- ...orphanIssues,
51
- ...contributedIssues,
52
- ];
53
33
  // EC-240 (AD-18): per-nav-item, default-open permission gating. The signed-in
54
34
  // user's role drives an OPTIONAL `visible` predicate on any view; absent →
55
35
  // visible. UI reflection only — the server chokepoint stays the real boundary,
@@ -75,126 +55,38 @@ export function SectionNav({ project, collapsed, onToggleCollapsed }) {
75
55
  return next;
76
56
  });
77
57
  }, []);
78
- return (_jsxs("nav", { "aria-label": translate('shell.nav.label'), className: cn('flex shrink-0 flex-col gap-0.5 border-r border-border bg-card/40 p-2 transition-[width] duration-150', collapsed ? 'w-[3.5rem]' : 'w-56'), children: [nodes.map((node, index) => {
79
- if (node.kind === 'separator') {
80
- return _jsx("div", { className: "my-1.5 border-t border-border/60", "aria-hidden": true }, `sep-${index}`);
81
- }
82
- if (node.kind === 'group') {
83
- const views = node.views.filter((view) => view.availability !== 'unavailable' && isVisible(view));
84
- if (views.length === 0)
58
+ return (_jsxs("nav", { "aria-label": translate('shell.nav.label'), className: cn('flex min-h-0 shrink-0 flex-col border-r border-border bg-card/40 transition-[width] duration-150', collapsed ? 'w-[3.5rem]' : 'w-56'), "data-testid": "section-nav", children: [_jsx("div", { className: "flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto p-2", "data-testid": "section-nav-views", children: nodes.map((node, index) => {
59
+ if (node.kind === 'separator') {
60
+ return _jsx("div", { className: "my-1.5 shrink-0 border-t border-border/60", "aria-hidden": true }, `sep-${index}`);
61
+ }
62
+ if (node.kind === 'group') {
63
+ const views = node.views.filter((view) => view.availability !== 'unavailable' && isVisible(view));
64
+ if (views.length === 0)
65
+ return null;
66
+ return (_jsxs("div", { className: "mt-2 shrink-0 first:mt-0", children: [collapsed ? (_jsx("div", { className: "my-1 border-t border-border/60", "aria-hidden": true })) : (_jsx(Text, { size: "xs", tone: "subtle", className: "px-3 pb-1 pt-1 font-medium uppercase tracking-wide", children: node.label })), views.map((view) => (_jsx(NavViewLink, { projectId: projectId, view: view, activeViewId: activeViewId, collapsed: collapsed }, view.id)))] }, `group-${node.label}-${index}`));
67
+ }
68
+ // EC-221: an unavailable view is absent from the rail (not greyed) — it
69
+ // stays reachable by URL, the rail simply doesn't advertise it. EC-240: a
70
+ // permission-hidden view is likewise absent-but-addressable.
71
+ if (node.availability === 'unavailable' || !isVisible(node))
85
72
  return null;
86
- return (_jsxs("div", { className: "mt-2 first:mt-0", children: [collapsed ? (_jsx("div", { className: "my-1 border-t border-border/60", "aria-hidden": true })) : (_jsx(Text, { size: "xs", tone: "subtle", className: "px-3 pb-1 pt-1 font-medium uppercase tracking-wide", children: node.label })), views.map((view) => (_jsx(NavViewLink, { projectId: projectId, view: view, activeViewId: activeViewId, collapsed: collapsed }, view.id)))] }, `group-${node.label}-${index}`));
87
- }
88
- // EC-221: an unavailable view is absent from the rail (not greyed) — it
89
- // stays reachable by URL, the rail simply doesn't advertise it. EC-240: a
90
- // permission-hidden view is likewise absent-but-addressable.
91
- if (node.availability === 'unavailable' || !isVisible(node))
92
- return null;
93
- // EC-293: a view may nest its sub-views (CMS collections). The parent renders
94
- // as a link with a disclosure chevron; its children render indented below,
95
- // hidden when the rail is collapsed OR this parent is collapsed. The parent
96
- // gets a subtle active hint when one of its children is the active view.
97
- const hasChildren = (node.children?.length ?? 0) > 0;
98
- const hasActiveChild = node.children?.some((child) => child.id === activeViewId) ?? false;
99
- const viewCollapsed = collapsedViews.has(node.id);
100
- return (_jsxs(Fragment, { children: [_jsx(NavViewLink, { projectId: projectId, view: node, activeViewId: activeViewId, collapsed: collapsed, hasActiveChild: hasActiveChild, collapsible: hasChildren && !collapsed, expanded: !viewCollapsed, onToggleExpanded: () => toggleViewCollapsed(node.id) }), collapsed || viewCollapsed
101
- ? null
102
- : node.children?.filter(isVisible).map((child) => (_jsx(NavViewLink, { projectId: projectId, view: child, activeViewId: activeViewId, collapsed: collapsed, nested: true }, child.id)))] }, node.id));
103
- }), issueViews.map((view) => (_jsx(ViewIssuesProbe, { view: view, project: project }, view.id))), _jsxs("div", { className: "mt-auto flex flex-col gap-0.5", children: [issues.length > 0 ? _jsx(NavIssues, { issues: issues, collapsed: collapsed }) : null, _jsx("button", { type: "button", onClick: onToggleCollapsed, "aria-label": collapsed ? translate('shell.sidebar.expand') : translate('shell.sidebar.collapse'), "aria-pressed": collapsed, title: collapsed ? translate('shell.sidebar.expand') : translate('shell.sidebar.collapse'), className: cn('flex h-9 items-center gap-2.5 rounded-md text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground', collapsed ? 'justify-center px-0' : 'px-3'), children: collapsed ? (_jsx(PanelLeftOpen, { className: "size-4 shrink-0" })) : (_jsxs(_Fragment, { children: [_jsx(PanelLeftClose, { className: "size-4 shrink-0" }), _jsx("span", { className: "min-w-0 flex-1 truncate text-left", children: translate('shell.sidebar.collapseLabel') })] })) })] })] }));
104
- }
105
- /**
106
- * EC-479 — what the project has not declared but the studio cannot work without.
107
- *
108
- * Joins the rail foot for the same reason EC-467's and EC-469's findings do: it is a
109
- * project-CONFIGURATION problem, not a content problem in one document, and the rail
110
- * is on every studio surface. It exists at all because the engine used to hide this
111
- * state behind its own `cms-core` fixtures — an unconfigured studio showed sample
112
- * collections and sample documents as if they were the project's. Removing that
113
- * fallback without reporting the absence would just trade a wrong screen for a blank
114
- * one, which the house rule bans equally.
115
- *
116
- * Read from the config holder alone (static per studio boot, like `useReuseIssues`),
117
- * so it needs no CMS provider and is memoised once. The pure decision core is
118
- * `projectConfigIssues`.
119
- */
120
- function useProjectConfigIssues() {
121
- return useMemo(() => projectConfigIssues(resolveDeploymentCollections()), []);
122
- }
123
- /**
124
- * EC-467 — the project's reusable-elements config issues: a declaration that
125
- * cannot resolve, or an ambiguous inference the studio refuses to guess through.
126
- * They join the rail foot because they are project-CONFIGURATION problems (like the
127
- * rail's own and the field renderers'), not content problems in one document — and
128
- * the rail is on every studio surface, so the developer cannot miss them. A project
129
- * with an unambiguous embed, or with none at all, contributes nothing here.
130
- *
131
- * Resolved from the config holders alone (registry + config collections + studio
132
- * config), all static per studio boot, so this needs no CMS provider and is
133
- * memoised once. The pure decision core is `resolveReuse`.
134
- */
135
- function useReuseIssues() {
136
- return useMemo(() => resolveReuse(getStudioRegistry().registry.list(), resolveDeploymentCollections(), resolveDeploymentReuse()).issues, []);
137
- }
138
- /**
139
- * EC-469 — the project's URL-map issues: two routes that match the same URLs, or a
140
- * redirect chain that loops.
141
- *
142
- * They join the rail foot for the same reason EC-467's reusable-elements issues do:
143
- * they are project-level problems, not content problems in one document, so the
144
- * document-scoped issues pane has no place for them — and the rail is on every studio
145
- * surface, so the developer cannot miss them. This is emphatically not a revived
146
- * Routes view (EC-303 retired that, correctly): nothing here is editable, it is
147
- * validation of the code + data the studio already reads.
148
- *
149
- * The two halves come from different planes, which is why only the studio can show
150
- * both: routes are CODE (config, static per boot) while redirects are editorial DATA
151
- * (the rail, live). The redirects read shares the rail's own query key, so a loop
152
- * disappears from the foot the moment it is fixed — and while that query is loading or
153
- * failed, `data` is absent and only the code-side conflicts are reported. That is
154
- * honest: the rail itself surfaces its own load error.
155
- *
156
- * Copy follows the issues-pane convention (EC-192) and is mapped by
157
- * {@link routeIssueItems} — severity included since EC-493.
158
- */
159
- function useRouteIssues(projectId) {
160
- const redirects = useRecordList(redirectRecordKind, projectId).data;
161
- return useMemo(() => routeIssueItems(routeValidationIssues({ routes: resolveDeploymentRoutes(), collections: resolveDeploymentCollections() }, redirects ?? [])), [redirects]);
162
- }
163
- /**
164
- * EC-606 — stored documents whose collection the project does not declare.
165
- *
166
- * Read from the content session, not the project session: this rail renders in
167
- * `StudioShell`, OUTSIDE `ProjectSessionProvider` (`studio-project-screen.tsx`), so
168
- * `useProjectSession` is unreachable here — and the provider's own `session` value is
169
- * `null` in the playground anyway. The content session is the channel both modes
170
- * already configure from the same `loadHydratedCms` result
171
- * (`configureContentSession(contentSessionOf(cms))`), and it is subscribable, so the
172
- * foot re-renders whenever it is re-pointed: at boot, on every CMS-surface mount, and
173
- * on the write-sync refresh while a canvas is mounted (`content-session-refresh.ts`).
174
- * The rail deliberately does NOT register as a refresh consumer — connected mode would
175
- * then pay a full hydration per autosave for a finding that changes only when config
176
- * changes or orphan rows are removed. The server snapshot is empty: there is no
177
- * session during SSR, so hydration renders no warning and the client adds it after.
178
- * The pure mapping is {@link orphanedCollectionItems}.
179
- */
180
- function useOrphanedCollectionIssues() {
181
- const orphans = useSyncExternalStore(subscribeContentSession, contentSessionOrphans, serverContentSessionOrphans);
182
- return useMemo(() => orphanedCollectionItems(orphans), [orphans]);
183
- }
184
- /**
185
- * EC-616 — runs one view's always-on findings hook (`useIssues`) and publishes what it
186
- * returns to the foot. One component per view, so each hook keeps its own hook order.
187
- */
188
- function ViewIssuesProbe({ view, project }) {
189
- const issues = view.useIssues({ project, projectId: project.id });
190
- useNavIssues(`view:`, issues);
191
- return null;
73
+ // EC-293: a view may nest its sub-views (CMS collections). The parent renders
74
+ // as a link with a disclosure chevron; its children render indented below,
75
+ // hidden when the rail is collapsed OR this parent is collapsed. The parent
76
+ // gets a subtle active hint when one of its children is the active view.
77
+ const hasChildren = (node.children?.length ?? 0) > 0;
78
+ const hasActiveChild = node.children?.some((child) => child.id === activeViewId) ?? false;
79
+ const viewCollapsed = collapsedViews.has(node.id);
80
+ return (_jsxs(Fragment, { children: [_jsx(NavViewLink, { projectId: projectId, view: node, activeViewId: activeViewId, collapsed: collapsed, hasActiveChild: hasActiveChild, collapsible: hasChildren && !collapsed, expanded: !viewCollapsed, onToggleExpanded: () => toggleViewCollapsed(node.id) }), collapsed || viewCollapsed
81
+ ? null
82
+ : node.children?.filter(isVisible).map((child) => (_jsx(NavViewLink, { projectId: projectId, view: child, activeViewId: activeViewId, collapsed: collapsed, nested: true }, child.id)))] }, node.id));
83
+ }) }), toggleable ? (_jsx("div", { className: "shrink-0 border-t border-border/60 p-2", children: _jsx("button", { type: "button", onClick: onToggleCollapsed, "aria-label": collapsed ? translate('shell.sidebar.expand') : translate('shell.sidebar.collapse'), "aria-pressed": collapsed, title: collapsed ? translate('shell.sidebar.expand') : translate('shell.sidebar.collapse'), className: cn('flex h-9 w-full items-center gap-2.5 rounded-md text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground', collapsed ? 'justify-center px-0' : 'px-3'), children: collapsed ? (_jsx(PanelLeftOpen, { className: "size-4 shrink-0" })) : (_jsxs(_Fragment, { children: [_jsx(PanelLeftClose, { className: "size-4 shrink-0" }), _jsx("span", { className: "min-w-0 flex-1 truncate text-left", children: translate('shell.sidebar.collapseLabel') })] })) }) })) : null] }));
192
84
  }
193
85
  /** One rail view (top-level or nested) — a Link to its home route, active by view id. */
194
86
  function NavViewLink({ projectId, view, activeViewId, collapsed, nested = false, hasActiveChild = false, collapsible = false, expanded = true, onToggleExpanded, }) {
195
87
  const isActive = view.id === activeViewId;
196
88
  const Icon = view.icon;
197
- const link = (_jsxs(Link, { to: STUDIO_PROJECT_ROUTE, params: { projectId, _splat: view.path }, title: view.label, "aria-current": isActive ? 'page' : undefined, className: cn('group relative flex h-9 items-center gap-2.5 rounded-md text-sm transition-colors',
89
+ const link = (_jsxs(Link, { to: STUDIO_PROJECT_ROUTE, params: { projectId, _splat: view.path }, title: view.label, "aria-current": isActive ? 'page' : undefined, className: cn('group relative flex h-9 shrink-0 items-center gap-2.5 rounded-md text-sm transition-colors',
198
90
  // Collapsible parents reserve room on the right for the chevron toggle.
199
91
  collapsed ? 'justify-center px-0' : nested ? 'pl-7 pr-3' : collapsible ? 'pl-3 pr-9' : 'px-3', isActive
200
92
  ? 'bg-accent font-medium text-accent-foreground'
@@ -206,7 +98,7 @@ function NavViewLink({ projectId, view, activeViewId, collapsed, nested = false,
206
98
  return link;
207
99
  // A parent pairs the link with a sibling chevron toggle (so the chevron collapses
208
100
  // without navigating, and the link still navigates to the parent surface).
209
- return (_jsxs("div", { className: "relative", children: [link, _jsx("button", { type: "button", onClick: onToggleExpanded, "aria-label": translate(expanded ? 'shell.nav.collapseView' : 'shell.nav.expandView', {
101
+ return (_jsxs("div", { className: "relative shrink-0", children: [link, _jsx("button", { type: "button", onClick: onToggleExpanded, "aria-label": translate(expanded ? 'shell.nav.collapseView' : 'shell.nav.expandView', {
210
102
  name: view.label,
211
103
  }), "aria-expanded": expanded, className: "absolute right-1 top-1/2 grid size-6 -translate-y-1/2 place-items-center rounded text-muted-foreground/70 transition-colors hover:bg-background hover:text-foreground", children: _jsx(ChevronDown, { className: cn('size-3.5 transition-transform', expanded ? '' : '-rotate-90'), "aria-hidden": true }) })] }));
212
104
  }
@@ -1 +1 @@
1
- {"version":3,"file":"section-nav.js","sourceRoot":"","sources":["../../src/components/section-nav.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAA;AACjG,OAAO,EAAE,IAAI,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAClF,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAGzE,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAA;AACjC,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EACL,mBAAmB,EACnB,4BAA4B,EAC5B,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAClE,OAAO,EACL,qBAAqB,EACrB,2BAA2B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CAAC,KAAK,GAAQ,EAChF,IAAI,CAAC,YAAY,KAAK,SAAS,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAC/C,eAAM,SAAS,EAAC,2CAA2C,uBAAa,KAAK,EAAE,SAAS,CAAC,mBAAmB,CAAC,GAAI,CAClH,CAAC,CAAC,CAAC,IAAI,IACH,CACR,CAAA;IACD,8DAA8D;IAC9D,IAAI,CAAC,WAAW;QAAE,OAAO,IAAI,CAAA;IAC7B,kFAAkF;IAClF,2EAA2E;IAC3E,OAAO,CACL,eAAK,SAAS,EAAC,UAAU,aACtB,IAAI,EACL,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,gBAAgB,gBACb,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,sBAAsB,EAAE;oBAClF,IAAI,EAAE,IAAI,CAAC,KAAK;iBACjB,CAAC,mBACa,QAAQ,EACvB,SAAS,EAAC,uKAAuK,YAEjL,KAAC,WAAW,IACV,SAAS,EAAE,EAAE,CAAC,+BAA+B,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,wBAE5E,GACK,IACL,CACP,CAAA;AACH,CAAC","sourcesContent":["import { Fragment, useCallback, useEffect, useMemo, useState, useSyncExternalStore } from 'react'\nimport { Link, STUDIO_PROJECT_ROUTE, useLocation } from '@elytracms/studio/router'\nimport { ChevronDown, PanelLeftClose, PanelLeftOpen } from 'lucide-react'\nimport type { Project } from '@elytracms/core/studio-core'\nimport type { CustomizationIssue } from '@elytracms/core/studio-core'\nimport { cn } from '../lib/utils'\nimport { readCollapsedViews, storeCollapsedViews } from '../lib/rail'\nimport { getStudioRegistry } from '../lib/registry'\nimport {\n projectConfigIssues,\n resolveDeploymentCollections,\n resolveDeploymentReuse,\n resolveDeploymentRoutes,\n} from '../lib/workspace'\nimport { routeValidationIssues } from '../lib/routes/route-issues'\nimport {\n contentSessionOrphans,\n serverContentSessionOrphans,\n subscribeContentSession,\n} from '../lib/data'\nimport { translate } from '../lib/i18n'\nimport { Text } from '@elytracms/studio/ui'\nimport { NavIssues, customizationItems, orphanedCollectionItems, routeIssueItems } from './nav-issues'\nimport type { NavIssueItem } from './nav-issues'\nimport { activeViewIdFromPath, isNavViewVisible, useStudioNav } from './app-views/sidebar'\nimport type { ResolvedRailView } from './app-views/sidebar'\nimport { resolveReuse } from './builder/reuse'\nimport { redirectRecordKind } from '@elytracms/core/persistence'\nimport { useRecordList } from './records/record-rail'\nimport { useContributedNavIssues, useNavIssues } from './nav-issues-registry'\nimport type { AppViewModule } from './app-views/module'\nimport { useFieldRenderers } from './cms/field-renderer'\nimport { useProjectRole } from './auth-context'\nimport type { NavPermissionContext } from './app-views/module'\n\nexport interface SectionNavProps {\n project: Project\n /** User-toggled collapse (EC-214) — icons only when collapsed, persisted by the shell. */\n collapsed: boolean\n onToggleCollapsed: () => void\n}\n\n/**\n * Vertical section rail (brief §8.1), driven by the configurable sidebar (EC-237):\n * a consumer-extendable tree of views / groups / separators resolved over the\n * built-in views (EC-239). Availability-aware (`unavailable` items are absent per\n * EC-221); the active item is matched by the VIEW ID in the URL, so two views\n * backed by the same surface (Content vs. a focused Categories) highlight\n * independently. The preference-persisted collapse and the strong active marker\n * (EC-214) are preserved. Customization issues (duplicate view id, invalid view,\n * non-component renderers) render at the rail foot — visible, never silent.\n */\nexport function SectionNav({ project, collapsed, onToggleCollapsed }: SectionNavProps) {\n const { pathname } = useLocation()\n const activeViewId = activeViewIdFromPath(pathname)\n const { nodes, issues: navIssues, registry } = useStudioNav(project)\n const { issues: rendererIssues } = useFieldRenderers()\n const configIssues = useProjectConfigIssues()\n const reuseIssues = useReuseIssues()\n const projectId = project.id\n const routeIssues = useRouteIssues(projectId)\n const orphanIssues = useOrphanedCollectionIssues()\n // EC-616: findings contributed by views and addons (`useNavIssues`), and the views that\n // declare always-on findings (`useIssues`) — mounted below, whether or not they are open.\n const contributedIssues = useContributedNavIssues()\n const issueViews = useMemo(() => registry.views.filter((view) => view.useIssues), [registry])\n // Config issues lead: \"this project declares no collections\" explains every\n // other emptiness on the screen, so it is the first thing to read.\n const issues = [\n ...customizationItems([...configIssues, ...navIssues, ...rendererIssues, ...reuseIssues]),\n ...routeIssues,\n ...orphanIssues,\n ...contributedIssues,\n ]\n\n // EC-240 (AD-18): per-nav-item, default-open permission gating. The signed-in\n // user's role drives an OPTIONAL `visible` predicate on any view; absent →\n // visible. UI reflection only — the server chokepoint stays the real boundary,\n // and a permission-hidden view is still reachable by URL (EC-221).\n const role = useProjectRole(projectId)\n const navCtx: NavPermissionContext = { project, role }\n const isVisible = (view: ResolvedRailView) => isNavViewVisible(view, navCtx)\n\n // EC-293: per-parent collapse of nested sub-views, persisted (read after mount,\n // like the rail-collapse pref — no flash script needed). A collapsed parent hides\n // its children but stays a navigable link.\n const [collapsedViews, setCollapsedViews] = useState<Set<string>>(() => new Set())\n useEffect(() => {\n setCollapsedViews(readCollapsedViews())\n }, [])\n const toggleViewCollapsed = useCallback((id: string) => {\n setCollapsedViews((prev) => {\n const next = new Set(prev)\n if (next.has(id)) next.delete(id)\n else next.add(id)\n storeCollapsedViews(next)\n return next\n })\n }, [])\n\n return (\n <nav\n aria-label={translate('shell.nav.label')}\n className={cn(\n 'flex shrink-0 flex-col gap-0.5 border-r border-border bg-card/40 p-2 transition-[width] duration-150',\n collapsed ? 'w-[3.5rem]' : 'w-56',\n )}\n >\n {nodes.map((node, index) => {\n if (node.kind === 'separator') {\n return <div key={`sep-${index}`} className=\"my-1.5 border-t border-border/60\" aria-hidden />\n }\n if (node.kind === 'group') {\n const views = node.views.filter(\n (view) => view.availability !== 'unavailable' && isVisible(view),\n )\n if (views.length === 0) return null\n return (\n <div key={`group-${node.label}-${index}`} className=\"mt-2 first:mt-0\">\n {collapsed ? (\n <div className=\"my-1 border-t border-border/60\" aria-hidden />\n ) : (\n <Text\n size=\"xs\"\n tone=\"subtle\"\n className=\"px-3 pb-1 pt-1 font-medium uppercase tracking-wide\"\n >\n {node.label}\n </Text>\n )}\n {views.map((view) => (\n <NavViewLink\n key={view.id}\n projectId={projectId}\n view={view}\n activeViewId={activeViewId}\n collapsed={collapsed}\n />\n ))}\n </div>\n )\n }\n // EC-221: an unavailable view is absent from the rail (not greyed) — it\n // stays reachable by URL, the rail simply doesn't advertise it. EC-240: a\n // permission-hidden view is likewise absent-but-addressable.\n if (node.availability === 'unavailable' || !isVisible(node)) return null\n // EC-293: a view may nest its sub-views (CMS collections). The parent renders\n // as a link with a disclosure chevron; its children render indented below,\n // hidden when the rail is collapsed OR this parent is collapsed. The parent\n // gets a subtle active hint when one of its children is the active view.\n const hasChildren = (node.children?.length ?? 0) > 0\n const hasActiveChild = node.children?.some((child) => child.id === activeViewId) ?? false\n const viewCollapsed = collapsedViews.has(node.id)\n return (\n <Fragment key={node.id}>\n <NavViewLink\n projectId={projectId}\n view={node}\n activeViewId={activeViewId}\n collapsed={collapsed}\n hasActiveChild={hasActiveChild}\n collapsible={hasChildren && !collapsed}\n expanded={!viewCollapsed}\n onToggleExpanded={() => toggleViewCollapsed(node.id)}\n />\n {collapsed || viewCollapsed\n ? null\n : node.children?.filter(isVisible).map((child) => (\n <NavViewLink\n key={child.id}\n projectId={projectId}\n view={child}\n activeViewId={activeViewId}\n collapsed={collapsed}\n nested\n />\n ))}\n </Fragment>\n )\n })}\n\n {issueViews.map((view) => (\n <ViewIssuesProbe key={view.id} view={view} project={project} />\n ))}\n\n <div className=\"mt-auto flex flex-col gap-0.5\">\n {issues.length > 0 ? <NavIssues issues={issues} collapsed={collapsed} /> : null}\n\n {/* Collapse toggle pinned to the rail foot (EC-214). */}\n <button\n type=\"button\"\n onClick={onToggleCollapsed}\n aria-label={collapsed ? translate('shell.sidebar.expand') : translate('shell.sidebar.collapse')}\n aria-pressed={collapsed}\n title={collapsed ? translate('shell.sidebar.expand') : translate('shell.sidebar.collapse')}\n className={cn(\n 'flex h-9 items-center gap-2.5 rounded-md text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground',\n collapsed ? 'justify-center px-0' : 'px-3',\n )}\n >\n {collapsed ? (\n <PanelLeftOpen className=\"size-4 shrink-0\" />\n ) : (\n <>\n <PanelLeftClose className=\"size-4 shrink-0\" />\n <span className=\"min-w-0 flex-1 truncate text-left\">{translate('shell.sidebar.collapseLabel')}</span>\n </>\n )}\n </button>\n </div>\n </nav>\n )\n}\n\n/**\n * EC-479 — what the project has not declared but the studio cannot work without.\n *\n * Joins the rail foot for the same reason EC-467's and EC-469's findings do: it is a\n * project-CONFIGURATION problem, not a content problem in one document, and the rail\n * is on every studio surface. It exists at all because the engine used to hide this\n * state behind its own `cms-core` fixtures — an unconfigured studio showed sample\n * collections and sample documents as if they were the project's. Removing that\n * fallback without reporting the absence would just trade a wrong screen for a blank\n * one, which the house rule bans equally.\n *\n * Read from the config holder alone (static per studio boot, like `useReuseIssues`),\n * so it needs no CMS provider and is memoised once. The pure decision core is\n * `projectConfigIssues`.\n */\nfunction useProjectConfigIssues(): CustomizationIssue[] {\n return useMemo(() => projectConfigIssues(resolveDeploymentCollections()), [])\n}\n\n/**\n * EC-467 — the project's reusable-elements config issues: a declaration that\n * cannot resolve, or an ambiguous inference the studio refuses to guess through.\n * They join the rail foot because they are project-CONFIGURATION problems (like the\n * rail's own and the field renderers'), not content problems in one document — and\n * the rail is on every studio surface, so the developer cannot miss them. A project\n * with an unambiguous embed, or with none at all, contributes nothing here.\n *\n * Resolved from the config holders alone (registry + config collections + studio\n * config), all static per studio boot, so this needs no CMS provider and is\n * memoised once. The pure decision core is `resolveReuse`.\n */\nfunction useReuseIssues(): CustomizationIssue[] {\n return useMemo(\n () =>\n resolveReuse(\n getStudioRegistry().registry.list(),\n resolveDeploymentCollections(),\n resolveDeploymentReuse(),\n ).issues,\n [],\n )\n}\n\n/**\n * EC-469 — the project's URL-map issues: two routes that match the same URLs, or a\n * redirect chain that loops.\n *\n * They join the rail foot for the same reason EC-467's reusable-elements issues do:\n * they are project-level problems, not content problems in one document, so the\n * document-scoped issues pane has no place for them — and the rail is on every studio\n * surface, so the developer cannot miss them. This is emphatically not a revived\n * Routes view (EC-303 retired that, correctly): nothing here is editable, it is\n * validation of the code + data the studio already reads.\n *\n * The two halves come from different planes, which is why only the studio can show\n * both: routes are CODE (config, static per boot) while redirects are editorial DATA\n * (the rail, live). The redirects read shares the rail's own query key, so a loop\n * disappears from the foot the moment it is fixed — and while that query is loading or\n * failed, `data` is absent and only the code-side conflicts are reported. That is\n * honest: the rail itself surfaces its own load error.\n *\n * Copy follows the issues-pane convention (EC-192) and is mapped by\n * {@link routeIssueItems} — severity included since EC-493.\n */\nfunction useRouteIssues(projectId: string): NavIssueItem[] {\n const redirects = useRecordList(redirectRecordKind, projectId).data\n return useMemo(\n () =>\n routeIssueItems(\n routeValidationIssues(\n { routes: resolveDeploymentRoutes(), collections: resolveDeploymentCollections() },\n redirects ?? [],\n ),\n ),\n [redirects],\n )\n}\n\n/**\n * EC-606 — stored documents whose collection the project does not declare.\n *\n * Read from the content session, not the project session: this rail renders in\n * `StudioShell`, OUTSIDE `ProjectSessionProvider` (`studio-project-screen.tsx`), so\n * `useProjectSession` is unreachable here — and the provider's own `session` value is\n * `null` in the playground anyway. The content session is the channel both modes\n * already configure from the same `loadHydratedCms` result\n * (`configureContentSession(contentSessionOf(cms))`), and it is subscribable, so the\n * foot re-renders whenever it is re-pointed: at boot, on every CMS-surface mount, and\n * on the write-sync refresh while a canvas is mounted (`content-session-refresh.ts`).\n * The rail deliberately does NOT register as a refresh consumer — connected mode would\n * then pay a full hydration per autosave for a finding that changes only when config\n * changes or orphan rows are removed. The server snapshot is empty: there is no\n * session during SSR, so hydration renders no warning and the client adds it after.\n * The pure mapping is {@link orphanedCollectionItems}.\n */\nfunction useOrphanedCollectionIssues(): NavIssueItem[] {\n const orphans = useSyncExternalStore(\n subscribeContentSession,\n contentSessionOrphans,\n serverContentSessionOrphans,\n )\n return useMemo(() => orphanedCollectionItems(orphans), [orphans])\n}\n\n/**\n * EC-616 — runs one view's always-on findings hook (`useIssues`) and publishes what it\n * returns to the foot. One component per view, so each hook keeps its own hook order.\n */\nfunction ViewIssuesProbe({ view, project }: { view: AppViewModule; project: Project }) {\n const issues = view.useIssues!({ project, projectId: project.id })\n useNavIssues(`view:`, issues)\n return null\n}\n\n/** One rail view (top-level or nested) — a Link to its home route, active by view id. */\nfunction NavViewLink({\n projectId,\n view,\n activeViewId,\n collapsed,\n nested = false,\n hasActiveChild = false,\n collapsible = false,\n expanded = true,\n onToggleExpanded,\n}: {\n projectId: string\n view: ResolvedRailView\n activeViewId: string | null\n collapsed: boolean\n nested?: boolean\n /** EC-293: this parent's a child is the active view → a subtle (non-accent) hint. */\n hasActiveChild?: boolean\n /** EC-293: this parent has nested children → render a disclosure chevron. */\n collapsible?: boolean\n /** Whether the nested children are shown (chevron points down) or hidden. */\n expanded?: boolean\n /** Toggle this parent's collapse (the chevron click — does not navigate). */\n onToggleExpanded?: () => void\n}) {\n const isActive = view.id === activeViewId\n const Icon = view.icon\n const link = (\n <Link\n to={STUDIO_PROJECT_ROUTE}\n params={{ projectId, _splat: view.path }}\n title={view.label}\n aria-current={isActive ? 'page' : undefined}\n className={cn(\n 'group relative flex h-9 items-center gap-2.5 rounded-md text-sm transition-colors',\n // Collapsible parents reserve room on the right for the chevron toggle.\n collapsed ? 'justify-center px-0' : nested ? 'pl-7 pr-3' : collapsible ? 'pl-3 pr-9' : 'px-3',\n isActive\n ? 'bg-accent font-medium text-accent-foreground'\n : hasActiveChild\n ? 'text-foreground hover:bg-muted'\n : 'text-muted-foreground hover:bg-muted hover:text-foreground',\n )}\n >\n {/* Strong active marker: a leading accent bar (EC-214). */}\n {isActive ? (\n <span className=\"absolute inset-y-1.5 left-0 w-0.5 rounded-full bg-primary\" aria-hidden />\n ) : null}\n <Icon className=\"size-4 shrink-0\" />\n {collapsed ? null : <span className=\"min-w-0 flex-1 truncate\">{view.label}</span>}\n {view.availability === 'planned' && !collapsed ? (\n <span className=\"size-1.5 shrink-0 rounded-full bg-warning\" aria-hidden title={translate('shell.nav.planned')} />\n ) : null}\n </Link>\n )\n // A leaf (or the collapsed icons-only rail) is just the link.\n if (!collapsible) return link\n // A parent pairs the link with a sibling chevron toggle (so the chevron collapses\n // without navigating, and the link still navigates to the parent surface).\n return (\n <div className=\"relative\">\n {link}\n <button\n type=\"button\"\n onClick={onToggleExpanded}\n aria-label={translate(expanded ? 'shell.nav.collapseView' : 'shell.nav.expandView', {\n name: view.label,\n })}\n aria-expanded={expanded}\n className=\"absolute right-1 top-1/2 grid size-6 -translate-y-1/2 place-items-center rounded text-muted-foreground/70 transition-colors hover:bg-background hover:text-foreground\"\n >\n <ChevronDown\n className={cn('size-3.5 transition-transform', expanded ? '' : '-rotate-90')}\n aria-hidden\n />\n </button>\n </div>\n )\n}\n"]}
1
+ {"version":3,"file":"section-nav.js","sourceRoot":"","sources":["../../src/components/section-nav.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAClE,OAAO,EAAE,IAAI,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAClF,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAEzE,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAA;AACjC,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAC3C,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAE1F,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAe/C;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,UAAU,CAAC,EAAE,OAAO,E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AAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,sBAAsB,EAAE;oBAClF,IAAI,EAAE,IAAI,CAAC,KAAK;iBACjB,CAAC,mBACa,QAAQ,EACvB,SAAS,EAAC,uKAAuK,YAEjL,KAAC,WAAW,IACV,SAAS,EAAE,EAAE,CAAC,+BAA+B,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,wBAE5E,GACK,IACL,CACP,CAAA;AACH,CAAC","sourcesContent":["import { Fragment, useCallback, useEffect, useState } from 'react'\nimport { Link, STUDIO_PROJECT_ROUTE, useLocation } from '@elytracms/studio/router'\nimport { ChevronDown, PanelLeftClose, PanelLeftOpen } from 'lucide-react'\nimport type { Project } from '@elytracms/core/studio-core'\nimport { cn } from '../lib/utils'\nimport { readCollapsedViews, storeCollapsedViews } from '../lib/rail'\nimport { translate } from '../lib/i18n'\nimport { Text } from '@elytracms/studio/ui'\nimport { activeViewIdFromPath, isNavViewVisible, useStudioNav } from './app-views/sidebar'\nimport type { ResolvedRailView } from './app-views/sidebar'\nimport { useProjectRole } from './auth-context'\nimport type { NavPermissionContext } from './app-views/module'\n\nexport interface SectionNavProps {\n project: Project\n /** User-toggled collapse (EC-214) — icons only when collapsed, persisted by the shell. */\n collapsed: boolean\n onToggleCollapsed: () => void\n /**\n * EC-690: whether the collapse toggle is offered. `false` on a narrow viewport, where the\n * shell keeps the rail icons-only whatever the stored preference (the content needs the room).\n */\n toggleable?: boolean\n}\n\n/**\n * Vertical section rail (brief §8.1), driven by the configurable sidebar (EC-237):\n * a consumer-extendable tree of views / groups / separators resolved over the\n * built-in views (EC-239). Availability-aware (`unavailable` items are absent per\n * EC-221); the active item is matched by the VIEW ID in the URL, so two views\n * backed by the same surface (Content vs. a focused Categories) highlight\n * independently. The preference-persisted collapse and the strong active marker\n * (EC-214) are preserved.\n *\n * EC-690: the rail renders NO findings any more — they live in the shell header's issues\n * badge and tray (owner ruling (a), 2026-10-28: one badge, in the header, none at the rail\n * foot). Measured before (wave-0100): two duplicate-redirect cards took 478 px of the foot,\n * and because the rail had no scroll container flex-shrink squashed every link from 36 to\n * 20 px and pushed the collapse toggle off-screen, at 1280×800 as at 390×844. Now the views\n * scroll in their own region (`min-h-0` + `overflow-y-auto`, links `shrink-0`), and the\n * collapse toggle is pinned below it.\n */\nexport function SectionNav({ project, collapsed, onToggleCollapsed, toggleable = true }: SectionNavProps) {\n const { pathname } = useLocation()\n const activeViewId = activeViewIdFromPath(pathname)\n const { nodes } = useStudioNav(project)\n const projectId = project.id\n\n // EC-240 (AD-18): per-nav-item, default-open permission gating. The signed-in\n // user's role drives an OPTIONAL `visible` predicate on any view; absent →\n // visible. UI reflection only — the server chokepoint stays the real boundary,\n // and a permission-hidden view is still reachable by URL (EC-221).\n const role = useProjectRole(projectId)\n const navCtx: NavPermissionContext = { project, role }\n const isVisible = (view: ResolvedRailView) => isNavViewVisible(view, navCtx)\n\n // EC-293: per-parent collapse of nested sub-views, persisted (read after mount,\n // like the rail-collapse pref — no flash script needed). A collapsed parent hides\n // its children but stays a navigable link.\n const [collapsedViews, setCollapsedViews] = useState<Set<string>>(() => new Set())\n useEffect(() => {\n setCollapsedViews(readCollapsedViews())\n }, [])\n const toggleViewCollapsed = useCallback((id: string) => {\n setCollapsedViews((prev) => {\n const next = new Set(prev)\n if (next.has(id)) next.delete(id)\n else next.add(id)\n storeCollapsedViews(next)\n return next\n })\n }, [])\n\n return (\n <nav\n aria-label={translate('shell.nav.label')}\n className={cn(\n 'flex min-h-0 shrink-0 flex-col border-r border-border bg-card/40 transition-[width] duration-150',\n collapsed ? 'w-[3.5rem]' : 'w-56',\n )}\n data-testid=\"section-nav\"\n >\n <div className=\"flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto p-2\" data-testid=\"section-nav-views\">\n {nodes.map((node, index) => {\n if (node.kind === 'separator') {\n return <div key={`sep-${index}`} className=\"my-1.5 shrink-0 border-t border-border/60\" aria-hidden />\n }\n if (node.kind === 'group') {\n const views = node.views.filter((view) => view.availability !== 'unavailable' && isVisible(view))\n if (views.length === 0) return null\n return (\n <div key={`group-${node.label}-${index}`} className=\"mt-2 shrink-0 first:mt-0\">\n {collapsed ? (\n <div className=\"my-1 border-t border-border/60\" aria-hidden />\n ) : (\n <Text size=\"xs\" tone=\"subtle\" className=\"px-3 pb-1 pt-1 font-medium uppercase tracking-wide\">\n {node.label}\n </Text>\n )}\n {views.map((view) => (\n <NavViewLink\n key={view.id}\n projectId={projectId}\n view={view}\n activeViewId={activeViewId}\n collapsed={collapsed}\n />\n ))}\n </div>\n )\n }\n // EC-221: an unavailable view is absent from the rail (not greyed) — it\n // stays reachable by URL, the rail simply doesn't advertise it. EC-240: a\n // permission-hidden view is likewise absent-but-addressable.\n if (node.availability === 'unavailable' || !isVisible(node)) return null\n // EC-293: a view may nest its sub-views (CMS collections). The parent renders\n // as a link with a disclosure chevron; its children render indented below,\n // hidden when the rail is collapsed OR this parent is collapsed. The parent\n // gets a subtle active hint when one of its children is the active view.\n const hasChildren = (node.children?.length ?? 0) > 0\n const hasActiveChild = node.children?.some((child) => child.id === activeViewId) ?? false\n const viewCollapsed = collapsedViews.has(node.id)\n return (\n <Fragment key={node.id}>\n <NavViewLink\n projectId={projectId}\n view={node}\n activeViewId={activeViewId}\n collapsed={collapsed}\n hasActiveChild={hasActiveChild}\n collapsible={hasChildren && !collapsed}\n expanded={!viewCollapsed}\n onToggleExpanded={() => toggleViewCollapsed(node.id)}\n />\n {collapsed || viewCollapsed\n ? null\n : node.children?.filter(isVisible).map((child) => (\n <NavViewLink\n key={child.id}\n projectId={projectId}\n view={child}\n activeViewId={activeViewId}\n collapsed={collapsed}\n nested\n />\n ))}\n </Fragment>\n )\n })}\n </div>\n\n {toggleable ? (\n <div className=\"shrink-0 border-t border-border/60 p-2\">\n {/* Collapse toggle pinned to the rail foot (EC-214) — outside the scrolling views. */}\n <button\n type=\"button\"\n onClick={onToggleCollapsed}\n aria-label={collapsed ? translate('shell.sidebar.expand') : translate('shell.sidebar.collapse')}\n aria-pressed={collapsed}\n title={collapsed ? translate('shell.sidebar.expand') : translate('shell.sidebar.collapse')}\n className={cn(\n 'flex h-9 w-full items-center gap-2.5 rounded-md text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground',\n collapsed ? 'justify-center px-0' : 'px-3',\n )}\n >\n {collapsed ? (\n <PanelLeftOpen className=\"size-4 shrink-0\" />\n ) : (\n <>\n <PanelLeftClose className=\"size-4 shrink-0\" />\n <span className=\"min-w-0 flex-1 truncate text-left\">{translate('shell.sidebar.collapseLabel')}</span>\n </>\n )}\n </button>\n </div>\n ) : null}\n </nav>\n )\n}\n\n/** One rail view (top-level or nested) — a Link to its home route, active by view id. */\nfunction NavViewLink({\n projectId,\n view,\n activeViewId,\n collapsed,\n nested = false,\n hasActiveChild = false,\n collapsible = false,\n expanded = true,\n onToggleExpanded,\n}: {\n projectId: string\n view: ResolvedRailView\n activeViewId: string | null\n collapsed: boolean\n nested?: boolean\n /** EC-293: this parent's a child is the active view → a subtle (non-accent) hint. */\n hasActiveChild?: boolean\n /** EC-293: this parent has nested children → render a disclosure chevron. */\n collapsible?: boolean\n /** Whether the nested children are shown (chevron points down) or hidden. */\n expanded?: boolean\n /** Toggle this parent's collapse (the chevron click — does not navigate). */\n onToggleExpanded?: () => void\n}) {\n const isActive = view.id === activeViewId\n const Icon = view.icon\n const link = (\n <Link\n to={STUDIO_PROJECT_ROUTE}\n params={{ projectId, _splat: view.path }}\n title={view.label}\n aria-current={isActive ? 'page' : undefined}\n className={cn(\n 'group relative flex h-9 shrink-0 items-center gap-2.5 rounded-md text-sm transition-colors',\n // Collapsible parents reserve room on the right for the chevron toggle.\n collapsed ? 'justify-center px-0' : nested ? 'pl-7 pr-3' : collapsible ? 'pl-3 pr-9' : 'px-3',\n isActive\n ? 'bg-accent font-medium text-accent-foreground'\n : hasActiveChild\n ? 'text-foreground hover:bg-muted'\n : 'text-muted-foreground hover:bg-muted hover:text-foreground',\n )}\n >\n {/* Strong active marker: a leading accent bar (EC-214). */}\n {isActive ? (\n <span className=\"absolute inset-y-1.5 left-0 w-0.5 rounded-full bg-primary\" aria-hidden />\n ) : null}\n <Icon className=\"size-4 shrink-0\" />\n {collapsed ? null : <span className=\"min-w-0 flex-1 truncate\">{view.label}</span>}\n {view.availability === 'planned' && !collapsed ? (\n <span className=\"size-1.5 shrink-0 rounded-full bg-warning\" aria-hidden title={translate('shell.nav.planned')} />\n ) : null}\n </Link>\n )\n // A leaf (or the collapsed icons-only rail) is just the link.\n if (!collapsible) return link\n // A parent pairs the link with a sibling chevron toggle (so the chevron collapses\n // without navigating, and the link still navigates to the parent surface).\n return (\n <div className=\"relative shrink-0\">\n {link}\n <button\n type=\"button\"\n onClick={onToggleExpanded}\n aria-label={translate(expanded ? 'shell.nav.collapseView' : 'shell.nav.expandView', {\n name: view.label,\n })}\n aria-expanded={expanded}\n className=\"absolute right-1 top-1/2 grid size-6 -translate-y-1/2 place-items-center rounded text-muted-foreground/70 transition-colors hover:bg-background hover:text-foreground\"\n >\n <ChevronDown\n className={cn('size-3.5 transition-transform', expanded ? '' : '-rotate-90')}\n aria-hidden\n />\n </button>\n </div>\n )\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"studio-project-screen.js","sourceRoot":"","sources":["../../src/components/studio-project-screen.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGjC,OAAO,EACL,kBAAkB,EAClB,IAAI,EACJ,YAAY,EACZ,oBAAoB,EACpB,SAAS,EACT,SAAS,GACV,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAEjE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAE9D,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM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AAC,KAAK,IAAC,GAAG,EAAC,GAAG,EAAC,KAAK,EAAC,QAAQ,EAAC,SAAS,EAAC,sBAAsB,aAC5D,KAAC,OAAO,IAAC,IAAI,EAAC,SAAS,YAAE,SAAS,CAAC,6BAA6B,CAAC,GAAW,EAC5E,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,YAAE,SAAS,CAAC,4BAA4B,CAAC,GAAQ,EACnE,KAAC,MAAM,IAAC,OAAO,kBAGb,KAAC,IAAI,IAAC,EAAE,EAAC,GAAG,EAAC,KAAK,EAAE,kBAAkB,YACnC,SAAS,CAAC,sBAAsB,CAAC,GAC7B,GACA,IACH,GACJ,CACP,CAAA;AACH,CAAC;AAED,SAAS,mBAAmB;IAC1B,OAAO,CACL,cAAK,SAAS,EAAC,oCAAoC,YACjD,MAAC,KAAK,IAAC,GAAG,EAAC,GAAG,EAAC,KAAK,EAAC,QAAQ,EAAC,SAAS,EAAC,sBAAsB,aAC5D,KAAC,OAAO,IAAC,KAAK,EAAE,CAAC,EAAE,IAAI,EAAC,IAAI,YACzB,SAAS,CAAC,2BAA2B,CAAC,GAC/B,EACV,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,YAAE,SAAS,CAAC,0BAA0B,CAAC,GAAQ,IAC3D,GACJ,CACP,CAAA;AACH,CAAC","sourcesContent":["import { useEffect } from 'react'\nimport type { ReactNode } from 'react'\nimport type { Project } from '@elytracms/core/studio-core'\nimport {\n launcherVisitState,\n Link,\n NavigateOnce,\n STUDIO_PROJECT_ROUTE,\n useParams,\n useSearch,\n} from '@elytracms/studio/router'\nimport { matchStudioRoute } from '@elytracms/studio/router/match'\nimport type { StudioRouteMatch } from '@elytracms/studio/router/match'\nimport { studioSearch } from '@elytracms/studio/router/search'\nimport type { StudioSearch } from '@elytracms/studio/router/search'\nimport { Button, Heading, Stack, Text } from '@elytracms/studio/ui'\nimport { translate } from '../lib/i18n'\nimport { useStudio } from './studio-context'\nimport { StudioShell } from './studio-shell'\nimport { AssetsProvider } from './assets/assets-store'\nimport { ProjectSessionProvider } from './project-session'\nimport { flatPath } from './app-views/module'\nimport { landingViewId, useStudioNav } from './app-views/sidebar'\nimport { NavIssuesProvider } from './nav-issues-registry'\nimport { useAuth, useProjectRole } from './auth-context'\nimport { getStudioOperations } from '../lib/operations'\nimport { useOperationCache, useOperationQuery } from '../lib/query'\nimport { useStudioLocale } from '../lib/locale'\nimport type { AppViewQueryHooks } from './app-views/module'\n\n/**\n * EC-223 Stage 6 (catch-all routing): the studio's per-project route component.\n *\n * The consumer mounts ONE splat route (`/$projectId/$`) whose component is this.\n * Everything that was a per-project file route — the provider stack, the section\n * rail shell, and every section screen — now lives inside the package and is\n * resolved here from the URL. The consumer's route tree shrinks to a single\n * ~10-line mount, which is the whole point of Stage 6: the engine owns its\n * navigation, so an external repo consumes the studio without rebuilding a route\n * file per screen.\n *\n * `projectId` stays a real route param (the `$projectId` segment); the trailing\n * pathname (`_splat`) is matched against the engine route table\n * (`matchStudioRoute`) into a module id + segments, and the active module (EC-239)\n * resolves the screen. Every surface already takes its ids as props, so the\n * resolver just hands the module its parsed deep-link.\n */\nexport function StudioProjectScreen() {\n const params = useParams({ strict: false }) as { projectId?: string; _splat?: string }\n // The route's VALIDATED search (the splat's `validateSearch: studioSearch`).\n // Read it through `useSearch`, not `useLocation().search`: the validated search\n // is resolved at route-match time and stable from the component's first render,\n // whereas `location.search` can lag a tick during hydration — long enough for a\n // child `<Navigate>` (the builder redirect) to fire on a momentarily-empty\n // search and drop its `?page=` deep-link target.\n const rawSearch = useSearch({ strict: false }) as Record<string, unknown>\n const studio = useStudio()\n const projectId = params.projectId ?? ''\n const project = studio.getProject(projectId)\n\n // Record the active project once it resolves (preserves recents across sections).\n useEffect(() => {\n if (project) studio.activate(project.id)\n }, [project, studio])\n\n if (!project) return <ProjectNotFound />\n\n const match = matchStudioRoute(params._splat ?? '')\n const search = studioSearch(rawSearch)\n\n return (\n // EC-616: the rail foot's contribution seam spans the shell (rail + content).\n <NavIssuesProvider>\n <StudioShell project={project}>\n {/* EC-177 gap 1: in Convex mode the session HYDRATES from persistence\n before any provider mounts — the builder boots from the latest\n persisted revision, publishing reflects the persisted state, and the\n preview content engine serves live documents. Playground renders\n synchronously from fixtures (session: null), exactly as before. */}\n <ProjectSessionProvider key={project.id} projectId={project.id}>\n <ProjectProviders project={project}>\n <StudioSectionResolver project={project} match={match} search={search} />\n </ProjectProviders>\n </ProjectSessionProvider>\n </StudioShell>\n </NavIssuesProvider>\n )\n}\n\n/**\n * The per-project provider stack, mounted once the session source is known.\n *\n * EC-287: there is no project-level builder graph anymore — layouts are code and\n * the DB holds content only. The block-field canvas mounts its OWN scoped\n * `BuilderProvider` per document (`composition-field-editor`), so no graph is\n * threaded here. (The Phase-10 `CollabProvider` that used to sit here went in\n * EC-574; the canvas surfaces read `projectId` from the project session.)\n */\nfunction ProjectProviders({ project, children }: { project: Project; children: ReactNode }) {\n return (\n // Keyed by project id so per-project state resets when switching projects.\n // EC-195: project-level so the canvas resolves `asset`-typed Image props and\n // the inspector picks from the live library — not just the Assets section.\n // Asset METADATA only (small); blobs stay lazy. (The data-source store that\n // used to wrap this went with the data-binding subsystem, EC-574.)\n <AssetsProvider key={project.id} projectId={project.id}>\n {children}\n </AssetsProvider>\n )\n}\n\n/**\n * The URL→screen switch (EC-223 Stage 6), driven by the view registry DERIVED from\n * the section rail (EC-237/239). The bare project URL redirects to the first\n * navigable rail view; otherwise the matched view id is resolved from the registry\n * (rail views + always-on built-ins) and its `parsePath` interprets the trailing\n * segments into a deep-link the view renders. An unknown view id or an unparseable\n * path is a not-found; rail CONFIG problems (duplicate/invalid views) surface as\n * visible issues in the shell, never silently. Renders inside the shell + provider\n * stack, so every surface sees the same live CMS store and breadcrumb context.\n */\nfunction StudioSectionResolver({\n project,\n match,\n search,\n}: {\n project: Project\n match: StudioRouteMatch\n search: StudioSearch\n}) {\n const projectId = project.id\n const nav = useStudioNav(project)\n const viewServices = useViewServices(projectId)\n\n if (match.section === 'index') {\n // Bare `/$projectId` → the project's first navigable rail view.\n // EC-441: `NavigateOnce` — this resolver re-renders while the landing\n // view's transition is pending; a per-render `<Navigate>` re-fires each time.\n return (\n <NavigateOnce\n to={STUDIO_PROJECT_ROUTE}\n params={{ projectId, _splat: landingViewId(nav, project) }}\n replace\n />\n )\n }\n\n const view = nav.registry.get(match.viewId)\n if (!view) return <StudioRouteNotFound />\n\n // A flat view (no `parsePath`) accepts only the bare path; a nested one\n // (CMS/components) interprets its segments. `null` → an over-deep path → not-found.\n const deepLink = (view.parsePath ?? flatPath)(match.segments)\n if (deepLink === null) return <StudioRouteNotFound />\n\n return <>{view.render({ project, projectId, deepLink, search, ...viewServices })}</>\n}\n\n/** The query hooks every view receives (stable: the hooks themselves). */\nconst VIEW_QUERY_HOOKS: AppViewQueryHooks = { useOperationQuery, useOperationCache }\n\n/** EC-616: the operations client, as a view reaches it (the one chokepoint). */\nconst viewOperations = async () => (await getStudioOperations()).operations\n\n/**\n * EC-616 — what `AppViewContext` grows by: the operations client, the query hooks, the\n * ambient content locale, the signed-in user and their role. Read here, in the resolver\n * (a component), so a view'''s plain `render` function receives them as values.\n */\nfunction useViewServices(projectId: string) {\n const { session } = useAuth()\n const role = useProjectRole(projectId)\n const { locale } = useStudioLocale()\n return {\n operations: viewOperations,\n query: VIEW_QUERY_HOOKS,\n locale,\n user: session?.user ?? null,\n role,\n }\n}\n\nfunction ProjectNotFound() {\n return (\n <div className=\"grid min-h-dvh place-items-center p-8\">\n <Stack gap=\"3\" align=\"center\" className=\"max-w-sm text-center\">\n <Heading size=\"display\">{translate('shell.projectNotFound.title')}</Heading>\n <Text tone=\"muted\">{translate('shell.projectNotFound.body')}</Text>\n <Button asChild>\n {/* EC-401: an explicit \"back to projects\" navigation — marked so the\n launcher's single-project auto-forward never bounces it back. */}\n <Link to=\"/\" state={launcherVisitState}>\n {translate('shell.backToProjects')}\n </Link>\n </Button>\n </Stack>\n </div>\n )\n}\n\nfunction StudioRouteNotFound() {\n return (\n <div className=\"grid h-full place-items-center p-8\">\n <Stack gap=\"2\" align=\"center\" className=\"max-w-sm text-center\">\n <Heading level={2} size=\"h2\">\n {translate('shell.routeNotFound.title')}\n </Heading>\n <Text tone=\"muted\">{translate('shell.routeNotFound.body')}</Text>\n </Stack>\n </div>\n )\n}\n"]}
1
+ {"version":3,"file":"studio-project-screen.js","sourceRoot":"","sources":["../../src/components/studio-project-screen.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGjC,OAAO,EACL,kBAAkB,EAClB,IAAI,EACJ,YAAY,EACZ,oBAAoB,EACpB,SAAS,EACT,SAAS,GACV,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAEjE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAE9D,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC7C,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAC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AAC,sBAAsB,aAC5D,KAAC,OAAO,IAAC,KAAK,EAAE,CAAC,EAAE,IAAI,EAAC,IAAI,YACzB,SAAS,CAAC,2BAA2B,CAAC,GAC/B,EACV,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,YAAE,SAAS,CAAC,0BAA0B,CAAC,GAAQ,IAC3D,GACJ,CACP,CAAA;AACH,CAAC","sourcesContent":["import { useEffect } from 'react'\nimport type { ReactNode } from 'react'\nimport type { Project } from '@elytracms/core/studio-core'\nimport {\n launcherVisitState,\n Link,\n NavigateOnce,\n STUDIO_PROJECT_ROUTE,\n useParams,\n useSearch,\n} from '@elytracms/studio/router'\nimport { matchStudioRoute } from '@elytracms/studio/router/match'\nimport type { StudioRouteMatch } from '@elytracms/studio/router/match'\nimport { studioSearch } from '@elytracms/studio/router/search'\nimport type { StudioSearch } from '@elytracms/studio/router/search'\nimport { Button, Heading, Stack, Text } from '@elytracms/studio/ui'\nimport { translate } from '../lib/i18n'\nimport { useStudio } from './studio-context'\nimport { StudioShell } from './studio-shell'\nimport { AssetsProvider } from './assets/assets-store'\nimport { ProjectSessionProvider } from './project-session'\nimport { flatPath } from './app-views/module'\nimport { landingViewId, useStudioNav } from './app-views/sidebar'\nimport { NavIssuesProvider } from './nav-issues-registry'\nimport { useAuth, useProjectRole } from './auth-context'\nimport { getStudioOperations } from '../lib/operations'\nimport { useOperationCache, useOperationQuery } from '../lib/query'\nimport { useStudioLocale } from '../lib/locale'\nimport type { AppViewQueryHooks } from './app-views/module'\n\n/**\n * EC-223 Stage 6 (catch-all routing): the studio's per-project route component.\n *\n * The consumer mounts ONE splat route (`/$projectId/$`) whose component is this.\n * Everything that was a per-project file route — the provider stack, the section\n * rail shell, and every section screen — now lives inside the package and is\n * resolved here from the URL. The consumer's route tree shrinks to a single\n * ~10-line mount, which is the whole point of Stage 6: the engine owns its\n * navigation, so an external repo consumes the studio without rebuilding a route\n * file per screen.\n *\n * `projectId` stays a real route param (the `$projectId` segment); the trailing\n * pathname (`_splat`) is matched against the engine route table\n * (`matchStudioRoute`) into a module id + segments, and the active module (EC-239)\n * resolves the screen. Every surface already takes its ids as props, so the\n * resolver just hands the module its parsed deep-link.\n */\nexport function StudioProjectScreen() {\n const params = useParams({ strict: false }) as { projectId?: string; _splat?: string }\n // The route's VALIDATED search (the splat's `validateSearch: studioSearch`).\n // Read it through `useSearch`, not `useLocation().search`: the validated search\n // is resolved at route-match time and stable from the component's first render,\n // whereas `location.search` can lag a tick during hydration — long enough for a\n // child `<Navigate>` (the builder redirect) to fire on a momentarily-empty\n // search and drop its `?page=` deep-link target.\n const rawSearch = useSearch({ strict: false }) as Record<string, unknown>\n const studio = useStudio()\n const projectId = params.projectId ?? ''\n const project = studio.getProject(projectId)\n\n // Record the active project once it resolves (preserves recents across sections).\n useEffect(() => {\n if (project) studio.activate(project.id)\n }, [project, studio])\n\n if (!project) return <ProjectNotFound />\n\n const match = matchStudioRoute(params._splat ?? '')\n const search = studioSearch(rawSearch)\n\n return (\n // EC-616: the findings contribution seam spans the shell (header tray, rail + content; EC-690).\n <NavIssuesProvider>\n <StudioShell project={project}>\n {/* EC-177 gap 1: in Convex mode the session HYDRATES from persistence\n before any provider mounts — the builder boots from the latest\n persisted revision, publishing reflects the persisted state, and the\n preview content engine serves live documents. Playground renders\n synchronously from fixtures (session: null), exactly as before. */}\n <ProjectSessionProvider key={project.id} projectId={project.id}>\n <ProjectProviders project={project}>\n <StudioSectionResolver project={project} match={match} search={search} />\n </ProjectProviders>\n </ProjectSessionProvider>\n </StudioShell>\n </NavIssuesProvider>\n )\n}\n\n/**\n * The per-project provider stack, mounted once the session source is known.\n *\n * EC-287: there is no project-level builder graph anymore — layouts are code and\n * the DB holds content only. The block-field canvas mounts its OWN scoped\n * `BuilderProvider` per document (`composition-field-editor`), so no graph is\n * threaded here. (The Phase-10 `CollabProvider` that used to sit here went in\n * EC-574; the canvas surfaces read `projectId` from the project session.)\n */\nfunction ProjectProviders({ project, children }: { project: Project; children: ReactNode }) {\n return (\n // Keyed by project id so per-project state resets when switching projects.\n // EC-195: project-level so the canvas resolves `asset`-typed Image props and\n // the inspector picks from the live library — not just the Assets section.\n // Asset METADATA only (small); blobs stay lazy. (The data-source store that\n // used to wrap this went with the data-binding subsystem, EC-574.)\n <AssetsProvider key={project.id} projectId={project.id}>\n {children}\n </AssetsProvider>\n )\n}\n\n/**\n * The URL→screen switch (EC-223 Stage 6), driven by the view registry DERIVED from\n * the section rail (EC-237/239). The bare project URL redirects to the first\n * navigable rail view; otherwise the matched view id is resolved from the registry\n * (rail views + always-on built-ins) and its `parsePath` interprets the trailing\n * segments into a deep-link the view renders. An unknown view id or an unparseable\n * path is a not-found; rail CONFIG problems (duplicate/invalid views) surface as\n * visible issues in the shell, never silently. Renders inside the shell + provider\n * stack, so every surface sees the same live CMS store and breadcrumb context.\n */\nfunction StudioSectionResolver({\n project,\n match,\n search,\n}: {\n project: Project\n match: StudioRouteMatch\n search: StudioSearch\n}) {\n const projectId = project.id\n const nav = useStudioNav(project)\n const viewServices = useViewServices(projectId)\n\n if (match.section === 'index') {\n // Bare `/$projectId` → the project's first navigable rail view.\n // EC-441: `NavigateOnce` — this resolver re-renders while the landing\n // view's transition is pending; a per-render `<Navigate>` re-fires each time.\n return (\n <NavigateOnce\n to={STUDIO_PROJECT_ROUTE}\n params={{ projectId, _splat: landingViewId(nav, project) }}\n replace\n />\n )\n }\n\n const view = nav.registry.get(match.viewId)\n if (!view) return <StudioRouteNotFound />\n\n // A flat view (no `parsePath`) accepts only the bare path; a nested one\n // (CMS/components) interprets its segments. `null` → an over-deep path → not-found.\n const deepLink = (view.parsePath ?? flatPath)(match.segments)\n if (deepLink === null) return <StudioRouteNotFound />\n\n return <>{view.render({ project, projectId, deepLink, search, ...viewServices })}</>\n}\n\n/** The query hooks every view receives (stable: the hooks themselves). */\nconst VIEW_QUERY_HOOKS: AppViewQueryHooks = { useOperationQuery, useOperationCache }\n\n/** EC-616: the operations client, as a view reaches it (the one chokepoint). */\nconst viewOperations = async () => (await getStudioOperations()).operations\n\n/**\n * EC-616 — what `AppViewContext` grows by: the operations client, the query hooks, the\n * ambient content locale, the signed-in user and their role. Read here, in the resolver\n * (a component), so a view'''s plain `render` function receives them as values.\n */\nfunction useViewServices(projectId: string) {\n const { session } = useAuth()\n const role = useProjectRole(projectId)\n const { locale } = useStudioLocale()\n return {\n operations: viewOperations,\n query: VIEW_QUERY_HOOKS,\n locale,\n user: session?.user ?? null,\n role,\n }\n}\n\nfunction ProjectNotFound() {\n return (\n <div className=\"grid min-h-dvh place-items-center p-8\">\n <Stack gap=\"3\" align=\"center\" className=\"max-w-sm text-center\">\n <Heading size=\"display\">{translate('shell.projectNotFound.title')}</Heading>\n <Text tone=\"muted\">{translate('shell.projectNotFound.body')}</Text>\n <Button asChild>\n {/* EC-401: an explicit \"back to projects\" navigation — marked so the\n launcher's single-project auto-forward never bounces it back. */}\n <Link to=\"/\" state={launcherVisitState}>\n {translate('shell.backToProjects')}\n </Link>\n </Button>\n </Stack>\n </div>\n )\n}\n\nfunction StudioRouteNotFound() {\n return (\n <div className=\"grid h-full place-items-center p-8\">\n <Stack gap=\"2\" align=\"center\" className=\"max-w-sm text-center\">\n <Heading level={2} size=\"h2\">\n {translate('shell.routeNotFound.title')}\n </Heading>\n <Text tone=\"muted\">{translate('shell.routeNotFound.body')}</Text>\n </Stack>\n </div>\n )\n}\n"]}
@@ -2,14 +2,15 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { launcherVisitState, Link, STUDIO_PROJECT_ROUTE, useLocation } from '@elytracms/studio/router';
3
3
  import { ChevronRight } from 'lucide-react';
4
4
  import { useCallback, useEffect, useState } from 'react';
5
- import { Row, Spacer, Toaster } from '@elytracms/studio/ui';
5
+ import { Row, Spacer } from '@elytracms/studio/ui';
6
6
  import { readRailCollapsed, storeRailCollapsed } from '../lib/rail.js';
7
7
  import { composeTabTitle, studioBaseTitle, tabTitleParts } from '../lib/tab-title.js';
8
8
  import { isSingleProjectWorkspace } from '../lib/workspace/index.js';
9
9
  import { translate } from '../lib/i18n/index.js';
10
10
  import { CurrentUserMenu } from './current-user-menu.js';
11
- import { DeliveryHealthBanner } from './delivery-health-banner.js';
12
11
  import { RolePolicyDriftIssues } from './users/role-policy-drift-issues.js';
12
+ import { NoticeCenter, NoticePeek } from './notifications/notice-center.js';
13
+ import { effectiveRailCollapsed, useNarrowViewport } from './use-narrow-viewport.js';
13
14
  import { PlaygroundBadge } from './playground-badge.js';
14
15
  import { DevLoginBadge } from './dev-login-badge.js';
15
16
  import { AiPanelToggle } from './ai/ai-panel-toggle.js';
@@ -46,7 +47,11 @@ export function StudioShell({ project, children }) {
46
47
  return next;
47
48
  });
48
49
  }, []);
49
- return (_jsxs(BreadcrumbProvider, { children: [_jsx(StudioTabTitle, { project: project, activeViewId: activeViewId }), _jsxs("div", { className: "flex h-dvh flex-col bg-background", children: [_jsxs("header", { className: "flex h-12 shrink-0 items-center gap-2 border-b border-border px-3", children: [_jsx(Link, { to: "/", state: launcherVisitState, className: "grid size-6 shrink-0 place-items-center", "aria-label": translate('shell.allProjects'), children: _jsx("span", { className: "size-5 rounded-[5px] bg-primary shadow-sm" }) }), singleProject ? (_jsx(ActiveProjectName, { project: project })) : (_jsx(ProjectSwitcher, { activeProject: project })), _jsx(HeaderBreadcrumb, { project: project, activeViewId: activeViewId }), _jsx(Spacer, {}), _jsx(PlaygroundBadge, {}), _jsx(DevLoginBadge, {}), _jsx(AiPanelToggle, {}), _jsx(CurrentUserMenu, { projectId: project.id })] }), _jsx(DeliveryHealthBanner, { projectId: project.id }), _jsx(RolePolicyDriftIssues, { projectId: project.id }), _jsxs("div", { className: "flex min-h-0 flex-1", children: [_jsx(SectionNav, { project: project, collapsed: railCollapsed, onToggleCollapsed: toggleRail }), _jsx("main", { className: "flex min-w-0 flex-1 flex-col overflow-hidden", children: _jsx("div", { className: "min-h-0 flex-1 overflow-auto", children: children }) })] })] }), _jsx(Toaster, {})] }));
50
+ // EC-690: below 640 px the rail is icons-only whatever the stored preference.
51
+ const narrow = useNarrowViewport();
52
+ // EC-690: the issues tray is bounded to the content area, so it never covers the rail.
53
+ const [contentArea, setContentArea] = useState(null);
54
+ return (_jsxs(BreadcrumbProvider, { children: [_jsx(StudioTabTitle, { project: project, activeViewId: activeViewId }), _jsxs("div", { className: "flex h-dvh flex-col bg-background", children: [_jsxs("header", { className: "flex h-12 shrink-0 items-center gap-2 border-b border-border px-3", children: [_jsx(Link, { to: "/", state: launcherVisitState, className: "grid size-6 shrink-0 place-items-center", "aria-label": translate('shell.allProjects'), children: _jsx("span", { className: "size-5 rounded-[5px] bg-primary shadow-sm" }) }), singleProject ? (_jsx(ActiveProjectName, { project: project })) : (_jsx(ProjectSwitcher, { activeProject: project })), _jsx(HeaderBreadcrumb, { project: project, activeViewId: activeViewId }), _jsx(Spacer, {}), _jsx(NoticeCenter, { project: project, boundary: contentArea }), _jsx(PlaygroundBadge, {}), _jsx(DevLoginBadge, {}), _jsx(AiPanelToggle, {}), _jsx(CurrentUserMenu, { projectId: project.id })] }), _jsx(RolePolicyDriftIssues, { projectId: project.id }), _jsxs("div", { className: "flex min-h-0 flex-1", children: [_jsx(SectionNav, { project: project, collapsed: effectiveRailCollapsed(railCollapsed, narrow), onToggleCollapsed: toggleRail, toggleable: !narrow }), _jsxs("main", { ref: setContentArea, className: "relative flex min-w-0 flex-1 flex-col overflow-hidden", children: [_jsx("div", { className: "min-h-0 flex-1 overflow-auto", children: children }), _jsx(NoticePeek, {})] })] })] })] }));
50
55
  }
51
56
  /**
52
57
  * Per-view browser tab title (EC-402). The studio is ONE catch-all splat route,
@@ -1 +1 @@
1
- {"version":3,"file":"studio-shell.js","sourceRoot":"","sources":["../../src/components/studio-shell.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,IAAI,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtG,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA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GAAG,IAAC,GAAG,EAAC,GAAG,EAAgC,SAAS,EAAC,SAAS,aAC7D,KAAC,YAAY,IAAC,SAAS,EAAC,4CAA4C,wBAAe,EAClF,CAAC,MAAM,IAAI,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAGpB,KAAC,IAAI,IAAC,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAO,EAAE,SAAS,EAAE,UAAU,YAC3D,IAAI,CAAC,KAAK,GACN,CACR,CAAC,CAAC,CAAC,CACF,eAAM,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,UAAU,YAAG,IAAI,CAAC,KAAK,GAAQ,CAC1E,KAVe,GAAG,IAAI,CAAC,KAAK,IAAI,KAAK,EAAE,CAWpC,CACP,CAAA;YACH,CAAC,CAAC,IACE,CACP,CAAA;AACH,CAAC","sourcesContent":["import { launcherVisitState, Link, STUDIO_PROJECT_ROUTE, useLocation } from '@elytracms/studio/router'\nimport { ChevronRight } from 'lucide-react'\nimport { useCallback, useEffect, useState } from 'react'\nimport type { ReactNode } from 'react'\nimport type { Project, ProjectId } from '@elytracms/core/studio-core'\nimport { Row, Spacer, Toaster } from '@elytracms/studio/ui'\nimport { readRailCollapsed, storeRailCollapsed } from '../lib/rail'\nimport { composeTabTitle, studioBaseTitle, tabTitleParts } from '../lib/tab-title'\nimport { isSingleProjectWorkspace } from '../lib/workspace'\nimport { translate } from '../lib/i18n'\nimport { CurrentUserMenu } from './current-user-menu'\nimport { DeliveryHealthBanner } from './delivery-health-banner'\nimport { RolePolicyDriftIssues } from './users/role-policy-drift-issues'\nimport { PlaygroundBadge } from './playground-badge'\nimport { DevLoginBadge } from './dev-login-badge'\nimport { AiPanelToggle } from './ai/ai-panel-toggle'\nimport { ActiveProjectName, ProjectSwitcher } from './project-switcher'\nimport { SectionNav } from './section-nav'\nimport { useSwitcherEntries } from './workspace-projects'\nimport { activeViewIdFromPath, useStudioNav } from './app-views/sidebar'\nimport { BreadcrumbProvider, useBreadcrumbTrail } from './breadcrumb-context'\n\nexport interface StudioShellProps {\n project: Project\n children: ReactNode\n}\n\n/**\n * The Studio shell (brief §4.3, §8.1): a persistent top bar + section rail that\n * preserve the active project while the user moves between surfaces. The top bar\n * carries the single global breadcrumb reaching the active record (EC-214) — no\n * secondary band, no per-view title repeating the section. Responsive and\n * overflow-safe.\n */\nexport function StudioShell({ project, children }: StudioShellProps) {\n const { pathname } = useLocation()\n const activeViewId = activeViewIdFromPath(pathname)\n\n // EC-401: the shared single-project predicate — the same one that drives the\n // launcher's auto-forward — decides whether the header slot carries the\n // switcher dropdown or just the project's name.\n const { entries } = useSwitcherEntries()\n const singleProject = isSingleProjectWorkspace(entries)\n\n // User-toggled, persisted rail collapse (EC-214). Defaults to expanded; the\n // stored preference is read after mount (no flash script needed for a rail).\n const [railCollapsed, setRailCollapsed] = useState(false)\n useEffect(() => {\n setRailCollapsed(readRailCollapsed())\n }, [])\n const toggleRail = useCallback(() => {\n setRailCollapsed((prev) => {\n const next = !prev\n storeRailCollapsed(next)\n return next\n })\n }, [])\n\n return (\n <BreadcrumbProvider>\n {/* EC-402: per-view tab title, fed by the same breadcrumb/nav data as the header. */}\n <StudioTabTitle project={project} activeViewId={activeViewId} />\n <div className=\"flex h-dvh flex-col bg-background\">\n {/* Top bar — global controls + the one breadcrumb to the active record. */}\n <header className=\"flex h-12 shrink-0 items-center gap-2 border-b border-border px-3\">\n {/* EC-401: an explicit \"all projects\" navigation — marked so the\n launcher's single-project auto-forward never bounces it back. */}\n <Link\n to=\"/\"\n state={launcherVisitState}\n className=\"grid size-6 shrink-0 place-items-center\"\n aria-label={translate('shell.allProjects')}\n >\n <span className=\"size-5 rounded-[5px] bg-primary shadow-sm\" />\n </Link>\n {singleProject ? (\n <ActiveProjectName project={project} />\n ) : (\n <ProjectSwitcher activeProject={project} />\n )}\n <HeaderBreadcrumb project={project} activeViewId={activeViewId} />\n <Spacer />\n {/* EC-153: explicit playground-mode marker (renders nothing on Convex). */}\n <PlaygroundBadge />\n {/* Dev-only unattended-auth marker (renders nothing in prod / when unset). */}\n <DevLoginBadge />\n {/* EC-199: AI assistant toggle — renders nothing unless `defineStudio({ ai })`. */}\n <AiPanelToggle />\n {/* EC-150: signed-in user + their role on this project + sign-out. */}\n <CurrentUserMenu projectId={project.id} />\n </header>\n\n {/* EC-268: warns when instant-publish env is incomplete (connected mode only). */}\n <DeliveryHealthBanner projectId={project.id} />\n {/* EC-605: a role-policy drift, published to the rail's issues foot (renders nothing). */}\n <RolePolicyDriftIssues projectId={project.id} />\n\n <div className=\"flex min-h-0 flex-1\">\n <SectionNav\n project={project}\n collapsed={railCollapsed}\n onToggleCollapsed={toggleRail}\n />\n\n <main className=\"flex min-w-0 flex-1 flex-col overflow-hidden\">\n <div className=\"min-h-0 flex-1 overflow-auto\">{children}</div>\n </main>\n </div>\n </div>\n {/* EC-268: transient action feedback (e.g. a publish that fails at transport). */}\n <Toaster />\n </BreadcrumbProvider>\n )\n}\n\n/**\n * Per-view browser tab title (EC-402). The studio is ONE catch-all splat route,\n * so per-view titles cannot come from per-route `head()` — this effect composes\n * `deepest crumb · view label · project name · base title` from the exact\n * sources the header breadcrumb renders (no new data flow, AD-17): the\n * contributed trail, the nav registry's localized view label, `project.name`,\n * and the `createStudioRootRoute` base title. Assignment is effect-only\n * (SSR-safe); unmounting (launcher, sign-in, project switch) restores the base\n * title, so non-project surfaces keep the consumer's branding untouched.\n */\nfunction StudioTabTitle({\n project,\n activeViewId,\n}: {\n project: Project\n activeViewId: string | null\n}) {\n const nav = useStudioNav(project)\n const trail = useBreadcrumbTrail()\n const view = activeViewId ? nav.registry.get(activeViewId) : undefined\n const title = composeTabTitle(\n tabTitleParts({\n breadcrumb: trail,\n viewLabel: view?.label,\n projectName: project.name,\n baseTitle: studioBaseTitle(),\n }),\n )\n\n useEffect(() => {\n document.title = title\n }, [title])\n\n // Leaving the project shell restores the base title (launcher/sign-in keep it).\n useEffect(\n () => () => {\n document.title = studioBaseTitle()\n },\n [],\n )\n\n return null\n}\n\nconst CRUMB_LINK =\n 'max-w-[12rem] truncate text-muted-foreground transition-colors hover:text-foreground'\nconst CRUMB_CURRENT = 'max-w-[16rem] truncate font-medium text-foreground'\n\n/**\n * The single global breadcrumb (EC-214): project (the switcher) › section › …the\n * active record. The section crumb is the active VIEW's label (EC-237/239, resolved\n * from the rail-derived registry); deeper crumbs are contributed by the active\n * surface via {@link useBreadcrumbTrail}. The last crumb is the current page (plain\n * text); earlier crumbs link back.\n */\nfunction HeaderBreadcrumb({\n project,\n activeViewId,\n}: {\n project: Project\n activeViewId: string | null\n}) {\n const projectId: ProjectId = project.id\n const nav = useStudioNav(project)\n const extra = useBreadcrumbTrail()\n const view = activeViewId ? nav.registry.get(activeViewId) : undefined\n if (!view) return null\n const sectionIsLast = extra.length === 0\n\n return (\n <Row gap=\"1\" className=\"min-w-0 text-sm\" aria-label={translate('shell.breadcrumb.label')}>\n <ChevronRight className=\"size-3.5 shrink-0 text-muted-foreground/50\" aria-hidden />\n {sectionIsLast ? (\n <span className={CRUMB_CURRENT}>{view.label}</span>\n ) : (\n <Link\n to={STUDIO_PROJECT_ROUTE}\n params={{ projectId, _splat: view.id }}\n className={CRUMB_LINK}\n >\n {view.label}\n </Link>\n )}\n {extra.map((item, index) => {\n const isLast = index === extra.length - 1\n return (\n <Row gap=\"1\" key={`${item.label}-${index}`} className=\"min-w-0\">\n <ChevronRight className=\"size-3.5 shrink-0 text-muted-foreground/50\" aria-hidden />\n {!isLast && item.to ? (\n // `to` and `params` are always contributed as a unit (the type\n // pairs them); the assertion satisfies the route's required params.\n <Link to={item.to} params={item.params!} className={CRUMB_LINK}>\n {item.label}\n </Link>\n ) : (\n <span className={isLast ? CRUMB_CURRENT : CRUMB_LINK}>{item.label}</span>\n )}\n </Row>\n )\n })}\n </Row>\n )\n}\n"]}
1
+ {"version":3,"file":"studio-shell.js","sourceRoot":"","sources":["../../src/components/studio-shell.tsx"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,4CAA4C,wBAAe,EAClF,aAAa,CAAC,CAAC,CAAC,CACf,eAAM,SAAS,EAAE,aAAa,YAAG,IAAI,CAAC,KAAK,GAAQ,CACpD,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,IACH,EAAE,EAAE,oBAAoB,EACxB,MAAM,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE,EACtC,SAAS,EAAE,UAAU,YAEpB,IAAI,CAAC,KAAK,GACN,CACR,EACA,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;gBACzB,MAAM,MAAM,GAAG,KAAK,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC,CAAA;gBACzC,OAAO,CACL,MAAC,GAAG,IAAC,GAAG,EAAC,GAAG,EAAgC,SAAS,EAAC,SAAS,aAC7D,KAAC,YAAY,IAAC,SAAS,EAAC,4CAA4C,wBAAe,EAClF,CAAC,MAAM,IAAI,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAGpB,KAAC,IAAI,IAAC,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAO,EAAE,SAAS,EAAE,UAAU,YAC3D,IAAI,CAAC,KAAK,GACN,CACR,CAAC,CAAC,CAAC,CACF,eAAM,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,UAAU,YAAG,IAAI,CAAC,KAAK,GAAQ,CAC1E,KAVe,GAAG,IAAI,CAAC,KAAK,IAAI,KAAK,EAAE,CAWpC,CACP,CAAA;YACH,CAAC,CAAC,IACE,CACP,CAAA;AACH,CAAC","sourcesContent":["import { launcherVisitState, Link, STUDIO_PROJECT_ROUTE, useLocation } from '@elytracms/studio/router'\nimport { ChevronRight } from 'lucide-react'\nimport { useCallback, useEffect, useState } from 'react'\nimport type { ReactNode } from 'react'\nimport type { Project, ProjectId } from '@elytracms/core/studio-core'\nimport { Row, Spacer } from '@elytracms/studio/ui'\nimport { readRailCollapsed, storeRailCollapsed } from '../lib/rail'\nimport { composeTabTitle, studioBaseTitle, tabTitleParts } from '../lib/tab-title'\nimport { isSingleProjectWorkspace } from '../lib/workspace'\nimport { translate } from '../lib/i18n'\nimport { CurrentUserMenu } from './current-user-menu'\nimport { RolePolicyDriftIssues } from './users/role-policy-drift-issues'\nimport { NoticeCenter, NoticePeek } from './notifications/notice-center'\nimport { effectiveRailCollapsed, useNarrowViewport } from './use-narrow-viewport'\nimport { PlaygroundBadge } from './playground-badge'\nimport { DevLoginBadge } from './dev-login-badge'\nimport { AiPanelToggle } from './ai/ai-panel-toggle'\nimport { ActiveProjectName, ProjectSwitcher } from './project-switcher'\nimport { SectionNav } from './section-nav'\nimport { useSwitcherEntries } from './workspace-projects'\nimport { activeViewIdFromPath, useStudioNav } from './app-views/sidebar'\nimport { BreadcrumbProvider, useBreadcrumbTrail } from './breadcrumb-context'\n\nexport interface StudioShellProps {\n project: Project\n children: ReactNode\n}\n\n/**\n * The Studio shell (brief §4.3, §8.1): a persistent top bar + section rail that\n * preserve the active project while the user moves between surfaces. The top bar\n * carries the single global breadcrumb reaching the active record (EC-214) — no\n * secondary band, no per-view title repeating the section. Responsive and\n * overflow-safe.\n */\nexport function StudioShell({ project, children }: StudioShellProps) {\n const { pathname } = useLocation()\n const activeViewId = activeViewIdFromPath(pathname)\n\n // EC-401: the shared single-project predicate — the same one that drives the\n // launcher's auto-forward — decides whether the header slot carries the\n // switcher dropdown or just the project's name.\n const { entries } = useSwitcherEntries()\n const singleProject = isSingleProjectWorkspace(entries)\n\n // User-toggled, persisted rail collapse (EC-214). Defaults to expanded; the\n // stored preference is read after mount (no flash script needed for a rail).\n const [railCollapsed, setRailCollapsed] = useState(false)\n useEffect(() => {\n setRailCollapsed(readRailCollapsed())\n }, [])\n const toggleRail = useCallback(() => {\n setRailCollapsed((prev) => {\n const next = !prev\n storeRailCollapsed(next)\n return next\n })\n }, [])\n // EC-690: below 640 px the rail is icons-only whatever the stored preference.\n const narrow = useNarrowViewport()\n // EC-690: the issues tray is bounded to the content area, so it never covers the rail.\n const [contentArea, setContentArea] = useState<HTMLElement | null>(null)\n\n return (\n <BreadcrumbProvider>\n {/* EC-402: per-view tab title, fed by the same breadcrumb/nav data as the header. */}\n <StudioTabTitle project={project} activeViewId={activeViewId} />\n <div className=\"flex h-dvh flex-col bg-background\">\n {/* Top bar — global controls + the one breadcrumb to the active record. */}\n <header className=\"flex h-12 shrink-0 items-center gap-2 border-b border-border px-3\">\n {/* EC-401: an explicit \"all projects\" navigation — marked so the\n launcher's single-project auto-forward never bounces it back. */}\n <Link\n to=\"/\"\n state={launcherVisitState}\n className=\"grid size-6 shrink-0 place-items-center\"\n aria-label={translate('shell.allProjects')}\n >\n <span className=\"size-5 rounded-[5px] bg-primary shadow-sm\" />\n </Link>\n {singleProject ? (\n <ActiveProjectName project={project} />\n ) : (\n <ProjectSwitcher activeProject={project} />\n )}\n <HeaderBreadcrumb project={project} activeViewId={activeViewId} />\n <Spacer />\n {/* EC-690: the ONE notification-and-issue surface — a badge by severity opening the\n issues tray (owner ruling (a): one badge, in the header, none at the rail foot). */}\n <NoticeCenter project={project} boundary={contentArea} />\n {/* EC-153: explicit playground-mode marker (renders nothing on Convex). */}\n <PlaygroundBadge />\n {/* Dev-only unattended-auth marker (renders nothing in prod / when unset). */}\n <DevLoginBadge />\n {/* EC-199: AI assistant toggle — renders nothing unless `defineStudio({ ai })`. */}\n <AiPanelToggle />\n {/* EC-150: signed-in user + their role on this project + sign-out. */}\n <CurrentUserMenu projectId={project.id} />\n </header>\n\n {/* EC-605: a role-policy drift, published to the issues tray (renders nothing). EC-690:\n the instant-publish health (EC-268) is a finding of the tray now, not a banner. */}\n <RolePolicyDriftIssues projectId={project.id} />\n\n <div className=\"flex min-h-0 flex-1\">\n <SectionNav\n project={project}\n collapsed={effectiveRailCollapsed(railCollapsed, narrow)}\n onToggleCollapsed={toggleRail}\n toggleable={!narrow}\n />\n\n <main ref={setContentArea} className=\"relative flex min-w-0 flex-1 flex-col overflow-hidden\">\n <div className=\"min-h-0 flex-1 overflow-auto\">{children}</div>\n {/* EC-690: new notices peek here — inside the content area, bottom-right, never over the rail. */}\n <NoticePeek />\n </main>\n </div>\n </div>\n </BreadcrumbProvider>\n )\n}\n\n/**\n * Per-view browser tab title (EC-402). The studio is ONE catch-all splat route,\n * so per-view titles cannot come from per-route `head()` — this effect composes\n * `deepest crumb · view label · project name · base title` from the exact\n * sources the header breadcrumb renders (no new data flow, AD-17): the\n * contributed trail, the nav registry's localized view label, `project.name`,\n * and the `createStudioRootRoute` base title. Assignment is effect-only\n * (SSR-safe); unmounting (launcher, sign-in, project switch) restores the base\n * title, so non-project surfaces keep the consumer's branding untouched.\n */\nfunction StudioTabTitle({\n project,\n activeViewId,\n}: {\n project: Project\n activeViewId: string | null\n}) {\n const nav = useStudioNav(project)\n const trail = useBreadcrumbTrail()\n const view = activeViewId ? nav.registry.get(activeViewId) : undefined\n const title = composeTabTitle(\n tabTitleParts({\n breadcrumb: trail,\n viewLabel: view?.label,\n projectName: project.name,\n baseTitle: studioBaseTitle(),\n }),\n )\n\n useEffect(() => {\n document.title = title\n }, [title])\n\n // Leaving the project shell restores the base title (launcher/sign-in keep it).\n useEffect(\n () => () => {\n document.title = studioBaseTitle()\n },\n [],\n )\n\n return null\n}\n\nconst CRUMB_LINK =\n 'max-w-[12rem] truncate text-muted-foreground transition-colors hover:text-foreground'\nconst CRUMB_CURRENT = 'max-w-[16rem] truncate font-medium text-foreground'\n\n/**\n * The single global breadcrumb (EC-214): project (the switcher) › section › …the\n * active record. The section crumb is the active VIEW's label (EC-237/239, resolved\n * from the rail-derived registry); deeper crumbs are contributed by the active\n * surface via {@link useBreadcrumbTrail}. The last crumb is the current page (plain\n * text); earlier crumbs link back.\n */\nfunction HeaderBreadcrumb({\n project,\n activeViewId,\n}: {\n project: Project\n activeViewId: string | null\n}) {\n const projectId: ProjectId = project.id\n const nav = useStudioNav(project)\n const extra = useBreadcrumbTrail()\n const view = activeViewId ? nav.registry.get(activeViewId) : undefined\n if (!view) return null\n const sectionIsLast = extra.length === 0\n\n return (\n <Row gap=\"1\" className=\"min-w-0 text-sm\" aria-label={translate('shell.breadcrumb.label')}>\n <ChevronRight className=\"size-3.5 shrink-0 text-muted-foreground/50\" aria-hidden />\n {sectionIsLast ? (\n <span className={CRUMB_CURRENT}>{view.label}</span>\n ) : (\n <Link\n to={STUDIO_PROJECT_ROUTE}\n params={{ projectId, _splat: view.id }}\n className={CRUMB_LINK}\n >\n {view.label}\n </Link>\n )}\n {extra.map((item, index) => {\n const isLast = index === extra.length - 1\n return (\n <Row gap=\"1\" key={`${item.label}-${index}`} className=\"min-w-0\">\n <ChevronRight className=\"size-3.5 shrink-0 text-muted-foreground/50\" aria-hidden />\n {!isLast && item.to ? (\n // `to` and `params` are always contributed as a unit (the type\n // pairs them); the assertion satisfies the route's required params.\n <Link to={item.to} params={item.params!} className={CRUMB_LINK}>\n {item.label}\n </Link>\n ) : (\n <span className={isLast ? CRUMB_CURRENT : CRUMB_LINK}>{item.label}</span>\n )}\n </Row>\n )\n })}\n </Row>\n )\n}\n"]}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * EC-690 — below this width the shell keeps the section rail icons-only (56 px) whatever the
3
+ * stored preference. Measured (wave-0100): at 390 px the expanded rail took 224 px, 57 % of
4
+ * the width, leaving the content 166 px — too little for the issues tray (bounded to the
5
+ * content area so it never covers the rail) or any editor.
6
+ */
7
+ export declare const NARROW_VIEWPORT_QUERY = "(max-width: 639px)";
8
+ /** Whether the viewport is narrow (`false` on the server: the rail renders as stored, then adapts). */
9
+ export declare function useNarrowViewport(): boolean;
10
+ /** The ONE reader of "is the rail icons-only": the user's collapse, or a narrow viewport. */
11
+ export declare function effectiveRailCollapsed(collapsed: boolean, narrow: boolean): boolean;