Skip to content

Fixed Geometry Viewer not auto-updating on first query execution afte…#9785

Open
anilsahoo20 wants to merge 3 commits intopgadmin-org:masterfrom
anilsahoo20:GH-9392
Open

Fixed Geometry Viewer not auto-updating on first query execution afte…#9785
anilsahoo20 wants to merge 3 commits intopgadmin-org:masterfrom
anilsahoo20:GH-9392

Conversation

@anilsahoo20
Copy link
Contributor

@anilsahoo20 anilsahoo20 commented Mar 25, 2026

…r View/Edit Data to Query Tool promotion. #9392

Summary by CodeRabbit

  • Bug Fixes
    • Geometry viewer now reliably resets and renders fresh state each time it's opened or updated, preventing stale or incorrect displays when switching to the Geometry Viewer tab.

@coderabbitai
Copy link

coderabbitai bot commented Mar 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 21c6d49d-54bc-4360-b56c-91f9c24be907

📥 Commits

Reviewing files that changed from the base of the PR and between a38cd79 and 37ad3d7.

📒 Files selected for processing (1)
  • web/pgadmin/tools/sqleditor/static/js/components/sections/ResultSet.jsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • web/pgadmin/tools/sqleditor/static/js/components/sections/ResultSet.jsx

Walkthrough

Replaced the GeometryViewer's previous keyless rendering by computing a memoized gvColumnsSignature from the current columns keys and using it as the React key for GeometryViewer, making the component identity depend on the ordered set of column keys.

Changes

Cohort / File(s) Summary
GeometryViewer key change
web/pgadmin/tools/sqleditor/static/js/components/sections/ResultSet.jsx
Added a memoized gvColumnsSignature derived from columns keys and passed it as key={gvColumnsSignature} to the GeometryViewer component to change remount behavior when opening/updating the Geometry Viewer tab.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly relates to the main change: fixing Geometry Viewer auto-update behavior on first query execution, which is precisely what the code change (adding memoized gvColumnsSignature as key) accomplishes.

✏️ 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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@web/pgadmin/tools/sqleditor/static/js/components/sections/ResultSet.jsx`:
- Around line 1499-1505: The code currently forces a full remount of
GeometryViewer by incrementing gvRenderKeyRef.current in openGeometryViewerTab
and passing it as the key to <GeometryViewer />, which discards viewer-local
state; stop bumping and using that key so the viewer instance remains stable
across data refreshes. Edit the openGeometryViewerTab implementation (and remove
gvRenderKeyRef usage) so layoutDocker.openTab({ id: PANELS.GEOMETRY, title:
gettext('Geometry Viewer'), content: <GeometryViewer rows={rowsData}
columns={columns} column={column}/> }) is used instead, leaving map-level
rekeying inside GeometryViewer (MapContainer keyed by SRID/column) to handle
necessary updates. Ensure any leftover gvRenderKeyRef declarations are removed
or unused.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7b316552-3e2e-480b-968b-4893c923180b

📥 Commits

Reviewing files that changed from the base of the PR and between 2576548 and a38cd79.

📒 Files selected for processing (1)
  • web/pgadmin/tools/sqleditor/static/js/components/sections/ResultSet.jsx

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.

1 participant