Skip to content

Conversation

@rusackas
Copy link
Member

Summary

Migrates 15 core JavaScript/JSX files and 11 test files to TypeScript as part of the ongoing frontend modernization effort.

Files Migrated

Utilities & Middleware (3 files)

  • src/utils/common.jscommon.ts
  • src/middleware/loggerMiddleware.jsloggerMiddleware.ts
  • src/visualizations/presets/MainPreset.jsMainPreset.ts

Reports (2 files)

  • src/features/reports/ReportModal/actions.jsactions.ts
  • src/features/reports/ReportModal/reducer.jsreducer.ts

Explore (6 files)

  • src/explore/exploreUtils/index.jsindex.ts
  • src/explore/reducers/exploreReducer.jsexploreReducer.ts
  • src/explore/components/EmbedCodeContent.jsxEmbedCodeContent.tsx
  • src/explore/components/ExploreChartHeader/index.jsxindex.tsx
  • src/explore/components/ExploreViewContainer/index.jsxindex.tsx
  • src/explore/components/useExploreAdditionalActionsMenu/index.jsxindex.tsx

Chart & Datasource (4 files)

  • src/components/Chart/chartAction.jschartAction.ts
  • src/components/Chart/ChartRenderer.jsxChartRenderer.tsx
  • src/components/Datasource/components/DatasourceEditor/DatasourceEditor.jsxDatasourceEditor.tsx
  • src/components/Datasource/utils/index.jsindex.ts

Key Improvements

  • Added proper TypeScript interfaces for all components and functions
  • Replaced PropTypes with TypeScript interfaces
  • Added typed Redux actions and state interfaces
  • Zero any types used throughout

Testing Instructions

  1. Verify type checking passes: npm run type (note: pre-existing TS6305 errors in packages/plugins are unrelated)
  2. Verify linting passes: npm run lint
  3. Run affected tests: npm run test -- --testPathPattern="(common|logger|MainPreset|ReportModal|exploreUtils|exploreReducer|EmbedCodeContent|ExploreChartHeader|ExploreViewContainer|useExploreAdditionalActionsMenu|chartAction|ChartRenderer|DatasourceEditor)"

Additional Information

This PR excludes dashboard-related files which will be migrated in a separate PR due to their interconnected nature.

🤖 Generated with Claude Code

Migrates 15 core JavaScript/JSX files and 11 test files to TypeScript
as part of the ongoing frontend modernization effort.

Files migrated:
- src/utils/common.js → common.ts
- src/middleware/loggerMiddleware.js → loggerMiddleware.ts
- src/visualizations/presets/MainPreset.js → MainPreset.ts
- src/features/reports/ReportModal/actions.js → actions.ts
- src/features/reports/ReportModal/reducer.js → reducer.ts
- src/explore/exploreUtils/index.js → index.ts
- src/explore/reducers/exploreReducer.js → exploreReducer.ts
- src/explore/components/EmbedCodeContent.jsx → EmbedCodeContent.tsx
- src/explore/components/ExploreChartHeader/index.jsx → index.tsx
- src/explore/components/ExploreViewContainer/index.jsx → index.tsx
- src/explore/components/useExploreAdditionalActionsMenu/index.jsx → index.tsx
- src/components/Chart/chartAction.js → chartAction.ts
- src/components/Chart/ChartRenderer.jsx → ChartRenderer.tsx
- src/components/Datasource/components/DatasourceEditor/DatasourceEditor.jsx → DatasourceEditor.tsx
- src/components/Datasource/utils/index.js → index.ts

Key improvements:
- Added proper TypeScript interfaces for all components and functions
- Replaced PropTypes with TypeScript interfaces
- Added typed Redux actions and state interfaces
- Zero `any` types used throughout

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@dosubot dosubot bot added change:frontend Requires changing the frontend frontend:refactor Related to refactoring the frontend labels Jan 13, 2026
@apache apache deleted a comment from codeant-ai-for-open-source bot Jan 13, 2026
@apache apache deleted a comment from bito-code-review bot Jan 13, 2026
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@apache apache deleted a comment from codeant-ai-for-open-source bot Jan 13, 2026
Copy link
Contributor

@bito-code-review bito-code-review bot left a comment

Choose a reason for hiding this comment

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

Code Review Agent Run #55969a

Actionable Suggestions - 5
  • superset-frontend/src/features/reports/ReportModal/reducer.ts - 1
  • superset-frontend/src/features/reports/ReportModal/actions.ts - 4
