Skip to content

Fixes #36069: Keep Browse Estate tree expanded to the remaining path after removing a browse chip - #38470

Merged
Rohit0301 merged 3 commits into
mainfrom
Rohit0301/openmetadata-36069-fix
Nov 23, 2026
Merged

Rohit0301 merged 3 commits into
mainfrom
Rohit0301/openmetadata-36069-fix

Conversation

@Rohit0301

@Rohit0301 Rohit0301 commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #36069

In Explore › Browse Estate, removing a browse chip (for example Schema ppg from postgres › mns_db › postgres › ppg) collapsed the tree to the service-type level instead of leaving it open at the remaining filters.

Root cause: removing a chip changes browsePath, which rebuilds the tree from its static roots (fetchEntityCounts with preserveExpandedTree = false). Root keys are static, but every lazily loaded level below them gets a fresh generateUUID() key. The old expanded keys then match nothing, and nothing re-expanded the tree along browsePath. The same gap left browse deep links (like the one in the issue) and page reloads collapsed.

Fix:

  • ExplorePureUtils.getBrowsePathAncestorKeys(treeNodes, browseFields) is a new pure helper. It returns the loaded nodes whose filterField is a strict prefix of the active browse path, not the browsed node itself. It returns [] for an empty or category path.
  • ExploreTree has a new effect on [browsePath, treeData] that expands those ancestors. Each expansion lazy-loads the next level, which re-runs the effect, until the browsed node is revealed and highlighted by the existing selection sync. autoExpandedKeysRef makes each node auto-expand only once, so a node the user collapses stays collapsed. It is cleared on rebuild together with requestedKeysRef.

Type of change:

  • Bug fix

High-level design:

N/A — small change.

Tests:

Use cases covered

  • Removing the Schema chip keeps the tree expanded to service type › service › database, with the database highlighted.
  • Removing the Database chip keeps it expanded to service type › service, with the service highlighted. Removing the Service chip leaves the service type highlighted.
  • Removing the Schema chip while an entity-type leaf (Tables / Stored Procedures) filter is active keeps the database expanded, and the Type chip stays.
  • A browse deep link or a page reload opens the tree down to the browsed node, including outside Databases (it opens the category root that holds the path, e.g. Dashboards).
  • A node the user collapses manually is not re-opened by later loads.

Unit tests

  • src/utils/ExplorePureUtils.test.ts: 5 cases for getBrowsePathAncestorKeys (strict prefixes only, partially loaded deep path, empty/category path).
  • The ExplorePureUtils and ExploreTree Jest suites pass: 84/84.

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Added 3 tests to playwright/e2e/Pages/ExploreBrowse.spec.ts:
    • removing browse chips keeps the tree expanded to the remaining path
    • removing the schema chip under an entity-type leaf keeps the database expanded
    • reloading a browse deep link expands the tree to the browsed schema
    • reloading a dashboard service browse link expands the Dashboards branch (added after review; not run locally yet)
  • yarn lint:playwright passes with 0 errors.

Local run of the new specs (chromium, against a backend built from this branch, UI dev server). All 3 passed:

Playwright run: 3 passed

Manual testing performed

  1. Built the backend from this branch (mvn -pl openmetadata-dist -am package, UI build skipped) and ran it on a fresh MySQL database with Elasticsearch 9.3. Ran the UI with Vite against it.
  2. Seeded the issue's shape through the API: Postgres service mns_db › databases postgres, analytics › schemas ppg, public, reporting, plus tables and the stored procedure refresh_orders.
  3. Went through the scenarios recorded below.

UI screen recording:

Recorded on commit a405bcb98bf (backend 2.0.0-SNAPSHOT from the same branch) with the seeded data above.

1. Chip removal at every level. Drill down to ppg, then remove the Schema, Database and Service chips in turn. Each time the tree stays expanded to the remaining path and highlights the right node.

1-chip-removal-every-level.webm

2. The issue's exact case. Open the issue's deep link (browse path to ppg plus the Stored Procedures filter). The tree opens to ppg. After removing Schema ppg it stays at postgres › mns_db › postgres, and the Type chip stays.

2-issue-deep-link-stored-procedures.webm

3. Reload at database level. After a page reload the tree re-opens to postgres › mns_db › postgres.

3-reload-at-database-level.webm

4. Another branch, and a manual collapse. analytics › reporting: removing the schema chip leaves analytics highlighted. A node the user collapses stays collapsed.

4-other-branch-and-manual-collapse.webm

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: I updated the migration scripts or explained why it is not needed. (N/A — no schema change)

  • For a UI feature or feature task: Docker build + sample-data recording. (Not applicable — this is a standalone bug fix. Recordings above come from a local build of this branch instead.)

  • I have added tests (unit / integration / Playwright as applicable) and listed them above.

  • Self-review against REVIEW.md.

  • Decision check. (N/A — no durable decision)

  • I have added a test that covers the exact scenario we are fixing. (Bug fix)

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no new actionable issues remain.

Summary

Keeps Browse Estate open along the remaining browse path after chip removal and restores paths on reload.

  • Browse Estate keeps the active path open after chip removal and reloads.

Reviews (5) · Last reviewed commit: "fix(ui): expand category roots only once..." · Reviewed by Greptile

…h after removing a chip

Removing a browse chip rebuilds the explore tree from its static roots and
re-keys every lazily loaded level, so the previous expansion was lost and the
tree collapsed to the service-type level. The tree now expands the loaded
ancestors of the active browsePath level by level, which also makes browse
deep links and reloads open at the browsed node.

