-
Notifications
You must be signed in to change notification settings - Fork 415
enhanced-notes-multiple-per-session #1679
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Introduce a first-class enhanced_notes table and migrate existing enhanced_md into it so that multiple per-session summaries can be managed. Update editor/tab types to use a discriminated EditorView (raw/transcript/enhanced with enhancedNoteId) and propagate enhancedNoteId through Enhanced, EnhancedEditor, StreamingView, header, and session components so the UI targets specific enhanced notes. Add hooks (useEnhancedNotes, create/delete/rename helpers), auto-enhance flow to create and start enhancement tasks for new enhanced notes, task arg/schema changes to carry enhancedNoteId, indexing/relationships in the store, and a one-time migration to move enhanced_md into enhanced_notes. This change was needed to support multiple, identifiable enhanced notes per session (with ordering, titles, and individual enhancement tasks) instead of a single enhanced_md blob on sessions. It also ensures UI hotkeys and tab switching work with multiple enhanced notes and preserves existing data via migration. Simplify auto-enhance flow and remove unused UI lookup Remove duplicated store manipulation and unused UI cell lookups by extracting enhanced note creation into useCreateEnhancedNote. Use a ref to track started tasks to prevent infinite retries and simplify effect dependencies. This reduces code duplication, removes an unnecessary position lookup in the header, and makes task startup logic more robust and easier to maintain. Fix type errors and remove migration code Address various TypeScript type errors surfaced by pnpm -F desktop typecheck and simplify code for this greenfield project by removing legacy data migration logic. - Corrected runtime checks to use discriminated union shapes (e.g. currentTab.type and tab.state.editor?.type) to satisfy type narrowing and avoid TypeErrors. - Fixed several component prop/signature mismatches (removed unused sessionId from EnhancedEditor props) and updated keys/isActive checks to use view.type. - Cleaned up imports (removed unused useCallback import) and adjusted hook usage to provide valid IDs to hooks to prevent undefined or empty-string arguments. - Rewrote enhanced note position calculation to count rows instead of relying on an index API that caused typing issues. - Removed one-time migration of enhanced_md to enhanced_notes and its schema flag (enhanced_notes_migrated) because this is a greenfield project and migration is unnecessary. These changes eliminate type errors and remove unnecessary migration logic while keeping behavior consistent for a new project. qqwd wip
Introduce enhanced_notes to the devtool seed data to support richer meeting/session notes in the desktop app. Added curated sample enhanced_notes JSON, a Zod schema for curated enhanced notes, loader logic to map sessions and templates to enhanced_notes entries, and included enhanced_notes in debug/random seed versions. Also implemented a shared enhanced-note builder, wiring it into builders/index and the random data generator so enhanced notes are produced for sessions (including markdown→Tiptap JSON conversion). This enables seeded enhanced note data for development and testing.
Add store lookup and archive behavior when deleting a template. Use the main store to check for any enhanced_notes rows that reference the template_id. If related notes are found, set the template to archived instead of deleting it; otherwise perform the existing delete. Ensure callbacks and dependencies are updated. chore(imports): reorder chat imports to fix linting Reorder imports in chat session and view files to match project import ordering (useToolRegistry and useShell moved back into place). chore(seed): simplify template seed data construction Extracted the template data object into a local `data` variable and return it to reduce repetition when seeding template entries.
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThis PR introduces a new enhanced notes feature to the desktop app. It refactors the editor view system to use discriminated unions with type fields, adds enhanced notes storage with Tinybase schema and CRUD hooks, updates components to reference enhanced notes by ID, and modifies the auto-enhance flow to create and track enhanced notes separately from sessions. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Header as Header / Tab UI
participant Enhanced as Enhanced Component
participant CreateNote as useCreateEnhancedNote
participant Task as AI Task System
participant Store as Tinybase Store
User->>Header: Click regenerate on enhanced note
Header->>Header: handleRegenerateClick()
Header->>Task: Start enhance task<br/>(with enhancedNoteId)
Task->>Store: Execute task using<br/>enhancedNoteId
Store->>Store: Update enhanced_notes<br/>with generated content
Task-->>Header: Task complete
Header->>Enhanced: Re-render with updated<br/>content from store
User->>Header: Alt+S (cycle enhanced tabs)
Header->>Header: Find next enhanced tab<br/>by type==='enhanced'
Header->>Header: Switch to enhanced editor
Enhanced->>Store: Load note by<br/>enhancedNoteId
Store-->>Enhanced: Return content & metadata
User->>Header: Click create other format
Header->>Header: Show format templates<br/>in popover
User->>Header: Select template
Header->>CreateNote: createEnhancedNote<br/>(sessionId, templateId)
CreateNote->>Store: Insert new enhanced_note
Store-->>CreateNote: Return enhancedNoteId
Header->>Header: Switch tab to new<br/>enhanced note
Header->>Task: Start enhance task<br/>for new note
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Areas requiring extra attention:
Possibly related PRs
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (29)
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. Comment |
No description provided.