Repository navigation
feat(studio): notebook cell operations - #48940
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
5 Skipped Deployments
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
📝 WalkthroughWalkthroughThis change adds typed notebook cell operations for insertion, replacement, deletion, and movement. It validates references and conflicts, applies ordered transformations, rejects empty results, and adds Vitest coverage. ChangesNotebook operations
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
|
@coderabbitai review |
✅ Action performedReview finished.
|
🎭 Playwright Test Results (next)Details
Skipped testsFeatures › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/studio/data/content/notebooks/notebook-operations.ts`:
- Around line 151-157: Update the operation-processing logic around
appendInsertion to resolve move_cell dependencies before emitting cells,
ensuring a move anchored to another moved cell is emitted after that anchor;
alternatively reject such dependent moves as conflicting_operations. Add a
regression test covering chained moves such as cell-1 after cell-3 and cell-2
after cell-1, expecting the correct order.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: b4cf6965-1c6d-4db4-9e58-cfce9f932566
📒 Files selected for processing (2)
apps/studio/data/content/notebooks/notebook-operations.test.tsapps/studio/data/content/notebooks/notebook-operations.ts
|
@coderabbitai review |
✅ Action performedReview finished.
|
c2773ff to
28b5512
Compare
Pure client-side logic for splicing partial writes into a notebook's cell list: insert_cell, replace_cell, delete_cell, and move_cell, resolved against the notebook's original cell ordering so results don't depend on operation order. Backend-facing wiring (update_notebook tool) lands next.
Operations run in the order given, each acting on the result of the ones before it — so a move's anchor reflects earlier ops in the same batch, and the same ops in a different order can produce a different, well-defined result. Multiple ops anchored on the same cell still stack in the order given, via a per-anchor offset, rather than each re-inserting immediately after the anchor and ending up reversed.
28b5512 to
23ea561
Compare
Braintrust eval report
|
Summary
data/content/notebooks/notebook-operations.ts) for applyingupdate_notebookcell edits client-side:insert_cell(after_cell_idincl.'start'),replace_cell,delete_cell,move_cell.create_notebook.update_notebooktool wiring is next.Towards FE-4083
Test plan
pnpm vitest run data/content/notebooks/notebook-operations.test.ts— 13 unit tests covering every op, combinations, and all three error cases.pnpm exec tsc --noEmitcleanpnpm exec eslintclean on new filesSummary by CodeRabbit
New Features
Tests