Skip to content

Refactor:Move MUI Components from Learning player model to Untitled Core Components#29550

Merged
anuj-kumary merged 6 commits into
mainfrom
refactor-learning-modal
Jun 29, 2026
Merged

Refactor:Move MUI Components from Learning player model to Untitled Core Components#29550
anuj-kumary merged 6 commits into
mainfrom
refactor-learning-modal

Conversation

@anuj-kumary

@anuj-kumary anuj-kumary commented Jun 27, 2026

Copy link
Copy Markdown
Member

Describe your changes:

Screen.Recording.2026-06-28.at.12.54.45.AM.mov

Type of change:

  • Bug fix
  • Improvement
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation

High-level design:

N/A — small change.

Tests:

Use cases covered

Unit tests

Backend integration tests

Ingestion integration tests

Playwright (UI) tests

Manual testing performed

UI screen recording / screenshots:

Not applicable.

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: I updated the migration scripts or explained why it is not needed.
  • 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.

Summary by Gitar

  • Component refactoring:
    • Replaced MUI Dialog with @openmetadata/ui-core-components Modal and ModalOverlay in ResourcePlayerModal.
    • Switched from MUI-based components (IconButton, Tooltip) to ButtonUtility and custom Badge components.
  • Style & Logic updates:
    • Migrated styling to use tailwind utility classes (tw:) and updated fullscreen toggle logic to target component IDs instead of refs.
    • Updated useWorkflowState hook to remove SelectChangeEvent dependency from MUI.

This will update automatically on new commits.

Greptile Summary

This PR refactors the ResourcePlayerModal component by replacing MUI (@mui/material) components with equivalents from the internal @openmetadata/ui-core-components library, aligning with the team's active effort to remove MUI from the codebase.

  • Modal layer: MUI Dialog is replaced with the ModalOverlay > Modal > Dialog hierarchy from the core component library; styling migrates from sx props to tw: Tailwind utility classes.
  • Controls & badges: MUI IconButton/TooltipButtonUtility, inline category chip Boxes → typed Badge components backed by a new CATEGORY_BADGE_COLORS map in Learning.interface.ts.
  • Hook cleanup: The SelectChangeEvent MUI import is removed from useWorkflowState in favour of an inline structural type; Playwright selectors switch from the fragile getByRole('dialog') to the stable data-testid attribute.

Confidence Score: 5/5

Safe to merge — this is a pure component-library swap with no behavioural changes to data fetching, auth, or navigation.

All four changed files are UI-layer only. The fullscreen and close logic is preserved from the original, and the three useEffect hooks that sync fullscreen state remain intact. The SelectChangeEvent removal in the hook is backward-compatible because the structural type is a supertype of the MUI one. Playwright selectors were updated in lockstep with the data-testid addition, keeping E2E coverage consistent.

No files require special attention.

Important Files Changed

