Repository navigation
fix(ui): modal and right panel reopen immediately after close - #32097
Conversation
Closing the view modal (memories) or preview panel (documents) triggered
a useEffect re-run because the open-state variable was in the dependency
array. At that moment searchParams still held the URL param, so the guard
passed and the modal/panel reopened.
Fix: remove the open-state variable (isViewModalOpen / previewFile) from
the dependency arrays so these effects only fire on URL (searchParams)
changes, not on modal/panel state changes.
Adds Playwright regression assertions: dialog.not.toBeVisible() +
not.toHaveURL(/memory=/) for memories, and panel.waitFor({ state:
'hidden' }) before the existing not.toBeVisible() for documents.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
commented
Aug 26, 2026
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
commented
Aug 26, 2026
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
|
| Count | Rule |
|---|---|
| 3 | sonarjs/cyclomatic-complexity |
| 3 | sonarjs/no-duplicate-string |
| 1 | sonarjs/cognitive-complexity |
| 1 | sonarjs/expression-complexity |
All findings
| Location | Rule | Message | |
|---|---|---|---|
| 🟡 | src/pages/ContextCenterPage/ContextCenterDocumentsPage/ContextCenterDocumentsPage.tsx:76:43 |
sonarjs/cyclomatic-complexity |
{"message":"Function has a complexity of 16 which is greater than 10 authorized.","cost":6,"secondaryLocations":[{"line":76,"column":42,"endLine":76,"endColumn" |
| 🟡 | src/pages/ContextCenterPage/ContextCenterDocumentsPage/ContextCenterDocumentsPage.tsx:216:28 |
sonarjs/cognitive-complexity |
Refactor this function to reduce its Cognitive Complexity from 21 to the 15 allowed. |
| 🟡 | src/pages/ContextCenterPage/ContextCenterDocumentsPage/ContextCenterDocumentsPage.tsx:216:28 |
sonarjs/cyclomatic-complexity |
{"message":"Function has a complexity of 12 which is greater than 10 authorized.","cost":2,"secondaryLocations":[{"line":216,"column":27,"endLine":216,"endColum |
| 🟡 | src/pages/ContextCenterPage/ContextCenterDocumentsPage/ContextCenterDocumentsPage.tsx:346:23 |
sonarjs/no-duplicate-string |
Define a constant instead of duplicating this literal 5 times. |
| 🟡 | src/pages/ContextCenterPage/ContextCenterDocumentsPage/ContextCenterDocumentsPage.tsx:531:23 |
sonarjs/no-duplicate-string |
Define a constant instead of duplicating this literal 10 times. |
| 🟡 | src/pages/ContextCenterPage/ContextCenterDocumentsPage/ContextCenterDocumentsPage.tsx:659:5 |
sonarjs/expression-complexity |
Reduce the number of conditional operators (5) used in the expression (maximum allowed 3). |
| 🟡 | src/pages/ContextCenterPage/ContextCenterMemoriesPage/ContextCenterMemoriesPage.tsx:99:42 |
sonarjs/cyclomatic-complexity |
{"message":"Function has a complexity of 22 which is greater than 10 authorized.","cost":12,"secondaryLocations":[{"line":99,"column":41,"endLine":99,"endColumn |
| 🟡 | src/pages/ContextCenterPage/ContextCenterMemoriesPage/ContextCenterMemoriesPage.tsx:521:31 |
sonarjs/no-duplicate-string |
Define a constant instead of duplicating this literal 3 times. |
Fix locally (fast - only checks files changed in this branch):
make ui-checkstyle-changed
✅ Playwright Results — workflow succeededValidated commit ✅ 219 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 41m 15s ⏱️ Max setup 2m 45s · max shard execution 10m 42s · max shard-job elapsed before upload 13m 32s · reporting 2s 🌐 142.58 requests/attempt · 2.02 app boots/UI scenario · 19.00% common-shard skew Optimization targets still in progress:
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
commented
Aug 26, 2026
🚦 Removed from the merge queue —
|
commented
Aug 27, 2026
Code Review ✅ ApprovedRemoves open-state variables from the URL-driven panel effect dependency arrays to prevent modals and right panels from reopening immediately after being closed. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
commented
Aug 27, 2026
|



Describe your changes:
Closing the view modal (Context Center Memories) or the document preview panel (Context Center Documents) caused it to immediately reopen. A
useEffectthat handles URL-driven panel opening had the open-state variable (isViewModalOpen/previewFile) in its dependency array. When the user closed the panel, that variable changed, re-triggering the effect. At that momentsearchParamsstill held the URL param (router navigation hadn't rendered yet), so the guard condition passed and the modal/panel reopened.Fix: remove the open-state variable from each effect's dependency array so the effect only fires on
searchParamschanges (URL navigation), not on modal/panel state changes.Type of change:
High-level design:
N/A — small change.
Tests:
Use cases covered
memory=paramUnit tests
Backend integration tests
Ingestion integration tests
Playwright (UI) tests
openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/ContextCenterMemories.spec.ts— addedexpect(dialog).not.toBeVisible()+expect(page).not.toHaveURL(/memory=/)after cancel click in the view-modal testopenmetadata-ui/src/main/resources/ui/playwright/e2e/Features/ContextCenterDocument.spec.ts— addedpanel.waitFor({ state: 'hidden' })before the existingnot.toBeVisible()assertionManual testing performed
UI screen recording / screenshots:
Not applicable.
Screen.Recording.2026-08-26.at.4.21.01.PM.mov
Screen.Recording.2026-08-26.at.4.22.21.PM.mov
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.Greptile Summary
The PR prevents Context Center memory modals and document preview panels from immediately reopening after users close them by limiting URL synchronization effects to navigation-related dependency changes.
Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains.
Important Files Changed
Reviews (3): Last reviewed commit: "Merge branch 'main' into fix-memory-moda..." | Re-trigger Greptile