Skip to content

Fixes #35852: Search Settings layout and an accessible edit control - #35853

Merged
harsh-vador merged 10 commits into
mainfrom
fix/search-settings-layout
Oct 21, 2026
Merged

harsh-vador merged 10 commits into
mainfrom
fix/search-settings-layout

Conversation

@harsh-vador

@harsh-vador harsh-vador commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #35852

Stacked on #35825 (Search Settings dark mode), because both PRs touch the same two LESS files. This PR targets that branch, so the diff shows only the layout changes. Once #35825 merges, GitHub retargets it to main.

Search Settings layout fixes from the 2.0 → main UI bug bash, measured in AI mode at 1440px (light and dark):

Bug Fix Measured
"+ Add" buttons flush against the panel edge (regression from #35253) CollapseHeader row gets tw:pe-6, matching the AccordionHeader trigger's px-6 Right gap 0 → 24px on all three
Ranking Details field chips truncated Removed the padding .configuration-container / p-box doubled on top of the core AccordionPanel; Fields spans the full row; chips are wrapped in a core Tooltip with triggerClassName="tw:max-w-full" (Badge's own tooltip wrapper is max-content), so long names truncate inside the card and the tooltip shows the full name No chip overflows its card (usageSummary.*.percentileRank overflowed by 26–32px before)
Global numeric cards: double border, pencil 1px from it, one word per line GlobalSettingItem no longer draws its own border/radius/background inside .global-setting-card (flex: 1; min-width: 0); dropped the 150px .value-container minimum; value margin xlg → md One border; labels on 2/1/2 lines; pencil 21px from the card edge
Edit pencil is a bare <svg onClick> (no role, name or keyboard access); placeholder hardcoded "value" Core ButtonUtility with tooltip={t('label.edit-entity', { entity: label })} (its accessible name), keeping the same data-testid. Focus moves to the value input when editing opens and back to the edit button when it closes; placeholder → t('label.value') Button named "Edit Max Aggregate Size" etc.; focus input → button verified live

Blast radius:

  • CollapseHeader, EntitySearchSettings and GlobalSettingItem each have a single consumer, all in Search Settings.
  • The Playwright spec and unit tests click the pencil by its unchanged data-testid.
2-ranking-chips-and-add-buttons-dark 1-global-numeric-cards-dark

Type of change:

  • Bug fix

High-level design:

N/A — targeted layout fixes.

Tests:

Use cases covered

  • The Add buttons are inset.
  • Ranking chips are fully visible.
  • Numeric cards have a single border and readable labels.
  • The edit control is reachable and named.

Unit tests

  • Added to GlobalSettingsItem.test.tsx: the edit control is a button named via label.edit-entity. Pressing Enter on it moves focus into the value input, and Cancel returns focus to the button.
  • Control run: without the component changes, exactly this test fails.
  • Search Settings suites: 13 suites, 91 tests pass (SearchSettings components, SearchSettingsPage, CollapseHeader, platform-settings search views).
  • ESLint: 0 errors, 5 warnings (same as the base branch). tsc errors in the touched sources: 1, the same as the base. Design audit: no new warnings. Checkstyle: 0 errors.

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • No spec changes. SearchSettings.spec.ts (--project=Basic --workers=1, against this branch's UI on a local main stack) passes 11/11, including the two tests that open the editor through global-setting-edit-icon-*, which is now a button.

Manual testing performed

  1. Ran this branch's UI (vite) against a local stack built from main, AI mode, light and dark.
  2. Measured before (Fixes #35821: theme Search Settings colours for dark mode #35825) and after: button gaps, chip truncation (scrollWidth vs clientWidth), card borders, label line counts, the pencil's role and name, and its distance to the card edge.

UI screen recording:

Not applicable — layout fixes. Before/after screenshots are below.

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

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

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

Summary

This PR improves Search Settings spacing, theme colors, and keyboard access.

  • Entity search settings keep controls and field names inside their cards.
  • Numeric settings fit within one card instead of drawing a second border.
  • Numeric settings open from a named button and keep keyboard focus in the edit flow.
  • Unused Search Settings styles are removed without changing page behavior.

All three previous findings are addressed. No new actionable issues were found. Review covered the full PR because the previous and current commits have different merge bases with the target commit. Tests and live visual checks were not run; UI dependencies are absent.

Reviews (4) · Last reviewed commit: "Merge branch 'main' into fix/search-sett..." · Reviewed by Greptile

harsh-vador and others added 6 commits October 21, 2026 10:52
Search Settings mixed fixed LESS colours (@white, @blue-3, @team-avatar-bg,
@border-color-4/5, @primary-50) with theme-aware text, so dark mode left
white ranking cards with near-white text and low-contrast value chips.

- Ranking cards and field cards: bg-primary surface, border-secondary border
- Ranking stage description: text-tertiary
- Global setting values, field weight chips, entity count pill:
  utility-brand-50 fill with utility-brand-700 text (badge pattern)
- Drop the legacy text-primary class from the weight chip; its !important
  colour overrode the chip styling
- Delete the unused field value boost button rules (buttons are core
  Buttons with tokenized hover)
…bles

Per ADR:2026-10-16-less-colours-read-tailwind-bridge-vars, edited LESS
colours use the --tw-background-color-*, --tw-text-color-* and
--tw-border-color-* families. The ranking cards take the surface role so
they sit above the page in dark mode instead of matching it.
- CollapseHeader pads its trailing edge (tw:pe-6) so the Add buttons sit
  inset like the header trigger
- Ranking Details: drop the padding .configuration-container and p-box
  doubled on top of AccordionPanel; Fields spans the full row; chips get a
  tooltip with the full field name
- GlobalSettingItem fills its card without its own border/background, the
  value block no longer forces a 150px minimum, and the value margin is md
- The edit pencil is a core ButtonUtility named "Edit <setting>" instead of
  a clickable svg; the input placeholder uses label.value
@harsh-vador
harsh-vador requested a review from a team as a code owner October 21, 2026 08:54
@harsh-vador harsh-vador added the UI UI specific issues label Oct 21, 2026
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This 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 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!

@harsh-vador harsh-vador self-assigned this Oct 21, 2026
…hips inside the card

- GlobalSettingItem: the input takes focus when editing opens, and focus
  returns to the edit button when the editor closes (save or cancel), so
  keyboard users are not dropped to <body>
- Ranking field chips: wrap them in a core Tooltip with a max-w-full trigger;
  Badge's own tooltip wrapper is max-content, which let long names
  (usageSummary.*.percentileRank) overflow the Signals card by up to 32px
@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!

jsx-a11y/no-autofocus forbids autoFocus; the editor input now takes focus from the same effect that hands focus back to the edit button on close.
@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!

@harsh-vador harsh-vador added the safe to test Add this label to run secure Github workflows on PRs label Oct 21, 2026
…ing editor

A slow save closes the editor after the user may have moved on to another
setting; restoring focus unconditionally pulled it back. Focus now returns to
the edit button only when it is still inside this editor or was dropped to
<body> (the input disables while saving).
@harsh-vador
harsh-vador changed the base branch from fix/search-settings-dark-mode to main October 21, 2026 10:15
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 79%
79.01% (128182/162223) 65.37% (44953/68767) 68.39% (25690/37562)

@gitar-bot

gitar-bot Bot commented Oct 21, 2026

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

🟡 Medium risk · Changing numeric-setting edit controls and focus transitions could disrupt keyboard editing if focus is lost during save or cancel.

Search Settings layout fixes: "+ Add" buttons are inset from the panel edge, ranking field chips truncate within their cards, numeric setting cards show a single border, and the edit control is now a named, keyboard-accessible button that moves focus into the value input. Resolved a focus-restore issue after save, where focus could be pulled away from where the user had moved it. No open issues found.

✅ 1 closed
✅ Edge Case: Focus restore after save can pull focus away from where the user moved it

📄 openmetadata-ui/src/main/resources/ui/src/components/SearchSettings/GlobalSettingsItem/GlobalSettingsItem.tsx:54-68 📄 openmetadata-ui/src/main/resources/ui/src/components/SearchSettings/GlobalSettingsItem/GlobalSettingsItem.tsx:93
closeEditor() always sets restoreFocusRef, and the effect then focuses the edit button with no condition. During a slow onUpdate (the finally in handleSave), the user can Tab or click into another control or another settings card. When the save finishes, focus jumps back to this row's edit button and interrupts them. Only restore focus when it would otherwise be lost: when document.activeElement is document.body or is still inside this item.

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

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ UI Checkstyle passed — lint findings in changed files

🔍 ESLint findings in this PR's files — 0 error(s), 5 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), 5 warning(s) across 2 changed file(s).

Count Rule
3 react-hooks/exhaustive-deps
2 openmetadata-imports/no-lower-layer-page-imports
All findings
Location Rule Message
🟡 src/components/SearchSettings/EntitySeachSettings/EntitySearchSettings.tsx:56:1 openmetadata-imports/no-lower-layer-page-imports Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here.
🟡 src/components/SearchSettings/EntitySeachSettings/EntitySearchSettings.tsx:166:5 react-hooks/exhaustive-deps React Hook useMemo has a missing dependency: 'entityType'. Either include it or remove the dependency array.
🟡 src/components/SearchSettings/EntitySeachSettings/EntitySearchSettings.tsx:622:6 react-hooks/exhaustive-deps React Hook useEffect has a missing dependency: 'fetchSearchConfig'. Either include it or remove the dependency array.
🟡 src/components/SearchSettings/EntitySeachSettings/EntitySearchSettings.tsx:634:6 react-hooks/exhaustive-deps React Hook useEffect has a missing dependency: 'fetchCustomProperties'. Either include it or remove the dependency array.
🟡 src/components/SearchSettings/GlobalSettingsItem/GlobalSettingsItem.tsx:22:1 openmetadata-imports/no-lower-layer-page-imports Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here.

Fix locally (fast - only checks files changed in this branch):

make ui-checkstyle-changed

@sonarqubecloud

Copy link
Copy Markdown

@harsh-vador
harsh-vador enabled auto-merge October 21, 2026 12:30
@harsh-vador
harsh-vador disabled auto-merge October 21, 2026 12:31
@harsh-vador
harsh-vador added this pull request to the merge queue Oct 21, 2026
Merged via the queue into main with commit f50860d Oct 21, 2026
87 of 89 checks passed
@harsh-vador
harsh-vador deleted the fix/search-settings-layout branch October 21, 2026 19:18
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.

Search Settings layout: flush Add buttons, truncated ranking chips, double-bordered numeric cards, inaccessible edit icon

3 participants