Skip to content

armgit / cogit

Public Imported from GitHub
0

Git for the intent behind agent-written code. Records what your coding agent decided and why, and links every commit to it.

fix(panel): say how to remove a project whose directory is gone

Eren262e35b5ffe8
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ba55284..1b0ea40 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
+### Changed
+- `cogit init` ends with the next step that fits: when Claude Code already lists the plugin as installed it says to work with Claude Code and open the map, otherwise it names the install command. It used to ask for the plugin even when it was there.
+- A panel card marked "missing" says on hover that `cogit config prune` removes it, and the map guide explains the panel's list, `prune` and that the map server stops after 30 idle minutes.
## [0.19.0] - 2026-10-28
### Changed
diff --git a/docs/guide/map.md b/docs/guide/map.md
index 06bd431..71ad9cc 100644
--- a/docs/guide/map.md
+++ b/docs/guide/map.md
@@ -8,7 +8,12 @@ cogit open # the panel: every project on this machine
`cogit open` builds the page and serves it on `127.0.0.1` (port 4747, `serverPort`), starting
the server in the background if it is not running. The page refreshes itself whenever the
record changes and keeps your place: the selected message, the unfolded branches, the scroll
-and the zoom. Nothing is sent anywhere; the server answers only this machine.
+and the zoom. Nothing is sent anywhere; the server answers only this machine. The server
+stops on its own after 30 minutes without a page open; the next `cogit open` starts it again.
+
+The panel lists every project `cogit init` set up on this machine. A project whose directory
+was deleted or moved stays as a card marked "missing"; `cogit config prune` removes those
+(`--dry-run` lists them first).
<picture>
<source media="(prefers-color-scheme: dark)" srcset="../images/map-dark.png">
diff --git a/packages/template/src/Panel.tsx b/packages/template/src/Panel.tsx
index c7a9d6a..a040503 100644
--- a/packages/template/src/Panel.tsx
+++ b/packages/template/src/Panel.tsx
@@ -53,7 +53,14 @@ export function Panel({ model }: { model: PanelViewModel }) {
<li key={project.path} className={project.missing ? "card missing" : "card"}>
<div className="card-head">
<h2>{project.name}</h2>
- {project.missing ? <span className="badge">missing</span> : null}
+ {project.missing ? (
+ <span
+ className="badge"
+ title="This directory is gone. `cogit config prune` removes it from the panel."
+ >
+ missing
+ </span>
+ ) : null}
</div>
<p className="muted path">{project.path}</p>
<dl className="card-facts">
diff --git a/packages/template/test/panel.test.ts b/packages/template/test/panel.test.ts
index 2156a8a..66a1c21 100644
--- a/packages/template/test/panel.test.ts
+++ b/packages/template/test/panel.test.ts
@@ -58,5 +58,23 @@ describe("Panel cards", () => {
createElement(Panel, { model: { ...model, projects: [project] } }),
);
expect(html).toContain('<a class="card-open" href="/map?dir=%2Fwork%2Fcogit">');
+ expect(html).not.toContain("missing");
+ });
+
+ it("says how to remove a project whose directory is gone", () => {
+ (globalThis as { document?: unknown }).document = { querySelector: () => ({}) };
+ const project = {
+ name: "gone",
+ path: "/work/gone",
+ lineageUrl: "file:///work/gone/.cogit/map.html",
+ lastActivity: null,
+ needsUserCount: 0,
+ missing: true,
+ } as PanelViewModel["projects"][number];
+ const html = renderToStaticMarkup(
+ createElement(Panel, { model: { ...model, projects: [project] } }),
+ );
+ expect(html).toContain('<li class="card missing">');
+ expect(html).toContain("`cogit config prune` removes it from the panel.");
});
});