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(map): an icon theme switch, the project's name in the middle, a plainer README image

Eren04adf801b961
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1a20401..cf02c38 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,8 @@ 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
+- The theme switch is one icon (a screen for the system's theme, a sun, a moon) with its meaning in the tooltip. A map's top bar puts cogit and its slogan, larger, on the left and the project's name and path in the middle. The README shows a plainer screenshot: only the map.
## [0.18.0] - 2026-10-28
### Added
diff --git a/docs/guide/map.md b/docs/guide/map.md
index c62f600..06bd431 100644
--- a/docs/guide/map.md
+++ b/docs/guide/map.md
@@ -86,8 +86,8 @@ where it left off. "← All projects" goes to the panel.
## Theme
-The button next to Settings switches between **System** (follow your system's light or dark
-mode), **Light** and **Dark**. The choice is remembered in this browser.
+The icon next to Settings switches the theme: a screen follows your system's light or dark
+mode, a sun is light, a moon is dark. Hover it to see which is on. The choice is remembered in this browser.
## Settings
diff --git a/docs/images/map-dark.png b/docs/images/map-dark.png
index fee0d93..09e8b6e 100644
Binary files a/docs/images/map-dark.png and b/docs/images/map-dark.png differ
diff --git a/docs/images/map-light.png b/docs/images/map-light.png
index 0964449..cd0a87b 100644
Binary files a/docs/images/map-light.png and b/docs/images/map-light.png differ
diff --git a/packages/template/src/App.tsx b/packages/template/src/App.tsx
index 77db8dc..72df0b3 100644
--- a/packages/template/src/App.tsx
+++ b/packages/template/src/App.tsx
@@ -55,8 +55,12 @@ export function App({ model }: { model: LineageViewModel }) {
return (
<main className="map-page">
<div className="page-head">
- <div className="page-bar">
+ <div className="page-bar page-bar-centered">
<Brand />
+ <div className="page-title">
+ <h1>{model.project.name}</h1>
+ <p className="muted">{model.project.path}</p>
+ </div>
<div className="page-bar-actions">
<SearchBox
value={query}
@@ -72,8 +76,6 @@ export function App({ model }: { model: LineageViewModel }) {
<header className="project">
<div>
- <h1>{model.project.name}</h1>
- <p className="muted">{model.project.path}</p>
<ProjectSwitcher model={model} />
<BackToPanel />
</div>
diff --git a/packages/template/src/ThemeButton.tsx b/packages/template/src/ThemeButton.tsx
index 1b6c3fc..4e5796c 100644
--- a/packages/template/src/ThemeButton.tsx
+++ b/packages/template/src/ThemeButton.tsx
@@ -13,19 +13,55 @@ export function useTheme(): ThemeMode {
return useSyncExternalStore(subscribeTheme, getTheme, getTheme);
}
-/** The top bar's System → Light → Dark switch, next to Settings. */
+const ICON_PROPS = {
+ width: 20,
+ height: 20,
+ viewBox: "0 0 24 24",
+ fill: "none",
+ stroke: "currentColor",
+ strokeWidth: 2,
+ strokeLinecap: "round",
+ strokeLinejoin: "round",
+ "aria-hidden": true,
+} as const;
+
+/** A screen for "follow the system", a sun for Light, a moon for Dark. */
+function ThemeIcon({ mode }: { mode: ThemeMode }) {
+ if (mode === "light")
+ return (
+ <svg {...ICON_PROPS}>
+ <circle cx="12" cy="12" r="4" />
+ <path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4" />
+ </svg>
+ );
+ if (mode === "dark")
+ return (
+ <svg {...ICON_PROPS}>
+ <path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z" />
+ </svg>
+ );
+ return (
+ <svg {...ICON_PROPS}>
+ <rect x="3" y="4" width="18" height="12" rx="2" />
+ <path d="M8 20h8M12 16v4" />
+ </svg>
+ );
+}
+
+/** The top bar's theme switch, next to Settings: one icon, the words in its tooltip. */
export function ThemeButton() {
const mode = useTheme();
const next = nextTheme(mode);
+ const text = `Theme: ${themeLabel(mode)}. Click for ${themeLabel(next)}.`;
return (
<button
type="button"
- className="settings-button theme-button"
- title={`Theme: ${mode}. Click for ${next}.`}
- aria-label={`Theme: ${mode}. Switch to ${next}.`}
+ className="theme-button"
+ title={text}
+ aria-label={text}
onClick={() => setTheme(next)}
>
- {themeLabel(mode)}
+ <ThemeIcon mode={mode} />
</button>
);
}
diff --git a/packages/template/src/styles.css b/packages/template/src/styles.css
index 8fb1ffe..11477db 100644
--- a/packages/template/src/styles.css
+++ b/packages/template/src/styles.css
@@ -184,7 +184,7 @@ main.panel-page {
flex-direction: column;
align-self: center;
color: var(--text);
- font-size: 20px;
+ font-size: 26px;
font-weight: 700;
letter-spacing: -0.02em;
line-height: 1.1;
@@ -193,7 +193,7 @@ main.panel-page {
.brand-tagline {
color: var(--muted);
- font-size: 11px;
+ font-size: 13px;
font-style: italic;
font-weight: 400;
letter-spacing: 0;
@@ -293,6 +293,55 @@ main.map-page {
gap: 12px;
}
+/* A map's top bar: cogit on the left, the project in the middle, the actions on the right. */
+.page-bar-centered {
+ display: grid;
+ grid-template-columns: 1fr auto 1fr;
+ align-items: center;
+}
+
+.page-bar-centered .page-bar-actions {
+ justify-self: end;
+ align-items: center;
+}
+
+.page-title {
+ min-width: 0;
+ text-align: center;
+}
+
+.page-title h1 {
+ margin: 0;
+ font-size: 26px;
+ line-height: 1.2;
+}
+
+.page-title .muted {
+ margin: 2px 0 0;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+/* The theme switch: one icon, its meaning in the tooltip. */
+.theme-button {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ width: 36px;
+ height: 36px;
+ padding: 0;
+ color: var(--text);
+ background: var(--panel);
+ border: 1px solid var(--line);
+ border-radius: 8px;
+ cursor: pointer;
+}
+
+.theme-button:hover {
+ background: var(--hover);
+}
+
/* Under the project's name and path: recent projects and Ctrl/Cmd+K. */
.project .switcher {
margin-top: 10px;
@@ -389,10 +438,6 @@ main.map-page {
cursor: pointer;
}
-.theme-button {
- margin-right: 8px;
-}
-
.settings-button:hover {
color: var(--text);
border-color: var(--accent);
@@ -1917,6 +1962,16 @@ time {
}
@media (max-width: 720px) {
+ .page-bar-centered {
+ grid-template-columns: 1fr auto;
+ }
+
+ .page-bar-centered .page-title {
+ grid-column: 1 / -1;
+ grid-row: 2;
+ text-align: left;
+ }
+
.project {
flex-direction: column;
align-items: flex-start;
diff --git a/packages/template/src/theme.ts b/packages/template/src/theme.ts
index 875335b..07d7a8c 100644
--- a/packages/template/src/theme.ts
+++ b/packages/template/src/theme.ts
@@ -16,9 +16,9 @@ export function nextTheme(mode: ThemeMode): ThemeMode {
return ORDER[(ORDER.indexOf(mode) + 1) % ORDER.length] as ThemeMode;
}
-/** What the button says for a mode. */
+/** How the button's tooltip names a mode. */
export function themeLabel(mode: ThemeMode): string {
- return mode === "system" ? "◐ System" : mode === "light" ? "☀ Light" : "☾ Dark";
+ return mode === "system" ? "same as your system" : mode === "light" ? "light" : "dark";
}
type Store = Pick<Storage, "getItem" | "setItem" | "removeItem">;
diff --git a/packages/template/test/theme.test.ts b/packages/template/test/theme.test.ts
index 283970c..53fc1dc 100644
--- a/packages/template/test/theme.test.ts
+++ b/packages/template/test/theme.test.ts
@@ -34,9 +34,9 @@ describe("the theme switch", () => {
expect(nextTheme("system")).toBe("light");
expect(nextTheme("light")).toBe("dark");
expect(nextTheme("dark")).toBe("system");
- expect(themeLabel("system")).toContain("System");
- expect(themeLabel("light")).toContain("Light");
- expect(themeLabel("dark")).toContain("Dark");
+ expect(themeLabel("system")).toBe("same as your system");
+ expect(themeLabel("light")).toBe("light");
+ expect(themeLabel("dark")).toBe("dark");
});
it("remembers a choice and forgets System", () => {