Repository navigation
Conversation
When a cell gets moved via move_cell operation in deriveNotebookDiff, the insertedAfter offset map was never cleared for that anchor cell. This caused later insert_cell operations anchored on the same (now-moved) cell to apply the stale offset on top of the correct current-position lookup, resulting in the new cell landing after the wrong position. The fix: clear the offset for an anchor cell from insertedAfter when it gets moved, since cells previously inserted after it stayed behind at its old location and should not affect subsequent inserts at its new position. Regression test added: reproduces the exact ticket scenario (insert after cell-1, move cell-1, insert after cell-1 again) and verifies correct final cell order. Fixes: FE-4308
|
The latest updates on your projects. Learn more about Vercel for GitHub.
5 Skipped Deployments
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughMoving a cell now clears its previous ChangesNotebook insertion tracking
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This localized fix clears stale insertion offsets when an anchor cell moves and adds regression coverage for the affected ordering behavior. No actionable merge-blocking risk remains beyond normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 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 |
🎭 Playwright Test Results (next)Details
Flaky testsFeatures › queue-table-operations.spec.ts › Queue Table Operations › pending changes persist when switching between tables Skipped testsFeatures › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled |
Braintrust eval report
|
I have read the CONTRIBUTING.md file.
YES
What kind of change does this PR introduce?
Bug fix
What is the current behavior?
When a cell gets moved via
move_celloperation inderiveNotebookDiff, theinsertedAfteroffset map is not cleared for that anchor cell. This causes laterinsert_celloperations anchored on the same (now-moved) cell to apply the stale offset on top of the correct current-position lookup, resulting in the new cell landing after the wrong position.What is the new behavior?
The offset for an anchor cell is now cleared from
insertedAfterwhen it gets moved, since cells previously inserted after it stay behind at its old location and should not affect subsequent inserts at its new position.A regression test has been added that reproduces the exact ticket scenario (insert after cell-1, move cell-1 after cell-3, insert after cell-1 again) and verifies the correct final cell order.
Additional context
Fixes: https://linear.app/supabase/issue/FE-4308/insert-anchored-to-a-previously-moved-cell-lands-after-the-wrong-cell
Summary by CodeRabbit