Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
011ab82
Architectural cleanup P0-P3: hygiene, SQL consolidation, IPC split, c…
ddutchie Jun 18, 2026
3b0362a
P4: Analytics canvas consistency — unify priority colors, extract hoo…
ddutchie Jun 18, 2026
8b64bdb
P5: God-component splits — type relocation, page.tsx, project-overvie…
ddutchie Jun 18, 2026
1972c88
Create v2.1.0.md
ddutchie Jun 18, 2026
e16970f
Update README.md, CONTRIBUTING.md, PR template, AGENTS.md for P0-P5 c…
ddutchie Jun 18, 2026
7f5e23e
Code Review
ddutchie Jun 18, 2026
af99741
Address PR review findings — data safety, resource cleanup, conventio…
ddutchie Jun 18, 2026
edafaff
P5-3: Decompose card-detail.tsx (550→232 LOC) — extract CardDetailSid…
ddutchie Jun 18, 2026
441cd2e
P5-3+P5-6: Decompose card-detail + notes-view god components
ddutchie Jun 18, 2026
55d6c48
Fix DatePicker popover clipping inside modals with overflow-y-auto
ddutchie Jun 18, 2026
4585d9b
Fix DatePicker: grow leftward when trigger is near right window edge
ddutchie Jun 18, 2026
6c6a730
Fix DatePicker: render popover via createPortal to document.body
ddutchie Jun 18, 2026
b7b2fde
P5-5: Decompose SessionPane.tsx (1009→269 LOC) — extract 6 components…
ddutchie Jun 18, 2026
3b1bfa3
P5-7+P5-8: Decompose flow-view + note-editor god components
ddutchie Jun 18, 2026
ce85be3
Update v2.1.0 changelog with full P0-P5 cleanup + PR review fixes
ddutchie Jun 18, 2026
7d32e36
Remove docs
ddutchie Jun 18, 2026
1b7bacc
Address PR review findings — IPC error consistency, SSRF host validat…
ddutchie Jun 18, 2026
cd3981c
Remove hex fallback from TerminalTab success color token
ddutchie Jun 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@

## Checklist

- [ ] `npm run type-check` passes
- [ ] `npm run type-check:all` passes
- [ ] `npm run lint` passes
- [ ] `npm test` passes
- [ ] `npm run test:e2e` passes (run before merging UI changes or cutting a release)
- [ ] No hardcoded colours — CSS variables only (`var(--accent)`, `var(--text-primary)`, etc.)
- [ ] No `text-[Npx]` pixel font classes — rem equivalents only (`text-[0.714rem]`, `text-xs`, etc.)
- [ ] New IPC handlers wrapped in `handle()` and return `IpcResult<T>`
- [ ] New DB migrations appended (not edited) in `schema.ts`
- [ ] `mcp-server.ts` changes use inlined SQL only — no import from `queries.ts`
- [ ] New SQL goes in `electron/db/queries.ts` — single source of truth (imported by both Electron main process and MCP server); never construct a `Database` instance outside `db/client.ts` (Electron) or `mcp-server.ts` (MCP runtime)

## Notes for reviewer

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
run: node scripts/generate-licenses.js

- name: Type check
run: npx tsc --noEmit
run: npm run type-check:all

