Skip to content

Chore(UI): Allow decimal values in the search settings boost values#27410

Merged
aniketkatkar97 merged 7 commits intomainfrom
allow-decimal-impact
Apr 21, 2026
Merged

Chore(UI): Allow decimal values in the search settings boost values#27410
aniketkatkar97 merged 7 commits intomainfrom
allow-decimal-impact

Conversation

@aniketkatkar97
Copy link
Copy Markdown
Member

This pull request enhances the search settings test suite and improves the precision and reliability of field value boost and slider controls in the UI. The main changes include updating the Playwright test setup to better handle admin authentication, adding comprehensive tests for field value boost functionality, and increasing slider precision in several UI components.

Test Improvements and Admin Authentication:

  • Refactored the Playwright test setup in SearchSettings.spec.ts to use a dedicated admin user fixture, ensuring more reliable authentication and isolation for tests involving toast notifications. The performAdminLogin utility is now used instead of createNewPage for all admin actions. [1] [2] [3]

Field Value Boost E2E Coverage:

  • Added end-to-end tests for adding and removing field value boosts in search settings, including UI interactions and toast notification verifications.

Slider Precision Improvements:

  • Updated the Slider components in FieldConfiguration.tsx, FieldValueBoostModal.tsx, and TermBoost.tsx to support decimal steps (step={0.1}), allowing for more precise adjustments. [1] [2] [3]
  • Modified the slider utility in searchSettingUtils.ts to target .ant-slider-step for track dimensions, improving reliability of slider manipulation in tests.
Screen.Recording.2026-04-16.at.9.59.14.AM.mov

@aniketkatkar97 aniketkatkar97 self-assigned this Apr 16, 2026
@aniketkatkar97 aniketkatkar97 requested a review from a team as a code owner April 16, 2026 04:30
@aniketkatkar97 aniketkatkar97 added the To release Will cherry-pick this PR into the release branch label Apr 16, 2026
Copilot AI review requested due to automatic review settings April 16, 2026 04:30
@github-actions github-actions Bot added safe to test Add this label to run secure Github workflows on PRs UI UI specific issues labels Apr 16, 2026
@aniketkatkar97 aniketkatkar97 linked an issue Apr 16, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves Search Settings UI precision by allowing decimal slider values for boost/weight controls, and expands Playwright coverage for Search Settings updates (including field value boost add/remove), while refactoring test authentication utilities.

Changes:

  • Updated several Ant Design Slider controls to use step={0.1} for decimal precision.
  • Refactored SearchSettings.spec.ts to use an admin page fixture and performAdminLogin for admin actions.
  • Updated Playwright slider manipulation utility to compute dimensions using .ant-slider-step and added E2E flow for field value boosts.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
openmetadata-ui/src/main/resources/ui/src/components/SearchSettings/TermBoost/TermBoost.tsx Enables decimal term boost slider steps.
openmetadata-ui/src/main/resources/ui/src/components/SearchSettings/FieldValueBoostModal/FieldValueBoostModal.tsx Enables decimal factor slider steps for field value boosts.
openmetadata-ui/src/main/resources/ui/src/components/SearchSettings/FieldConfiguration/FieldConfiguration.tsx Enables decimal field weight slider steps.
openmetadata-ui/src/main/resources/ui/playwright/utils/searchSettingUtils.ts Adjusts slider dimension targeting for more reliable test interactions.
openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/SearchSettings.spec.ts Refactors admin authentication flow and adds E2E coverage for field value boost add/remove.
Comments suppressed due to low confidence (4)

openmetadata-ui/src/main/resources/ui/playwright/utils/searchSettingUtils.ts:100

  • The locator was changed to .ant-slider-step, but the thrown error still says “Slider track not found”. Updating the message to reflect the actual element being located will make failures much easier to debug.
  const sliderHandle = page.getByTestId(testId).locator('.ant-slider-handle');
  const sliderTrack = page.getByTestId(testId).locator('.ant-slider-step');

  // Get slider track dimensions
  const box = await sliderTrack.boundingBox();
  if (!box) {
    throw new Error('Slider track not found');
  }

openmetadata-ui/src/main/resources/ui/src/components/SearchSettings/FieldConfiguration/FieldConfiguration.tsx:185

  • With step={0.1}, slider onChange values can suffer from JS floating-point artifacts (e.g. 25.600000000000001) and the UI currently renders fieldWeight directly. Consider normalizing the value in handleWeightChange (e.g., round to 1 decimal) and/or formatting the displayed value so users don’t see long float representations.
            <Slider
              max={100}
              min={0}
              step={0.1}
              tooltip={{ open: false }}
              value={fieldWeight}
              onChange={handleWeightChange}
            />

openmetadata-ui/src/main/resources/ui/src/components/SearchSettings/FieldValueBoostModal/FieldValueBoostModal.tsx:164

  • With step={0.1}, factor may pick up floating-point artifacts and it’s rendered directly in the modal header. Consider rounding/normalizing the slider value in handleFactorChange (e.g., to 1 decimal) and/or formatting the displayed value to avoid showing long float representations.
            <Slider
              max={100}
              min={0}
              step={0.1}
              tooltip={{ open: false }}
              value={factor}
              onChange={handleFactorChange}
            />

openmetadata-ui/src/main/resources/ui/src/components/SearchSettings/TermBoost/TermBoost.tsx:169

  • With step={0.1}, termBoostData.boost may end up with floating-point artifacts and it’s rendered directly in the UI. Consider rounding/normalizing the slider value in handleBoostChange (e.g., to 1 decimal) and/or formatting the displayed value to avoid long float representations.
            <Slider
              max={100}
              min={0}
              step={0.1}
              tooltip={{ open: false }}
              value={termBoostData.boost}
              onChange={handleBoostChange}
            />

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 16, 2026

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 61%
61.94% (60265/97284) 41.98% (31615/75292) 45% (9495/21098)

