Skip to content

Fixes #34870: Platform Settings part 4 — Search - #34896

Merged
chirag-madlani merged 1 commit into
chirag-madlani/ai-mode-settings-modal-pr3from
chirag-madlani/ai-mode-settings-modal-pr4
Oct 8, 2026
Merged

chirag-madlani merged 1 commit into
chirag-madlani/ai-mode-settings-modal-pr3from
chirag-madlani/ai-mode-settings-modal-pr4

Conversation

@chirag-madlani

@chirag-madlani chirag-madlani commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Describe your changes:

Fixes #34870

Stacked on #34888 (part 3), which is stacked on #34882 (part 2) and #34872 (part 1). Review those first. This PR's diff is only the part-4 commit, and GitHub retargets it as the earlier parts merge.

Moves the last classic Settings → Preferences page, Search, into the AI-mode settings modal's Platform Settings. With this, Platform Settings covers all 12 legacy pages. The new UI is built only from @openmetadata/ui-core-components; the classic Search pages are untouched.

Type of change:

  • New feature

High-level design:

Item sub-pages. Search has one page per entity type, so Platform Settings pages can now set hasItemViews. #platform-settings/search/<entity> opens that entity's settings, with its own title (getItemTitle) and breadcrumb. The header title and breadcrumb logic moved out of the panel into a pure getPageHeader util.

Global Search (SearchSettingsView, GlobalSearchSettings, HybridWeightsSection, NumberSettingRow, SearchEntityCards)

  • Keeps the classic behaviour: each change saves the full settings document straight away and refreshes the app's searchConfig.
  • Toggles: access control, and column indexing. Turning column indexing off asks for confirmation; turning it on shows the reindex message.
  • Limits: max aggregate size, max result hits and max analyzed offset are edited in place. Save is enabled only for an integer within the legacy bounds.
  • Hybrid weights: shown only where searchSettingsClassBase.showHybridSearchWeights() allows. The keyword weight is always the complement of the semantic weight.
  • Term boosts: saved with Save. Deleting a saved boost saves straight away; an unsaved new card is just dropped.
  • Field value boosts: add and edit go through a HookForm dialog. Add, edit and delete save straight away.
  • Reset: admin-only and confirmed first.
  • Entity cards: one card per entity type, from the same category list the classic page uses.

Per-entity Search (EntitySearchSettings, RankingSection, MatchingFieldCard, SearchPreviewPanel, TermBoostCard, FieldValueBoostTable, FieldValueBoostDialog)

  • As on the classic page, everything edits a draft that is saved together. Save (enabled once something changes) and Restore Defaults (confirmed first) sit in the modal header.
  • Ranking: algorithm, enabled switch, stage weights, signal modes and max boost.
  • Matching fields: includes custom properties (extension.*). Each field has weight, match type and highlighting; highlighting is offered only for fields the server marks highlightable.
  • Score and boost modes, plus term and field value boosts.
  • Preview: a live preview of the entity's index runs with the unsaved draft. It has debounced search, optional ranking details and pagination, and ignores stale responses.

Settings load once per mount on both pages. Under StrictMode, a second response could otherwise reset a draft or term boosts the user had already started editing (the same issue PR3 fixed in useSettingsFetch).

Tests:

Use cases covered

  • Global:
    • Each toggle saves the full document.
    • Column indexing: turning it off is confirmed (and can be cancelled); turning it on shows the reindex message.
    • Limits outside their range can't be saved.
    • Term boosts: saving an edit, deleting a saved one, and dropping an unsaved one.
    • Field value boosts: editing and deleting save straight away.
    • Hybrid weights are saved as complements.
    • Reset: confirmed, cancelled, or dismissed with Escape; hidden for non-admins.
    • A failed save leaves the settings unchanged.
    • Entity cards open the entity page.
  • Entity:
    • The draft drives the preview and is saved for that entity only; other entities are untouched.
    • Ranking switch, stage weight, signals and modes.
    • Field weight and match type.
    • Highlighting only on allowed fields.
    • Adding fields, including custom properties.
    • Term and field value boosts change the draft only.
    • Restore defaults.
    • An unknown entity returns to the list.
  • Preview: the request shape, debounced search, ranking details, pagination, the empty state and error toasts.
  • Routing: search/<entity> round-trips, its title and breadcrumbs, and the breadcrumb back to Search.

