Skip to content

Prevent Persona Home Page save when no widgets are configured and verify widget-based save state in Playwright#28579

Draft
Copilot wants to merge 4 commits into
mainfrom
copilot/fix-empty-widget-state
Draft

Prevent Persona Home Page save when no widgets are configured and verify widget-based save state in Playwright#28579
Copilot wants to merge 4 commits into
mainfrom
copilot/fix-empty-widget-state

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 1, 2026

Describe your changes:

  • Problem summary

    • Persona Home Page customization allowed saving with zero widgets, creating inconsistent behavior (editor allowed empty config; runtime fell back to defaults).
  • What changed

    • Save-state validation
      • CustomizeMyData treats an empty filtered widget layout as invalid and disables Save.
      • Addressed review feedback by inlining the empty-layout check in disableSave and removing the redundant isWidgetSelectionEmpty dependency from the memo deps.
    • User-facing warning
      • Added an inline warning when widget count is zero: message.minimum-widget-required.
    • i18n update
      • Added minimum-widget-required in en-us.json.
    • Unit coverage
      • Extended CustomizeMyData.test.tsx to assert Save is disabled and warning alert is rendered for empty layout.
    • Playwright coverage
      • Added E2E coverage in CustomizeLandingPage.spec.ts to validate Save button state transitions based on widget selection:
        • Save disabled when all widgets are removed.
        • Save enabled again after adding a widget back.

I worked on this because Persona configuration should enforce at least one widget at save time instead of silently allowing an empty config that later resolves to default widgets, and this behavior should be validated at both unit and E2E levels.

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

  • Persona Home Page customization with zero widgets shows a warning and prevents Save.
  • Save button state updates correctly as widget selection changes (disabled when empty, enabled when at least one widget exists).
  • Existing non-empty widget configurations continue to use normal save behavior.

Unit tests

  • I added unit tests for the new/changed logic.
  • Files added/updated:
    • openmetadata-ui/src/main/resources/ui/src/components/MyData/CustomizableComponents/CustomizeMyData/CustomizeMyData.test.tsx
  • Coverage on changed classes: N/A (targeted unit update only)
  • Coverage %: N/A

Backend integration tests

  • Not applicable (no backend API changes).
  • Files added/updated:

Ingestion integration tests

  • Not applicable (no ingestion changes).
  • Files added/updated:

Playwright (UI) tests

  • I added Playwright E2E tests under openmetadata-ui/.../ui/playwright/ for UI changes.
  • Files added/updated:
    • openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/CustomizeLandingPage.spec.ts

Manual testing performed

  • Ran targeted UI unit tests:
    • yarn test src/components/MyData/CustomizableComponents/CustomizeMyData/CustomizeMyData.test.tsx --runInBand
  • Ran Playwright lint on changed spec:
    • yarn lint:base './playwright/e2e/Flow/CustomizeLandingPage.spec.ts'

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.

Copilot AI changed the title [WIP] Fix Persona Home Page to support empty widget state Prevent Persona Home Page save when no widgets are configured Jun 1, 2026
Copilot AI requested a review from chirag-madlani June 1, 2026 09:32
@chirag-madlani
Copy link
Copy Markdown
Collaborator

@copilot Create a playwright test validating save button state based on the widget selection.
Also need to address this comment

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jun 1, 2026

@copilot Create a playwright test validating save button state based on the widget selection.
Also need to address [this comment](#28579 (comment)...

Addressed in 258cecd0.

  • Added Playwright test in playwright/e2e/Flow/CustomizeLandingPage.spec.ts to validate Save button state when widget selection becomes empty and after re-adding a widget.
  • Addressed linked feedback (discussion_r3333060077) by inlining the empty-layout check in disableSave and removing the redundant dependency in CustomizeMyData.tsx.

Copilot AI changed the title Prevent Persona Home Page save when no widgets are configured Prevent Persona Home Page save when no widgets are configured and verify widget-based save state in Playwright Jun 1, 2026
@gitar-bot
Copy link
Copy Markdown

gitar-bot Bot commented Jun 1, 2026

Code Review ✅ Approved 1 resolved / 1 findings

Prevents Persona Home Page save with zero widgets by adding validation logic and an inline warning message. The redundant widget selection dependency was removed from useMemo, successfully addressing the identified finding.

✅ 1 resolved
Bug: isWidgetSelectionEmpty in useMemo deps is a plain variable

📄 openmetadata-ui/src/main/resources/ui/src/components/MyData/CustomizableComponents/CustomizeMyData/CustomizeMyData.tsx:162 📄 openmetadata-ui/src/main/resources/ui/src/components/MyData/CustomizableComponents/CustomizeMyData/CustomizeMyData.tsx:170-171
On line 170, isWidgetSelectionEmpty is used inside the disableSave useMemo and listed in its dependency array (line 171). However, isWidgetSelectionEmpty is derived directly from filteredLayout.length (line 162) — it's a plain const, not state or a ref, so it's recomputed every render. Since filteredLayout is already in the dependency array and isWidgetSelectionEmpty is derived from it, including it is redundant but harmless. This is a minor readability concern — the memo could just inline the check.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 2, 2026

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Persona Home Page does Not Support Empty Widget State (Defaults to 6 Widgets)

2 participants