Additional Suggestions - 3
  • superset-frontend/src/components/Chart/chartAction.ts - 1
    • Incorrect Timezone Handling in Data Age · Line 774-778
      The data_age logging mixes local time with UTC, which may produce incorrect age values in non-UTC timezones. Consider using UTC for both dates in the diff calculation.
      Code suggestion
       @@ -775,1 +775,1 @@
      -                  ? extendedDayjs(new Date()).diff(
      +                  ? extendedDayjs.utc(new Date()).diff(
  • superset-frontend/src/features/reports/ReportModal/actions.ts - 2
    • Inaccurate Error Message · Line 124-124
      The error message specifies 'dashboard' but fetchUISpecificReport is used for both dashboard and chart reports, leading to misleading feedback.
      Code suggestion
       @@ -120,9 +120,9 @@
      -      .catch(() => {
      -        dispatch(
      -          addDangerToast(
      -            t(
      -              'There was an issue fetching reports attached to this dashboard.',
      -            ),
      -          ),
      -        );
      -      });
      +      .catch(() => {
      +        dispatch(
      -          addDangerToast(
      -            t(
      -              'There was an issue fetching reports.',
      -            ),
      -          ),
      -        );
      -      });
    • Grammar Error in Message · Line 207-207
      The error message uses incorrect grammar; 'active' should be 'activate' to properly indicate the failure to activate or deactivate.
      Code suggestion
       @@ -204,7 +204,7 @@
      -      .catch(() => {
      -        dispatch(
      -          addDangerToast(
      -            t('We were unable to active or deactivate this report.'),
      -          ),
      -        );
      -      })
      +      .catch(() => {
      +        dispatch(
      -          addDangerToast(
      -            t('We were unable to activate or deactivate this report.'),
      -          ),
      -        );
      -      })
Review Details
  • Files reviewed - 8 · Commit Range: c1b3085..c1b3085
    • superset-frontend/src/components/Chart/chartAction.js
    • superset-frontend/src/components/Chart/chartAction.ts
    • superset-frontend/src/explore/reducers/exploreReducer.js
    • superset-frontend/src/explore/reducers/exploreReducer.ts
    • superset-frontend/src/features/reports/ReportModal/actions.js
    • superset-frontend/src/features/reports/ReportModal/actions.ts
    • superset-frontend/src/features/reports/ReportModal/reducer.js
    • superset-frontend/src/features/reports/ReportModal/reducer.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

Move DELETE_REPORT dispatch and success toast from .finally() to .then()
so they only execute on successful deletion, not on failure.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@netlify
Copy link

netlify bot commented Jan 13, 2026

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 4f743a5
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/69669ce0ed2eec00088bceba
😎 Deploy Preview https://deploy-preview-37107--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.

rusackas and others added 3 commits January 13, 2026 12:04
Use vizType (derived from currentFormData) instead of formData.viz_type
so drill-to-detail props are correctly enabled/disabled when the user
changes visualization type without re-running the query.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…ask is absent

Ensures custom setDataMask handlers work in non-dashboard/embedded contexts.

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

This comment was marked as outdated.

- common.ts: wrap return in Boolean() for proper boolean type
- logger.test.ts: add dispatch property to MockStore interface
- exploreReducer.ts: use flexible ExtendedControlState interface, fix SliceUpdatedAction owners type
- ReportModal/actions.ts: use ThunkDispatch for thunk actions, add error handling to addReport
- ReportModal/reducer.ts: cast through unknown for dynamic property access

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

@bito-code-review bito-code-review bot left a comment

Choose a reason for hiding this comment

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

Code Review Agent Run #706562

Actionable Suggestions - 1
  • superset-frontend/src/explore/reducers/exploreReducer.ts - 1
Additional Suggestions - 1
  • superset-frontend/src/explore/reducers/exploreReducer.ts - 1
    • Reduced type safety in control state · Line 178-178
      Changing ExtendedControlState from extending ControlState to a loose Record reduces type safety, as it no longer guarantees the required properties of ControlState. The reducer casts ExtendedControlState to ControlStateMapping, which expects ControlState objects, potentially allowing invalid control configurations.
Review Details
  • Files reviewed - 8 · Commit Range: 2230728..234c958
    • superset-frontend/src/components/Chart/chartAction.js
    • superset-frontend/src/components/Chart/chartAction.ts
    • superset-frontend/src/explore/reducers/exploreReducer.js
    • superset-frontend/src/explore/reducers/exploreReducer.ts
    • superset-frontend/src/features/reports/ReportModal/actions.js
    • superset-frontend/src/features/reports/ReportModal/actions.ts
    • superset-frontend/src/features/reports/ReportModal/reducer.js
    • superset-frontend/src/features/reports/ReportModal/reducer.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


interface SliceUpdatedAction {
type: typeof actions.SLICE_UPDATED;
slice: Omit<Slice, 'owners'> & {
Copy link
Contributor

Choose a reason for hiding this comment

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

Type mismatch in action interface

The SliceUpdatedAction interface expects owners as Array<{value: number; label: string}>, but the action creator sliceUpdated takes Slice with owners as number[]. This mismatch could cause runtime failures in the reducer handler when mapping owner.value, as the handler assumes owners are objects with value/label properties.

Code suggestion
Check the AI-generated fix before applying
Suggested change
slice: Omit<Slice, 'owners'> & {
slice: Slice & {
Citations

Code Review Run #706562


Should Bito avoid suggestions like this for future reviews? (Manage Rules)

  • Yes, avoid them

- actions.ts: add error handling to editReport, guard against empty charts
- chartAction.ts: fix RootState type, cast SupersetClient calls, add AnnotationLayerWithOverrides type

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

bito-code-review bot commented Jan 13, 2026

Code Review Agent Run #dcfec9

Actionable Suggestions - 0
Review Details
  • Files reviewed - 8 · Commit Range: 234c958..3fce4fe
    • superset-frontend/src/components/Chart/chartAction.js
    • superset-frontend/src/components/Chart/chartAction.ts
    • superset-frontend/src/explore/reducers/exploreReducer.js
    • superset-frontend/src/explore/reducers/exploreReducer.ts
    • superset-frontend/src/features/reports/ReportModal/actions.js
    • superset-frontend/src/features/reports/ReportModal/actions.ts
    • superset-frontend/src/features/reports/ReportModal/reducer.js
    • superset-frontend/src/features/reports/ReportModal/reducer.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

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

Labels

change:frontend Requires changing the frontend frontend:refactor Related to refactoring the frontend size/XXL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant