Skip to content

fix(ui/search): tell same-named containers apart in filter options - #21198

Open
rob-1019 wants to merge 4 commits into
masterfrom
fix/search-filter-container-disambiguation
Open

rob-1019 wants to merge 4 commits into
masterfrom
fix/search-filter-container-disambiguation

Conversation

@rob-1019

@rob-1019 rob-1019 commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Before this PR, the Container filter's option list labels each container by its name only, so a store schema in two databases shows up as two identical store entries and users can't tell which one they are picking; with this PR, options that share a name are prefixed with the fewest parent containers that tell them apart (the database first, then higher levels), shown as a dotted path such as petshop_east.store; long paths stay readable (lakehouse_a.….supply, petsho…to_2024.store) and the hidden parts show on hover.

What changes

  • Only colliding options change. A container whose name is unique among the options on offer keeps its plain name, so the list grows only where it has to.
  • The comparison is against the options currently on offer in that menu, so the same container can be shown plainly in one list and with its database in another.
  • If no level tells a group apart (the same names all the way up), each option shows its whole parent path.
  • Long paths keep the two parts that matter: the parent that tells the options apart and the container's own name. Levels between them collapse to …, and a name too long on its own is shortened in the middle, so names that differ only at the start or end (…_2019_to_2024 vs …_2014_to_2018) stay apart. Hovering an ellipsis shows what it hides; hovering the rest of the path shows the full path. The row never scrolls sideways.
  • This covers every place that uses the entity value menu for containers: the value menu of an applied Container filter, Add filter → Container, and the View builder.

How

The search, autocomplete and facet queries behind these menus already fetch parentContainers for containers, so this is UI-only:

  • searchV2/filters/containerDisambiguation.ts (new): groups container options by name and finds the minimal disambiguating depth per group; getContainerPathSegments turns a path into display segments within a character budget, each ellipsis carrying the text it hides.
  • EntityValueMenu computes it over the options on offer and passes each option its parents through mapFilterOption to FilterOption, which renders each segment with its own tooltip.

No GraphQL, backend or config changes; no new UI strings.

Testing

  • Playwright tests/search-container-filter/container-filter-disambiguation.spec.ts with petshop sample containers: same-named schemas in two databases, same-named databases in two catalogs (a collapsed path, checking both hover tooltips), and a unique name. Passes with this PR at 32ff5120d55 (4 of 4). Also checked by hand with 60–90 character names and a six-level chain: every option stays distinct and nothing overflows.
  • Unit: containerDisambiguation.test.ts (grouping, depth, unique names, non-container options, identical chains, path formatting, collapsing and middle-shortening long paths), EntityValueMenu.test.tsx (labels rendered end to end, including shortened ones), FilterOption.test.tsx. 100% of changed lines covered.
  • Lint and type-check clean (:datahub-web-react:yarnLint, :e2e-test:ui:playwright:lint).

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly PR Title Format)
  • Tests for the changes have been added/updated
  • Docs related to the changes have been added/updated (not needed: display-only change)
  • Breaking changes (none)

🤖 Generated with Claude Code


Summary by cubic

Fixes the Container filter option list so same-named containers are told apart, and search can find them by a parent name.

  • Colliding options are prefixed with the fewest parent containers (database first) that separate them, shown as a dotted path such as petshop_east.store; unique names stay plain.
  • Long paths keep the levels that differ, collapse only the levels the whole group shares to an ellipsis, and skip shortening when shortened names would look alike; hovering an ellipsis shows what it hides and hovering the rest shows the full path.
  • The prefix depends on the options currently on offer in that menu, so the same container can appear plainly in one list and prefixed with its database in another.
  • The value menu's search now matches containers on their full path, so typing a parent shown in a label (petshop_east) keeps that option.
  • UI-only: the search, autocomplete, and facet queries already fetch parentContainers, so no GraphQL, backend, or config changes.

