Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(Popover): Upgrade Popover to Antd5 #31973

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

alexandrusoare
Copy link
Contributor

@alexandrusoare alexandrusoare commented Jan 23, 2025

SUMMARY

Upgrading Popover component to Antd5.

Fixes #31953

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

BEFORE

image

AFTER

image

BEFORE

image

AFTER

image

BEFORE

image

AFTER

image

BEFORE

image

AFTER

image

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

Copy link

korbit-ai bot commented Jan 23, 2025

Based on your review schedule, I'll hold off on reviewing this PR until it's marked as ready for review. If you'd like me to take a look now, comment /korbit-review.

Your admin can change your review schedule in the Korbit Console

Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

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

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Fix Detected
Functionality Unreliable Header Access ▹ view
Functionality Redundant Z-Index Configuration ▹ view
Functionality Filter popover z-index issue in full-size mode ▹ view
Files scanned
File Path Reviewed
superset-frontend/src/components/Popover/index.tsx
superset-frontend/src/explore/components/controls/ConditionalFormattingControl/types.ts
superset-frontend/src/explore/components/controls/ConditionalFormattingControl/FormattingPopover.tsx
superset-frontend/src/explore/components/controls/ContourControl/ContourPopoverTrigger.tsx
superset-frontend/packages/superset-ui-chart-controls/src/components/SQLPopover.tsx
superset-frontend/src/components/Popover/Popover.stories.tsx
superset-frontend/src/dashboard/components/nativeFilters/FilterCard/index.tsx
superset-frontend/src/components/Table/header-renderers/HeaderWithRadioGroup.tsx
superset-frontend/src/dashboard/styles.ts
superset-frontend/src/GlobalStyles.tsx
superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterPopoverTrigger/index.tsx
superset-frontend/src/explore/components/controls/LayerConfigsControl/LayerConfigsControl.tsx
superset-frontend/src/explore/components/controls/MapViewControl/MapViewControl.tsx
superset-frontend/src/explore/components/controls/DndColumnSelectControl/ColumnSelectPopoverTrigger.tsx
superset-frontend/src/explore/components/controls/MapViewControl/MapViewPopoverContent.tsx
superset-frontend/src/explore/components/controls/ControlPopover/ControlPopover.tsx
superset-frontend/src/theme/index.ts
superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricPopoverTrigger.tsx
superset-frontend/src/dashboard/components/FiltersBadge/DetailsPanel/index.tsx
superset-frontend/src/explore/components/controls/AnnotationLayerControl/index.tsx
superset-frontend/src/explore/components/DataTableControl/index.tsx
superset-frontend/src/explore/components/controls/TimeSeriesColumnControl/index.jsx
superset-frontend/src/explore/components/controls/DateFilterControl/DateFilterLabel.tsx
superset-frontend/cypress-base/cypress/support/e2e.ts
superset-frontend/src/components/DropdownContainer/index.tsx
superset-frontend/cypress-base/cypress/e2e/dashboard/utils.ts
superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx
superset-frontend/cypress-base/cypress/support/directories.ts

Explore our documentation to understand the languages and file types we support and the files we ignore.

Need a new review? Comment /korbit-review on this PR and I'll review your latest changes.

Korbit Guide: Usage and Customization

Interacting with Korbit

  • You can manually ask Korbit to review your PR using the /korbit-review command in a comment at the root of your PR.
  • You can ask Korbit to generate a new PR description using the /korbit-generate-pr-description command in any comment on your PR.
  • Too many Korbit comments? I can resolve all my comment threads if you use the /korbit-resolve command in any comment on your PR.
  • Chat with Korbit on issues we post by tagging @korbit-ai in your reply.
  • Help train Korbit to improve your reviews by giving a 👍 or 👎 on the comments Korbit posts.

Customizing Korbit

  • Check out our docs on how you can make Korbit work best for you and your team.
  • Customize Korbit for your organization through the Korbit Console.

Current Korbit Configuration

