Skip to content

fix(AlertReportModal): TypeError when pasting text into the Alerts content form search field#39298

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

fix(AlertReportModal): TypeError when pasting text into the Alerts content form search field#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

  • 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 -- 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.51%. Comparing base (f850c6b) to head (6a17ec9).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #39298   +/-   ##
=======================================
  Coverage   64.51%   64.51%           
=======================================
  Files        2557     2557           
  Lines      133057   133059    +2     
  Branches    30903    30904    +1     
=======================================
+ Hits        85843    85845    +2     
  Misses      45724    45724           
  Partials     1490     1490           
Flag Coverage Δ
javascript 66.34% <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 2 times, most recently 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

Comment on lines +1274 to +1276
if (!chart || typeof chart !== 'object' || chart.value === undefined) {
return;
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Isn't this the actual fix? Is the optimization in AsyncSelect necessary?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's correct. I'll remove the AsyncSelect optimization from this PR for better scoping. Do you think it is worth it for me to open another PR for the AsyncSelect optimization so that it can be reviewed with low priority?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@msyavuz rescoped and created another branch for the optimization. Thanks!

@pull-request-size pull-request-size bot added size/M and removed size/L labels Apr 14, 2026
@github-actions github-actions bot removed the packages label Apr 14, 2026
@JCelento JCelento changed the title fix(AsyncSelect): call fireOnChange() only when past actually updates… fix(AlertReportModal): TypeError when pasting text into the Alerts content form search field Apr 14, 2026
@JCelento JCelento force-pushed the fix/search-copy-paste branch from 84491bf to 15fa0c2 Compare April 14, 2026 13:33
@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review bot commented Apr 14, 2026

Code Review Agent Run #feaf18

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: e1bc1dc..15fa0c2
    • 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

@JCelento JCelento force-pushed the fix/search-copy-paste branch from 15fa0c2 to 1c47852 Compare April 14, 2026 18:24
@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review bot commented Apr 14, 2026

Code Review Agent Run #9af424

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: d29bad9..1c47852
    • 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

@JCelento JCelento force-pushed the fix/search-copy-paste branch from 1c47852 to 7ae6ea9 Compare April 15, 2026 12:04
@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review bot commented Apr 15, 2026

Code Review Agent Run #27471e

Actionable Suggestions - 0
Additional Suggestions - 1
  • superset-frontend/src/features/alerts/AlertReportModal.tsx - 1
    • Missing return type hint · Line 1273-1273
      Per organization guidelines in BITO.md, add explicit return type hints to all functions for consistency and type safety. The getChartVisualizationType function returns either undefined (early return) or a Promise (from the API call), so annotate it accordingly to improve readability and enable better static checking.
      Code suggestion
       @@ -1273,1 +1273,1 @@
      -  const getChartVisualizationType = (chart: SelectValue) => {
      +  const getChartVisualizationType = (chart: SelectValue): Promise<void> | undefined => {
Review Details
  • Files reviewed - 2 · Commit Range: 3250d30..7ae6ea9
    • 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

JCelento and others added 3 commits April 16, 2026 18:52
…s/Select/AsyncSelect.tsx

Co-authored-by: codeant-ai-for-open-source[bot] <244253245+codeant-ai-for-open-source[bot]@users.noreply.github.com>
@JCelento JCelento force-pushed the fix/search-copy-paste branch from 7ae6ea9 to 6a17ec9 Compare April 16, 2026 21:52
@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review bot commented Apr 16, 2026

Code Review Agent Run #610960

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: 71b9d73..6a17ec9
    • 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 size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants