This commit is contained in:
@@ -15,6 +15,8 @@ import {
|
||||
} from '@/components/ui/dropdown-menu';
|
||||
import { Sheet, SheetContent, SheetHeader, SheetTitle } from '@/components/ui/sheet';
|
||||
import { AssistantPanel, AssistantPanelProvider } from '@/components/ai-assistant';
|
||||
import { UiEditingProvider } from '@/components/ui-tree/UiEditingProvider';
|
||||
import { pageKeyForRoute } from '@/lib/skills/registry';
|
||||
import { endAdminSession } from '@/lib/admin/session';
|
||||
import { useCurrentUser } from '@/lib/krowHooks';
|
||||
|
||||
@@ -177,8 +179,22 @@ export default function AdminLayout() {
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* The layout session for whichever page is open.
|
||||
*
|
||||
* Mounted here rather than inside a page because both the page and the panel
|
||||
* beside it need the same one: the page renders the tree, and Owliver
|
||||
* proposes changes to it. Two providers would be two trees, and the preview
|
||||
* shown in chat would be of a page nobody was looking at.
|
||||
*
|
||||
* A page that has registered no composition simply has an empty tree, so this
|
||||
* costs nothing on the surfaces that have not migrated yet.
|
||||
*/
|
||||
const uiPage = pageKeyForRoute(location.pathname) || '';
|
||||
|
||||
return (
|
||||
<AssistantPanelProvider role="admin" pathname={location.pathname}>
|
||||
<UiEditingProvider page={uiPage}>
|
||||
{/* Transparent so the ambient canvas painted behind the app reads through.
|
||||
An opaque shell here would cover it and every Admin page would lose the
|
||||
tint at once — which is exactly why the canvas is one layer and not a
|
||||
@@ -354,6 +370,7 @@ export default function AdminLayout() {
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</UiEditingProvider>
|
||||
</AssistantPanelProvider>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user