Skip to content

add knip to CI#32

Closed
ntietje1 wants to merge 1 commit intoxy-flowfrom
claude/fix-runner-syntax-error-V5AOn
Closed

add knip to CI#32
ntietje1 wants to merge 1 commit intoxy-flowfrom
claude/fix-runner-syntax-error-V5AOn

Conversation

@ntietje1
Copy link
Copy Markdown
Owner

@ntietje1 ntietje1 commented Apr 4, 2026

Summary by CodeRabbit

  • New Features

    • Canvas: New collaborative whiteboard sidebar item with drawing, selection, and editing tools.
    • Real-time collaboration: Switched to Yjs-based syncing for notes and canvases with live remote cursors and selections.
    • Canvas tools: Draw, erase, lasso, and rectangle selection with color/opacity controls.
    • File embedding: Embed files, folders, and notes directly into canvases.
    • Preview deployments: Pull request-specific preview URLs with OAuth disabled.
  • Chores

    • Dependency updates: Added Yjs, lib0, and related libraries; removed older sync packages.
    • Workflow refinement: Separated E2E tests into dedicated workflow and improved preview deployment pipeline.

…yntaxError

The notes mutations imported @blocknote/core (a browser-oriented library)
at the module level, causing SyntaxError in Convex's V8 isolate when any
note mutation was loaded. This moves BlockNoteEditor usage to "use node"
actions that run in Node.js instead.

- Create convex/notes/nodeActions.ts ("use node") for persistNoteBlocks
  and initializeNoteContent
- Create convex/notes/internalMutations.ts for saveNoteBlocksInternal
  and pushYjsUpdateInternal
- Create convex/yjsSync/internalQueries.ts for getUpdatesInternal
- Remove @blocknote/core runtime imports from mutations.ts and createNote.ts
- persistNoteBlocks now schedules a Node.js action via ctx.scheduler
- createNote with content creates empty Yjs doc then schedules content init

https://claude.ai/code/session_01J9nErHs2JYcyBnj6zFY2Kv
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
wizard-archive c6aa726 Apr 04 2026, 05:47 PM

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 4, 2026

Caution

Review failed

Failed to post review comments

Warning

Ignoring CodeRabbit configuration file changes. For security, only the configuration from the base branch is applied for open source repositories.

📝 Walkthrough

Walkthrough

This PR introduces a collaborative canvas (drawing/diagramming) feature backed by Yjs real-time synchronization, replaces ProseMirror sync with Yjs for notes, adds comprehensive E2E testing for canvas and collaboration workflows, refactors CI/deployment GitHub Actions workflows (moving E2E tests to a separate workflow, adding a preview deployment workflow), updates dependencies (adds yjs, @xyflow/react, perfect-freehand, lib0), and gates OAuth functionality on preview deployments.

Changes

