Skip to content

Conversation

@sadpandajoe
Copy link
Member

@sadpandajoe sadpandajoe commented Jan 28, 2026

SUMMARY

Bug fix: Export as Example was broken in subdirectory deployments (app prefix) because ensureAppRoot() double-prefixed the API endpoint — SupersetClient.get() already adds the app root internally, so the request went to /app/prefix/app/prefix/api/v1/... and returned 404.

Test infrastructure: Re-enables the skipped Dashboard Export Playwright E2E tests by creating a reusable Menu component that reliably handles Ant Design dropdown submenu interactions.

Changes

  • DownloadMenuItems/index.tsx — Remove ensureAppRoot() wrapper on Export as Example endpoint to fix double app-root prefix
  • DownloadMenuItems.test.tsx — Add unit tests asserting the correct endpoint path (prevents regression) and error toast on failure
  • Menu.ts (Playwright) — New reusable component with hover → keyboard → dispatchEvent fallback for opening Ant Design submenus; uses dispatchEvent('click') for item selection to bypass viewport/pointer interception from chart content; uses global TIMEOUT.FORM_LOAD constant and named ANIMATION_DELAY for maintainability
  • DashboardPage.ts (Playwright) — Add waitForChartsToLoad() using browser-context getComputedStyle visibility checks; add selectDownloadOption() using the Menu component
  • export.spec.ts (Playwright) — Remove skip, add 60s timeout for cold-cache CI runs, add download cleanup and toast assertions

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A — Export as Example silently failed (404) in app-prefix deployments; now works correctly.

