Skip to content

Conversation

@lucasheriques
Copy link
Contributor

Summary

Refactored Notetaker from Dexie local-first to TanStack Query backend-first architecture with smart caching and real-time transcript streaming.

This PR builds on #1 (Recall SDK integration) to add live transcript display with intelligent backend sync.

Architecture Changes

  • ❌ Removed Dexie (IndexedDB) dependency
  • ✅ Migrated to TanStack Query for server state management
  • ✅ Backend-first with PostHog as source of truth
  • ✅ Local buffering with batched uploads (10 segments OR 10 seconds)

Key Features

  • ⚡ Real-time transcript segments from Recall.ai AssemblyAI stream
  • 📊 Smart polling: 2s during active recording, 10s for ready recordings
  • 🔄 Local buffer prevents duplicate uploads with timestamp tracking
  • 🎯 Optimistic UI updates with "pending upload" badge
  • 🔁 Automatic query invalidation and cache management
  • 📏 Transcript view limited to 60vh (leaves room for notes/action items)
  • 🔄 Auto-scroll with manual override detection
  • 🔄 Retry button for failed uploads

Query Keys

To avoid collision with legacy Recordings feature:

  • notetaker-recordings - List of all recordings
  • notetaker-recording - Individual recording details
  • notetaker-transcript - Transcript segments for a recording

Files Added

  • src/renderer/features/notetaker/hooks/useRecordings.ts - TanStack Query hooks for recordings
  • src/renderer/features/notetaker/hooks/useTranscript.ts - Local buffering + batched upload logic
  • src/renderer/features/notetaker/components/LiveTranscriptView.tsx - Real-time transcript UI

Files Removed

  • src/renderer/features/notetaker/stores/notetakerStore.ts - Replaced by TanStack Query
  • src/renderer/services/db.ts - Dexie schema (no longer needed)
  • src/renderer/services/transcriptSync.ts - Integrated into hooks

Dependencies Removed

  • dexie
  • dexie-react-hooks

Data Flow

IPC Events (Real-time) → Local Buffer (React State)
                            ↓
                    Batch Upload (10 segments / 10s)
                            ↓
                    PostHog Backend (Source of Truth)
                            ↓
                    TanStack Query Cache (Auto-polling)
                            ↓
                        UI Display (60vh max height)

Test Plan

  • Start a Zoom/Meet/Teams meeting
  • Verify recording starts automatically
  • Verify transcript segments appear in real-time
  • Verify auto-scroll works
  • Manually scroll up and verify auto-scroll disables
  • Scroll to bottom and verify auto-scroll re-enables
  • Verify batched uploads happen every 10 segments
  • Verify pending upload badge shows during buffering
  • End meeting and verify final upload happens
  • Verify no mystery recordings from legacy feature

Copy link
Contributor Author

lucasheriques commented Oct 27, 2025

@lucasheriques lucasheriques force-pushed the feat/recall-sdk-integration branch from 5ffb727 to b5f4955 Compare October 27, 2025 16:25
@lucasheriques lucasheriques force-pushed the feat/live-transcripts-tanstack-query branch from 466d3b3 to 8f69b83 Compare October 27, 2025 16:25
@lucasheriques lucasheriques force-pushed the feat/recall-sdk-integration branch from b5f4955 to bf25859 Compare October 27, 2025 17:23
@lucasheriques lucasheriques force-pushed the feat/live-transcripts-tanstack-query branch from 8f69b83 to a36a57c Compare October 27, 2025 17:23
@lucasheriques lucasheriques force-pushed the feat/recall-sdk-integration branch from bf25859 to afc6e0c Compare October 27, 2025 17:31
@lucasheriques lucasheriques force-pushed the feat/live-transcripts-tanstack-query branch from a36a57c to a591531 Compare October 27, 2025 17:31
@lucasheriques lucasheriques force-pushed the feat/recall-sdk-integration branch from afc6e0c to 3b0c6a9 Compare October 27, 2025 17:32
@lucasheriques lucasheriques force-pushed the feat/live-transcripts-tanstack-query branch 4 times, most recently from 320cdde to 3bd4259 Compare October 27, 2025 17:53
@lucasheriques lucasheriques force-pushed the feat/recall-sdk-integration branch from 3b0c6a9 to ce38011 Compare October 27, 2025 17:53
Refactored Notetaker from Dexie local-first to TanStack Query backend-first architecture with smart caching and real-time transcript streaming.

**Architecture Changes:**
- Removed Dexie (IndexedDB) dependency
- Migrated to TanStack Query for server state management
- Backend-first with PostHog as source of truth
- Local buffering with batched uploads (10 segments / 10s)

**Key Features:**
- Real-time transcript segments from Recall.ai AssemblyAI stream
- Smart polling: 2s during active recording, 10s for ready recordings
- Local buffer prevents duplicate uploads
- Optimistic UI updates with pending upload badge
- Automatic query invalidation and cache management
- Transcript view limited to 60vh (room for notes/action items)

**Query Keys (unique to avoid collision with legacy Recordings):**
- notetaker-recordings
- notetaker-recording
- notetaker-transcript

**Files Added:**
- src/renderer/features/notetaker/hooks/useRecordings.ts
- src/renderer/features/notetaker/hooks/useTranscript.ts
- src/renderer/features/notetaker/components/LiveTranscriptView.tsx

**Files Removed:**
- src/renderer/features/notetaker/stores/notetakerStore.ts
- src/renderer/services/db.ts (Dexie schema)
- src/renderer/services/transcriptSync.ts

**Dependencies Removed:**
- dexie
- dexie-react-hooks
…colors

- More compact layout: removed Cards, reduced spacing
- Speaker names only show when speaker changes (not repeated)
- Consistent color-coding for each speaker
- Alternating row backgrounds for better scanning
- Timestamp inline with text for better use of space
- 100px fixed-width speaker column for alignment
Removed refetchInterval from useTranscript query since we get real-time
updates via IPC events from Recall.ai. Query still fetches once on mount
for historical segments but doesn't continuously poll the backend.
@lucasheriques lucasheriques force-pushed the feat/live-transcripts-tanstack-query branch from 3bd4259 to 7d86d35 Compare October 27, 2025 17:55
@lucasheriques lucasheriques force-pushed the feat/recall-sdk-integration branch from ce38011 to ab0ce3b Compare October 27, 2025 17:55
@lucasheriques lucasheriques changed the base branch from feat/recall-sdk-integration to graphite-base/67 October 28, 2025 02:20
@lucasheriques lucasheriques marked this pull request as draft October 28, 2025 18:02
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.

2 participants