merge: integrate conversation attention badges

This commit is contained in:
inman
2026-09-03 10:46:24 +08:00
5 changed files with 436 additions and 5 deletions

View File

@@ -0,0 +1,90 @@
# Task: Limit conversation unread badge triggers
## Identity
- Task ID: 20260902-conversation-badge-a7c49e
- Mode: Feature
- Branch: codex/20260902-conversation-badge-a7c49e-conversation-badge-a7c49e
- Worktree: /Users/inmanx/Documents/makelore-conversation-badge-a7c49e
- Base commit: 301c1496b0a3a1af3b9443a68a67de8dfea45749
- Owner: codex
- Status: Ready for integration
## Scope
- Limit the Makelore Code Conversation-list red unread marker to hidden
Conversations that newly require user interaction or whose current task has
reached a terminal result.
- Keep assistant streaming content, thinking, tool progress, and individual tool
failures visible in the timeline without treating them as new-message badge
triggers.
- Add focused Renderer-store coverage and an Electron production-seam regression,
and synchronize the current behavior in `README.md`.
## Intent And Constraints
- Preserve Conversation-local Snapshot/Patch reduction, generation/sequence
recovery, selected-Conversation read clearing, and lightweight hidden summaries.
- Do not change Electron Main, public contracts, runtime error semantics,
Conversation metadata storage, or the sidebar presentation itself.
- A new pending select/confirm/input/editor interaction must set the marker for a
hidden Conversation. A new completed, failed, or aborted run terminal must also
set it.
- Repeated updates to an already-pending interaction or an already-terminal run
must not recreate a marker the user has already cleared.
- Work in the isolated worktree because local `main` is owned by the completed
unsigned-macOS-package task; that task has no semantic or file overlap.
## Outcome
- Replaced the prior `assistant message.upsert` unread trigger with a transition
predicate over the target Conversation's previous and reduced Snapshots.
- The predicate recognizes only a newly pending interaction or a newly terminal
run. Terminal identity is compared by run id and terminal reason so unrelated
late patches do not recreate a cleared marker.
- Assistant stream start/update, thinking, tool lifecycle, and `tool.upsert` error
patches no longer mark a hidden Conversation unread. If the whole run later
settles, its completed/failed/aborted transition still marks it.
- Extended the controllable Electron EventSource fixture and added a real sidebar
assertion covering process failure, pending confirmation, read clearing, and
final task settlement.
- Updated `README.md` with the user-visible badge rule. No Main/runtime/API/storage
behavior changed.
## Verification
- Red phase: the focused store suite failed four assertions against the prior
assistant-message trigger, covering the unwanted process marker and the missing
interaction/failed/aborted terminal markers.
- `pnpm exec vitest run tests/unit/coding-conversations-store.test.tsx --maxWorkers=1`:
passed, 1 file / 28 tests.
- `pnpm exec vitest run tests/unit/coding-chat-panel.test.tsx --maxWorkers=1`:
passed, 1 file / 17 tests.
- `pnpm run typecheck`: passed.
- `pnpm run lint:check`: passed with 0 errors and 5 pre-existing warnings outside
the changed files; scoped ESLint on all changed TypeScript files passed cleanly.
- `pnpm test`: passed; functional stage 212 files / 1,735 passed / 3 skipped,
isolated pressure stage 1 file / 1 passed.
- `pnpm run build:vite`: passed for Renderer, Electron Main, Preload, and utility;
only existing Browserslist, dynamic-import, and chunk-size warnings remained.
- `pnpm exec playwright test tests/e2e/pi-coding-first-chat.spec.ts`: passed, 3/3.
- All project commands used the pinned pnpm 10.33.4. `git diff --check` passed.
## Follow-ups
- None.
## Promotion Candidates
- Target: `.project-docs/30-worklog/current-state.md`
Proposal: record that a hidden Code Conversation's red unread marker now signals
only newly pending user interaction or a newly terminal completed/failed/aborted
task, while assistant/tool process updates and individual tool failures remain
non-notifying.
Evidence: `src/stores/coding-conversations.ts`, focused 28-test store suite, and
the 3/3 Electron `pi-coding-first-chat` production-seam run.
Future impact: future patch types and sidebar changes should preserve the
distinction between process visibility and user-attention notification.
Semantic conflicts: none; ADR-006's Snapshot/Patch and per-Conversation isolation
boundaries are unchanged.
Human confirmation required: no.