Copilot AI review requested due to automatic review settings April 16, 2026 11:59
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Copilot AI review requested due to automatic review settings April 21, 2026 01:46
@open-metadata open-metadata deleted a comment from github-actions Bot Apr 21, 2026
@gitar-bot
Copy link
Copy Markdown

gitar-bot Bot commented Apr 21, 2026

Code Review ✅ Approved

Updates search settings to accept decimal values for boost factors, allowing for more granular ranking control. No issues found.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Comments suppressed due to low confidence (3)

openmetadata-ui/src/main/resources/ui/src/components/SearchSettings/FieldConfiguration/FieldConfiguration.tsx:185

  • With step={0.1}, fieldWeight can now be a decimal. The UI currently renders the value directly (and also pads values < 10 with a leading 0 in the header), which can lead to awkward formatting for decimals and potential floating-point artifacts. Consider rounding/formatting consistently (e.g., to 1 decimal) in all places this weight is displayed.
            <Slider
              max={100}
              min={0}
              step={0.1}
              tooltip={{ open: false }}
              value={fieldWeight}
              onChange={handleWeightChange}
            />

openmetadata-ui/src/main/resources/ui/src/components/SearchSettings/FieldValueBoostModal/FieldValueBoostModal.tsx:164

  • With step={0.1}, factor can now be a decimal. The modal displays factor directly, which can show long floating-point representations (and is inconsistent with other search-setting sliders that format to a fixed precision). Consider rounding/formatting the displayed value (and the saved value, if needed) to a consistent precision (e.g., 1 decimal).
            <Slider
              max={100}
              min={0}
              step={0.1}
              tooltip={{ open: false }}
              value={factor}
              onChange={handleFactorChange}
            />

openmetadata-ui/src/main/resources/ui/src/components/SearchSettings/TermBoost/TermBoost.tsx:169

  • With step={0.1}, termBoostData.boost can now be a decimal. The value is rendered directly, which can produce inconsistent/ugly formatting (and possible floating-point artifacts). Consider rounding/formatting the displayed boost to a consistent precision (e.g., 1 decimal).
            <Slider
              max={100}
              min={0}
              step={0.1}
              tooltip={{ open: false }}
              value={termBoostData.boost}
              onChange={handleBoostChange}
            />

@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown
Contributor

🟡 Playwright Results — all passed (18 flaky)

✅ 3692 passed · ❌ 0 failed · 🟡 18 flaky · ⏭️ 89 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 480 0 1 4
🟡 Shard 2 654 0 2 7
🟡 Shard 3 661 0 4 1
🟡 Shard 4 646 0 2 27
🟡 Shard 5 610 0 1 42
🟡 Shard 6 641 0 8 8
🟡 18 flaky test(s) (passed on retry)
  • Pages/AuditLogs.spec.ts › should apply both User and EntityType filters simultaneously (shard 1, 1 retry)
  • Features/BulkEditEntity.spec.ts › Database Schema (shard 2, 1 retry)
  • Features/Glossary/GlossaryHierarchy.spec.ts › should cancel move operation (shard 2, 1 retry)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 1 retry)
  • Features/RTL.spec.ts › Verify Following widget functionality (shard 3, 1 retry)
  • Flow/PersonaDeletionUserProfile.spec.ts › User profile loads correctly before and after persona deletion (shard 3, 1 retry)
  • Flow/PersonaFlow.spec.ts › Remove users in persona should work properly (shard 3, 1 retry)
  • Pages/Customproperties-part2.spec.ts › entityReferenceList shows item count, scrollable list, no expand toggle (shard 4, 1 retry)
  • Pages/DataContracts.spec.ts › Create Data Contract and validate for Table (shard 4, 1 retry)
  • Pages/Glossary.spec.ts › Add and Remove Assets (shard 5, 1 retry)
  • Pages/Glossary.spec.ts › Column dropdown drag-and-drop functionality for Glossary Terms table (shard 6, 1 retry)
  • Pages/Lineage/DataAssetLineage.spec.ts › verify create lineage for entity - Dashboard (shard 6, 1 retry)
  • Pages/Lineage/DataAssetLineage.spec.ts › verify create lineage for entity - Api Endpoint (shard 6, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard 6, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab IS visible for supported type: searchIndex (shard 6, 1 retry)
  • Pages/Lineage/PlatformLineage.spec.ts › Verify domain platform view (shard 6, 1 retry)
  • Pages/ServiceEntity.spec.ts › Delete Messaging Service (shard 6, 1 retry)
  • Pages/Users.spec.ts › Permissions for table details page for Data Consumer (shard 6, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@aniketkatkar97 aniketkatkar97 merged commit 255c635 into main Apr 21, 2026
56 checks passed
@aniketkatkar97 aniketkatkar97 deleted the allow-decimal-impact branch April 21, 2026 05:35
@github-actions
Copy link
Copy Markdown
Contributor

Failed to cherry-pick changes to the 1.12.6 branch.
Please cherry-pick the changes manually.
You can find more details here.

aniketkatkar97 added a commit that referenced this pull request Apr 21, 2026
…27410)

* Allow floating values for boost value sliders

* Fix the checkstyle

* Fix test flakiness

* Fix checkstyle
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 To release Will cherry-pick this PR into the release branch UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow decimal values for search settings boost values

3 participants