TESTING INSTRUCTIONS

  1. Unit tests: npx jest --no-coverage src/dashboard/components/menu/DownloadMenuItems/DownloadMenuItems.test.tsx
  2. E2E tests: PLAYWRIGHT_ADMIN_PASSWORD=admin INCLUDE_EXPERIMENTAL=true npx playwright test --grep "Dashboard Export"
  3. Manual (app prefix): Deploy with APPLICATION_ROOT=/prefix/, open a dashboard, click Download → Export as Example — should download a zip (previously 404'd)

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

@bito-code-review
Copy link
Contributor

bito-code-review bot commented Jan 28, 2026

Code Review Agent Run #51c985

Actionable Suggestions - 0
Review Details
  • Files reviewed - 4 · Commit Range: 31db274..31db274
    • superset-frontend/playwright/components/core/Menu.ts
    • superset-frontend/playwright/components/core/index.ts
    • superset-frontend/playwright/pages/DashboardPage.ts
    • superset-frontend/playwright/tests/experimental/dashboard/export.spec.ts
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@dosubot dosubot bot added the dashboard:export Related to exporting dashboards label Jan 28, 2026
…nent

- Create Menu core component for Ant Design dropdown menu interactions
- Use hover-first approach with keyboard/dispatchEvent fallbacks
- Scope popup selector by filtering for expected item text (avoid wrong popup)
- Remove unused Menu methods (YAGNI): getItem, getSubmenu, selectItem, waitFor*
- Remove magic waitForTimeout(100) - rely on popup visibility wait
- Fix waitForChartsToLoad to wait for all indicators (count=0), not just first
- Keep waitForLoad and waitForChartsToLoad as separate methods
- Use existing Toast component for success toast assertions
- Add toast assertions to both Export YAML and Export as Example tests
- Add afterEach cleanup of downloaded files
- Export Toast from core components index

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@sadpandajoe sadpandajoe force-pushed the fix-dashboard-playwright-tests branch from 31db274 to 0f7ef7b Compare January 28, 2026 19:24
@netlify
Copy link

netlify bot commented Jan 28, 2026

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 0f7ef7b
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/697a6266bad3d0000849d0e4
😎 Deploy Preview https://deploy-preview-37529--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@bito-code-review
Copy link
Contributor

bito-code-review bot commented Jan 28, 2026

Code Review Agent Run #b73c4b

Actionable Suggestions - 0
Review Details
  • Files reviewed - 4 · Commit Range: 0f7ef7b..0f7ef7b
    • superset-frontend/playwright/components/core/Menu.ts
    • superset-frontend/playwright/components/core/index.ts
    • superset-frontend/playwright/pages/DashboardPage.ts
    • superset-frontend/playwright/tests/experimental/dashboard/export.spec.ts
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

…click

Two fixes for Dashboard Export test reliability:

1. waitForChartsToLoad: Loading indicators ([aria-label="Loading"]) persist
   in the DOM as hidden elements after charts load. Changed from DOM count
   check to browser-context getComputedStyle visibility evaluation, which
   returns immediately when charts are already loaded (no timeout penalty).
   Also increased default timeout from PAGE_LOAD (10s) to API_RESPONSE (15s)
   since chart data loading involves API calls.

2. Menu submenu click: Ant Design renders submenu popups in portals that can
   be positioned outside the viewport or behind chart content (z-index).
   Changed from Playwright click() to dispatchEvent('click') to bypass
   viewport and pointer interception checks.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@sadpandajoe sadpandajoe force-pushed the fix-dashboard-playwright-tests branch from ac2d5de to 11a900f Compare January 28, 2026 21:13
@bito-code-review
Copy link
Contributor

bito-code-review bot commented Jan 28, 2026

Code Review Agent Run #05856e

Actionable Suggestions - 0
Review Details
  • Files reviewed - 4 · Commit Range: 0f7ef7b..11a900f
    • superset-frontend/playwright/components/core/Menu.ts
    • superset-frontend/playwright/components/core/index.ts
    • superset-frontend/playwright/pages/DashboardPage.ts
    • superset-frontend/playwright/tests/experimental/dashboard/export.spec.ts
  • Files skipped - 0
  • Tools
    • Eslint (Linter) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

…dpoint

The Export as Example handler was wrapping the API endpoint with
ensureAppRoot() before passing it to SupersetClient.get(). Since
SupersetClient.getUrl() already prepends the app root internally,
this caused a double prefix (e.g., /app/prefix/app/prefix/api/v1/...)
when Superset is deployed under a subdirectory (APPLICATION_ROOT).

This made the Export as Example download silently fail in app_prefix
deployments — the API call returned a 404, so no download event fired
and the Playwright test timed out waiting for the download.

The Export YAML handler was not affected because it passes the raw
endpoint path without ensureAppRoot().

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@bito-code-review
Copy link
Contributor

bito-code-review bot commented Jan 28, 2026

Code Review Agent Run #93051c

Actionable Suggestions - 0
Review Details
  • Files reviewed - 5 · Commit Range: 11a900f..7c502b2
    • superset-frontend/playwright/components/core/Menu.ts
    • superset-frontend/playwright/components/core/index.ts
    • superset-frontend/playwright/pages/DashboardPage.ts
    • superset-frontend/playwright/tests/experimental/dashboard/export.spec.ts
    • superset-frontend/src/dashboard/components/menu/DownloadMenuItems/index.tsx
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

The World Health dashboard has multiple charts that can take 10-15s to
load on cold CI runs. Combined with menu interaction and download time,
the total exceeds the default 30s test timeout on first attempt.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@sadpandajoe sadpandajoe changed the title test(playwright): fix Dashboard Export tests with reliable Menu component fix(dashboard): fix Export as Example with app prefix and enable Dashboard Export E2E tests Jan 28, 2026
Copy link
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 fixes a critical bug in the Dashboard Export as Example feature that caused 404 errors on Superset deployments using APPLICATION_ROOT (subdirectory deployments), and re-enables previously skipped E2E tests.

Changes:

  • Fixed double-prefix bug in Export as Example by removing incorrect ensureAppRoot() wrapper before passing endpoint to SupersetClient.get()
  • Created reusable Menu core component with robust fallback strategy for Ant Design dropdown submenu interactions (hover → keyboard → dispatchEvent)
  • Improved chart loading detection in DashboardPage using browser-context visibility evaluation instead of DOM element count

Reviewed changes

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

Show a summary per file
File Description
superset-frontend/src/dashboard/components/menu/DownloadMenuItems/index.tsx Removed ensureAppRoot() wrapper causing double-prefix bug in Export as Example endpoint
superset-frontend/playwright/tests/experimental/dashboard/export.spec.ts Consolidated and re-enabled 2 E2E tests (Export YAML and Export as Example) with proper cleanup
superset-frontend/playwright/pages/DashboardPage.ts Added waitForChartsToLoad() method and refactored download methods to use new Menu component
superset-frontend/playwright/components/core/Menu.ts New reusable Menu component with three-tier fallback strategy for reliable submenu interaction
superset-frontend/playwright/components/core/index.ts Exported Menu and Toast components

@bito-code-review
Copy link
Contributor

bito-code-review bot commented Jan 29, 2026

Code Review Agent Run #4a53fd

Actionable Suggestions - 0
Review Details
  • Files reviewed - 6 · Commit Range: 7c502b2..8025b0e
    • superset-frontend/playwright/components/core/Menu.ts
    • superset-frontend/playwright/components/core/index.ts
    • superset-frontend/playwright/pages/DashboardPage.ts
    • superset-frontend/playwright/tests/experimental/dashboard/export.spec.ts
    • superset-frontend/src/dashboard/components/menu/DownloadMenuItems/DownloadMenuItems.test.tsx
    • superset-frontend/src/dashboard/components/menu/DownloadMenuItems/index.tsx
  • Files skipped - 0
  • Tools
    • Eslint (Linter) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

…ror handling

Adds tests to verify SupersetClient.get is called with the correct
endpoint path (no double app-root prefix) and that error/success toasts
are shown appropriately.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@sadpandajoe sadpandajoe force-pushed the fix-dashboard-playwright-tests branch from 8025b0e to 09e01a7 Compare January 29, 2026 01:05
@bito-code-review
Copy link
Contributor

bito-code-review bot commented Jan 29, 2026

Code Review Agent Run #e9121e

Actionable Suggestions - 0
Review Details
  • Files reviewed - 6 · Commit Range: 0f7ef7b..09e01a7
    • superset-frontend/playwright/components/core/Menu.ts
    • superset-frontend/playwright/components/core/index.ts
    • superset-frontend/playwright/pages/DashboardPage.ts
    • superset-frontend/playwright/tests/experimental/dashboard/export.spec.ts
    • superset-frontend/src/dashboard/components/menu/DownloadMenuItems/DownloadMenuItems.test.tsx
    • superset-frontend/src/dashboard/components/menu/DownloadMenuItems/index.tsx
  • Files skipped - 0
  • Tools
    • Eslint (Linter) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

- Remove invalid `{ timeout }` arg from dispatchEvent (not a valid option)
- Replace local SUBMENU_OPEN constant with global TIMEOUT.FORM_LOAD
- Extract magic number 150ms to named ANIMATION_DELAY constant

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@bito-code-review
Copy link
Contributor

bito-code-review bot commented Jan 29, 2026

Code Review Agent Run #f07ffa

Actionable Suggestions - 0
Review Details
  • Files reviewed - 6 · Commit Range: 09e01a7..693ea1c
    • superset-frontend/playwright/components/core/Menu.ts
    • superset-frontend/playwright/components/core/index.ts
    • superset-frontend/playwright/pages/DashboardPage.ts
    • superset-frontend/playwright/tests/experimental/dashboard/export.spec.ts
    • superset-frontend/src/dashboard/components/menu/DownloadMenuItems/DownloadMenuItems.test.tsx
    • superset-frontend/src/dashboard/components/menu/DownloadMenuItems/index.tsx
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

Copy link
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 6 out of 6 changed files in this pull request and generated no new comments.

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

Labels

dashboard:export Related to exporting dashboards size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant