feat: add session label system (backend + sidebar UI)#12
Conversation
Backend: - session-labels.mjs: label CRUD, setSessionLabel(), boot recovery - session-auto-distill.mjs: auto-generate experience notes via Haiku when label transitions to done/pending-review - Auto-set 'started' label on message send - Boot-time recovery for asked-for-restart labels - Config: SESSION_LABELS_FILE, TASKS_FILE, REPORTS_DIR paths Frontend: - Sidebar: colored label badge (◆) displayed in session meta line - Label definitions fetched on app init (/api/session-labels) - CSS: .session-label-badge styling Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- ◆ button in session action bar opens label dropdown - Click to assign/change label, shows current label as active - Clear option to remove label - Dropdown auto-dismisses on outside click - CSS: dropdown styling with hover states Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
API returns {labels: [...]} not a bare array. Fix init.js to extract
.labels field, and add defensive Array.isArray check in renderer.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Label badge in session meta line is now directly clickable - Empty state shows subtle "◇ label" placeholder (hover to reveal) - Remove redundant ◆ button from session action bar - Cleaner UX: label lives where it's displayed Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9d5614da36
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| import('./chat/task-manager.mjs'), | ||
| import('./chat/scheduler.mjs'), |
There was a problem hiding this comment.
Remove imports for modules absent from this commit
chat-server.mjs now unconditionally imports ./chat/task-manager.mjs and ./chat/scheduler.mjs, but this commit does not add either file (it only adds chat/session-auto-distill.mjs and chat/session-labels.mjs under chat/). Because these imports are inside top-level Promise.all(...), Node throws ERR_MODULE_NOT_FOUND during startup and the chat server cannot boot at all.
Useful? React with 👍 / 👎.
| await fetch(`/api/sessions/${session.id}/label`, { | ||
| method: "PATCH", | ||
| headers: { "Content-Type": "application/json" }, |
There was a problem hiding this comment.
Persist label changes only after a successful API call
The new label picker calls PATCH /api/sessions/${session.id}/label, but the session PATCH handler accepts only /api/sessions/:id (it rejects paths where parts.length !== 3 in chat/router-control-routes.mjs), so this request returns an error instead of updating metadata. Since the client code does not check response.ok and updates session.label locally anyway, users see a successful label change in the sidebar that is not actually saved and disappears after refresh.
Useful? React with 👍 / 👎.
Summary
Scope