Unit tests

  • Added for the new logic. They use the real core components and HookForm; only the REST layer, app store and the result card are mocked.
  • Files: SearchSettingsView.test.tsx, EntitySearchSettings.test.tsx, SearchPreviewPanel.test.tsx, TermBoostCard.test.tsx, SearchSettings.utils.test.ts; updated PlatformSettings.utils.test.ts and PlatformSettingsPanel.test.tsx.
  • Results: 22 suites / 160 tests in the folder; all 105 Profile suites (705 tests) pass.
  • Coverage on the part-4 and touched files: 95.5% lines, every file ≥ 90%.

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Extended playwright/e2e/Features/ProfilePlatformSettings.spec.ts to 19 tests:
    • Global Search: saves stubbed on the settings round-trip, so tenant-wide search config never changes. The access-control toggle and a limit both save the full document.
    • Reset: the reset endpoint is stubbed. Cancel doesn't reset; Confirm does.
    • Entity page: deleting a matching field re-runs the preview with the draft, and Save writes it for table only.
    • The landing test now opens Search too.

Local run against a dev server (PLAYWRIGHT_IS_OSS=true, local backend on :8585):

Spec Result
Features/ProfilePlatformSettings.spec.ts 19/19 passed at 2 workers. At 4 workers the host load average was ~40 and part-1 tests timed out opening the modal too, so those runs weren't representative.
Canary and smoke sets Not run locally; left to the merge queue

Manual testing performed

  1. Local stack on :8585 with the UI dev server, logged in as admin, AI mode. Opened Settings → Administration → Platform Settings → Search.
  2. Global:
    • Toggled access control and saw the success toast.
    • Typed 50 into Max Result Hits and Save stayed disabled; 500 saved.
    • Added a term boost card; scrolled the field value boosts and entity cards.
    • Opened Reset and cancelled.
  3. Opened Tables:
    • Checked ranking stages and signals; expanded a matching field and changed its weight.
    • Opened the Add field menu, which lists custom properties and scrolls within the viewport.
    • Searched "orders" in the preview and turned on ranking details.
    • Opened Add Field Value Boost; then saved, and Save disabled again.

UI screen recording / screenshots:

Recording (platform-settings-pr4-walkthrough.mp4, 60s) and screenshots to be attached.

platform-settings-pr4-walkthrough.mp4
01-landing 02-search-global 03-search-global-boosts 04-search-entity-cards 05-entity-tables 06-entity-fields 06b-entity-signals 07-entity-field-open 08-entity-add-field-menu 09-entity-boosts 10-entity-fvb-dialog

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: Not applicable — no schema changes.

  • For UI changes: I attached a screen recording and/or screenshots above.

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

  • The issue properly describes why the new feature is needed, what's the goal, and how we are building it.

  • I have updated the documentation. Not applicable — UI move; no user-facing docs change.

  • I have added tests around the new logic.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR checks passed

The linked issue has a description and all required Shipping project fields set. Thanks!

@github-actions github-actions Bot added safe to test Add this label to run secure Github workflows on PRs UI UI specific issues labels Oct 8, 2026
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

🔄 Playwright impact map auto-refreshed

This PR touched specs or UI source that changed the source→spec routing map. I regenerated .github/playwright/impact-map.generated.json and pushed the diff to this branch.

- source entries: 852 → 874
- 23 added, 1 removed, 24 changed spec-list

New source→spec entries:
  openmetadata-ui/src/main/resources/ui/src/components/Settings/Email/TestEmail/TestEmail.component.tsx
  openmetadata-ui/src/main/resources/ui/src/components/common/atoms/drawer/AiFormModal.tsx
  openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/platform-settings/AppModeSettingsForm.tsx
  openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/platform-settings/DataAssetRulesSettings.tsx
  openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/platform-settings/DataQualitySettings.tsx
  openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/platform-settings/DimensionDeleteDialog.tsx
  openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/platform-settings/EmailSettings.tsx
  openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/platform-settings/HealthCheckSettings.tsx
  openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/platform-settings/LearningResourcesSettings.tsx
  openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/platform-settings/PlatformSettingsLanding.tsx
  … and 13 more

