Skip to content

Chore(UI): New service flow feedback#29697

Open
aniketkatkar97 wants to merge 5 commits into
mainfrom
fix-navigation-guard-modal-buttons
Open

Chore(UI): New service flow feedback#29697
aniketkatkar97 wants to merge 5 commits into
mainfrom
fix-navigation-guard-modal-buttons

Conversation

@aniketkatkar97

@aniketkatkar97 aniketkatkar97 commented Jul 2, 2026

Copy link
Copy Markdown
Member

Fixes #29696

This pull request makes improvements to the tab and modal components to enhance UI consistency and code maintainability. The main changes are focused on adjusting badge sizing in tabs to match the design system and refactoring the modal button layout for better structure.

Tab component improvements:

Modal component refactor:


Summary by Gitar

  • UI/UX improvements:
    • Reduced z-index of resizable-panels splitter to 50 to prevent UI overlay issues when the modal is open.
  • Component updates:
    • Added onClose={onStay} to NavigationGuardModal for consistent dialog behavior.
    • Updated Dialog.Footer in NavigationGuardModal with extra top margin.
  • Testing:
    • Added NavigationGuardModal.test.tsx to ensure proper modal rendering and action handling for onLeave and onStay callbacks.

This will update automatically on new commits.

Greptile Summary

This PR makes two focused UI improvements: badge sizing in the Tab component now follows a design-system rule (badge is always one size smaller than its tab), and the NavigationGuardModal close button is given explicit semantic meaning via onClose={onStay}.

  • tabs.tsx: A badgeSizeMapping constant (sm→xs, md→sm) replaces the direct size pass-through to Badge, along with a corrected conditional margin class that now fires on md-mapped badges rather than sm tabs.
  • NavigationGuardModal.tsx: onClose={onStay} is passed to Dialog so the X button consistently triggers the "stay" path; tw:sm:mt-3 adjusts footer spacing at the sm breakpoint. The Dialog implementation uses onClose ?? close, so onClose fully replaces the built-in dismiss — the parent remains responsible for setting isOpen=false.
  • NavigationGuardModal.test.tsx: New test suite covering closed-state rendering, open-state content, and isolated onLeave/onStay callback assertions.

Confidence Score: 5/5

Safe to merge — all three changed files contain narrow, intentional adjustments with no correctness concerns.

The badge-size mapping is well-typed and exhaustively covers all existing tab sizes. The NavigationGuardModal changes correctly leverage the Dialog component's onClose-replaces-close contract (confirmed by reading modal.tsx), and the new tests cover the key interaction paths.

No files require special attention.

Important Files Changed

Filename Overview
openmetadata-ui-core-components/src/main/resources/ui/src/components/application/tabs/tabs.tsx Introduces badgeSizeMapping to ensure badge sizes are always one step smaller than the tab size; updates Badge size prop and its conditional margin class accordingly. Well-typed with Record<keyof typeof sizes, Sizes>.
openmetadata-ui/src/main/resources/ui/src/components/common/NavigationGuardModal/NavigationGuardModal.tsx Adds explicit onClose={onStay} to Dialog so the X close button semantically matches "stay on page"; adds responsive top-margin class to Dialog.Footer. Dialog's implementation uses onClose ?? close, so onStay replaces (not supplements) the built-in close() call — parent is responsible for updating isOpen.
openmetadata-ui/src/main/resources/ui/src/components/common/NavigationGuardModal/NavigationGuardModal.test.tsx New test file covering closed-state rendering, open-state content rendering, and callback isolation for onLeave and onStay buttons. Good use of async findByRole for controlled modal rendering.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User triggers navigation away] --> B[NavigationGuardModal opens\nisOpen=true]
    B --> C{User action}
    C -->|Clicks Discard button| D[onLeave called\nParent navigates away\nisOpen=false]
    C -->|Clicks Continue Editing button| E[onStay called\nParent cancels navigation\nisOpen=false]
    C -->|Clicks X close button| F["onClose={onStay} fires\nonStay called\nParent cancels navigation\nisOpen=false"]
    C -->|Clicks ModalOverlay backdrop| G["onOpenChange false fires\nonStay called\nParent cancels navigation\nisOpen=false"]
    D --> H[Modal closes]
    E --> H
    F --> H
    G --> H
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[User triggers navigation away] --> B[NavigationGuardModal opens\nisOpen=true]
    B --> C{User action}
    C -->|Clicks Discard button| D[onLeave called\nParent navigates away\nisOpen=false]
    C -->|Clicks Continue Editing button| E[onStay called\nParent cancels navigation\nisOpen=false]
    C -->|Clicks X close button| F["onClose={onStay} fires\nonStay called\nParent cancels navigation\nisOpen=false"]
    C -->|Clicks ModalOverlay backdrop| G["onOpenChange false fires\nonStay called\nParent cancels navigation\nisOpen=false"]
    D --> H[Modal closes]
    E --> H
    F --> H
    G --> H
Loading

Reviews (5): Last reviewed commit: "Merge branch "main" into "fix-navigation..." | Re-trigger Greptile

@aniketkatkar97 aniketkatkar97 self-assigned this Jul 2, 2026
Copilot AI review requested due to automatic review settings July 2, 2026 10:24
@github-actions github-actions Bot added safe to test Add this label to run secure Github workflows on PRs UI UI specific issues labels Jul 2, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 addresses UI consistency feedback for the “new service flow” by aligning the service tabs badge sizing with the design system and by refactoring the Navigation Guard modal to use the shared modal footer component.