Cohort / File(s) Summary
Canvas Feature (Schema & Types)
convex/canvases/baseSchema.ts, convex/canvases/types.ts, convex/canvases/schema.ts
New Convex schema defining canvases table with indexes (by_campaign_location_parent_name, by_campaign_slug, by_campaign_deletionTime) and derived type aliases (CanvasFromDb, Canvas, CanvasWithContent).
Canvas Mutations & Functions
convex/canvases/mutations.ts, convex/canvases/functions/createCanvas.ts, convex/canvases/functions/updateCanvas.ts, convex/canvases/functions/enhanceCanvas.ts
New authenticated mutations and helper functions for creating and updating canvas items, including slug validation, enhancement with sidebar metadata, and Yjs document initialization.
Yjs Synchronization Core
convex/yjsSync/schema.ts, convex/yjsSync/mutations.ts, convex/yjsSync/queries.ts, convex/yjsSync/internalMutations.ts, convex/yjsSync/internalQueries.ts
New Yjs-backed database schema with yjsUpdates and yjsAwareness tables; mutations for pushing/removing updates and awareness; queries for fetching remote state; internal operations for compaction and cleanup.
Yjs Helper Functions
convex/yjsSync/functions/*
Utility functions for Yjs document lifecycle: createYjsDocument, deleteYjsDocument, reconstructYDoc, checkYjsReadAccess/checkYjsWriteAccess, compactUpdates, uint8ToArrayBuffer.
Yjs Constants & Types
convex/yjsSync/constants.ts
New AWARENESS_TTL_MS constant for awareness entry lifecycle management.
Note Yjs Migration
convex/notes/functions/createNote.ts, convex/notes/mutations.ts, convex/notes/internalMutations.ts, convex/notes/nodeActions.ts
Updated note creation to use createYjsDocument instead of ProseMirror sync; added internal mutations for saving/persisting note blocks; added Node.js actions for initializing and persisting Yjs-backed note content.
Sidebar Item Integration
convex/sidebarItems/schema/baseValidators.ts, convex/sidebarItems/schema/schema.ts, convex/sidebarItems/schema/contentSchema.ts, convex/sidebarItems/types/baseTypes.ts, convex/sidebarItems/types/types.ts
Extended sidebar item validators and types to recognize canvases as a new item type; updated type unions across SidebarItemId, SidebarItemType, and content validators.
Sidebar Item Functions
convex/sidebarItems/functions/fetchCampaignSidebarItems.ts, convex/sidebarItems/functions/getSidebarItemById.ts, convex/sidebarItems/functions/getSidebarItemBySlug.ts, convex/sidebarItems/functions/applyToDependents.ts, convex/sidebarItems/functions/defaultItemName.ts, convex/sidebarItems/functions/enhanceSidebarItem.ts, convex/sidebarItems/functions/hardDeleteItem.ts
Updated sidebar item queries and operations to support canvases: added canvas-specific queries, enhancement logic, default naming, and Yjs cleanup on hard delete.
Convex Configuration & Prosemirror Removal
convex/convex.config.ts, convex/prosemirrorSync.ts, convex/crons.ts, convex/_test/setup.helper.ts, convex/auth/component.ts, convex/schema.ts
Removed ProseMirror sync middleware; added Yjs sync tables to schema; updated auth config to conditionally register Google OAuth (not required in preview); added cron job for cleaning stale Yjs awareness entries.
Yjs Test Suites
convex/yjsSync/__tests__/*, convex/notes/__tests__/createNoteYjsIntegration.test.ts, convex/sidebarItems/__tests__/hardDeleteYjsCleanup.test.ts
Comprehensive Vitest suites for Yjs sync helpers, mutations, queries, and integration with note/sidebar item operations.
Canvas UI Components (Core)
src/features/canvas/components/canvas-viewer.tsx, src/features/canvas/components/canvas-toolbar.tsx, src/features/canvas/components/canvas-color-panel.tsx
Main canvas editor component using React Flow; toolbar for tool selection, undo/redo, viewport controls; color picker for stroke styling.
Canvas Node Components
src/features/canvas/components/nodes/*
React Flow node types: text, sticky notes, rectangles, freehand strokes, embeds; minimap support; resizable wrapper with dragging/selection visual feedback.
Canvas Remote Collaboration UI
src/features/canvas/components/canvas-remote-cursors.tsx, src/features/canvas/components/canvas-remote-selections.tsx, src/features/canvas/components/canvas-strokes.tsx
Render remote users' cursors, selections, and freehand strokes with smooth positioning and visual indicators.
Canvas Hooks
src/features/canvas/hooks/useCanvas*.ts, src/features/canvas/hooks/useNode*.ts
Comprehensive hook suite: awareness sync, drawing/erasing/lasso/rectangle selection, history management, keyboard shortcuts, file uploads, wheel zoom, drop targets, selection rect management, Yjs document sync.
Canvas Store & Utilities
src/features/canvas/stores/canvas-tool-store.ts, src/features/canvas/utils/*
Zustand store for tool state; canvas awareness type definitions; context infrastructure; stroke geometry utilities; color and cursor utilities.
Canvas Feature Export
src/features/canvas/index.ts
Public export of CanvasViewer component.
Editor Integration (Yjs)
src/features/editor/providers/convex-yjs-provider.ts, src/features/editor/hooks/useConvexYjsCollaboration.ts, src/features/editor/hooks/useNoteYjsCollaboration.ts, src/features/editor/hooks/useYjsReactFlowSync.ts
Core provider for Yjs collaboration via Convex; hooks for managing Yjs documents, syncing React Flow state, and persisting note blocks.
Editor Integration (Patching)
src/features/editor/utils/patch-yundo-destroy.ts
Runtime patches for TipTap/ProseMirror undo plugin to preserve history across editor lifecycle and synchronize attribute changes within Yjs transactions.
Editor Components (Notes)
src/features/editor/components/viewer/note/note-editor.tsx
Updated note editor to use Yjs collaboration instead of ProseMirror sync; added plugin patching and user identity wiring.
Editor & Viewer
src/features/editor/components/viewer/sidebar-item-editor.tsx, src/features/editor/components/create-new-dashboard.tsx
Added canvas viewer routing; added "Create Canvas" button to creation dashboard.
Canvas Card & Folder View
src/features/editor/components/viewer/folder/canvas-card.tsx, src/features/editor/components/viewer/folder/item-card.tsx
New canvas card component for folder/sidebar views; integrated into item card renderer.
Embed Components
src/features/canvas/components/nodes/embed-content/*, src/features/canvas/components/nodes/embed-node.tsx
Embed support in canvas for notes, folders, maps, and files with conditional rich-view rendering.
Sidebar & Sharing Hooks
src/features/sidebar/hooks/useCreateSidebarItem.ts, src/features/sidebar/hooks/useEditSidebarItem.ts
Added canvas creation and editing support via new mutations; updated type unions and switch logic.
Sidebar Utilities
src/features/sidebar/utils/sidebar-item-utils.ts
Added canvas type guard, labels, icon mappings.
Context Menu & DnD
src/features/context-menu/actions.tsx, src/features/context-menu/menu-registry.ts, src/features/dnd/utils/dnd-registry.ts
Added canvas creation action; added canvas type recognition; added canvas drop-zone type with embed rejection logic for self-embedding.
Sharing Hooks
src/features/sharing/hooks/useSidebarItemsShare.ts
Extended share info type to include canvases.
Layout & Sidebar
src/features/sidebar/components/sidebar-layout.tsx
Minor drag-end cleanup logic update (explicit width/position setting vs. style removal).
Authentication
src/features/auth/components/sign-in-credentials-form.tsx, src/features/auth/components/sign-up-form.tsx, src/features/auth/utils/auth-server.ts
Gated OAuth buttons on preview deployments; added tooltip messaging; enabled JWT caching in auth config.
Preview & Utility Components
src/shared/components/preview-banner.tsx, src/shared/utils/preview.ts
New preview deployment indicator banner; environment variable exports for preview detection.
Shared Utilities
src/shared/utils/color.ts, src/shared/components/color-picker-popover.tsx, src/shared/hooks/useSpringPosition.ts
Color contrast computation; color picker popover; spring-physics hook for smooth position animation.
Styling
src/styles/app.css
Added CSS theme tokens and dark-mode overrides for transparent/background colors; updated motion preferences; added React Flow-specific styling for selection and node types.
Configuration & Workflow
.coderabbit.yaml, .github/workflows/ci.yml, .github/workflows/deploy.yml, .github/workflows/e2e.yml, .github/workflows/preview.yml, eslint.config.js, vite.config.ts, package.json
Updated review profile to "assertive"; removed E2E test job from CI; added separate E2E workflow; added preview deployment workflow with Convex/Cloudflare setup; included .gitignore in ESLint; added Yjs resolution alias; updated dependencies (removed ProseMirror, added Yjs/xyflow/perfect-freehand/lib0).
Editor Hooks Tests
src/features/editor/hooks/__tests__/*, src/features/editor/providers/__tests__/convex-yjs-provider.test.ts
Comprehensive test suites for Yjs collaboration hooks, provider lifecycle, remote updates/awareness, and note persistence.
E2E Tests
e2e/editor-stress.spec.ts, e2e/yjs-collaboration.spec.ts
New stress and collaboration test suites for canvas and note editors covering undo/redo, persistence, multi-tab sync, formatting, and reconnection scenarios.

Sequence Diagram(s)

sequenceDiagram
    participant Client as Client (Browser)
    participant Provider as ConvexYjsProvider
    participant Convex as Convex<br/>(Backend)
    participant YjsDoc as Y.Doc<br/>(Local)
    
    Client->>YjsDoc: User edits (draw, type, etc.)
    YjsDoc->>Provider: Local update event
    Provider->>Provider: Buffer & debounce updates
    Provider->>Convex: pushUpdate(documentId, update)
    Convex->>Convex: Store update to yjsUpdates table
    Convex-->>Provider: Return seq number
    
    Convex->>Client: Fetch via getUpdates query
    Client->>Provider: Apply remote updates
    Provider->>YjsDoc: Y.applyUpdate()
    YjsDoc->>Client: Sync state (render updates)
    
    Client->>Provider: Awareness change (cursor, selection)
    Provider->>Convex: pushAwareness(documentId, clientId, state)
    Convex->>Convex: Store/update yjsAwareness row
    
    Convex->>Client: Fetch via getAwareness query
    Client->>Provider: Apply remote awareness
    Provider->>Client: Update remote cursors/selections
Loading
sequenceDiagram
    participant User1 as User 1<br/>(Canvas)
    participant Canvas1 as React Flow<br/>Instance 1
    participant Yjs1 as Y.Doc +<br/>Awareness 1
    participant Convex as Convex<br/>(Server)
    participant Yjs2 as Y.Doc +<br/>Awareness 2
    participant Canvas2 as React Flow<br/>Instance 2
    participant User2 as User 2<br/>(Canvas)
    
    User1->>Canvas1: Draw stroke / Add node
    Canvas1->>Yjs1: Update nodesMap / edgesMap
    Yjs1->>Convex: pushUpdate (Yjs update bytes)
    
    Convex->>Yjs2: Remote update fetched<br/>via getUpdates query
    Yjs2->>Canvas2: Node change event observed
    Canvas2->>User2: Re-render with new node
    
    User2->>Canvas2: Cursor movement
    Canvas2->>Yjs2: setLocalCursor awareness
    Yjs2->>Convex: pushAwareness (cursor position)
    
    Convex->>Yjs1: Remote awareness fetched<br/>via getAwareness query
    Yjs1->>Canvas1: Apply awareness update
    Canvas1->>User1: Render User2's cursor
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

  • add preview deployments #29: Overlapping workflow changes (deploy.yml concurrency, preview.yml addition, e2e.yml creation, ci.yml e2e removal) and preview UI infrastructure (preview banner, auth gating, environment variables in src/shared/utils/preview.ts).
  • Note yjs #30: Parallel Yjs synchronization implementation and removal of ProseMirror sync across both canvases and notes (createYjsDocument, yjsSync schema/mutations, internalMutations).
  • Testing #26: Related CI workflow changes—the retrieved PR adds e2e-test job to ci.yml while this PR removes it and moves to a separate e2e.yml workflow.

Poem

🐰 A canvas unfolds where rabbits now play,
With Yjs whispers syncing the day,
Freehand strokes flowing, cursors dancing near,
Real-time collaboration drawing cheer!
✨ From many to one, updates bloom—
No more ProseMirror dust in the room! 🎨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/fix-runner-syntax-error-V5AOn

@ntietje1 ntietje1 changed the base branch from main to xy-flow April 4, 2026 18:11
@ntietje1 ntietje1 closed this Apr 5, 2026
@ntietje1 ntietje1 deleted the claude/fix-runner-syntax-error-V5AOn branch April 5, 2026 01:08
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