Skip to content

chore: Upgrade to React 18 - #38563

Merged
msyavuz merged 46 commits into
masterfrom
msyavuz/chore/react-18-clean
May 4, 2026
Merged

msyavuz merged 46 commits into
masterfrom
msyavuz/chore/react-18-clean

Conversation

@msyavuz

@msyavuz msyavuz commented Mar 10, 2026 •

Copy link
Copy Markdown
Member

User description

SUMMARY

Upgrade to React 18

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

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

CodeAnt-AI Description

Upgrade frontend to React 18 and migrate rendering, drag-and-drop, and tests

What Changed

  • The app and embedded frontends now use React 18 root rendering so pages and embedded views mount with the React 18 renderer.
  • Charts placed on maps are mounted and unmounted with the React 18 renderer, preventing leftover chart DOM when maps or visualizations update.
  • Collection item lists now use a dnd-kit-based drag-and-drop with explicit drag handles, restoring stable reordering and reducing accidental drags.
  • Tests and testing helpers were migrated to @testing-library/react v14 and updated patterns (renderHook/waitFor/act) to reduce flaky test behavior.
  • Multiple UI props (icons, labels, children) now accept generic React nodes so components render custom icons and label content more reliably.

Impact

✅ React 18 rendering for app and embedded views
✅ Reliable chart removal on maps (no leftover DOM)
✅ Stable item reordering in collection controls

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

msyavuz and others added 2 commits March 10, 2026 19:20
- Bump react, react-dom to ^18.2.0
- Bump @types/react, @types/react-dom to ^18.2.0
- Migrate ReactDOM.render() to createRoot() in all entry points
- Upgrade @testing-library/react to ^14.0.0
- Remove @testing-library/react-hooks (merged into RTL 14)
- Migrate 54 test files from @testing-library/react-hooks imports
- Replace react-sortable-hoc with @dnd-kit/sortable (CollectionControl)
- Remove @cypress/react (incompatible with React 18, Cypress deprecated)
- Update all sub-package peerDependencies to ^18.2.0
- Migrate ChartLayer (cartodiagram) from ReactDOM.render to createRoot

Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Add children prop to components that lost implicit children (React.FC)
- Fix ReactNode type narrowing (Date, bigint, object, function types)
- Replace waitForNextUpdate with waitFor in renderHook tests (RTL 14)
- Add @ts-expect-error for react-dnd DndProvider children prop
- Forward ref in CustomListItem for dnd-kit sortable
- Fix icon prop types to use ReactNode
- Update ui-overrides root.context.provider type for children

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@dosubot dosubot Bot added the change:frontend Requires changing the frontend label Mar 10, 2026
@msyavuz msyavuz changed the title Msyavuz/chore/react 18 clean chore: React 18 Mar 10, 2026
@codeant-ai-for-open-source codeant-ai-for-open-source Bot added the size:XL This PR changes 500-999 lines, ignoring generated files label Mar 10, 2026
@codeant-ai-for-open-source codeant-ai-for-open-source Bot changed the title chore: React 18 Msyavuz/chore/react 18 clean Mar 10, 2026
@codeant-ai-for-open-source

Copy link
Copy Markdown
Contributor

Sequence Diagram

This PR reimplements the Explore CollectionControl drag-and-drop using dnd-kit, so reordering items now flows through a DnD context that updates the collection value via arrayMove and calls the parent onChange handler.

sequenceDiagram
    participant User
    participant CollectionControl
    participant DnD
    participant ParentForm

    User->>CollectionControl: Drag collection item handle
    CollectionControl->>DnD: Start drag session with item id
    User->>DnD: Drop item at new position
    DnD-->>CollectionControl: Drag end with active and over ids
    CollectionControl->>CollectionControl: Compute new order with arrayMove
    CollectionControl->>ParentForm: onChange(updated collection items)
    ParentForm-->>CollectionControl: Rerender with new item order
Loading

Generated by CodeAnt AI