Changes:

  • Add a tab-size → badge-size mapping so tab badges render at a smaller, design-system-aligned size.
  • Update the Tab badge sizing + conditional styling to use the new mapping.
  • Refactor NavigationGuardModal actions to use Dialog.Footer instead of a custom wrapper.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
openmetadata-ui/src/main/resources/ui/src/components/common/NavigationGuardModal/NavigationGuardModal.tsx Switches the navigation guard modal action area to use Dialog.Footer for shared modal structure/styling.
openmetadata-ui-core-components/src/main/resources/ui/src/components/application/tabs/tabs.tsx Introduces a size mapping to ensure badges are smaller than their associated tab size and updates the Tab badge rendering accordingly.

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 63%
63.26% (71240/112598) 46.33% (41422/89400) 47.56% (12709/26719)

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

🔴 Playwright Results — 1 failure(s), 26 flaky

✅ 4479 passed · ❌ 1 failed · 🟡 26 flaky · ⏭️ 37 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 440 0 3 16
🔴 Shard 2 801 1 8 8
🟡 Shard 3 808 0 1 7
🟡 Shard 4 809 0 4 5
🟡 Shard 5 855 0 2 0
🟡 Shard 6 766 0 8 1

Genuine Failures (failed on all attempts)

Features/BulkEditEntity.spec.ts › Database (shard 2)
Error: �[2mexpect(�[22m�[31mlocator�[39m�[2m).�[22mtoHaveText�[2m(�[22m�[32mexpected�[39m�[2m)�[22m failed

Locator:  getByTestId('processed-row')
Expected: �[32m"1"�[39m
Received: �[31m"6"�[39m
Timeout:  90000ms

Call log:
�[2m  - Expect "toHaveText" with timeout 90000ms�[22m
�[2m  - waiting for getByTestId('processed-row')�[22m
�[2m    93 × locator resolved to <span class="font-semibold" data-testid="processed-row">6</span>�[22m
�[2m       - unexpected value "6"�[22m

🟡 26 flaky test(s) (passed on retry)
  • Flow/Tour.spec.ts › Tour should work from help section (shard 1, 2 retries)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab IS visible for supported type: metric (shard 1, 1 retry)
  • Flow/SearchRBAC.spec.ts › a dashboard-scoped user sees dashboards but never tables (shard 1, 1 retry)
  • Features/BulkEditEntity.spec.ts › Database Schema (shard 2, 1 retry)
  • Features/BulkEditEntity.spec.ts › Glossary Term (Nested) (shard 2, 2 retries)
  • Features/BulkImport.spec.ts › Database Schema (shard 2, 1 retry)
  • Features/BulkImport.spec.ts › Keyboard Delete selection (shard 2, 2 retries)
  • Features/ContextCenterPermission.spec.ts › user with view-only permission cannot see restore or delete actions on an archived document (shard 2, 1 retry)
  • Features/ContextCenterPermission.spec.ts › user with editAll permission can see restore action but not delete action on an archived document, and can restore it (shard 2, 1 retry)
  • Features/ContextCenterPermission.spec.ts › user with deleteAll permission can see delete action but not restore action on an archived document, and can delete it (shard 2, 1 retry)
  • Features/FailedTestCaseSampleData.spec.ts › FailedTestCaseSampleData (shard 2, 1 retry)
  • Features/SearchExport.spec.ts › Export queues a background job and downloads from the jobs tray (shard 3, 1 retry)
  • Flow/ExploreDiscovery.spec.ts › Should display domain and owner of deleted asset in suggestions when showDeleted is on (shard 4, 1 retry)
  • Pages/CustomProperties.spec.ts › Time (shard 4, 1 retry)
  • Pages/CustomProperties.spec.ts › Table (shard 4, 1 retry)
  • Pages/DataContractInheritance.spec.ts › Edit Asset Contract - Add SLA when inheriting SLA from Data Product (PATCH should use /add not /replace) (shard 4, 1 retry)
  • Pages/Domains.spec.ts › Domain Rbac (shard 5, 1 retry)
  • Pages/ExplorePageRightPanel_KnowledgeCenter.spec.ts › Should remove user owner for knowledgeCenter (shard 5, 1 retry)
  • Pages/ExplorePageRightPanel.spec.ts › Should allow Data Steward to view all tabs for searchIndex (shard 6, 1 retry)
  • Pages/Glossary.spec.ts › Column dropdown drag-and-drop functionality for Glossary Terms table (shard 6, 1 retry)
  • Pages/GlossaryImportExport.spec.ts › Glossary Bulk Import Export (shard 6, 1 retry)
  • Pages/GlossaryImportExport.spec.ts › Import partial success - some terms pass, some fail (shard 6, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify Impact Analysis service filter selection (shard 6, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab is NOT visible for pipelineService in platform lineage (shard 6, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab is NOT visible for apiService in platform lineage (shard 6, 1 retry)
  • Pages/ServiceEntity.spec.ts › Announcement create, edit & delete (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

Copilot AI review requested due to automatic review settings July 3, 2026 10:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

Copilot AI review requested due to automatic review settings July 3, 2026 15:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

@gitar-bot

gitar-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Improves UI consistency by centralizing tab badge sizing, refactoring NavigationGuardModal with semantic Dialog.Footer components, and adjusting resizable panel z-index to prevent modal overlap. Comprehensive test coverage added for all modal interaction paths; no issues found.

Options

Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqubecloud

sonarqubecloud Bot commented Jul 3, 2026

Copy link
Copy Markdown

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.

Navigation blocker modal and service page feedback

3 participants