Removed source→spec entries:
  openmetadata-ui/src/main/resources/ui/src/pages/AppearanceConfigSettingsPage/AppearanceConfigSettingsPage.tsx

Entries whose spec list changed:
  openmetadata-ui/src/main/resources/ui/playwright/e2e/Utils/appMode.ts
  openmetadata-ui/src/main/resources/ui/playwright/support/fixtures/base.ts
  openmetadata-ui/src/main/resources/ui/playwright/utils/common.ts
  openmetadata-ui/src/main/resources/ui/playwright/utils/waitHelpers.ts
  openmetadata-ui/src/main/resources/ui/src/components/AppModeSwitcher/AppModeSwitcher.tsx
  openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/LineageConfigModal.tsx
  openmetadata-ui/src/main/resources/ui/src/components/MyData/CustomizableComponents/CustomizablePageHeader/CustomizablePageHeader.tsx
  openmetadata-ui/src/main/resources/ui/src/components/SearchSettings/EntitySeachSettings/EntitySearchSettings.tsx
  openmetadata-ui/src/main/resources/ui/src/components/SearchSettings/FieldConfiguration/FieldConfiguration.tsx
  openmetadata-ui/src/main/resources/ui/src/components/SearchSettings/SearchPreview/SearchPreview.tsx
  … and 14 more

What is this file? It is the auto-generated half of Playwright's PR planner. It routes "if source X changes, run specs Y" by walking spec imports and cross-referencing getByTestId strings. Hand-authored routing in impact-map.json always wins on conflict.

What if I want to regenerate locally instead? Run this before pushing your next change to skip the bot commit:

python3 .github/scripts/generate_playwright_impact_map.py
git add .github/playwright/impact-map.generated.json
git commit --amend --no-edit  # or a separate commit

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 76%
76.29% (120190/157531) 62.23% (74388/119531) 63.69% (24868/39041)

@chirag-madlani
chirag-madlani force-pushed the chirag-madlani/ai-mode-settings-modal-pr3 branch from 7dce727 to b1a1a7e Compare October 8, 2026 07:07
@chirag-madlani
chirag-madlani force-pushed the chirag-madlani/ai-mode-settings-modal-pr4 branch from cdc37c0 to 2768db9 Compare October 8, 2026 07:07
@chirag-madlani
chirag-madlani force-pushed the chirag-madlani/ai-mode-settings-modal-pr4 branch from 2768db9 to 47c082d Compare October 8, 2026 07:48
@chirag-madlani
chirag-madlani force-pushed the chirag-madlani/ai-mode-settings-modal-pr3 branch from b1a1a7e to 372c1eb Compare October 8, 2026 09:18
@chirag-madlani
chirag-madlani force-pushed the chirag-madlani/ai-mode-settings-modal-pr4 branch from 47c082d to 7d9952f Compare October 8, 2026 09:18
@chirag-madlani
chirag-madlani force-pushed the chirag-madlani/ai-mode-settings-modal-pr4 branch 2 times, most recently from 9a34ea0 to bb17587 Compare October 8, 2026 10:14
@chirag-madlani
chirag-madlani force-pushed the chirag-madlani/ai-mode-settings-modal-pr3 branch from 372c1eb to 844c4f4 Compare October 8, 2026 10:49
@chirag-madlani
chirag-madlani force-pushed the chirag-madlani/ai-mode-settings-modal-pr4 branch from bb17587 to b06c3e9 Compare October 8, 2026 10:49
Moves Settings > Preferences > Search into the AI-mode settings modal:
the global search settings (access control, column indexing, limits,
hybrid weights, term and field value boosts, reset) and one page per
entity (ranking, matching fields, modes, boosts) with a live preview of
the unsaved draft. Built on ui-core-components only.

Platform Settings pages can now have read-only item sub-pages at
<page>/<itemId>; header titles and breadcrumbs move into getPageHeader.
@chirag-madlani
chirag-madlani force-pushed the chirag-madlani/ai-mode-settings-modal-pr3 branch from 844c4f4 to 3f71a7c Compare October 8, 2026 10:54
@chirag-madlani
chirag-madlani force-pushed the chirag-madlani/ai-mode-settings-modal-pr4 branch from b06c3e9 to 2cc155c Compare October 8, 2026 10:54
@gitar-bot