Comment on lines 53 to 60
'state' | 'sql' | 'progress' | 'results' | 'duration' | 'started'
> {
state?: Record<string, any>;
sql?: Record<string, any>;
progress?: Record<string, any>;
results?: Record<string, any>;
state?: ReactNode;
sql?: ReactNode;
progress?: ReactNode;
results?: ReactNode;
duration?: ReactNode;
started?: ReactNode;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggestion: The QueryTableQuery type omits and redefines several fields from QueryResponse to be ReactNode, but user and db are not omitted and thus retain their original Record<string, any> types while later being assigned JSX elements, creating a type mismatch that breaks the contract of QueryTableQuery and can cause TypeScript errors or misuse of these fields as non-object values elsewhere. [type error]

Severity Level: Critical 🚨
- ❌ SqlLab QueryTable file fails TypeScript type-checking.
- ❌ Frontend build/tests can fail, blocking deployments.
- ⚠️ Query history UI cannot be shipped with current types.
Suggested change
'state' | 'sql' | 'progress' | 'results' | 'duration' | 'started'
> {
state?: Record<string, any>;
sql?: Record<string, any>;
progress?: Record<string, any>;
results?: Record<string, any>;
state?: ReactNode;
sql?: ReactNode;
progress?: ReactNode;
results?: ReactNode;
duration?: ReactNode;
started?: ReactNode;
'state' | 'sql' | 'progress' | 'results' | 'duration' | 'started' | 'user' | 'db'
> {
state?: ReactNode;
sql?: ReactNode;
progress?: ReactNode;
results?: ReactNode;
duration?: ReactNode;
started?: ReactNode;
user?: ReactNode;
db?: ReactNode;
Steps of Reproduction ✅
1. Open `superset-frontend/src/SqlLab/components/QueryTable/index.tsx` and locate
`QueryTableQuery` at lines 51–61, which extends `QueryResponse` but only omits `'state' |
'sql' | 'progress' | 'results' | 'duration' | 'started'`.

2. In the same file, inspect the `data` `useMemo` mapping at lines 250–279 where `const q
= rest as QueryTableQuery;` is created and `q.user` and `q.db` are assigned JSX `<Button>`
elements (lines 262–279).

3. Inspect `superset-frontend/src/SqlLab/fixtures.ts` where `baseQuery: QueryResponse` is
defined at lines 587–672 and note that `db` and `user` are initialized as objects: `db: {
key: 'main' }` and `user: { key: 'admin' }` at lines 611–612, evidencing that
`QueryResponse['db']` and `QueryResponse['user']` are object-shaped, not ReactNode.

4. Run the TypeScript type checker or frontend build (e.g., `npm test` or `npm run build`)
in this PR: the compiler will type-check `QueryTable/index.tsx`, see `q.user` and `q.db`
being assigned React elements where their inherited types from `QueryResponse` are object
types, and emit errors similar to "Type 'ReactElement<...>' is not assignable to type
'Record<string, any>'" for these assignments, causing the SqlLab frontend to fail
compilation.
Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** superset-frontend/src/SqlLab/components/QueryTable/index.tsx
**Line:** 53:60
**Comment:**
	*Type Error: The `QueryTableQuery` type omits and redefines several fields from `QueryResponse` to be `ReactNode`, but `user` and `db` are not omitted and thus retain their original `Record<string, any>` types while later being assigned JSX elements, creating a type mismatch that breaks the contract of `QueryTableQuery` and can cause TypeScript errors or misuse of these fields as non-object values elsewhere.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
👍 | 👎

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This seems relevant as well

error: Error,
info: { componentStack: string } | null,
) {
handleRenderContainerFailure(error: Error, info: ErrorInfo) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggestion: The error handler logs chart render metrics using this.renderStartTime, but this field is never initialized in the Chart component, so start_offset will be undefined and duration will be NaN, producing invalid telemetry data whenever the error boundary is triggered. Use a safe fallback when renderStartTime is not a valid number so that logging always uses numeric values. [logic error]

Severity Level: Major ⚠️
- ⚠️ Chart error telemetry has undefined start_offset and NaN duration.
- ⚠️ LOG_ACTIONS_RENDER_CHART analytics receive corrupted timing data.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What the AI suggest sounds interesting. What do you think?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

renderStartTime is declared as any (not in this PR) and never assigned anywhere in this file, so when ErrorBoundary triggers handleRenderContainerFailure we dispatch start_offset: undefined and duration: NaN to LOG_ACTIONS_RENDER_CHART, which also violates the number contract declared on Actions.logEvent. ChartRenderer and Markdown already handle this correctly (typed as number, initialized in the constructor, refreshed before render).
Suggest doing the same here: type as number and set this.renderStartTime = Logger.getTimestamp() in the constructor, so the offset is always finite even if the boundary fires before componentDidMount.

@bito-code-review bito-code-review Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review Agent Run #139db3

Actionable Suggestions - 2
  • superset-frontend/src/features/reports/ReportModal/index.tsx - 1
  • superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/getControlItemsMap.tsx - 1
    • Inconsistent function handling for config properties · Line 231-231
Additional Suggestions - 4
  • superset-frontend/src/features/home/types.ts - 1
    • Missing children prop handling in RightMenu component · Line 49-49
      The children prop is added to RightMenuProps but the RightMenu component does not destructure or render it, so any passed children would be ignored. This could lead to unexpected behavior if the component is intended to support children.
  • superset-frontend/src/explore/components/controls/CollectionControl/index.tsx - 2
    • Prohibit 'any' type usage · Line 102-102
      The code uses 'any' in React.ComponentType, violating TypeScript standards that prohibit 'any' types. Consider defining a proper union type for control component props or using 'unknown' if props vary widely.
    • Add return type hints · Line 68-68
      Add explicit return type annotations to component functions DragHandle, SortableItem, and CollectionControl as required by codebase standards for all functions and methods.
      Code suggestion
       @@ -68,1 +68,1 @@
      -function DragHandle() {
      +function DragHandle(): JSX.Element {
  • superset-frontend/src/explore/components/StashFormDataContainer/index.tsx - 1
    • Require children prop · Line 28-28
      The children prop is currently optional, but all usages of this container component provide children, and the component renders them. Making it required improves type safety and prevents potential misuse.
      Code suggestion
       @@ -28,1 +28,1 @@
      -  children?: ReactNode;
      +  children: ReactNode;
Review Details
  • Files reviewed - 97 · Commit Range: 51b47f9..09b341f
    • superset-frontend/packages/superset-core/src/theme/utils/themeUtils.test.ts
    • superset-frontend/packages/superset-ui-core/src/components/AsyncAceEditor/useJsonValidation.test.ts
    • superset-frontend/packages/superset-ui-core/src/components/Button/types.ts
    • superset-frontend/packages/superset-ui-core/src/components/Label/Label.test.tsx
    • superset-frontend/packages/superset-ui-core/src/components/TableCollection/TableCollection.test.tsx
    • superset-frontend/packages/superset-ui-core/src/components/TableCollection/utils.tsx
    • superset-frontend/packages/superset-ui-core/src/components/TruncatedList/index.tsx
    • superset-frontend/packages/superset-ui-core/src/hooks/useChangeEffect/useChangeEffect.test.ts
    • superset-frontend/packages/superset-ui-core/src/hooks/useComponentDidMount/useComponentDidMount.test.ts
    • superset-frontend/packages/superset-ui-core/src/hooks/useComponentDidUpdate/useComponentDidUpdate.test.ts
    • superset-frontend/packages/superset-ui-core/src/hooks/useElementOnScreen/useElementOnScreen.test.ts
    • superset-frontend/packages/superset-ui-core/src/hooks/usePrevious/usePrevious.test.ts
    • superset-frontend/packages/superset-ui-core/src/hooks/useTruncation/useCSSTextTruncation.test.tsx
    • superset-frontend/packages/superset-ui-core/src/hooks/useTruncation/useChildElementTruncation.test.ts
    • superset-frontend/packages/superset-ui-core/src/ui-overrides/types.ts
    • superset-frontend/plugins/legacy-preset-chart-deckgl/src/CategoricalDeckGLContainer.tsx
    • superset-frontend/plugins/legacy-preset-chart-deckgl/src/DeckGLContainer.tsx
    • superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/common.test.ts
    • superset-frontend/plugins/plugin-chart-ag-grid-table/src/renderers/TextCellRenderer.tsx
    • superset-frontend/plugins/plugin-chart-ag-grid-table/test/utils/useColDefs.test.ts
    • superset-frontend/plugins/plugin-chart-cartodiagram/src/components/ChartLayer.tsx
    • superset-frontend/plugins/plugin-chart-cartodiagram/test/components/chartLayer.test.ts
    • superset-frontend/spec/helpers/testing-library.tsx
    • superset-frontend/src/SqlLab/components/AppLayout/index.tsx
    • superset-frontend/src/SqlLab/components/EditorWrapper/useAnnotations.test.ts
    • superset-frontend/src/SqlLab/components/EditorWrapper/useKeywords.test.ts
    • superset-frontend/src/SqlLab/components/KeyboardShortcutButton/index.tsx
    • superset-frontend/src/SqlLab/components/PopEditorTab/index.tsx
    • superset-frontend/src/SqlLab/components/QueryTable/index.tsx
    • superset-frontend/src/SqlLab/components/RunQueryActionButton/index.tsx
    • superset-frontend/src/SqlLab/components/SqlEditorTopBar/useDatabaseSelector.test.ts
    • superset-frontend/src/SqlLab/hooks/useQueryEditor/useQueryEditor.test.ts
    • superset-frontend/src/chartCustomizations/components/DeckglLayerVisibility/useDeckLayerMetadata.test.ts
    • superset-frontend/src/components/Chart/Chart.tsx
    • superset-frontend/src/components/Chart/ChartContextMenu/useContextMenu.test.tsx
    • superset-frontend/src/components/Chart/DrillBy/useResultsTableView.test.ts
    • superset-frontend/src/components/Chart/DrillDetail/DrillDetailTableControls.tsx
    • superset-frontend/src/components/Datasource/FoldersEditor/hooks/useDragHandlers.test.ts
    • superset-frontend/src/components/Datasource/components/DatasourceEditor/DatasourceEditor.tsx
    • superset-frontend/src/components/DynamicPlugins/index.tsx
    • superset-frontend/src/components/FilterableTable/useCellContentParser.test.ts
    • superset-frontend/src/components/Modal/useModalValidation.test.ts
    • superset-frontend/src/components/ResizableSidebar/useStoredSidebarWidth.test.ts
    • superset-frontend/src/components/StreamingExportModal/useStreamingExport.test.ts
    • superset-frontend/src/dashboard/components/gridComponents/Header/Header.test.tsx
    • superset-frontend/src/dashboard/components/gridComponents/new/DraggableNewComponent.test.tsx
    • superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/useCrossFiltersScopingModal.test.ts
    • superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/getControlItemsMap.tsx
    • superset-frontend/src/dashboard/components/nativeFilters/state.test.ts
    • superset-frontend/src/dashboard/components/resizable/ResizableContainer.tsx
    • superset-frontend/src/dashboard/contexts/AutoRefreshContext.test.tsx
    • superset-frontend/src/dashboard/hooks/useAutoRefreshTabPause.test.tsx
    • superset-frontend/src/dashboard/hooks/useCurrentTime.test.ts
    • superset-frontend/src/dashboard/hooks/useTabVisibility.test.ts
    • superset-frontend/src/embedded/EmbeddedContextProviders.tsx
    • superset-frontend/src/embedded/index.tsx
    • superset-frontend/src/explore/components/ControlHeader.tsx
    • superset-frontend/src/explore/components/DataTableControl/useFilteredTableData.test.ts
    • superset-frontend/src/explore/components/DataTableControl/useTableColumns.test.ts
    • superset-frontend/src/explore/components/ExploreChartPanel/index.tsx
    • superset-frontend/src/explore/components/ExploreContainer/index.tsx
    • superset-frontend/src/explore/components/StashFormDataContainer/index.tsx
    • superset-frontend/src/explore/components/controls/CollectionControl/index.tsx
    • superset-frontend/src/explore/components/controls/CustomListItem/index.tsx
    • superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterPopoverTrigger/index.tsx
    • superset-frontend/src/explore/components/controls/FilterControl/utils/useDatePickerInAdhocfilter.test.ts
    • superset-frontend/src/explore/components/controls/FilterControl/utils/useGetTimeRangeLabel.test.ts
    • superset-frontend/src/features/datasets/hooks/useDatasetLists.test.ts
    • superset-frontend/src/features/datasets/metadataBar/useDatasetMetadataBar.test.tsx
    • superset-frontend/src/features/home/SubMenu.tsx
    • superset-frontend/src/features/home/types.ts
    • superset-frontend/src/features/reports/ReportModal/index.tsx
    • superset-frontend/src/features/roles/RoleListEditModal.tsx
    • superset-frontend/src/features/users/UserListModal.tsx
    • superset-frontend/src/hooks/apiResources/apiResources.test.ts
    • superset-frontend/src/hooks/apiResources/dashboards.test.ts
    • superset-frontend/src/hooks/apiResources/databaseFunctions.test.ts
    • superset-frontend/src/hooks/apiResources/datasets.test.ts
    • superset-frontend/src/hooks/apiResources/queries.test.ts
    • superset-frontend/src/hooks/apiResources/queryValidations.test.ts
    • superset-frontend/src/hooks/apiResources/schemas.test.ts
    • superset-frontend/src/hooks/apiResources/sqlEditorTabs.test.ts
    • superset-frontend/src/hooks/apiResources/sqlLab.test.ts
    • superset-frontend/src/hooks/apiResources/tables.test.ts
    • superset-frontend/src/hooks/useBeforeUnload/useBeforeUnload.test.ts
    • superset-frontend/src/hooks/useConfirmModal/useConfirmModal.test.tsx
    • superset-frontend/src/hooks/useDebounceValue.test.ts
    • superset-frontend/src/hooks/usePermissions.test.tsx
    • superset-frontend/src/hooks/useUnsavedChangesPrompt/useUnsavedChangesPrompt.test.tsx
    • superset-frontend/src/logger/useLogAction.test.ts
    • superset-frontend/src/pages/SqlLab/LocationContext.tsx
    • superset-frontend/src/theme/hooks/useThemeValidation.test.ts
    • superset-frontend/src/theme/tests/ThemeProvider.test.tsx
    • superset-frontend/src/views/CRUD/hooks.test.tsx
    • superset-frontend/src/views/RootContextProviders.tsx
    • superset-frontend/src/views/index.tsx
    • superset-frontend/src/views/menu.tsx
  • Files skipped - 23
    • superset-frontend/package-lock.json - Reason: Filter setting
    • superset-frontend/package.json - Reason: Filter setting
    • superset-frontend/packages/superset-core/package.json - Reason: Filter setting
    • superset-frontend/packages/superset-ui-chart-controls/package.json - Reason: Filter setting
    • superset-frontend/packages/superset-ui-core/package.json - Reason: Filter setting
    • superset-frontend/plugins/legacy-plugin-chart-calendar/package.json - Reason: Filter setting
    • superset-frontend/plugins/legacy-plugin-chart-country-map/package.json - Reason: Filter setting
    • superset-frontend/plugins/legacy-plugin-chart-horizon/package.json - Reason: Filter setting
    • superset-frontend/plugins/legacy-plugin-chart-map-box/package.json - Reason: Filter setting
    • superset-frontend/plugins/legacy-plugin-chart-paired-t-test/package.json - Reason: Filter setting
    • superset-frontend/plugins/legacy-plugin-chart-parallel-coordinates/package.json - Reason: Filter setting
    • superset-frontend/plugins/legacy-plugin-chart-partition/package.json - Reason: Filter setting
    • superset-frontend/plugins/legacy-plugin-chart-rose/package.json - Reason: Filter setting
    • superset-frontend/plugins/legacy-plugin-chart-world-map/package.json - Reason: Filter setting
    • superset-frontend/plugins/legacy-preset-chart-deckgl/package.json - Reason: Filter setting
    • superset-frontend/plugins/legacy-preset-chart-nvd3/package.json - Reason: Filter setting
    • superset-frontend/plugins/plugin-chart-ag-grid-table/package.json - Reason: Filter setting
    • superset-frontend/plugins/plugin-chart-cartodiagram/package.json - Reason: Filter setting
    • superset-frontend/plugins/plugin-chart-echarts/package.json - Reason: Filter setting
    • superset-frontend/plugins/plugin-chart-handlebars/package.json - Reason: Filter setting
    • superset-frontend/plugins/plugin-chart-pivot-table/package.json - Reason: Filter setting
    • superset-frontend/plugins/plugin-chart-table/package.json - Reason: Filter setting
    • superset-frontend/plugins/plugin-chart-word-cloud/package.json - Reason: Filter setting
  • 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 [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

Comment on lines 369 to 371
/>
<StyledCronError>{cronError}</StyledCronError>
<StyledCronError>{cronError as ReactNode}</StyledCronError>
<div

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Incorrect cron error display

Rendering the cronError object directly will show '[object Object]' instead of the error message. CronError from react-js-cron is an object with 'type' and 'description' properties - the description should be displayed.

Code suggestion
Check the AI-generated fix before applying
Suggested change
/>
<StyledCronError>{cronError}</StyledCronError>
<StyledCronError>{cronError as ReactNode}</StyledCronError>
<div
/>
<StyledCronError>{cronError?.description}</StyledCronError>
<div

Code Review Run #139db3


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

  • Yes, avoid them

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this relevant?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The suggestion modifies the error display to show cronError?.description instead of casting cronError to ReactNode. This assumes cronError is an object with a description property, potentially improving readability by displaying a specific error message rather than the raw error object. However, if cronError lacks a description field or is already a string, this might not enhance the code and could lead to undefined display.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not sure if you've seen this

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This question isn’t related to the pull request. I can only help with questions about the PR’s code or comments.

<InfoTooltip
placement="top"
tooltip={controlItem.config.description}
tooltip={controlItem.config.description as React.ReactNode}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Inconsistent function handling for config properties

The tooltip prop casts controlItem.config.description directly to ReactNode, but according to the BaseControlConfig type, description can be a function that returns ReactNode, just like label. This inconsistency could cause runtime errors if description is a function. It looks like the change handles label functions but missed description.

Code suggestion
Check the AI-generated fix before applying
Suggested change
tooltip={controlItem.config.description as React.ReactNode}
tooltip={typeof controlItem.config.description === 'function' ? (controlItem.config.description as Function)() : controlItem.config.description as React.ReactNode}

Code Review Run #139db3


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

  • Yes, avoid them

@msyavuz msyavuz changed the title Msyavuz/chore/react 18 clean chore: Upgrade to React 18 Mar 10, 2026
@msyavuz msyavuz mentioned this pull request Mar 10, 2026
9 tasks
msyavuz and others added 2 commits March 10, 2026 22:50
Co-Authored-By: Claude Opus 4.6 <[email protected]>
@bito-code-review

bito-code-review Bot commented Mar 10, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #94c884

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 09b341f..50aa590
    • superset-frontend/webpack.config.js
  • Files skipped - 1
    • superset-frontend/package-lock.json - Reason: Filter setting
  • 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 [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@bito-code-review bito-code-review Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review Agent Run #8f1aed

Actionable Suggestions - 1
  • superset-frontend/src/features/users/UserListModal.tsx - 1
Filtered by Review Rules

Bito filtered these suggestions based on rules created automatically for your feedback. Manage rules.

  • superset-frontend/plugins/plugin-chart-cartodiagram/src/components/ChartLayer.tsx - 1
Review Details
  • Files reviewed - 19 · Commit Range: 50aa590..80cd613
    • superset-frontend/plugins/plugin-chart-ag-grid-table/src/renderers/TextCellRenderer.tsx
    • superset-frontend/plugins/plugin-chart-cartodiagram/src/components/ChartLayer.tsx
    • superset-frontend/src/SqlLab/components/PopEditorTab/index.tsx
    • superset-frontend/src/chartCustomizations/components/DeckglLayerVisibility/useDeckLayerMetadata.test.ts
    • superset-frontend/src/components/DynamicPlugins/index.tsx
    • superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/getControlItemsMap.tsx
    • superset-frontend/src/embedded/EmbeddedContextProviders.tsx
    • superset-frontend/src/explore/components/ExploreChartPanel/index.tsx
    • superset-frontend/src/explore/components/controls/CollectionControl/index.tsx
    • superset-frontend/src/explore/components/controls/CustomListItem/index.tsx
    • superset-frontend/src/features/roles/RoleListEditModal.tsx
    • superset-frontend/src/features/users/UserListModal.tsx
    • superset-frontend/src/hooks/apiResources/dashboards.test.ts
    • superset-frontend/src/hooks/apiResources/datasets.test.ts
    • superset-frontend/src/hooks/apiResources/queries.test.ts
    • superset-frontend/src/hooks/apiResources/sqlEditorTabs.test.ts
    • superset-frontend/src/hooks/apiResources/sqlLab.test.ts
    • superset-frontend/src/views/RootContextProviders.tsx
    • superset-frontend/src/pages/SqlLab/LocationContext.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 [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@codeant-ai-for-open-source codeant-ai-for-open-source Bot added size:XL This PR changes 500-999 lines, ignoring generated files and removed size:XL This PR changes 500-999 lines, ignoring generated files labels Mar 11, 2026
msyavuz and others added 3 commits April 27, 2026 12:43
The dev build's `ReactRefreshWebpackPlugin` was passed `exclude: /service-worker/`,
which silently overrode the plugin's default `exclude: /node_modules/`. As a
result, pre-bundled ESM packages (e.g. react-checkbox-tree) had the refresh
loader injected into their nested webpack runtime, where `$Refresh$` is not
defined — producing `__webpack_require__.$Refresh$ is undefined` when loading a
dashboard via the legacy filterscope tree.

Pass both regexes as an array so the node_modules default is preserved
alongside the service-worker exclusion.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…ions

Stabilize prop identity for the chart title editor so unrelated parent
re-renders don't bubble through the entire header subtree:

- ExploreChartHeader: wrap default export in memo; useMemo all props
  passed to PageHeaderWithActions (editableTitleProps, certificatied-
  BadgeProps, faveStarProps, titlePanelAdditionalItems, rightPanel-
  AdditionalItems, menuDropdownProps) instead of building fresh object
  literals on each render.
- PageHeaderWithActions: wrap in memo so it skips re-renders when its
  parent re-renders with stable props. The chart title commit path
  already keeps typed text in DynamicEditableTitle's local state and
  only dispatches on Enter/blur, but unstable parent prop identity was
  forcing the memoized DynamicEditableTitle subtree to re-render
  anyway.
- Header.test.tsx: add a test that asserts typing in the dashboard
  title only dispatches updateDashboardTitle/onChange once on commit,
  not per keystroke.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
The dashboard/chart title flickered when typing letters but not when
deleting them. Root cause: the auto-grow width was driven by an
async `ResizeObserver` (via `useResizeDetector`) on the hidden sizer
span. After each keystroke React committed the new value with the
stale width, the browser painted that intermediate state, then the
ResizeObserver delivered a layout callback asynchronously and a
second commit corrected the width — visible as a flicker. Deleting
didn't flicker because the input never needs to shrink mid-edit.

Replace the async ResizeObserver on the sizer with a synchronous
measurement: read `offsetWidth` inside the same `useLayoutEffect`
that mirrors the value into the sizer. The width update now lands
in the same paint cycle as the value change.

Also fix two pre-existing dead-code paths exposed by this work:
the `sizerRef.current.setSelectionRange` cursor effect and the
`sizerRef.current?.input` overflow check both targeted a `<span>`
and were no-ops. Wire a proper `InputRef` to the actual input so
cursor positioning on edit and the overflow tooltip work.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@bito-code-review

bito-code-review Bot commented Apr 27, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #16aea1

Actionable Suggestions - 0
Additional Suggestions - 1
  • superset-frontend/src/explore/components/ExploreChartHeader/index.tsx - 1
    • Naming Inconsistency · Line 273-273
      Rename `certificatiedBadgeProps` to `certifiedBadgeProps` (and update its usage in the JSX prop) to correct the spelling and align with other components.
Review Details
  • Files reviewed - 5 · Commit Range: c9a2b1d..301610f
    • superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/state.test.ts
    • superset-frontend/webpack.config.js
    • superset-frontend/packages/superset-ui-core/src/components/PageHeaderWithActions/index.tsx
    • superset-frontend/src/dashboard/components/Header/Header.test.tsx
    • superset-frontend/src/explore/components/ExploreChartHeader/index.tsx
  • Files skipped - 1
    • superset-frontend/package-lock.json - Reason: Filter setting
  • 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 [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

msyavuz and others added 2 commits April 27, 2026 17:18
Reported as: "Weird behaviour for dashboard name edit as sometimes you
can't delete or add any letters to it." When the input received focus
without going through the onClick handler first (tab focus, autofocus,
or a batched click+keystroke event group), the very first change event
fired with `isEditing` still false. The pre-existing guard
`if (!canEdit || !isEditing) return` in `handleChange` silently dropped
the keystroke. Because the input is controlled, antd's internal
`useMergedState` then re-synced the DOM value back to the stale
`props.value`, so the user saw their typed character or backspace
disappear — the symptom of an "unresponsive" input.

The guard was unnecessary: `disabled={!canEdit}` already prevents
changes when editing isn't allowed, so the only reason a change event
fires is that the user actually typed. Drop the `!isEditing` half of
the guard and flip `isEditing` on the first change, so a typed
keystroke both enters edit mode and is preserved.

Add a regression suite covering rapid type+backspace, the
focus-without-click case (the actual reproducer), and a re-render
mid-edit that should not clobber unsaved typing.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Adds Jest coverage that mounts CssTemplateModal in Edit, Add, and
closed->open transition flows and asserts the Ace editor element is
present. Investigation in response to a #38563 review comment ("only
the label, no css input field") could not reproduce the regression from
static analysis or in jsdom; this guards the editor from disappearing
under future renders/refactors regardless.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@bito-code-review

bito-code-review Bot commented Apr 27, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #c624f4

Actionable Suggestions - 0
Review Details
  • Files reviewed - 3 · Commit Range: 301610f..5b1dfdd
    • superset-frontend/packages/superset-ui-core/src/components/DynamicEditableTitle/index.tsx
    • superset-frontend/packages/superset-ui-core/src/components/DynamicEditableTitle/DynamicEditableTitle.regression.test.tsx
    • superset-frontend/src/features/cssTemplates/CssTemplateModal.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 [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

msyavuz and others added 2 commits April 29, 2026 20:36
The merge of master into the React 18 branch regenerated the lockfile
via npm install, which once again left maplibre-gl only installed
inside the deck.gl and plugin-chart-point-cluster-map workspace
node_modules. Webpack imports @vis.gl/react-maplibre from the root,
so it could not resolve maplibre-gl and the production build failed
with two "Module not found: Can't resolve 'maplibre-gl'" errors,
breaking every cypress and playwright job on the PR.

Run npm dedupe so maplibre-gl is hoisted to the root node_modules,
matching how master resolves it. Same fix as 92d219a — the
post-merge install regression keeps recurring.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

@EnxDev EnxDev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, just some nits. Thanks for this fantastic work!

error: Error,
info: { componentStack: string } | null,
) {
handleRenderContainerFailure(error: Error, info: ErrorInfo) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

renderStartTime is declared as any (not in this PR) and never assigned anywhere in this file, so when ErrorBoundary triggers handleRenderContainerFailure we dispatch start_offset: undefined and duration: NaN to LOG_ACTIONS_RENDER_CHART, which also violates the number contract declared on Actions.logEvent. ChartRenderer and Markdown already handle this correctly (typed as number, initialized in the constructor, refreshed before render).
Suggest doing the same here: type as number and set this.renderStartTime = Logger.getTimestamp() in the constructor, so the offset is always finite even if the boundary fires before componentDidMount.

placement="top"
tooltip={controlItem.config.description}
tooltip={
controlItem.config.description as React.ReactNode

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same gotcha as label just above; description can also be (state, controlState, chartState?) => ReactNode (see BaseControlConfig in superset-ui-chart-controls/src/types.ts).
Casting straight to ReactNode would let a function slip through and render as [object Function] (or trip React 18's "Functions are not valid as a React child"). Could we mirror the typeof === 'function' guard you already added for label?
Something like:

tooltip={
  typeof controlItem.config.description === 'function'
    ? (controlItem.config.description as Function)()
    : controlItem.config.description
}

onClick={() => onUserClicked(q.userId)}
>
{q.user}
{q.user as ReactNode}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this already typed?

@alexandrusoare alexandrusoare left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM just some nits

const { isSorted, isSortedDesc } = getSortingInfo(headerGroups, column.id);
return {
title: column.Header,
title: column.Header as ReactNode,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not sure if you've seen this, looks relevant?

initialState,
manualPagination: serverPagination,
manualPagination: true,
manualSortBy: serverPagination,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

?

Comment on lines 369 to 371
/>
<StyledCronError>{cronError}</StyledCronError>
<StyledCronError>{cronError as ReactNode}</StyledCronError>
<div

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not sure if you've seen this

</Tabs.TabPane>
</Tabs>
);
}) as unknown as ReactNode

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

?

msyavuz added 3 commits May 4, 2026 10:33
- Initialize renderStartTime in Chart.tsx constructor with proper number type
- Mirror function-type guard for description in getControlItemsMap
- Apply prettier formatting to handlebarTemplate.tsx and TableChart.tsx
@bito-code-review

bito-code-review Bot commented May 4, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #4d366b

Actionable Suggestions - 0
Review Details
  • Files reviewed - 4 · Commit Range: 5b1dfdd..945a020
    • superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/handlebarTemplate.tsx
    • superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx
    • superset-frontend/src/components/Chart/Chart.tsx
    • superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/getControlItemsMap.tsx
  • Files skipped - 1
    • superset-frontend/package-lock.json - Reason: Filter setting
  • 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 [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@rusackas

rusackas commented May 4, 2026

Copy link
Copy Markdown
Member

LGTM... let's get this in, then we can address a few lingering issues found as a fast-follow.

  1. embedded/index.tsx:192 — createRoot(appMountPoint).render(...) is called inline with no root reference. The started guard is declared inside the 'port transfer' message handler, so each port-transfer event creates a fresh started=false. A re-handshake → second createRoot on the same DOM node → React 18 warns and behavior is undefined. Fix: hoist const root = createRoot(appMountPoint) to module scope and unmount in the existing beforeunload handler.
  2. DynamicEditableTitle/index.tsx:84-86 — useEffect(() => setCurrentTitle(title), [title]) still clobbers in-flight user input if the parent's title prop changes during an edit. The "first keystroke" fix only ensured isEditing flips inside handleChange; this effect ignores isEditing. Fix: gate with if (!isEditing) setCurrentTitle(title).
  3. CollectionControl/index.tsx:172-176 — itemIds falls back to String(i) when keyAccessor returns falsy. Two items can collide on the same id, breaking dnd-kit reordering after a drag (and React reuse via shared key). Fix: generate a stable id (e.g. nanoid) on insert; never derive from index.
  4. CollectionControl/index.tsx (drag handle + axis lock) — attributes/listeners spread onto a wrapping an (which has role="img") creates a broken a11y tree and breaks keyboard activation. Also missing axis lock — original used lockAxis="y", items can now drift horizontally. Fix: spread onto a via setActivatorNodeRef; add modifiers={[restrictToVerticalAxis]} (requires installing @dnd-kit/modifiers, currently not in package.json). Adding KeyboardSensor would also be a trivial accessibility win.
  5. DynamicEditableTitle.regression.test.tsx:73 — Third "prop changes mid-edit do not clobber" test rerenders. Harness with the same initialTitle="Foo", so the prop the component sees never actually changes. The test does not exercise the bug it claims to guard. Fix: pass a different title prop directly to DynamicEditableTitle via rerender, not via the harness.

@hainenber

Copy link
Copy Markdown
Contributor

Its happening!

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 dependencies:npm packages plugins preset-io size/XXL size:XXL This PR changes 1000+ lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants