Repository navigation
fix(studio): reset anchor offsets on cell move and preserve stationary entry order on no-op move downgrade - #49550
Conversation
…y entry order on no-op move downgrade
|
Thanks for contributing to Supabase! ❤️ Our team will review your PR. A few tips for a smoother review process:
|
|
@AyushDubey23 is attempting to deploy a commit to the Supabase Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
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; 8 remain after this review. 📝 WalkthroughWalkthrough
ChangesNotebook diff ordering
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This localized bug fix adds regression coverage for notebook cell movement and 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🛠️ Fix failing CI checks 💡
🧪 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 |
I have read the CONTRIBUTING.md file.
YES
What kind of change does this PR introduce?
Bug fix
What is the current behavior?
Closes #49545
Closes #49546
deriveNotebookDiff, inserting a cell after an anchor that was previously moved shifts the new cell past its intended target position becauseinsertedAfterretains accumulated offset counts from the anchor's pre-move location (Insert anchored to a previously-moved cell lands after the wrong cell in deriveNotebookDiff #49545).deriveNotebookDiff, a move that is downgraded tounchanged(downgradeNoOpMoves) leaves{ _tag: 'removed' }entries displaced below cells whose moves were cancelled out (A downgraded no-op move displaces a removed entry from its original position #49546).What is the new behavior?
insertedAfter.delete(operation.cell_id)is invoked when handlingmove_celloperations so anchor insertion offsets reset when a cell relocates.downgradeNoOpMovessorts stationary entries (unchanged,removed,replaced) by their original notebook index when downgrading a no-op move, ensuring deleted entries remain in their original relative position.Additional context
Added focused regression unit tests covering both operation composition scenarios in
notebook-operations.test.ts.Summary by CodeRabbit