diff --git a/src/renderer/App.tsx b/src/renderer/App.tsx index 35160f6..01a8140 100644 --- a/src/renderer/App.tsx +++ b/src/renderer/App.tsx @@ -63,6 +63,16 @@ interface HarnessCatalogEntry { export function App() { const [surface, setSurface] = useState('library') const [paletteOpen, setPaletteOpen] = useState(false) + const [library, setLibrary] = useState([]) + + useEffect(() => { + let alive = true + window.hoist.library + .list() + .then((entries) => { if (alive) setLibrary(entries) }) + .catch(() => { /* monotonic guard */ }) + return () => { alive = false } + }, []) useEffect(() => { const onKey = (e: KeyboardEvent) => { @@ -102,7 +112,7 @@ export function App() { {surface === 'gateway' && } {surface === 'status' && } - + {paletteOpen && (
{h.name} - {h.version && {h.version}} + {h.version && {cleanVersion(h.version, h.name)}}
{statusLabel(h.status)} @@ -460,22 +483,32 @@ function LibrarySurface() { ) } -function LibraryInspectionPanel() { +function LibraryInspectionPanel({ entry }: { entry: LibraryEntry | undefined }) { const [cardOpen, setCardOpen] = useState(true) + if (!entry) { + return ( + + ) + } + const v = cleanVersion(entry.version, entry.name) return ( <>
{cardOpen && (
- - - - - + {v}} /> + {entry.exec || "โ€”"}} /> + + + {entry.exec ? "on PATH" : "โ€”"}} />
)}
@@ -766,8 +799,8 @@ function StatusSurface() { ) } -function DetailRail({ surface }: { surface: SurfaceId }) { - if (surface === 'library') return +function DetailRail({ surface, library }: { surface: SurfaceId; library: LibraryEntry[] }) { + if (surface === 'library') return return (