fix: hoist DetailPanel into AppShell detail slot for proper slide-in
DetailPanel is a flex sibling that slides in from the right — it must be rendered at the AppShell level via the detail prop, not inside the page content. Add DetailPanelContext so pages can push their panel content up to LayoutShell, which passes it to AppShell.detail. Applied to Dashboard (exchange detail) and AgentHealth (instance detail). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,7 @@ import { useRouteCatalog } from '../api/queries/catalog';
|
||||
import { useAgents } from '../api/queries/agents';
|
||||
import { useAuthStore } from '../auth/auth-store';
|
||||
import { useMemo, useCallback } from 'react';
|
||||
import { DetailPanelProvider, useDetailPanelSlot } from './DetailPanelContext';
|
||||
|
||||
function healthToColor(health: string): string {
|
||||
switch (health) {
|
||||
@@ -68,6 +69,7 @@ function LayoutContent() {
|
||||
const { data: agents } = useAgents();
|
||||
const { username, logout } = useAuthStore();
|
||||
const { open: paletteOpen, setOpen: setPaletteOpen } = useCommandPalette();
|
||||
const { detail } = useDetailPanelSlot();
|
||||
|
||||
const sidebarApps: SidebarApp[] = useMemo(() => {
|
||||
if (!catalog) return [];
|
||||
@@ -122,6 +124,7 @@ function LayoutContent() {
|
||||
apps={sidebarApps}
|
||||
/>
|
||||
}
|
||||
detail={detail}
|
||||
>
|
||||
<TopBar
|
||||
breadcrumb={breadcrumb}
|
||||
@@ -146,7 +149,9 @@ export function LayoutShell() {
|
||||
<ToastProvider>
|
||||
<CommandPaletteProvider>
|
||||
<GlobalFilterProvider>
|
||||
<LayoutContent />
|
||||
<DetailPanelProvider>
|
||||
<LayoutContent />
|
||||
</DetailPanelProvider>
|
||||
</GlobalFilterProvider>
|
||||
</CommandPaletteProvider>
|
||||
</ToastProvider>
|
||||
|
||||
Reference in New Issue
Block a user