Fixes #36069
@Rohit0301
Rohit0301 requested a review from a team as a code owner November 23, 2026 10:20
Category roots carry no filterField, so a browse path outside the
default-expanded Databases root (e.g. a dashboard service) never had its root
opened on reload or deep link. Under a browse path each root's totalCount is
scoped to that path, so expand the roots with matches.
…e path

Selecting a tree node changes browsePath before the root counts refresh, so
the stale unfiltered totals opened every populated category. Track the
browsePath the root counts were refreshed for and ignore root counts until
they match the current path.
@gitar-bot

gitar-bot Bot commented Nov 23, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk

Auto-expanding Browse Estate ancestors after path changes alters tree navigation; stale or mismatched root counts could open unrelated categories.

Keeps the Explore Browse Estate tree expanded along the remaining browse path after a chip is removed, on reload, and on deep links, by auto-expanding ancestor nodes whose filter field is a strict prefix of the active browse path. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

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

@Rohit0301
Rohit0301 enabled auto-merge (squash) November 23, 2026 10:57
@Rohit0301
Rohit0301 merged commit 6aeece9 into main Nov 23, 2026
56 checks passed
@Rohit0301
Rohit0301 deleted the Rohit0301/openmetadata-36069-fix branch November 23, 2026 11:17
@Rohit0301 Rohit0301 mentioned this pull request Nov 23, 2026
2 tasks done
Rohit0301 added a commit that referenced this pull request Nov 24, 2026
* fix(ui): align entity header badges with title actions (#38436)

The badges box was pinned to the top of the header row while the title
actions were centred against the 40px service logo, leaving the DQ alert
icon and status badge ~4px higher than the copy/learning icons. Render
badges in the same h-8 actions row instead.

(cherry picked from commit 7ccb672)

* Fixes #36069: Keep Browse Estate tree expanded to the remaining path after removing a browse chip (#38470)

* fix(ui): keep Browse Estate tree expanded to the remaining browse path after removing a chip

Removing a browse chip rebuilds the explore tree from its static roots and
re-keys every lazily loaded level, so the previous expansion was lost and the
tree collapsed to the service-type level. The tree now expands the loaded
ancestors of the active browsePath level by level, which also makes browse
deep links and reloads open at the browsed node.

Fixes #36069

* fix(ui): expand the category root holding the browse path on reload

Category roots carry no filterField, so a browse path outside the
default-expanded Databases root (e.g. a dashboard service) never had its root
opened on reload or deep link. Under a browse path each root's totalCount is
scoped to that path, so expand the roots with matches.

* fix(ui): expand category roots only once their counts match the browse path

Selecting a tree node changes browsePath before the root counts refresh, so
the stale unfiltered totals opened every populated category. Track the
browsePath the root counts were refreshed for and ignore root counts until
they match the current path.

(cherry picked from commit 6aeece9)

* Fixes open-metadata/openmetadata-collate#8792: Dark-mode logo and monogram support in Platform Settings > Theme (#38435)

* feat(ui): dark-mode logo and monogram in Platform Settings > Theme

Add optional customLogoDarkUrlPath and customMonogramDarkUrlPath to the
logo configuration. BrandImage uses the dark variant only when the dark
theme is active and one is set, falling back to the light URL, then the
brand default; pre-auth pages read the theme the boot script applied.

The AI shell sidebar now shows an admin-set custom logo (it showed only
the build's mark), so the dark variant is visible after sign-in.

Rebuild the Theme view and edit form to the design: light/dark previews
with captions, an add/remove dark mode version field, live invalid-URL
and image-load errors that block saving, a checking state, and a
best-effort "hard to see in dark mode" warning.

* fix(ui): address self-review of dark-mode logos

- Only logo URLs edited in this session block Save, so a saved logo that
  no longer loads cannot hold up an unrelated theme change.
- The classic Appearance page keeps the dark-mode URLs when it saves.
- The AI sidebar resolves the custom logo for the active theme and keeps
  the build's sidebar mark when nothing applies.
- Update the Platform Settings Playwright theme flow for the new copy,
  the image check and the dark-logo round trip.

* fix(ui): mark a logo URL loaded before the optional contrast check

Save no longer waits on the CORS image request used for the
hard-to-see-in-dark-mode warning; the warning arrives separately.

* chore(ui): use the design's Moon icon for the dark-mode preview captions

Replace the Moon01 glyph with the Moon SVG from the design.

* docs: record the dark-mode logo variant contract; use Typography color prop

Add ADR:2026-11-23-dark-logo-variants-fall-back-to-the-light-url for the
fallback, merge-on-write and Save-blocking rules. Colour logo field
messages and captions through Typography's color prop.

* style(ui): organize imports in LogoUrlField

* fix(ui): enlarge the AI sidebar logo; drop the app-install tick background

The sidebar wordmark (built-in or custom) fills the 32px header row
instead of 24px. The app-install connector line now stops either side
of the tick, so the tick needs no background to mask it.

* fix(ui): show the AI sidebar logo at the classic sidebar's 40px

The header row and wordmark grow from 32px to 40px, matching the 40px
BrandImage in the classic left sidebar.

(cherry picked from commit 8b18e8f)
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.

Explore > Browse Estate: Removing a filter overly reduces the collapse state of the estate tree

2 participants