Skip to content

Conversation

@yujonglee
Copy link
Contributor

No description provided.

@coderabbitai
Copy link

coderabbitai bot commented Oct 30, 2025

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Migrates the entire codebase from separate persisted and internal TinyBase store modules to a unified main store module, updating ~95 files with new import paths, API references, and store identifiers. Introduces modularized schema files and refactors store initialization logic.

Changes

Cohort / File(s) Summary
Chat UI Components
apps/desktop/src/components/chat/header.tsx, message/tool/search.tsx, session.tsx, view.tsx
Updated TinyBase store references from persisted.UI to main.UI; adjusted callback type annotations and index references accordingly
Calendar/Day Components
apps/desktop/src/components/main/body/calendars/calendar-checkbox-row.tsx, calendar-day.tsx, day-events.tsx, day-sessions.tsx, index.tsx
Replaced all persisted.UI/persisted.STORE_ID with main.UI/main.STORE_ID for row/slice/table queries
Contacts Components
apps/desktop/src/components/main/body/contacts/details.tsx, index.tsx, organization-details.tsx, organizations.tsx, people.tsx
Unified store references from persisted/internal to main across useRow, useSliceRowIds, and callback hooks
Events/Folders/Sessions UI
apps/desktop/src/components/main/body/events.tsx, folders/index.tsx, humans.tsx, sessions/floating/*, sessions/note-input/*, sessions/outer-header/*, sessions/shared.tsx, sessions/title-input.tsx
Migrated data access layer from persisted.UI to main.UI and updated store ID references consistently across 20+ files
Sidebar & Settings Components
apps/desktop/src/components/main/sidebar/*, settings/ai/*, settings/general/index.tsx, settings/memory/custom-vocabulary.tsx, settings/notification.tsx, settings/template/*
Updated imports and store/UI hook references from internal/persisted to main in all settings and sidebar UIs
Store Layer — Schema Modules
apps/desktop/src/store/tinybase/schema-external.ts (new), schema-internal.ts (refactored)
New file schema-external.ts: extracts and re-exports external schemas (Human, Event, Calendar, etc.) with zod preprocessing and storage types. Refactored schema-internal.ts: renamed SCHEMAinternalSchemaForTinybase, removed public UI/store exports
Store Layer — Core & Persisters
main.ts (refactored), cloudPersister.ts, localPersister.ts
main.ts: consolidated schema management, changed STORE_ID to "main", added rowIdOfChange helper, introduced llmProviders/sttProviders queries, unified store initialization. Persisters: updated to use unified main module; localPersister.ts now uses createCustomSqlitePersister with listener/cleanup callbacks
Zustand & AI-Task Store
apps/desktop/src/store/zustand/ai-task/*, listener/transcript.ts, tabs/schema.ts
Updated PersistedStore type imports from persisted module to main module; Word type references migrated from persisted.Wordmain.Word
Contexts & Routes
apps/desktop/src/contexts/listener.tsx, search/engine/*, routes/app/settings/_layout.tsx
Replaced internal/persisted imports with main for UI state reads and store type annotations
Devtool Seed & Bootstrap
apps/desktop/src/devtool/*, main.tsx
Updated type imports across 15+ seed/builder files from persistedmain; main.tsx: unified app-level store wiring to use single store variable instead of separate persistedStore/internalStore
Utilities & Types
apps/desktop/src/utils/segments.ts, timeline.ts, transcript.ts, types/index.ts
Updated exported type signatures and utility function parameters from persisted.Word/persisted.Event/etc. to main.* equivalents

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Areas requiring careful attention:

  • schema-external.ts (new file): Comprehensive schema definitions with zod preprocessing—validate correctness of field mappings, storage types (SessionStorage, TemplateStorage, etc.), and table schema structure
  • main.ts refactor: Verify store initialization sequence (schema setup, persister binding, async loading, DEFAULT_USER_ID handling), new query definitions (llmProviders, sttProviders), and rowIdOfChange helper logic
  • localPersister.ts: Confirm createCustomSqlitePersister integration, listener interval setup (1000ms), and cleanup callback binding
  • schema-internal.ts removals: Ensure no broken re-exports; verify internalSchemaForTinybase is used correctly in main.ts
  • Type consistency across ~95 files: Spot-check a sampling of component files to confirm all main.UI, main.STORE_ID, main.INDEXES, and main.QUERIES references are correctly applied
  • Callback type annotations: Review ChatSession, template editor, and settings components for correct callback parameter types (e.g., Partial<main.ChatMessage>, Partial<main.Template>)

Possibly related PRs

Suggested reviewers

  • duckduckhero
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch single-tinybase-store

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5e256f4 and 915f4a7.

📒 Files selected for processing (93)
  • apps/desktop/src/components/chat/header.tsx (3 hunks)
  • apps/desktop/src/components/chat/message/tool/search.tsx (2 hunks)
  • apps/desktop/src/components/chat/session.tsx (2 hunks)
  • apps/desktop/src/components/chat/view.tsx (4 hunks)
  • apps/desktop/src/components/main/body/calendars/calendar-checkbox-row.tsx (1 hunks)
  • apps/desktop/src/components/main/body/calendars/calendar-day.tsx (2 hunks)
  • apps/desktop/src/components/main/body/calendars/day-events.tsx (1 hunks)
  • apps/desktop/src/components/main/body/calendars/day-sessions.tsx (1 hunks)
  • apps/desktop/src/components/main/body/calendars/index.tsx (2 hunks)
  • apps/desktop/src/components/main/body/contacts/details.tsx (9 hunks)
  • apps/desktop/src/components/main/body/contacts/index.tsx (2 hunks)
  • apps/desktop/src/components/main/body/contacts/organization-details.tsx (3 hunks)
  • apps/desktop/src/components/main/body/contacts/organizations.tsx (5 hunks)
  • apps/desktop/src/components/main/body/contacts/people.tsx (4 hunks)
  • apps/desktop/src/components/main/body/events.tsx (3 hunks)
  • apps/desktop/src/components/main/body/folders/index.tsx (6 hunks)
  • apps/desktop/src/components/main/body/humans.tsx (2 hunks)
  • apps/desktop/src/components/main/body/sessions/floating/generate.tsx (3 hunks)
  • apps/desktop/src/components/main/body/sessions/floating/listen.tsx (2 hunks)
  • apps/desktop/src/components/main/body/sessions/index.tsx (2 hunks)
  • apps/desktop/src/components/main/body/sessions/note-input/enhanced/editor.tsx (1 hunks)
  • apps/desktop/src/components/main/body/sessions/note-input/raw.tsx (1 hunks)
  • apps/desktop/src/components/main/body/sessions/note-input/transcript/viewer/segment.ts (2 hunks)
  • apps/desktop/src/components/main/body/sessions/note-input/transcript/viewer/test-utils.ts (2 hunks)
  • apps/desktop/src/components/main/body/sessions/outer-header/folder.tsx (1 hunks)
  • apps/desktop/src/components/main/body/sessions/outer-header/metadata/participants.tsx (3 hunks)
  • apps/desktop/src/components/main/body/sessions/outer-header/metadata/shared.ts (2 hunks)
  • apps/desktop/src/components/main/body/sessions/outer-header/overflow.tsx (2 hunks)
  • apps/desktop/src/components/main/body/sessions/outer-header/shared/folder.tsx (2 hunks)
  • apps/desktop/src/components/main/body/sessions/shared.tsx (1 hunks)
  • apps/desktop/src/components/main/body/sessions/title-input.tsx (1 hunks)
  • apps/desktop/src/components/main/body/shared/folder-breadcrumb.tsx (2 hunks)
  • apps/desktop/src/components/main/sidebar/search/item.tsx (2 hunks)
  • apps/desktop/src/components/main/sidebar/timeline/index.tsx (2 hunks)
  • apps/desktop/src/components/main/sidebar/timeline/item.tsx (1 hunks)
  • apps/desktop/src/components/settings/ai/llm/configure.tsx (2 hunks)
  • apps/desktop/src/components/settings/ai/llm/select.tsx (3 hunks)
  • apps/desktop/src/components/settings/ai/shared/index.tsx (1 hunks)
  • apps/desktop/src/components/settings/ai/stt/configure.tsx (2 hunks)
  • apps/desktop/src/components/settings/ai/stt/select.tsx (4 hunks)
  • apps/desktop/src/components/settings/general/index.tsx (1 hunks)
  • apps/desktop/src/components/settings/memory/custom-vocabulary.tsx (2 hunks)
  • apps/desktop/src/components/settings/notification.tsx (1 hunks)
  • apps/desktop/src/components/settings/template/editor.tsx (2 hunks)
  • apps/desktop/src/components/settings/template/index.tsx (3 hunks)
  • apps/desktop/src/components/settings/template/sections-list.tsx (1 hunks)
  • apps/desktop/src/components/settings/template/use-template-navigation.ts (2 hunks)
  • apps/desktop/src/contexts/listener.tsx (2 hunks)
  • apps/desktop/src/contexts/search/engine/index.tsx (1 hunks)
  • apps/desktop/src/contexts/search/engine/indexing.ts (1 hunks)
  • apps/desktop/src/contexts/search/engine/listeners.ts (1 hunks)
  • apps/desktop/src/devtool/index.tsx (1 hunks)
  • apps/desktop/src/devtool/seed/data/loader.ts (1 hunks)
  • apps/desktop/src/devtool/seed/shared/builders.ts (1 hunks)
  • apps/desktop/src/devtool/seed/shared/calendar.ts (1 hunks)
  • apps/desktop/src/devtool/seed/shared/chat.ts (1 hunks)
  • apps/desktop/src/devtool/seed/shared/event.ts (1 hunks)
  • apps/desktop/src/devtool/seed/shared/folder.ts (1 hunks)
  • apps/desktop/src/devtool/seed/shared/human.ts (1 hunks)
  • apps/desktop/src/devtool/seed/shared/index.ts (1 hunks)
  • apps/desktop/src/devtool/seed/shared/mapping.ts (1 hunks)
  • apps/desktop/src/devtool/seed/shared/memory.ts (1 hunks)
  • apps/desktop/src/devtool/seed/shared/organization.ts (1 hunks)
  • apps/desktop/src/devtool/seed/shared/session.ts (1 hunks)
  • apps/desktop/src/devtool/seed/shared/tag.ts (1 hunks)
  • apps/desktop/src/devtool/seed/shared/template.ts (1 hunks)
  • apps/desktop/src/devtool/seed/shared/transcript.ts (1 hunks)
  • apps/desktop/src/devtool/seed/versions/curated.ts (1 hunks)
  • apps/desktop/src/devtool/seed/versions/empty.ts (1 hunks)
  • apps/desktop/src/devtool/seed/versions/random.ts (1 hunks)
  • apps/desktop/src/hooks/useAutoEnhance.ts (2 hunks)
  • apps/desktop/src/hooks/useAutoGenerateTitle.ts (2 hunks)
  • apps/desktop/src/hooks/useLLMConnection.ts (2 hunks)
  • apps/desktop/src/hooks/useSTTConnection.ts (2 hunks)
  • apps/desktop/src/hooks/useStartListening.ts (2 hunks)
  • apps/desktop/src/main.tsx (3 hunks)
  • apps/desktop/src/routes/app/settings/_layout.tsx (3 hunks)
  • apps/desktop/src/store/tinybase/cloudPersister.ts (4 hunks)
  • apps/desktop/src/store/tinybase/localPersister.ts (2 hunks)
  • apps/desktop/src/store/tinybase/main.ts (7 hunks)
  • apps/desktop/src/store/tinybase/schema-external.ts (1 hunks)
  • apps/desktop/src/store/tinybase/schema-internal.ts (2 hunks)
  • apps/desktop/src/store/zustand/ai-task/index.ts (1 hunks)
  • apps/desktop/src/store/zustand/ai-task/task-configs/enhance.ts (1 hunks)
  • apps/desktop/src/store/zustand/ai-task/task-configs/index.ts (1 hunks)
  • apps/desktop/src/store/zustand/ai-task/task-configs/title.ts (1 hunks)
  • apps/desktop/src/store/zustand/ai-task/tasks.ts (1 hunks)
  • apps/desktop/src/store/zustand/listener/transcript.ts (1 hunks)
  • apps/desktop/src/store/zustand/tabs/schema.ts (1 hunks)
  • apps/desktop/src/types/index.ts (1 hunks)
  • apps/desktop/src/utils/segments.ts (3 hunks)
  • apps/desktop/src/utils/timeline.ts (4 hunks)
  • apps/desktop/src/utils/transcript.ts (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@yujonglee yujonglee merged commit a09d9e6 into main Oct 30, 2025
4 of 5 checks passed
@yujonglee yujonglee deleted the single-tinybase-store branch October 30, 2025 00:49
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