feat: session bookmarks and custom tags - #80
Conversation
Verification: Session bookmarks and custom tagsVerdict: PASS Claim: Adds persistent SQLite-backed bookmarks to the session browser. PUT/DELETE/GET bookmark routes. Sessions list enriched with Method: Cold start — Steps
Response shape sample{
"sessionId": "760468c9-...",
"tags": ["architecture", "important"],
"note": "Key auth decision session",
"createdAt": "2026-06-10T..."
}GET /api/sessions enriched field sample{ "id": "760468c9-...", "bookmarked": true, "tags": ["architecture", "important"], ... }Findings
🤖 Verified with Claude Code |
Adds persistent bookmarks to the session browser:
Backend
- src/bookmarks.ts — SQLite-backed store at ~/.config/copilot-lens/bookmarks.db
(separate from the derived-data cache, survives POST /api/cache/clear)
CRUD: listBookmarks, getBookmark, upsertBookmark, deleteBookmark,
getBookmarkMap, listAllTags
- GET /api/bookmarks — list all bookmarks
- GET /api/bookmarks/tags — all known tag values (for auto-suggest)
- PUT /api/bookmarks/:id — upsert { tags, note }
- DELETE /api/bookmarks/:id — remove
- GET /api/sessions — enriched with bookmarked:true and tags[]
- GET /api/sessions/:id/export — JSONL now includes tags + note when bookmarked
Frontend
- ☆/★ star button on every session card — click to bookmark/unbookmark
- Tag chips on bookmarked cards
- Filter bar below the controls: "★ Bookmarked" pill + per-tag pills
- Detail pane: Bookmark section with tag input (Enter to add, ✕ to remove,
datalist auto-suggest from existing tags), freeform note, Save button
Persistence
- bookmarks.db lives in ~/.config/copilot-lens/ — separate from session
cache so Refresh never loses user data
Closes #69
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
d0fea49 to
6e92538
Compare
Summary
Closes #69 — session bookmarks and custom tags.
Adds persistent bookmarking to the session browser: star any session, attach tags and a freeform note, then filter the list by bookmark or tag. Bookmark data lives in its own SQLite file (
~/.config/copilot-lens/bookmarks.db) separate from the derived-data cache, so it survives Refresh /POST /api/cache/clear.What was added
Backend (
src/bookmarks.ts+src/server.ts)GET /api/bookmarksGET /api/bookmarks/tags<datalist>auto-suggestPUT /api/bookmarks/:id{ tags, note }— creates or updates, never resetscreatedAtDELETE /api/bookmarks/:id{ ok: bool }GET /api/sessionsnow includesbookmarked: trueandtags[]on enriched sessions.GET /api/sessions/:id/exportincludestagsandnotein the JSONL output when bookmarked.Frontend
★ Bookmarkedpill + per-tag pills — clicking toggles each filter, filters compose with existing time/status/dir selectors<datalist>auto-suggest from existing tags), freeform note textarea, Save buttonTests (
src/__tests__/bookmarks.test.ts)27 unit tests covering
upsertBookmark,getBookmark,listBookmarks,deleteBookmark,getBookmarkMap, andlistAllTags. Tests redirect the DB to amkdtempdirectory viaCOPILOT_LENS_DB_DIRand wipe it after each case.All 134 tests pass. Zero TypeScript errors. Clean build.
Test plan
npm start), open Sessions tab — filter bar visible, all pills inactive★ Bookmarkedpill → only starred sessions showntagsandnotefields🤖 Generated with Claude Code