Fix tool install-state, inherit program description, declutter Tools cards

- Tool detail showed installed tools as 'Not installed': /deployments/{name}
  populated 'installed' for path deployments but left 'active' null, and
  ToolDetail keyed off 'active'. Now the endpoint sets active=installed for path,
  and ToolDetail reads 'installed' directly (verified: on-PATH ⇒ True, else False).
- A deployment now inherits its program's description by default: copied at
  creation (CLI create + API _save_deployment on new deployments) + a one-time
  patchup of existing ones (29 deployments).
- Tools page cards no longer list deployments (ProgramCard showDeployments=false) —
  the lens already scopes to the tool; the deployment list is a Programs-catalog thing.
This commit is contained in:
2026-07-01 13:07:00 -07:00
parent 183c589b63
commit 0463cd91f1
7 changed files with 64 additions and 33 deletions

View File

@@ -38,8 +38,9 @@ export function ToolDetailPage() {
<p className="text-sm text-[var(--muted)] -mt-4 mb-6">{deployment.description}</p>
)}
{/* A tool's PATH deployment: install/uninstall is its start/stop. */}
<PathLifecycle name={deployment.id} active={deployment.active} onDone={refetch} />
{/* A tool's PATH deployment: install/uninstall is its start/stop. Its
live state is `installed` (on PATH), which the endpoint sets directly. */}
<PathLifecycle name={deployment.id} installed={deployment.installed} onDone={refetch} />
<div className="bg-[var(--card)] border border-[var(--border)] rounded-lg p-5 mb-6">
<h2 className="text-sm font-semibold text-[var(--muted)] uppercase tracking-wider mb-3">
@@ -65,19 +66,19 @@ export function ToolDetailPage() {
/** Install/uninstall a tool on PATH — the path deployment's lifecycle. */
function PathLifecycle({
name,
active,
installed: installedState,
onDone,
}: {
name: string
active: boolean | null
installed: boolean | null
onDone: () => void
}) {
const { mutate, isPending } = useProgramAction()
const installed = active === true
const installed = installedState === true
const dot =
active === true
installedState === true
? "bg-green-500"
: active === false
: installedState === false
? "bg-[var(--muted)]"
: "bg-transparent border border-[var(--muted)]"
return (

View File

@@ -14,7 +14,7 @@ export function Tools() {
{isLoading ? (
<p className="text-[var(--muted)]">Loading...</p>
) : programs && programs.length > 0 ? (
<ProgramList programs={programs} linkBase="/tools" />
<ProgramList programs={programs} linkBase="/tools" showDeployments={false} />
) : (
<p className="text-[var(--muted)]">No tools yet.</p>
)}