Filename Overview
openmetadata-ui/src/main/resources/ui/src/components/Learning/ResourcePlayer/ResourcePlayerModal.component.tsx Full MUI-to-core-components refactor; ref-based fullscreen replaced by document.getElementById; sx props replaced with Tailwind; overall logic preserved correctly.
openmetadata-ui/src/main/resources/ui/src/components/Learning/Learning.interface.ts Adds CATEGORY_BADGE_COLORS mapping from ResourceCategory to BadgeColors type; clean extraction of color logic out of the component.
openmetadata-ui/src/main/resources/ui/src/hooks/useWorkflowState.ts Removes MUI SelectChangeEvent import; handler type replaced with a compatible structural type — existing logic already handles both shapes.
openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/LearningResources.spec.ts Test selectors updated from getByRole('dialog') to getByTestId('resource-player-dialog'), improving specificity and reducing brittleness.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant User
    participant ModalOverlay
    participant Dialog
    participant ResourcePlayerModal
    participant BrowserAPI as Browser Fullscreen API

    User->>ModalOverlay: "click resource card (open=true)"
    ModalOverlay->>Dialog: "render (width=1143)"
    Dialog->>ResourcePlayerModal: mount component
    ResourcePlayerModal->>ResourcePlayerModal: fetch resource by id
    ResourcePlayerModal-->>User: display modal with player

    User->>ResourcePlayerModal: click maximize button
    ResourcePlayerModal->>BrowserAPI: getElementById(FULLSCREEN_CONTAINER_ID).requestFullscreen()
    BrowserAPI-->>ResourcePlayerModal: fullscreenchange event → setIsFullScreen(true)
    ResourcePlayerModal-->>User: fullscreen layout (h-screen w-screen)

    User->>ResourcePlayerModal: click minimize button
    ResourcePlayerModal->>BrowserAPI: document.exitFullscreen()
    BrowserAPI-->>ResourcePlayerModal: fullscreenchange event → setIsFullScreen(false)
    ResourcePlayerModal-->>User: normal layout (max-h-[90vh])

    User->>ResourcePlayerModal: click close (or backdrop)
    ResourcePlayerModal->>ModalOverlay: onOpenChange(false) → onClose()
    ModalOverlay->>ResourcePlayerModal: "open=false"
    ResourcePlayerModal->>BrowserAPI: exitFullscreen() if active
    ResourcePlayerModal-->>User: modal dismissed
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"}}}%%
sequenceDiagram
    participant User
    participant ModalOverlay
    participant Dialog
    participant ResourcePlayerModal
    participant BrowserAPI as Browser Fullscreen API

    User->>ModalOverlay: "click resource card (open=true)"
    ModalOverlay->>Dialog: "render (width=1143)"
    Dialog->>ResourcePlayerModal: mount component
    ResourcePlayerModal->>ResourcePlayerModal: fetch resource by id
    ResourcePlayerModal-->>User: display modal with player

    User->>ResourcePlayerModal: click maximize button
    ResourcePlayerModal->>BrowserAPI: getElementById(FULLSCREEN_CONTAINER_ID).requestFullscreen()
    BrowserAPI-->>ResourcePlayerModal: fullscreenchange event → setIsFullScreen(true)
    ResourcePlayerModal-->>User: fullscreen layout (h-screen w-screen)

    User->>ResourcePlayerModal: click minimize button
    ResourcePlayerModal->>BrowserAPI: document.exitFullscreen()
    BrowserAPI-->>ResourcePlayerModal: fullscreenchange event → setIsFullScreen(false)
    ResourcePlayerModal-->>User: normal layout (max-h-[90vh])

    User->>ResourcePlayerModal: click close (or backdrop)
    ResourcePlayerModal->>ModalOverlay: onOpenChange(false) → onClose()
    ModalOverlay->>ResourcePlayerModal: "open=false"
    ResourcePlayerModal->>BrowserAPI: exitFullscreen() if active
    ResourcePlayerModal-->>User: modal dismissed
Loading

Reviews (5): Last reviewed commit: "Merge branch 'main' into refactor-learni..." | Re-trigger Greptile

@anuj-kumary anuj-kumary self-assigned this Jun 27, 2026
@anuj-kumary anuj-kumary requested a review from a team as a code owner June 27, 2026 19:26
@anuj-kumary anuj-kumary added UI UI specific issues safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check labels Jun 27, 2026
@github-actions

github-actions Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 62%
63.04% (70447/111749) 45.88% (40631/88558) 47.32% (12574/26567)

@github-actions

github-actions Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

🟡 Playwright Results — all passed (59 flaky)

