Restore Alt+drag rectangular selection in the editor (#9864, #10029)#10043
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughCodeMirror Editor configuration is updated to restore rectangular (block) text selection by removing the crosshairCursor feature and making rectangularSelection unconditional. This fix is documented in the v9.16 release notes alongside other bug fixes for rectangular selection restoration and SQL function/procedure editing. ChangesRectangular Selection Fix and Documentation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
39709bf to
c5fe8e8
Compare
…pgadmin-org#10029 The fix for pgadmin-org#9570 (stop Alt+F5 showing a crosshair cursor) changed the rectangular-selection eventFilter to require Alt+Ctrl and moved the crosshair cue to Control. That broke the long-standing Alt+drag block (column) selection and left an inconsistent Ctrl crosshair cue. Restore the default rectangularSelection() (Alt+drag) and drop crosshairCursor entirely - the crosshair-on-Alt was exactly the artifact pgadmin-org#9570 wanted gone, and CodeMirror's crosshair cannot be limited to an active drag. This brings back block selection (pgadmin-org#9864, pgadmin-org#10029) while keeping pgadmin-org#9570's intent (no crosshair on the Alt+F5 shortcut). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
c5fe8e8 to
09fe9d6
Compare
There was a problem hiding this comment.
Pull request overview
Restores the CodeMirror editor’s longstanding Alt/Option+drag rectangular (column) selection gesture that was regressed by the earlier #9570 fix, while keeping the “no crosshair cursor when Alt is held” behavior.
Changes:
- Restore default
rectangularSelection()behavior (Alt/Option+drag) in the editor. - Remove
crosshairCursorusage so holding Alt (e.g., for Alt+F5) no longer shows a crosshair cue. - Add v9.16 release note entry for the regression fix.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| web/pgadmin/static/js/components/ReactCodeMirror/components/Editor.jsx | Restores default rectangular selection gesture and removes crosshair cursor extension. |
| docs/en_US/release_notes_9_16.rst | Documents the rectangular selection regression fix in v9.16 release notes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
asheshv
left a comment
There was a problem hiding this comment.
Code change is correct — rectangularSelection() with the default eventFilter and the removal of the dead crosshairCursor import is clean.
Please confirm one thing before merging: Alt+drag on macOS (both browser and the Electron desktop runtime). macOS's OS-level accent/variant popover can intercept Alt-click on some setups, which is likely why the prior code used altKey && ctrlKey. If it's been verified live, all good.
Summary
Fixes #9864 and #10029.
The fix for #9570 (commit 3598840) stopped Alt+F5 from showing a crosshair cursor, but did so by changing the editor's rectangular-selection
eventFilterto require Alt+Ctrl and moving the crosshair cue to Control. That broke the long-standing Alt+drag block/column selection (reported in #9864 and #10029) and left the crosshair cue inconsistent with the actual gesture.Fix: restore the default
rectangularSelection()(Alt+drag) and removecrosshairCursorentirely.crosshairCursoronly keys off a held modifier (it can't be limited to an active drag), so dropping it is the clean reconciliation.Changes
Editor.jsx:rectangularSelection()restored;crosshairCursorimport + usage removed.🤖 Generated with Claude Code
Summary by CodeRabbit
Documentation
Bug Fixes