Skip to content

Allow shift + click to extend the cell range selection in the Query Tool results grid. #8647 - #10617

Closed
dpage wants to merge 1 commit into
pgadmin-org:masterfrom
dpage:fix/issue-8647-shift-click-range
Closed

dpage wants to merge 1 commit into
pgadmin-org:masterfrom
dpage:fix/issue-8647-shift-click-range

Conversation

@dpage

@dpage dpage commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Shift + click in the Query Tool results grid now extends the cell range from the selected cell, as shift + arrow keys already did.

This bumps the pinned react-data-grid fork to pick up pgadmin-org/react-data-grid#9 (shift + mousedown extends the range) and pgadmin-org/react-data-grid#10 (shift + key range handling only for shift + arrow with range selection on, range mouse handlers only attached when it is on, and a GroupRow/TreeDataGrid props fix). The yarn.lock change touches only react-data-grid.

On the row number column, shift + click is pgAdmin's own row selection, so onCellMouseDown now selects that cell as a plain click does. Without that, a cell range selected earlier stayed highlighted alongside the selected rows.

Test plan

  • New Jest spec QueryToolDataGridMouseDown.spec.js; the sqleditor and components Jest specs pass (--maxWorkers=2).
  • eslint on the changed files; the webpack dev build compiles.
  • Checked in the Query Tool with Playwright against PostgreSQL 18, comparing the old fork, the new fork alone and the new fork with this change:
    • shift + click selects the range and copies it; shift + click again re-extends from the same cell; a plain click collapses the range;
    • shift + arrow keys still extend the range;
    • shift + click on column headers still selects a column range;
    • shift + click on a row number no longer leaves a stale cell range highlighted.

Closes #8647

Summary by CodeRabbit

  • Bug Fixes
    • Shift-clicking a row number now selects that cell without triggering the grid’s default range-selection behavior.
    • Shift-clicking data cells retains the existing range-selection behavior. Clicking a row number without Shift, or clicking a data cell without Shift, continues to behave as before.

…ool results grid. pgadmin-org#8647

Bump the pinned react-data-grid fork to pick up shift + mousedown extending
the selected range from the selected cell (pgadmin-org/react-data-grid#9),
plus the change limiting shift + key range handling to shift + arrow keys
when range selection is enabled (pgadmin-org/react-data-grid#10).

Shift + click on the row number column is pgAdmin's row selection, so keep
selecting that cell as a plain click does there. Otherwise a cell range
selected earlier stays highlighted alongside the selected rows.

Closes pgadmin-org#8647
@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: pgadmin-org/pgadmin4/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2876e223-a53d-4f44-9766-b72ec848bd7e
📥 Commits

Reviewing files that changed from the base of the PR and between 2477a94 and 3b9db24.

⛔ Files ignored due to path filters: 1
  • web/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing: 3
  • web/package.json
  • web/pgadmin/tools/sqleditor/static/js/components/QueryToolDataGrid/index.jsx
  • web/regression/javascript/sqleditor/QueryToolDataGridMouseDown.spec.js

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review.

Walkthrough

The query grid now intercepts Shift-mousedown on row-number cells to prevent the default range behavior and select the cell. The grid dependency is updated, and a regression spec covers this behavior and two non-intercepted cases.

Changes

Query grid selection

Layer / File(s) Summary
Row-number Shift-click handling
web/package.json, web/pgadmin/tools/sqleditor/static/js/components/QueryToolDataGrid/index.jsx, web/regression/javascript/sqleditor/QueryToolDataGridMouseDown.spec.js
The react-data-grid dependency points to a new commit. The grid prevents default range handling and calls selectCell() for Shift-mousedown on row-number cells. The spec checks this case, Shift-mousedown on a data cell, and plain mousedown on a row-number cell.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature · Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to 3b9db

Shift-clicking a row number preserves row selection and clears the previous cell range. The change is mergeable after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the primary change: enabling Shift+click to extend cell range selection in the Query Tool results grid.
Linked Issues check Passed Issue #8647 requires Shift+click to select the complete cell range. The PR pins the react-data-grid fork to the commit that adds Shift+mousedown range extension. The Query Tool grid keeps the default …
Out of Scope Changes check Passed The reviewed changes are limited to the react-data-grid fork pin, Query Tool grid mouse handling, and focused Jest coverage. These changes support issue #8647 and prevent stale range highlighting duri…
Full details: Docstring Coverage

Explanation

Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@dpage

dpage commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

Squashed and merged as b98470f.

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.

Cell range selection on shift + click should work

1 participant