✅ 4417 passed · ❌ 0 failed · 🟡 59 flaky · ⏭️ 38 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 322 0 3 4
🟡 Shard 2 821 0 8 9
🟡 Shard 3 822 0 7 7
🟡 Shard 4 827 0 4 10
🟡 Shard 5 854 0 20 0
🟡 Shard 6 771 0 17 8
🟡 59 flaky test(s) (passed on retry)
  • Features/DataAssetRulesEnabled.spec.ts › Verify the Store Procedure Entity Action items after rules is Enabled (shard 1, 1 retry)
  • Pages/AISettings.spec.ts › persists MCP Chat configuration after save (shard 1, 1 retry)
  • Flow/SearchRBAC.spec.ts › the browse tree only shows the asset-type categories a user can access (shard 1, 1 retry)
  • Features/BulkEditOperationBadges.spec.ts › Glossary bulk edit search filters rows and clear restores them (shard 2, 1 retry)
  • Features/BulkImport.spec.ts › Database Schema (shard 2, 1 retry)
  • Features/Container.spec.ts › Copy column link button should copy the column URL to clipboard (shard 2, 1 retry)
  • Features/Container.spec.ts › Copy column link should have valid URL format (shard 2, 1 retry)
  • Features/DataQuality/TestCaseImportExportBasic.spec.ts › should show validation errors for invalid CSV (shard 2, 2 retries)
  • Features/DataQuality/TestCaseImportExportE2eFlow.spec.ts › Admin: Complete export-import-validate flow (shard 2, 2 retries)
  • Features/GlobalPageSize.spec.ts › Page size should persist across different pages (shard 2, 1 retry)
  • Features/GlobalSearchSuggestions.spec.ts › Navigate to column from column suggestion (shard 2, 1 retry)
  • Features/LandingPageWidgets/FollowingWidget.spec.ts › Check followed entity present in following widget (shard 3, 1 retry)
  • Features/Permissions/EntityPermissions.spec.ts › MlModel allow entity-specific permission operations (shard 3, 1 retry)
  • Features/Permissions/EntityPermissions.spec.ts › Spreadsheet allow common operations permissions (shard 3, 1 retry)
  • Features/Permissions/EntityPermissions.spec.ts › Worksheet allow common operations permissions (shard 3, 1 retry)
  • Features/SearchExport.spec.ts › Export queues a background job and downloads from the jobs tray (shard 3, 1 retry)
  • Features/SearchIndexNestedColumns.spec.ts › 25-level oversized nested column indexes and is searchable by its deep column name (shard 3, 1 retry)
  • Features/Table.spec.ts › should persist page size (shard 3, 1 retry)
  • Flow/NestedChildrenUpdates.spec.ts › should update nested column description immediately without page refresh (shard 4, 1 retry)
  • Flow/NestedChildrenUpdates.spec.ts › should update nested column description immediately without page refresh (shard 4, 1 retry)
  • Pages/CustomProperties.spec.ts › Integer (shard 4, 2 retries)
  • Pages/CustomProperties.spec.ts › Set enum custom property on column and verify in UI (shard 4, 2 retries)
  • Pages/Entity.spec.ts › Delete File (shard 5, 1 retry)
  • Pages/Entity.spec.ts › Team as Owner Add, Update and Remove (shard 5, 1 retry)
  • Pages/Entity.spec.ts › Announcement create, edit & delete (shard 5, 1 retry)
  • Pages/Entity.spec.ts › Team as Owner Add, Update and Remove (shard 5, 1 retry)
  • Pages/Entity.spec.ts › User should be denied access to edit description when deny policy rule is applied on an entity (shard 5, 1 retry)
  • Pages/Entity.spec.ts › Glossary Term Add, Update and Remove (shard 5, 1 retry)
  • Pages/Entity.spec.ts › Tag and Glossary Selector should close vice versa (shard 5, 1 retry)
  • Pages/Entity.spec.ts › Glossary Term Add, Update and Remove (shard 5, 1 retry)
  • ... and 29 more

📦 Download artifacts

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

@sonarqubecloud

Copy link
Copy Markdown

@anuj-kumary anuj-kumary merged commit 2d23eff into main Jun 29, 2026
59 of 62 checks passed
@anuj-kumary anuj-kumary deleted the refactor-learning-modal branch June 29, 2026 15:00
@gitar-bot

gitar-bot Bot commented Jun 29, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Refactors the Learning player model by migrating MUI components to core UI components and updating styles to Tailwind utility classes. 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

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 skip-pr-checks Bypass PR metadata validation check UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants