Replaces the separate Entities/Graph nav items with one Knowledge Base page that browses all entities as either a table or a force-graph, scoped by ontology layer (Infrastructure/Governance/Cognition), with a resizable browse/detail split instead of a slide-over sheet. - New KnowledgeBase.svelte: layer tabs, view toggle, resizable browse/detail split (pattern from Chat.svelte's rail). - EntityTable/EntityGraph extracted as presentational sub-components; their search/filter/root/depth toolbars live in the shared page toolbar (not the resizable pane) so they don't truncate when the divider is dragged narrow, and both views start flush with the detail pane for consistent height. - EntityTable columns are sortable (slug/type/name/state/health). - EntityDetailContent redesigned as a single-column list of collapsible sections (DetailSection.svelte), collapsed by default when empty; relation entries are clickable and select the entity in the browse pane + detail pane (and drill in-place in EntitySheet wherever it's used elsewhere in the app). - api.ts: add layer filter to fetchEntities, add fetchEntityTypes for client-side graph layer scoping (the graph endpoint has no layer param). Old hash routes (#/entities, #/graph) redirect to #/kb. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
29 lines
1015 B
Svelte
29 lines
1015 B
Svelte
<script lang="ts">
|
|
import EntityDetailContent from '$lib/components/EntityDetailContent.svelte'
|
|
import * as Sheet from '$lib/components/ui/sheet'
|
|
|
|
let { slug, open = $bindable(false) }: { slug: string | null; open?: boolean } = $props()
|
|
|
|
// Lets a relation click inside the sheet drill into that entity in place,
|
|
// without closing/reopening. Resets to the externally-requested slug
|
|
// whenever the caller opens the sheet on a different entity.
|
|
let currentSlug = $state(slug)
|
|
$effect(() => {
|
|
currentSlug = slug
|
|
})
|
|
</script>
|
|
|
|
<Sheet.Root bind:open>
|
|
<Sheet.Content side="right" class="w-full p-0 sm:max-w-2xl">
|
|
<Sheet.Header class="sr-only">
|
|
<Sheet.Title>{currentSlug ?? 'Entity detail'}</Sheet.Title>
|
|
<Sheet.Description>Entity detail panel</Sheet.Description>
|
|
</Sheet.Header>
|
|
{#if currentSlug}
|
|
{#key currentSlug}
|
|
<EntityDetailContent slug={currentSlug} onSelectEntity={(s) => (currentSlug = s)} />
|
|
{/key}
|
|
{/if}
|
|
</Sheet.Content>
|
|
</Sheet.Root>
|