Conversation
…eneral improvements Streamline document handling and remove unused context - Removed the `use-document-context` and `use-document-utils` hooks to simplify document management. - Introduced a unified `use-document` hook to handle document state and actions. - Updated various components to utilize the new `use-document` hook, ensuring consistent document state management. - Adjusted document creation and update logic to eliminate reliance on artifact kinds, setting kind to 'text' by default. - Enhanced synonym overlay functionality in the editor, with its own react component
Feat/clean code
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. WalkthroughRefactors the app from an artifact-centric model to a document-centric model. Removes artifact components/hooks/APIs, introduces document hooks, actions, and streaming helpers. Adds emoji and synonym overlays with corresponding editor plugins and schema. Adjusts DB/API to make kind optional/null and fixes routing/layout providers. Updates dependencies to support new editor/markdown features. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant UI as DocumentWorkspace
participant Editor as Editor (PM)
participant Hook as useDocument (SWR)
participant API as /api/document
participant AI as document-helpers
User->>UI: Create Document (title)
UI->>Hook: setDocument({ status: "loading" })
UI->>API: PUT /api/document { title, kind: "text" }
API-->>UI: { id }
UI->>Hook: setDocument({ documentId: id, title })
UI->>AI: createTextDocument({ title, dataStream })
AI-->>UI: text-delta chunks
UI->>Editor: dispatch stream-data (documentUpdate)
UI->>Hook: setDocument({ content += chunk, status: "streaming" })
AI-->>UI: finish
UI->>Editor: dispatch creation-stream-finished
UI->>Hook: setDocument({ status: "idle" })
sequenceDiagram
autonumber
participant PM as Synonym Plugin
participant UI as SynonymOverlay (React)
participant Editor as EditorView
PM->>UI: dispatch "synonym-overlay:open" { synonyms, pos, from,to,view }
UI-->>Editor: render overlay at coords
User->>UI: select synonym
UI->>Editor: replaceWith(from,to, chosen)
UI->>PM: dispatch "synonym-overlay:close"
sequenceDiagram
autonumber
participant PM as Emoji Plugin
participant UI as EmojiOverlay
participant Editor as EditorView
PM->>UI: show suggestions for ":par..."
User->>UI: navigate/select emoji
UI->>PM: window.insertEmojiSuggestion(code)
PM->>Editor: insert emoji code, re-render glyph
PM->>UI: close overlay
sequenceDiagram
autonumber
participant Chat as Chat UI
participant Doc as useDocument
participant Stream as DataStreamHandler
Chat->>Doc: read document.documentId/title/content
Chat->>Stream: submit (with activeDocumentId if not "init")
Stream->>Doc: on text-delta/documentUpdate -> setDocument({...})
Stream->>Chat: dispatch editor:events (force-save/finished)
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes Possibly related PRs
Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (53)
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
Summary by CodeRabbit
New Features
UX Improvements
Behavior Changes
Chores