fix: hoist DetailPanel into AppShell detail slot for proper slide-in
All checks were successful
CI / build (push) Successful in 1m22s
CI / cleanup-branch (push) Has been skipped
CI / docker (push) Successful in 51s
CI / deploy (push) Successful in 38s
CI / deploy-feature (push) Has been skipped

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:
hsiegeln
2026-03-24 18:28:03 +01:00
parent 0a5f4a03b5
commit 5de792744e
4 changed files with 192 additions and 104 deletions

View File

@@ -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>