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
|
Caution Review failedThe pull request is closed. WalkthroughReplaces artifact-centric architecture with a document-centric model across UI, hooks, streaming, and DB. Adds emoji and synonym overlays to the editor. Simplifies AI toolchains to text-only creation/update. Removes artifact components/hooks, updates prompts and queries, adjusts layouts/providers, and consolidates navigation and middleware rules. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant UI as DocumentWorkspace
participant Editor as Editor
participant Hook as useDocument
participant API as /api/document
participant Stream as DataStreamHandler
UI->>Hook: setDocument({id,title,content}) on create/rename
UI->>API: POST/PUT /api/document (id,title,content)
API-->>UI: 200 OK (id,title,content)
UI->>Stream: start streaming (new doc)
Stream-->>Editor: editor:stream-text (text-delta)
Stream-->>UI: editor:creation-stream-finished (finish)
UI->>Hook: setDocument(status='idle')
sequenceDiagram
autonumber
participant User
participant Editor
participant Emo as emojiPlugin
participant Overlay as EmojiOverlay
User->>Editor: Type ":" + query
Editor->>Emo: keymap/transaction
Emo->>Overlay: open(position, suggestions)
User->>Overlay: Navigate/select emoji
Overlay-->>Emo: insertEmojiSuggestion(code)
Emo->>Editor: replace text with emoji
Emo->>Overlay: close
sequenceDiagram
autonumber
participant User
participant Editor
participant Syn as synonym-plugin
participant UI as SynonymOverlay (component)
User->>Editor: Hover/select word
Editor->>Syn: fetch synonyms
Syn-->>UI: dispatch "synonym-overlay:open" (pos, list, range)
User->>UI: Click synonym
UI->>Editor: replace range with synonym
UI-->>Syn: dispatch "synonym-overlay:close"
sequenceDiagram
autonumber
participant Actions as DocumentActions
participant Win as window
participant Editor as Editor
Actions->>Win: preview-document-update {documentId,newContent}
Note over Editor: Show diff view
Actions->>Win: cancel-document-update {documentId}
Note over Editor: Hide diff view
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
Refactor