Skip to content

fix(ui): modal and right panel reopen immediately after close - #32097

Merged
Rohit0301 merged 4 commits into
mainfrom
fix-memory-modal-reopen
Aug 27, 2026
Merged

Rohit0301 merged 4 commits into
mainfrom
fix-memory-modal-reopen

Conversation

@Rohit0301

@Rohit0301 Rohit0301 commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Closing the view modal (Context Center Memories) or the document preview panel (Context Center Documents) caused it to immediately reopen. A useEffect that 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 moment searchParams still 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 searchParams changes (URL navigation), not on modal/panel state changes.

Type of change:

  • Bug fix

High-level design:

N/A — small change.

Tests:

Use cases covered

  • User opens a memory card view modal → closes it → modal stays closed and URL loses the memory= param
  • User opens a document preview panel → closes it → panel stays hidden

Unit tests

  • Not applicable (logic fix covered by Playwright E2E below).

Backend integration tests

  • Not applicable (no backend changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Added Playwright regression assertions.
  • Files updated:
    • openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/ContextCenterMemories.spec.ts — added expect(dialog).not.toBeVisible() + expect(page).not.toHaveURL(/memory=/) after cancel click in the view-modal test
    • openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/ContextCenterDocument.spec.ts — added panel.waitFor({ state: 'hidden' }) before the existing not.toBeVisible() assertion

Manual testing performed

  1. Navigated to Context Center → Memories page
  2. Clicked a memory row to open the view-only modal — modal appeared correctly
  3. Clicked Cancel — modal closed and stayed closed (previously it reopened immediately)
  4. Navigated to Context Center → Documents page
  5. Clicked a document row to open the preview panel — panel appeared correctly
  6. Clicked the close button — panel closed and stayed closed (previously it reopened immediately)

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:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: N/A
  • For UI changes: behavior-only fix, no visual change — recording not applicable.
  • I have added tests (Playwright regression assertions) and listed them above.
  • I have added a test that covers the exact scenario we are fixing.

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.

  • Removes modal and preview state variables from their respective effect dependency arrays.
  • Adds Playwright assertions that the memory modal remains closed and its URL parameter is removed.
  • Waits for the document preview panel to become hidden after closing.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
openmetadata-ui/src/main/resources/ui/src/pages/ContextCenterPage/ContextCenterDocumentsPage/ContextCenterDocumentsPage.tsx Stops local preview-state changes from retriggering URL-driven document preview opening.
openmetadata-ui/src/main/resources/ui/src/pages/ContextCenterPage/ContextCenterMemoriesPage/ContextCenterMemoriesPage.tsx Stops modal visibility changes from retriggering URL-driven memory modal opening.
openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/ContextCenterDocument.spec.ts Strengthens the close-flow assertion by waiting for the document panel to become hidden.
openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/ContextCenterMemories.spec.ts Verifies that closing the memory modal keeps it hidden and removes the memory URL parameter.

Reviews (3): Last reviewed commit: "Merge branch 'main' into fix-memory-moda..." | Re-trigger Greptile

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>
@github-actions

ghost commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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 skip-pr-checks label.

@github-actions github-actions Bot added the UI UI specific issues label Aug 26, 2026
@github-actions

ghost commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@Rohit0301 Rohit0301 self-assigned this Aug 26, 2026
@Rohit0301 Rohit0301 added the safe to test Add this label to run secure Github workflows on PRs label Aug 26, 2026
@Rohit0301
Rohit0301 enabled auto-merge August 26, 2026 10:57
@github-actions

ghost commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ UI Checkstyle passed — lint findings in changed files

🔍 ESLint findings in this PR's files — 0 error(s), 8 warning(s)

Errors block the build. Warnings do not yet — they are rules whose backlog is still
being worked down, listed so this PR does not add to it. See docs/ui-code-quality-gate.md.

0 error(s), 8 warning(s) across 2 changed file(s).

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

@github-actions

ghost commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 67%
67.16% (80197/119395) 51.65% (48803/94478) 52.68% (14721/27943)

@github-actions

ghost commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 0d33aa46a0c0b72d1bcff844b71047847a1948d5 in Playwright run 33043088359, attempt 1.

✅ 219 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky

Performance

Blocking 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:

  • Common shard skew was 19% (convergence target: at most 15%).
  • Application boot ratio was 2.02 per UI scenario (499 boots / 247 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 94 0 0 0 0 0
✅ Shard chromium-02 125 0 0 0 0 0

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@Rohit0301
Rohit0301 added this pull request to the merge queue Aug 26, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 26, 2026
@github-actions

ghost commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-08-26T15:42:32Z)

Blocked the queue: ui-checkstyle

@gitar-bot

ghost commented Aug 27, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

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

Options

Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@sonarqubecloud

ghost commented Aug 27, 2026

Copy link
Copy Markdown

@Rohit0301
Rohit0301 added this pull request to the merge queue Aug 27, 2026
Merged via the queue into main with commit e6e0d8b Aug 27, 2026
@Rohit0301
Rohit0301 deleted the fix-memory-modal-reopen branch August 27, 2026 07:42

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants