Skip to content

feat: [L2-02] build cross-paper Chats library and session reopening - #59

Merged
dkritarth merged 1 commit into
masterfrom
feat/chats-library
Sep 12, 2026
Merged

feat: [L2-02] build cross-paper Chats library and session reopening#59
dkritarth merged 1 commit into
masterfrom
feat/chats-library

Conversation

@dkritarth

Copy link
Copy Markdown
Owner

Closes #36

User outcome

Users can browse all prior chat sessions across all papers from the sidebar Chats view, see stable fallback titles, paper associations, backend badges, and timestamps, search across conversations, and click to immediately reopen any past chat thread in AskPanel.

Acceptance criteria

  • List shows session title/fallback, paper, backend, and timestamp.
  • Reopen restores exact persisted messages and active paper.
  • New chat appears without restart (real-time poll / sync).
  • Deleted/missing paper behavior is defined and safe (displays paper-missing notice without crashing).
  • Empty/loading/error states and keyboard navigation work.
  • Results persist across restart and order deterministically by recent activity.

Automated verification

  • Extended core/chat/repo.ts with listChatSessions, updateChatSessionTitle, deleteChatSession.
  • Added unit tests in core/chat/repo.test.ts (9 tests) covering cross-paper listing, stable fallback titles, message preview, search filtering across titles and messages, missing paper handling, and cascade deletion.
  • Extended core/chat/manager.ts and core/chat/manager.test.ts (11 tests) verifying explicit session reopening.
  • Added component tests in src/app/ChatsList.test.tsx (5 tests) verifying rendering, keyboard navigation, session selection, deletion, and search.
  • Updated src/app/Sidebar.test.tsx and src/app/AskPanel.test.tsx.
  • All unit tests passing: 258/258 tests across 35 suites (npm test).
  • TypeScript typecheck passing: npm run typecheck.
  • Production bundle build passing: npm run build.

Live Electron verification

  • Implemented automated Playwright-driven live verification in test/chats-live.mjs:
    1. Boots live Electron instance under xvfb.
    2. Ingests two sample papers.
    3. Creates multiple chat sessions across both papers and both backends (claude and codex).
    4. Renames sessions and validates chatListSessions() bridge output.
    5. Switches sidebar to Chats view and validates rendered items in DOM.
    6. Filters sessions using search input.
    7. Clicks a session and verifies reopening of the paper tab and AskPanel.
    8. Closes Electron and launches a second instance to verify full SQLite persistence across restarts.
    9. Executed and confirmed pass: === [L2-02] LIVE CHATS LIBRARY VERIFICATION SUCCESSFUL ===.

Visual and console evidence

  • Sidebar Chats tab renders list of chat items with session title, paper title, backend pill (claude amber, codex green), turn count, relative timestamp, and hover delete button.
  • Instant search filter bar at the top of the Chats list.
  • Clean warning banner if a chat refers to a deleted/missing paper.
  • Clean console logs with zero uncaught errors.

Limitations and follow-ups

  • Cross-paper multi-document synthesis is intentionally out of scope for this card and will follow in Phase 3.
  • In-place inline title renaming in the sidebar list can be added as a quick UX polish.

Independent review

  • Strict AGENTS.md compliance: all data operations executed in main/core via SQLite queries; renderer uses only window.vellum preload bridge.
  • Parameterized SQL prevents injection vulnerabilities during search and title updates.

@dkritarth
dkritarth merged commit e69830e into master Sep 12, 2026
1 check passed
@dkritarth
dkritarth deleted the feat/chats-library branch September 12, 2026 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[L2-02] Build cross-paper Chats library and session reopening

1 participant