Skip to content

fix(AsyncSelect): call fireOnChange() only when past actually updates…#39298

Open
JCelento wants to merge 7 commits intoapache:masterfrom
JCelento:fix/search-copy-paste
Open

fix(AsyncSelect): call fireOnChange() only when past actually updates…#39298
JCelento wants to merge 7 commits intoapache:masterfrom
JCelento:fix/search-copy-paste

Conversation

@JCelento
Copy link
Copy Markdown
Contributor

@JCelento JCelento commented Apr 11, 2026

SUMMARY

  • AsyncSelect paste: onChange is only fired when paste actually changes the value. In single mode, pasting a value equal to the current selection no longer triggers onChange. In multiple mode, building the next value from selectValueRef avoids stale closures; pasting only tokens that are already selected does not update state or call onChange. Unit tests cover paste, deduplication, and the no-op onChange case for multiple modes.

  • Alerts / reports (AlertReportModal): The Chart field uses allowClear so the selection can be cleared from the UI. getChartVisualizationType returns early when the chart value is missing or invalid so /api/v1/chart/:id is not called with bad input after clear. Adds a test that clearing the chart drives the expected empty state.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

BEFORE

before-alert-fix under10mb

AFTER

after-alert-fix under10mb

TESTING INSTRUCTIONS

  1. Unit tests:
    cd superset-frontend && npm run test -- packages/superset-ui-core/src/components/Select/AsyncSelect.test.tsx
    npm run test -- src/features/alerts/AlertReportModal.test.tsx (or full suite as you prefer).

  2. Manual :

  • Go to Alerts & Reports
  • Click + Alert and navigate to Alert Contents
  • Select Charts
  • Paste any text into the chart selection field
    Expected results:
    The pasted text should be used to search and filter the list of available charts, the same way typing works.
  1. 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

@JCelento JCelento marked this pull request as draft April 11, 2026 20:39
@dosubot dosubot bot added the change:frontend Requires changing the frontend label Apr 11, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.42%. Comparing base (c971ea3) to head (57eae54).

❌ Your project check has failed because the head coverage (99.81%) is below the target coverage (100.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #39298   +/-   ##
=======================================
  Coverage   64.41%   64.42%           
=======================================
  Files        2554     2554           
  Lines      132660   132667    +7     
  Branches    30778    30780    +2     
=======================================
+ Hits        85459    85466    +7     
  Misses      45715    45715           
  Partials     1486     1486           
Flag Coverage Δ
javascript 66.11% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JCelento JCelento marked this pull request as ready for review April 13, 2026 13:00
@dosubot dosubot bot added the alert-reports Namespace | Anything related to the Alert & Reports feature label Apr 13, 2026
@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review bot commented Apr 13, 2026

Code Review Agent Run #42db95

Actionable Suggestions - 0
Review Details
  • Files reviewed - 4 · Commit Range: 4dc7413..08629eb
    • superset-frontend/packages/superset-ui-core/src/components/Select/AsyncSelect.test.tsx
    • superset-frontend/packages/superset-ui-core/src/components/Select/AsyncSelect.tsx
    • superset-frontend/src/features/alerts/AlertReportModal.test.tsx
    • superset-frontend/src/features/alerts/AlertReportModal.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

@pull-request-size pull-request-size bot added size/L and removed size/M labels Apr 13, 2026
@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review bot commented Apr 13, 2026

Code Review Agent Run #d53417

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: 08629eb..52e3b57
    • superset-frontend/packages/superset-ui-core/src/components/Select/AsyncSelect.test.tsx
    • superset-frontend/src/features/alerts/AlertReportModal.test.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

@JCelento JCelento force-pushed the fix/search-copy-paste branch from 52e3b57 to 6d97c75 Compare April 13, 2026 17:16
@JCelento JCelento force-pushed the fix/search-copy-paste branch from 7196f5b to fd8f980 Compare April 13, 2026 17:56
@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review bot commented Apr 13, 2026

Code Review Agent Run #adf21d

Actionable Suggestions - 0
Review Details
  • Files reviewed - 4 · Commit Range: 0a0f8f5..fd8f980
    • superset-frontend/packages/superset-ui-core/src/components/Select/AsyncSelect.test.tsx
    • superset-frontend/packages/superset-ui-core/src/components/Select/AsyncSelect.tsx
    • superset-frontend/src/features/alerts/AlertReportModal.test.tsx
    • superset-frontend/src/features/alerts/AlertReportModal.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

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

Labels

alert-reports Namespace | Anything related to the Alert & Reports feature change:frontend Requires changing the frontend packages size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant