Skip to content

fix(ui): closing version drawer no longer appends tab to entity URL#30465

Open
Rohit0301 wants to merge 6 commits into
mainfrom
version-drawer-tab-reset-bug
Open

fix(ui): closing version drawer no longer appends tab to entity URL#30465
Rohit0301 wants to merge 6 commits into
mainfrom
version-drawer-tab-reset-bug

Conversation

@Rohit0301

@Rohit0301 Rohit0301 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Describe your changes:

Screen.Recording.2026-07-24.at.4.25.53.PM.mov

Closing the version history drawer on Database, DatabaseSchema, and all other entity pages was navigating to a URL with a trailing tab segment (e.g. /databaseSchema/fqn/schema) instead of the clean entity URL. This caused the entity detail page to not select its default tab. The bug was introduced in March 2024 (PR #15404) when entity-specific routes were consolidated into generic route helpers — backHandler started forwarding the version-page tab param to getEntityDetailsPath, which was never correct.

I removed the tab argument from backHandler in DatabaseSchemaVersionPage, DatabaseVersionPage, and EntityVersionPage so the back navigation always lands on the clean entity URL, letting the page fall back to its own default tab.

Type of change:

  • Bug fix

High-level design:

N/A — small change.

Tests:

Use cases covered

  • Opening the version drawer then closing it returns to the exact entity page URL with no trailing tab segment
  • Default tab is correctly selected after closing the version drawer on Database, DatabaseSchema, and Table entity pages

Unit tests

  • Not applicable (logic change is a one-line removal, no unit test surface).

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • I added Playwright E2E tests under openmetadata-ui/.../ui/playwright/ for UI changes.
  • Files added/updated: playwright/e2e/VersionPages/EntityVersionPages.spec.ts

Manual testing performed

  1. Navigated to database/Another%20Hybrid%20Runner%20Redshift%202.dev
  2. Clicked the version button — URL changed to .../versions/0.1/schema
  3. Clicked the close button in the version drawer
  4. Verified URL returned to the entity page without /schema and the default Tables tab was selected

UI screen recording / screenshots:

Not applicable.

Checklist:

  • I have read the CONTRIBUTING document.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • I have added a test that covers the exact scenario we are fixing.

Greptile Summary

Fixes version-drawer close navigation to return to clean entity URLs.

  • Removes the version-page tab argument from Database, DatabaseSchema, and generic entity back handlers.
  • Adds Playwright coverage for closing version drawers on Table, Database, and DatabaseSchema pages.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failures remain.

Important Files Changed

Filename Overview
openmetadata-ui/src/main/resources/ui/playwright/e2e/VersionPages/EntityVersionPages.spec.ts Adds end-to-end regression coverage verifying that closing version drawers restores tab-free entity URLs.
openmetadata-ui/src/main/resources/ui/src/pages/DatabaseSchemaVersionPage/DatabaseSchemaVersionPage.tsx Updates DatabaseSchema version-drawer back navigation to use the clean entity route.
openmetadata-ui/src/main/resources/ui/src/pages/DatabaseVersionPage/DatabaseVersionPage.tsx Updates Database version-drawer back navigation to use the clean entity route.
openmetadata-ui/src/main/resources/ui/src/pages/EntityVersionPage/EntityVersionPage.component.tsx Updates generic entity version-drawer back navigation to omit the version route's tab parameter.

Reviews (6): Last reviewed commit: "Merge branch 'main' into version-drawer-..." | Re-trigger Greptile

The backHandler in DatabaseSchemaVersionPage, DatabaseVersionPage, and
EntityVersionPage was passing the version-page tab to getEntityDetailsPath,
causing the entity detail URL to include a trailing tab segment (e.g.
/schema) after closing the drawer. This left the entity page without its
default tab selected. Removed the tab argument so the back navigation
always lands on the clean entity URL. Also adds Playwright tests covering
the close-and-return flow for Table, Database, and DatabaseSchema entities.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Rohit0301
Rohit0301 requested a review from a team as a code owner July 24, 2026 10:56
@github-actions

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

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!

@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 4651a8a7fdc5c7907e3693b67ead7c73f6c1ffd2 in Playwright run 30098977851, attempt 1.

✅ 555 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 5 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) 48m 44s

⏱️ Max setup 2m 59s · max shard execution 15m 47s · max shard-job elapsed before upload 18m 59s · reporting 4s

🌐 205.96 requests/attempt · 2.93 app boots/UI scenario · 15.63% common-shard skew

Optimization targets still in progress:

  • Common shard skew was 15.63% (convergence target: at most 15%).
  • Browser traffic was 205.96 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.93 per UI scenario (1690 boots / 576 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 108 0 0 0 0 0
✅ Shard chromium-02 110 0 0 3 0 0
✅ Shard chromium-03 104 0 0 0 0 0
✅ Shard chromium-04 95 0 0 0 0 0
✅ Shard data-asset-rules-01 61 0 0 0 0 0
✅ Shard domain-isolation-01 14 0 0 0 0 0
✅ Shard global-state-01 23 0 0 0 0 0
✅ Shard ingestion-01 1 0 0 0 0 0
✅ Shard reindex-01 2 0 0 0 0 0
✅ Shard search-01 10 0 0 0 0 0
✅ Shard search-rbac-01 27 0 0 2 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 self-assigned this Jul 24, 2026
@Rohit0301 Rohit0301 added the safe to test Add this label to run secure Github workflows on PRs label Jul 24, 2026
@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 65%
65.67% (76783/116916) 49.52% (46065/93017) 50.76% (13891/27364)

…on drawer tests

toHaveURL exact match failed because the app appends ?showDeletedTables=false
after closing the version drawer. Use a regex that checks only the pathname
so query parameters don't cause false negatives.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Rohit0301 and others added 3 commits July 24, 2026 17:54
Entity FQNs contain dots which become . wildcards in an unescaped RegExp,
weakening the assertion. Escape the pathname with the standard regex-escape
pattern so dots and other metacharacters are matched literally.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@gitar-bot

gitar-bot Bot commented Jul 24, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 1 resolved / 1 findings

Removes the version-page tab argument from entity back handlers to ensure closing the version drawer returns to a clean URL, and adds corresponding Playwright test coverage. No issues found.

✅ 1 resolved
Edge Case: entityPathname interpolated into RegExp without escaping

📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/VersionPages/EntityVersionPages.spec.ts:527 📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/VersionPages/EntityVersionPages.spec.ts:545 📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/VersionPages/EntityVersionPages.spec.ts:563
entityPathname is embedded directly into new RegExp() without escaping regex metacharacters. Entity FQNs commonly contain dots (e.g. ...Redshift%202.dev) which become . wildcards, and could contain other special chars, weakening the assertion (e.g. 2.dev would also match 2Xdev). Escape the pathname before building the pattern, e.g. const escaped = entityPathname.replace(/[.*+?^${}()|[\]\]/g, '\$&'); then use new RegExp(\^[^?]${escaped}(?.)?$`)`.

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 👍 / 👎 | Gitar

@sonarqubecloud

Copy link
Copy Markdown

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant