Skip to content

Restore Alt+drag rectangular selection in the editor (#9864, #10029)#10043

Merged
asheshv merged 2 commits into
pgadmin-org:masterfrom
dpage:fix-9864-10029-rectangular-selection
Jun 12, 2026
Merged

Restore Alt+drag rectangular selection in the editor (#9864, #10029)#10043
asheshv merged 2 commits into
pgadmin-org:masterfrom
dpage:fix-9864-10029-rectangular-selection

Conversation

@dpage

@dpage dpage commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

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 eventFilter to 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 remove crosshairCursor entirely.

Changes

  • Editor.jsx: rectangularSelection() restored; crosshairCursor import + usage removed.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation

    • Published pgAdmin 4 v9.16 release notes with connection behavior clarification and updated PostgreSQL utility versions.
  • Bug Fixes

    • Fixed code editor selection behavior and rectangular selection functionality.
    • Resolved multiple issues across UI, SQL query tools, ERD, schema-diff, JSON editor, and authentication components.

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: cca14b9c-84a8-43e7-8583-2e5b76f84b9d

📥 Commits

Reviewing files that changed from the base of the PR and between 435a1d0 and f692aa1.

📒 Files selected for processing (2)
  • docs/en_US/release_notes_9_16.rst
  • web/pgadmin/static/js/components/ReactCodeMirror/components/Editor.jsx

Walkthrough

CodeMirror 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.

Changes

Rectangular Selection Fix and Documentation

Layer / File(s) Summary
Editor rectangular selection configuration
web/pgadmin/static/js/components/ReactCodeMirror/components/Editor.jsx
crosshairCursor is removed from imports; rectangularSelection is changed from a conditional configuration gated by alt+ctrl modifiers to an unconditional call, with comments explaining the intentional omission of crosshairCursor.
v9.16 Release Notes: Selection Fixes
docs/en_US/release_notes_9_16.rst
Bug fixes section documents the restoration of rectangular text selection via Issue #9864 (Alt+drag default behavior, no crosshair cursor reintroduction) and Issue #10029 (additional rectangular selection restoration), with the existing Issue #10059 entry for SQL function/procedure AS $BODY$ wrapper fix retained.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • pgadmin-org/pgadmin4#9763: Modifies the same Editor.jsx rectangularSelection and crosshairCursor configuration in defaultExtensions.

Suggested reviewers

  • asheshv
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly describes the main change: restoring Alt+drag rectangular selection in the editor, which is the primary focus of the code changes in Editor.jsx.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@dpage dpage force-pushed the fix-9864-10029-rectangular-selection branch 2 times, most recently from 39709bf to c5fe8e8 Compare June 9, 2026 11:36
…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>
@dpage dpage force-pushed the fix-9864-10029-rectangular-selection branch from c5fe8e8 to 09fe9d6 Compare June 9, 2026 11:37
@asheshv asheshv requested a review from Copilot June 10, 2026 14:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 crosshairCursor usage 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.

Comment thread docs/en_US/release_notes_9_16.rst

@asheshv asheshv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@asheshv asheshv merged commit 0649bcd into pgadmin-org:master Jun 12, 2026
33 of 34 checks passed
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.

pgAdmin 9.14 the column selection (Alt/Option + right mouse) drag no longer work

3 participants