# ── Lint ────────────────────────────────────────────────────────────────────
lint:
Expand Down
12 changes: 6 additions & 6 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ This version has breaking changes — APIs, conventions, and file structure may
- **Alpha variants**: `color-mix(in srgb, var(--token) X%, transparent)` — never hardcode `rgba()`
- **Font sizes**: use `rem`-based Tailwind classes (`text-xs`, `text-sm`, `text-[0.714rem]`, etc.). Never use `text-[Npx]` — pixel classes don't scale with the font size setting.
- **Font scaling**: `--font-scale` CSS variable is set on `<html>` inline by `applyFontScale()`. Root `font-size: calc(14px * var(--font-scale))`. SVG `fontSize` attributes must be multiplied by `useFontScale()` from `analyticsHooks.ts`.
- `mcp-server.ts` uses inlined SQL only (no `queries.ts` import) due to Node ABI boundary
- **better-sqlite3 ABI**: the only ABI-sensitive operation is constructing the `Database` instance via `new Database(dbPath, { nativeBinding })`. That happens once in `electron/db/client.ts` (Electron ABI, `electron-native/`) for the main process and once in `mcp-server.ts` (Node 22 ABI, `pkg-native/`) for the MCP runtime. Helper functions in `electron/db/queries.ts` and `electron/db/graph-queries.ts` may be imported from `electron/mcp/tools/*` — they run on the already-constructed `db` handle regardless of which TS file defines them (see `electron/mcp/tools/codebase.ts`, which already does `import * as q from "../../db/queries"`). Never construct a `Database` outside those two bootstrap sites.

## Build

```bash
npm run compile # rebuilds dist-electron/ + dist-mcp/mcp-server.bundle.js
npx tsc --noEmit # type-check (always run after changes)
npm run compile # rebuilds dist-electron/ + dist-mcp/mcp-server.bundle.js
npm run type-check:all # type-check renderer + electron (always run after changes)
```

esbuild is stricter than tsc — backticks inside template literals must be unescaped at the template level. Use `import * as z from "zod"` (not `import { z }`) in all Electron files.
Expand All @@ -49,7 +49,7 @@ esbuild is stricter than tsc — backticks inside template literals must be unes

**KnowledgeGraphView** (`src/components/graph/KnowledgeGraphView.tsx`) — Force-directed and Radial tree layouts only. Reads from `graphData` store slice (populated by `loadGraph()`). `GraphLayoutMode = "force" | "radial"`.

**InsightsView** (`src/components/insights/InsightsView.tsx`) — hosts all seven analytics canvases. Also calls `loadGraph()` on mount (same as KGV) because canvases scope data via `useScopedData(nodes)` which needs `graphData.nodes` populated. Local `InsightsLayout` type — not stored in the global store.
**InsightsView** (`src/components/insights/InsightsView.tsx`) — hosts all seven analytics canvases (which live in `src/components/graph/` alongside the KnowledgeGraph canvases and the shared scaffold). Also calls `loadGraph()` on mount (same as KGV) because canvases scope data via `useScopedData(nodes)` which needs `graphData.nodes` populated. Local `InsightsLayout` type — not stored in the global store.

## Analytics canvas architecture

Expand All @@ -68,7 +68,7 @@ Shared modules:
- `analyticsUtils.ts` — `PRIORITY_COLOR`, `CANVAS_PAD`, `truncateName`, `HOUR_MS`, `DAY_MS`, etc.
- `analyticsHooks.ts` — `useContainerDims`, `useScopedData`, `useFontScale`
- `AnalyticsShared.tsx` — `<CanvasEmptyState>`, `<CanvasTooltip>`, `<SvgTimeAxis>`
- `graphUtils.ts` — `resolveCssVar()` for canvas 2D context colour lookups
- `analyticsUtils.ts` — shared constants (`PRIORITY_COLOR`, `CANVAS_PAD`), `resolveCssVar()` for canvas 2D context colour lookups, `truncateName`

## Store slices

Expand Down Expand Up @@ -115,7 +115,7 @@ Notes write to both `.md` files and SQLite simultaneously. Dashboards write to S

## Key constraints

- Never import from `queries.ts` in `mcp-server.ts` — it crosses the Node ABI boundary
- Never construct a `Database` instance outside `electron/db/client.ts` (Electron) and `mcp-server.ts` (MCP runtime) — those are the only two ABI bootstrap sites (see "better-sqlite3 ABI" above)
- All DB writes from renderer go through `ipc()` / `ipcAwait()` to the Electron main process
- `graphData` is lazy — only populated when `loadGraph(activeWorkspaceId)` is called. Both `KnowledgeGraphView` and `InsightsView` call it on mount.
- D3 `fontSize` in SVG must always be multiplied by `useFontScale()` — never hardcode px values
Expand Down
Loading