gitar-bot Bot commented Oct 8, 2026

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

🔴 High risk · Adding controls to change search access control and ranking settings could expose restricted assets or alter which results users see.

Completes the Platform Settings migration by moving the classic Search page into the modal with per-entity configuration pages. Global search settings save immediately per toggle or limit change; per-entity settings draft together and save on confirmation. Resolved immediate-save term boost data loss, entity term boost deletion, preview refetch thrashing on slider edits, and failed-save editor dismissal. Comprehensive test coverage (95.5% lines, 160 unit tests, 19 Playwright tests) confirms the implementation. No issues remain.

✅ 4 closed
✅ Bug: Any immediate save throws away unsaved term boost edits

📄 openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/platform-settings/search/SearchSettingsView.tsx:80-88 📄 openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/platform-settings/search/SearchSettingsView.tsx:112-126 📄 openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/platform-settings/search/SearchSettingsView.tsx:201-209
Term boost edits stay in local termBoosts state until the user clicks Save. Other actions save immediately through updateGlobalSettings: toggles, limits, hybrid weights, and adding, editing or deleting a field value boost. That function writes config.globalSettings, which still has the old saved term boosts, and then applyConfig sets termBoosts back to the server value and clears termBoostsChanged. So if a user edits a boost and then flips any toggle, the boost edit is lost without any warning. Fix: in updateGlobalSettings, merge the local termBoosts into the payload when termBoostsChanged is true. Another option is to keep the local term boost state when the update does not touch termBoosts.

✅ Edge Case: Can't delete a new entity term boost once a tag is picked

📄 openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/platform-settings/search/EntitySearchSettings.tsx:269-278
When a tag is picked on a new card, TermBoostCard reports { value: tag, boost: 0 }. handleTermBoostChange ignores this because the boost is 0, so the boost never reaches the draft. If the user then clicks delete, handleTermBoostDelete gets a non-empty value and filters draft.termBoosts, which doesn't contain it. The new card stays on screen and the Add button stays disabled. SearchSettingsView avoids this by checking whether the value is in the list. Use the same check here.

✅ Performance: Preview refetches on every slider tick of a draft edit

📄 openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/platform-settings/search/SearchPreviewPanel.tsx:74-88 📄 openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/platform-settings/search/EntitySearchSettings.tsx:249-255
previewConfig is rebuilt on every draft change, and SearchPreviewPanel sends a new searchPreview request whenever searchConfig changes. Only the query text is debounced. Dragging a matching-field weight slider or a term-boost slider can therefore send dozens of search requests in a second. Each one also sets isLoading, so the results flicker to a skeleton. The stale-response guard keeps the results correct, but the backend still runs every request. The fix is to debounce the config before it reaches the fetch effect, as the search term already is.

✅ Bug: Failed saves still close the editor and drop the user's input

📄 openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/platform-settings/search/SearchSettingsView.tsx:114-128 📄 openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/platform-settings/search/SearchSettingsView.tsx:208-216 📄 openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/platform-settings/search/NumberSettingRow.tsx:52-60
updateGlobalSettings catches every error and only shows a toast, so its promise always resolves. NumberSettingRow.save runs setDraft(null) after await onSave(...), and handleSaveFieldValueBoost runs setEditingBoost(null). Both therefore run even when the PUT fails: the limit input or the field value boost dialog closes and the typed value is lost, even though nothing was saved. The fix is to make updateGlobalSettings return a success flag (or rethrow) and close the editor only when it succeeded.

Review coverage

📋 Rules No rules evaluated

🧪 Functional validation Not enabled · Set up

🤖 Auto-approval Not enabled · Set up

Options

Display: compact → Counting what did not apply, without listing it.

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

sonarqubecloud Bot commented Oct 8, 2026

Copy link
Copy Markdown

@chirag-madlani
chirag-madlani merged commit bb792d8 into chirag-madlani/ai-mode-settings-modal-pr3 Oct 8, 2026
68 of 69 checks passed
@chirag-madlani
chirag-madlani deleted the chirag-madlani/ai-mode-settings-modal-pr4 branch October 8, 2026 11:24
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.

Settings modal: Platform Settings — Search settings (global + per-entity)

1 participant