Skip to content

Staging#68

Closed
will-lp1 wants to merge 6 commits intomainfrom
staging
Closed

Staging#68
will-lp1 wants to merge 6 commits intomainfrom
staging

Conversation

@will-lp1
Copy link
Copy Markdown
Owner

@will-lp1 will-lp1 commented Aug 21, 2025

Summary by CodeRabbit

  • New Features

    • Emoji autocompletion and rendering in the editor.
    • Synonym suggestion overlay with inline replace.
    • Compact document action bar: view changes, navigate versions, copy to clipboard.
  • UX Improvements

    • Unified, document-centric workspace and chat integration.
    • Cleaner editor loading and version preview flow.
  • Behavior Changes

    • Home page buttons: clearer “Open/Begin” labels with chevron.
    • Signed-out redirect now goes to home; authenticated users aren’t auto-redirected from “/”.
  • Chores

    • Dependency updates and additions (editor plugins, Markdown tooling, UI libraries, SDKs).

…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
@vercel
Copy link
Copy Markdown

vercel bot commented Aug 21, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
cursorforwriting-wkur Ready Ready Preview Comment Aug 21, 2025 10:42pm

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Aug 21, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Refactors 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

Cohort / File(s) Summary
Artifact system removal
apps/snow-leopard/components/artifact*.tsx, apps/snow-leopard/components/toolbar.tsx, apps/snow-leopard/hooks/use-artifact.ts, apps/snow-leopard/artifacts/text/*, apps/snow-leopard/lib/artifacts/server.ts, apps/snow-leopard/components/create-artifact.tsx
Deletes artifact UI, actions, toolbar, hooks, text artifact client/server, and artifact server registry. Removes exported types and classes tied to artifacts.
Document-centric refactor
apps/snow-leopard/hooks/use-document.ts, .../components/document/document-workspace.tsx, .../components/document/actions.tsx, .../components/document/document-tool.tsx, .../components/document/version-header.tsx, .../components/document/skeleton.tsx, .../components/data-stream-handler.tsx, .../components/chat/*, .../components/sidebar/sidebar-documents.tsx
Introduces useDocument SWR state, rewires components from artifact→document (ids, titles, content, status), replaces ArtifactActions with DocumentActions, updates streaming deltas to documentUpdate, and adjusts chat/sidebar to document object.
Editor: schema, plugins, functions
apps/snow-leopard/lib/editor/basic-schema.ts, .../editor/config.ts, .../editor/editor-plugins.ts, .../editor/functions.tsx, .../editor/synonym-plugin.ts, .../components/document/editor.tsx
Adds shared ProseMirror schema with diff mark; re-exports in config; adds emoji plugin; switches content pipeline to Markdown parsing/serialization; synonym plugin emits open/close events; editor renders SynonymOverlay.
Emoji feature
apps/snow-leopard/lib/editor/emoji-plugin.ts, .../components/emoji-overlay.tsx, .../package.json
Adds emoji autocomplete/rendering plugin and React overlay; registers plugin; adds node-emoji and related deps.
AI helpers and tools
apps/snow-leopard/lib/ai/document-helpers.ts, .../lib/ai/tools/document-streaming.ts, .../lib/ai/tools/create-document.ts, .../lib/ai/tools/update-document.ts, .../lib/ai/prompts.ts
Introduces create/update text document streaming helpers; collapses kind handling to 'text'; removes kind from update result; broadens prompt type to null
DB and API adjustments
apps/snow-leopard/lib/db/queries.ts, .../app/api/document/actions/create.ts, .../app/documents/actions.ts
Makes kind optional/null in save/create version paths; removes ArtifactKind usage and assertions; update flow sets kind null on save.
Layout and providers
apps/snow-leopard/app/layout.tsx, .../app/documents/layout.tsx
Removes global SuggestionOverlayProvider/DocumentProvider; adds SuggestionOverlayProvider scoped to documents layout.
Routing and pages
apps/snow-leopard/app/page.tsx, .../app/documents/page.tsx, .../app/documents/[id]/page.tsx, .../middleware.ts, .../components/sidebar/sidebar-user-nav.tsx
Tweaks CTAs/labels; updates AlwaysVisibleArtifact import to document-workspace; adjusts auth middleware redirect rules; post-signout redirect to '/'.
Types
apps/snow-leopard/types/metadata.ts, .../types/document.ts
Renames ArtifactMetadata→DocumentMetadata; introduces UIDocument; renames ArtifactContent→DocumentContent and removes some fields.
Auth
apps/snow-leopard/lib/auth.ts
Improves Stripe env validation messages/order; enables via STRIPE_ENABLED or NEXT_PUBLIC_STRIPE_ENABLED.
Manifests
apps/snow-leopard/package.json, /package.json
Adds/updates dependencies (React 19 RC, next canary, markdown-it, node-emoji, prosemirror-tables, etc.); devDependencies reorder in root.

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" })
Loading
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"
Loading
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
Loading
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)
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Possibly related PRs

Poem

A rabbit taps keys in the snow-lit night,
Artifacts hop off, documents take flight.
Emojis bloom: ✨ → ✨ with glee,
Synonyms whisper, “choose me, choose me!”
Streams weave pages, line by line—
Snow Leopard purrs, “the doc is mine.”

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 details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 0bb2471 and e708e0d.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (53)
  • apps/snow-leopard/app/api/document/actions/create.ts (1 hunks)
  • apps/snow-leopard/app/documents/[id]/page.tsx (1 hunks)
  • apps/snow-leopard/app/documents/actions.ts (1 hunks)
  • apps/snow-leopard/app/documents/layout.tsx (3 hunks)
  • apps/snow-leopard/app/documents/page.tsx (1 hunks)
  • apps/snow-leopard/app/layout.tsx (1 hunks)
  • apps/snow-leopard/app/page.tsx (2 hunks)
  • apps/snow-leopard/artifacts/text/client.tsx (0 hunks)
  • apps/snow-leopard/artifacts/text/server.ts (0 hunks)
  • apps/snow-leopard/components/artifact-actions.tsx (0 hunks)
  • apps/snow-leopard/components/artifact.tsx (0 hunks)
  • apps/snow-leopard/components/chat/chat-header.tsx (2 hunks)
  • apps/snow-leopard/components/chat/chat.tsx (5 hunks)
  • apps/snow-leopard/components/chat/message.tsx (1 hunks)
  • apps/snow-leopard/components/chat/messages.tsx (1 hunks)
  • apps/snow-leopard/components/chat/multimodal-input.tsx (4 hunks)
  • apps/snow-leopard/components/create-artifact.tsx (0 hunks)
  • apps/snow-leopard/components/data-stream-handler.tsx (4 hunks)
  • apps/snow-leopard/components/document/actions.tsx (1 hunks)
  • apps/snow-leopard/components/document/document-tool.tsx (5 hunks)
  • apps/snow-leopard/components/document/document-workspace.tsx (10 hunks)
  • apps/snow-leopard/components/document/editor.tsx (4 hunks)
  • apps/snow-leopard/components/document/skeleton.tsx (0 hunks)
  • apps/snow-leopard/components/document/version-header.tsx (6 hunks)
  • apps/snow-leopard/components/emoji-overlay.tsx (1 hunks)
  • apps/snow-leopard/components/highlight-blog-tool.tsx (0 hunks)
  • apps/snow-leopard/components/sidebar/sidebar-documents.tsx (4 hunks)
  • apps/snow-leopard/components/sidebar/sidebar-user-nav.tsx (1 hunks)
  • apps/snow-leopard/components/suggestion-overlay-provider.tsx (6 hunks)
  • apps/snow-leopard/components/synonym-overlay.tsx (1 hunks)
  • apps/snow-leopard/components/toolbar.tsx (0 hunks)
  • apps/snow-leopard/hooks/use-artifact.ts (0 hunks)
  • apps/snow-leopard/hooks/use-document-context.tsx (0 hunks)
  • apps/snow-leopard/hooks/use-document.ts (13 hunks)
  • apps/snow-leopard/lib/ai/document-helpers.ts (1 hunks)
  • apps/snow-leopard/lib/ai/prompts.ts (1 hunks)
  • apps/snow-leopard/lib/ai/tools/create-document.ts (1 hunks)
  • apps/snow-leopard/lib/ai/tools/document-streaming.ts (1 hunks)
  • apps/snow-leopard/lib/ai/tools/update-document.ts (0 hunks)
  • apps/snow-leopard/lib/artifacts/server.ts (0 hunks)
  • apps/snow-leopard/lib/auth.ts (2 hunks)
  • apps/snow-leopard/lib/db/queries.ts (3 hunks)
  • apps/snow-leopard/lib/editor/basic-schema.ts (1 hunks)
  • apps/snow-leopard/lib/editor/config.ts (1 hunks)
  • apps/snow-leopard/lib/editor/editor-plugins.ts (2 hunks)
  • apps/snow-leopard/lib/editor/emoji-plugin.ts (1 hunks)
  • apps/snow-leopard/lib/editor/functions.tsx (1 hunks)
  • apps/snow-leopard/lib/editor/synonym-plugin.ts (3 hunks)
  • apps/snow-leopard/middleware.ts (1 hunks)
  • apps/snow-leopard/package.json (4 hunks)
  • apps/snow-leopard/types/document.ts (2 hunks)
  • apps/snow-leopard/types/metadata.ts (1 hunks)
  • package.json (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch staging

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@will-lp1 will-lp1 closed this Aug 21, 2025
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.

1 participant