General Settings
Setting Value
Review Schedule Automatic excluding drafts
Max Issue Count 10
Automatic PR Descriptions
Issue Categories
Category Enabled
Naming
Database Operations
Documentation
Logging
Error Handling
Systems and Environment
Objects and Data Structures
Readability and Maintainability
Asynchronous Processing
Design Patterns
Third-Party Libraries
Performance
Security
Functionality

Feedback and Support

Note

Korbit Pro is free for open source projects 🎉

Looking to add Korbit to your team? Get started with a free 2 week trial here

@@ -169,7 +169,7 @@ Cypress.Commands.add('login', () => {
}).then(response => {
if (response.status === 302) {
// If there's a redirect, follow it manually
const redirectUrl = response.headers['location'];
const redirectUrl = response.headers.location;
Copy link

Choose a reason for hiding this comment

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

Unreliable Header Access category Functionality

Tell me more
What is the issue?

The access of 'location' property directly from response.headers might be unreliable as some browsers normalize header names to lowercase while others preserve case sensitivity.

Why this matters

Different browsers handle HTTP header case sensitivity differently. The direct property access may lead to inconsistent behavior across different browsers and environments, potentially breaking the login functionality.

Suggested change ∙ Feature Preview

Use a case-insensitive method to access the header value:

const location = response.headers.get('location') || response.headers.get('Location');

💡 Does this comment miss the mark? Tell us why and Korbit will adapt to your team’s feedback.
💬 Chat with Korbit by mentioning @korbit-ai.

@@ -181,6 +181,7 @@ const baseConfig: ThemeConfig = {
},
Popover: {
colorBgElevated: supersetTheme.colors.grayscale.light5,
zIndexPopup: supersetTheme.zIndex.max,
Copy link

Choose a reason for hiding this comment

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

Redundant Z-Index Configuration category Functionality

Tell me more
What is the issue?

The zIndexPopup value is set redundantly in multiple component configurations (Dropdown, Menu, Popover) when it's already defined at the root level with zIndexPopupBase.

Why this matters

Having multiple identical z-index definitions can lead to inconsistencies if the base value needs to be changed in the future. The component-level zIndexPopup values are unnecessary since they inherit from zIndexPopupBase.

Suggested change ∙ Feature Preview

Remove the redundant zIndexPopup definitions from individual components since they inherit from the base configuration:

const baseConfig: ThemeConfig = {
  token: {
    zIndexPopupBase: supersetTheme.zIndex.max,
  },
  components: {
    Dropdown: {
      colorBgElevated: supersetTheme.colors.grayscale.light5,
      // remove zIndexPopup
    },
    Menu: {
      // ... other properties ...
      // remove zIndexPopup
    },
    Popover: {
      colorBgElevated: supersetTheme.colors.grayscale.light5,
      // remove zIndexPopup
    },
  }
}

💡 Does this comment miss the mark? Tell us why and Korbit will adapt to your team’s feedback.
💬 Chat with Korbit by mentioning @korbit-ai.

Comment on lines +659 to +665
{/* <Global
styles={css`
// @z-index-above-dashboard-header (100) + 1 = 101
${fullSizeChartId &&
`div > .filterStatusPopover.ant-popover{z-index: 101}`}
`}
/>
/> */}
Copy link

Choose a reason for hiding this comment

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

Filter popover z-index issue in full-size mode category Functionality

Tell me more
What is the issue?

The commented-out Global styles for the filterStatusPopover z-index may affect the visibility of filter popover when a chart is in full-size mode.

Why this matters

Without the z-index styling, the filter status popover might appear behind the full-size chart, making it inaccessible to users when they need to interact with filters while viewing a chart in full-size mode.

Suggested change ∙ Feature Preview

Re-enable the Global styles component to maintain proper z-index layering:

<Global
  styles={css`
    // @z-index-above-dashboard-header (100) + 1 = 101
    ${fullSizeChartId &&
    `div > .filterStatusPopover.ant-popover{z-index: 101}`}
  `}
/>

💡 Does this comment miss the mark? Tell us why and Korbit will adapt to your team’s feedback.
💬 Chat with Korbit by mentioning @korbit-ai.

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

Successfully merging this pull request may close these issues.

Ant Design 5: Upgrade Popover component
3 participants