Written for commit fe891b5. Summary will update on new commits.

View guided diff Turn on auto-fix

@github-actions github-actions Bot added the product PR or Issue related to the DataHub UI/UX label Nov 11, 2026
@cursor

cursor Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

PR Summary

Overview
Container filter value menus no longer show duplicate bare names when several containers share a label (e.g. two store schemas). For options that collide in the current list, the UI prefixes the fewest parent containers needed to distinguish them, rendered as a dotted path (petshop_east.store). Uniquely named containers stay unchanged.

A new containerDisambiguation module groups colliding container options, picks disambiguating parent depth, and builds compact path segments (middle ellipsis for shared levels, middle-truncation for long names) with tooltips for hidden text and the full path. EntityValueMenu computes parents for the options on screen and passes them through mapFilterOption into FilterOption, which shows an icon plus the path instead of the generic entity row when parents are present.

Local search in the entity value menu now matches containers on their full parent path (so filtering by a parent name in petshop_east.store still finds the right row).

Unit tests cover the disambiguation logic and menu rendering; Playwright tests and fixtures exercise the behavior in the Container filter dropdown.

Reviewed by Cursor Bugbot for commit fe891b5. Bugbot is set up for automated code reviews on this repo. Configure here.

@codecov

codecov Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Bundle Report

Changes will increase total bundle size by 2.5kB (0.01%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
datahub-react-web-esm 31.56MB 2.5kB (0.01%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: datahub-react-web-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/utils-*.js 2.31kB 20.29kB 12.87% ⚠️
assets/SelectedSearchFilters-*.js 188 bytes 28.76kB 0.66%

Files in assets/utils-*.js:

  • ./src/app/searchV2/filters/containerDisambiguation.ts → Total Size: 3.75kB

  • ./src/app/searchV2/filters/FilterOption.tsx → Total Size: 6.15kB

Files in assets/SelectedSearchFilters-*.js:

  • ./src/app/searchV2/filters/value/EntityValueMenu.tsx → Total Size: 2.47kB

  • ./src/app/searchV2/filters/mapFilterOption.tsx → Total Size: 651 bytes

  • ./src/app/searchV2/filters/value/utils.tsx → Total Size: 5.6kB

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

i18n locale parity

Status: ⚠️ drift detected (warn-only) — 135 issue(s) across 13 locale(s)

Locale Missing keys Stale keys Placeholder Files
de 153 10 0 10
es 153 10 0 10
fi 153 12 0 11
fr 153 10 0 10
hu 153 10 0 10
it 153 10 0 10
ja 153 12 0 11
nb 153 10 0 10
pt-BR 153 10 0 10
ru 153 13 0 12
sv 153 10 0 10
zh-CN 153 10 0 10
zh-TW 153 12 0 11

Per-key detail is in the job summary of the datahub-web-react-lint run, or reproduce locally:

./gradlew :datahub-web-react:yarnI18nParityCheck        # all locales
cd datahub-web-react && yarn check-i18n-parity --lang de  # one locale

@codecov

codecov Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

❌ 4 Tests Failed:

Tests completed Failed Passed Skipped
62 4 58 0
View the top 3 failed test(s) by shortest run time
search-container-filter/container-filter-disambiguation.spec.ts::Container filter disambiguation › a container with a unique name keeps its plain name
Stack Traces | 16.5s run time
expect(locator).toBeVisible() failed
search-container-filter/container-filter-disambiguation.spec.ts::Container filter disambiguation › hovering a collapsed path shows the levels it hides, and the full path elsewhere
Stack Traces | 18.3s run time
expect(locator).toBeVisible() failed
search-container-filter/container-filter-disambiguation.spec.ts::Container filter disambiguation › containers that share a parent name show the level that separates them
Stack Traces | 18.6s run time
expect(locator).toBeVisible() failed
search-container-filter/container-filter-disambiguation.spec.ts::Container filter disambiguation › same-named containers show the parent that separates them
Stack Traces | 19.4s run time
expect(locator).toBeVisible() failed

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@meticulous

meticulous Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

✅ Meticulous spotted 0 visual differences across 426 screens tested: view results.

Meticulous evaluated ~18 hours of user flows which tested 74/171 of the executable lines edited in your PR1.

1. These 97 untested lines will likely automatically gain test coverage over the coming days, however if you wish to increase coverage immediately you can do so by interacting with your feature on localhost.

Expected differences? Click here. Last updated for commit fe891b5 fix(ui/search): fit the container path into master's filter option layou.... This comment will update as new commits are pushed.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Initial JS bundle size ➡️

Base (2ba446b) This PR Diff
index.html (/login) 250 KB 250 KB +0 KB (+0.0%)
Logged-in shell 1.07 MB 1.07 MB +0 KB (+0.0%)
/search 1.25 MB 1.25 MB +1 KB (+0.1%)
/ (home) 1.27 MB 1.27 MB +1 KB (+0.1%)

index.html is the login page; logged-in pages add the shell. Gzip of the JS loaded before first paint. Codecov reports total bundle including lazy chunks — these intentionally differ.

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Boot web vitals (no backend)

Unauthenticated /login against the two dist/ trees from this job. No GMS — this is eager JS, not search/dataset payload. Lantern, desktop, 1x CPU. Does not forecast fleet p75; do not gate on LCP.

Web-vitals A/B — base (2ba446b) (A) vs pr (fe891b5) (B)

Lighthouse 12.8.2, throttling simulate (cpu 1x, rtt 40 ms, 10240 kbps). Form factor: desktop. Cache: cold (fresh incognito context per run). target n=3/build, 1 warm-up discarded, alternating A,B.

Boot-only (no GMS). Unauthenticated login route — eager JS/CSS/font transfer and parse, not search/dataset payload. Do not treat as a fleet p75.

boot

Measured runs in the table: A 3/3, B 3/3.

metric A p50 B p50 Δ p50 Δ% A p95 B p95
fcp 851 ms 780 ms -71 ms -8.3% 852 ms 850 ms
lcp 1304 ms 1308 ms 4 ms +0.3% 1305 ms 1326 ms
cls 0.0000 0.0000 0.0000 — 0.0000 0.0000
tbt 11 ms 15 ms 4 ms +36.4% 13 ms 20 ms
tti 1305 ms 1309 ms 4 ms +0.3% 1306 ms 1329 ms
ttfb 1 ms 1 ms 0 ms +5.3% 1 ms 1 ms
transferredBytes 1077.1 KB 1077.1 KB 0.0 KB +0.0% 1077.1 KB 1077.1 KB
mainThread 276 ms 286 ms 10 ms +3.8% 279 ms 340 ms
bootup 149 ms 156 ms 7 ms +4.6% 150 ms 180 ms

Resource transfer by type (p50):

type A bytes B bytes Δ bytes A requests B requests
document 1.3 KB 1.3 KB 0.0 KB 1 1
script 645.3 KB 645.3 KB -0.0 KB 8 8
stylesheet 3.0 KB 3.0 KB 0.0 KB 2 2
image 48.7 KB 48.7 KB 0.0 KB 1 1
media 257.3 KB 257.3 KB 0.0 KB 1 1
font 106.6 KB 106.6 KB 0.0 KB 3 3
other 0.0 KB 0.0 KB 0.0 KB 0 0

LCP element A: div > div.sc-fpAkvV > div.sc-pRPz > p.sc-pNWdM — Welcome to DataHub
LCP element B: div > div.sc-fpAkvV > div.sc-pRPz > p.sc-pNWdM — Welcome to DataHub

These numbers rank changes and gate regressions against the measured origin(s). They do not sum across PRs and do not forecast any fleet-wide production number.

rob-1019 and others added 4 commits December 4, 2026 12:31
Container filter options were labelled with the container's name only, so a
"store" schema in two databases showed up as two identical "store" entries.
When options on offer share a name, prefix each with the fewest parent
containers that tell them apart (the database first, then higher levels),
as a dotted path. A long path keeps the parent that tells it apart and the
container's own name, collapses the levels between them to an ellipsis and
shortens over-long names in the middle; hovering an ellipsis shows what it
hides and hovering the rest shows the full path. Options with a unique name
are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nt names

A long path collapsed every level between its outermost parent and the
container's own name, which could make labels collide again when several
levels are needed to tell options apart. Collapse only the levels the whole
group shares, keep the ones that differ, and skip shortening a level when
the shortened names would look alike.

The value menu's search matched only a container's own name, so typing a
parent shown in a label hid that option. Match containers on their full
path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…yout

Master now renders entity filter options with EntitySelectOption. Show the
entity icon before the disambiguating container path, keep master's option
when no path is needed, restore the Entity import mapFilterOption lost in the
rebase, and drop the onApply prop EntityValueMenu no longer takes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rob-1019
rob-1019 force-pushed the fix/search-filter-container-disambiguation branch from 32ff512 to fe891b5 Compare December 4, 2026 17:44
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Smart test selection

Playwright E2E tests

This run: smart

  • Selection: smart: specs tagged analytics, search, views plus the tests the change affects
  • Size: 62 tests in 14 spec files, ~11 min predicted on 2 shard(s)
Specs selected because of this PR (14)
Spec Tests Why
analytics/analytics.spec.ts 2/2 tagged analytics
autocomplete-v2/autocomplete.spec.ts 2/2 tagged search
browse-v2/browse-v2.spec.ts 10/10 tagged search
logical-models/physical-children-view.spec.ts 2/2 tagged search, tagged views
search-container-filter/container-filter-disambiguation.spec.ts 4/4 seeds from search-container-filter, changed
search/query-and-filter-search.spec.ts 10/10 tagged search
search/search-filters.spec.ts 5/5 tagged search
search/search-within-operator.spec.ts 1/1 tagged search
search/search.spec.ts 7/7 tagged search
search/searchv2.spec.ts 15/15 tagged search
views/v2-manage-views.spec.ts 1/1 tagged views
views/v2-view-nested-conditions.spec.ts 1/1 tagged views
views/v2-view-select.spec.ts 1/1 tagged views
views/v2-view-within-operator.spec.ts 1/1 tagged views

Add the run-all-tests:playwright label to run the full Playwright suite on this PR.

commit fe891b5 · workflow run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 3 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit fe891b5. Configure here.

}
});
closeSharedRun();
return segments.concat(shorten('self', label));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Shortened names still collide

Medium Severity

keepWhole only compares parent names inside one same-name group. The container's own name is always passed through shortenName, which keeps a fixed head and tail. Two different long names that share those ends, under the same disambiguating parent, still render as the same option label.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit fe891b5. Configure here.

overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
`;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Full names clipped after keepWhole

Medium Severity

When keepWhole is set, the full parent name is rendered with no hidden text. ContainerPath then clips that string with overflow: hidden and an end ellipsis, so names that differ only in the middle can still look identical in the list.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit fe891b5. Configure here.

<Label style={{ maxWidth: 150 }}>
{isSubTypeFilter ? capitalizeFirstLetterOnly(label as string) : label}
</Label>
defaultLabel

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checkbox name ignores disambiguated path

Medium Severity

Disambiguated container rows draw a parent path, but the checkbox aria-label and data-testid still use the plain label from getFilterIconAndLabel. Same-named containers stay identical to assistive tech, and those test ids collide.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit fe891b5. Configure here.

This branch was successfully deployed

2 active deployments
Preview — fe891b5b Deployed Dec 4, 2026 by vercel[bot]
datahub-project-web-react (Preview) — fe891b5b Deployed Dec 4, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product PR or Issue related to the DataHub UI/UX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant