Repository navigation
chore: Upgrade to React 18 - #38563
Conversation
- 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]>
Sequence DiagramThis 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
Generated by CodeAnt AI |
| '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; |
There was a problem hiding this comment.
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.| '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.There was a problem hiding this comment.
This seems relevant as well
| error: Error, | ||
| info: { componentStack: string } | null, | ||
| ) { | ||
| handleRenderContainerFailure(error: Error, info: ErrorInfo) { |
There was a problem hiding this comment.
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.There was a problem hiding this comment.
What the AI suggest sounds interesting. What do you think?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Code Review Agent Run #139db3
Actionable Suggestions - 2
-
superset-frontend/src/features/reports/ReportModal/index.tsx - 1
- Incorrect cron error display · Line 369-371
-
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-49The 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-102The 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-68Add 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-28The 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
| /> | ||
| <StyledCronError>{cronError}</StyledCronError> | ||
| <StyledCronError>{cronError as ReactNode}</StyledCronError> | ||
| <div |
There was a problem hiding this comment.
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
| /> | |
| <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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Not sure if you've seen this
There was a problem hiding this comment.
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} |
There was a problem hiding this comment.
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
| 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
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Code Review Agent Run #94c884Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
There was a problem hiding this comment.
Code Review Agent Run #8f1aed
Actionable Suggestions - 1
-
superset-frontend/src/features/users/UserListModal.tsx - 1
- Form Field Mismatch · Line 177-177
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
- Replace `any` with proper type · Line 40-40
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
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]>
Code Review Agent Run #16aea1Actionable Suggestions - 0Additional Suggestions - 1
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
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]>
Code Review Agent Run #c624f4Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
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
left a comment
There was a problem hiding this comment.
LGTM, just some nits. Thanks for this fantastic work!
| error: Error, | ||
| info: { componentStack: string } | null, | ||
| ) { | ||
| handleRenderContainerFailure(error: Error, info: ErrorInfo) { |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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} |
alexandrusoare
left a comment
There was a problem hiding this comment.
LGTM just some nits
| const { isSorted, isSortedDesc } = getSortingInfo(headerGroups, column.id); | ||
| return { | ||
| title: column.Header, | ||
| title: column.Header as ReactNode, |
There was a problem hiding this comment.
Not sure if you've seen this, looks relevant?
| initialState, | ||
| manualPagination: serverPagination, | ||
| manualPagination: true, | ||
| manualSortBy: serverPagination, |
| /> | ||
| <StyledCronError>{cronError}</StyledCronError> | ||
| <StyledCronError>{cronError as ReactNode}</StyledCronError> | ||
| <div |
There was a problem hiding this comment.
Not sure if you've seen this
| </Tabs.TabPane> | ||
| </Tabs> | ||
| ); | ||
| }) as unknown as ReactNode |
- 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
Code Review Agent Run #4d366bActionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
|
LGTM... let's get this in, then we can address a few lingering issues found as a fast-follow.
|
|
Its happening! |
User description
SUMMARY
Upgrade to React 18
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION
CodeAnt-AI Description
Upgrade frontend to React 18 and migrate rendering, drag-and-drop, and tests
What Changed
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:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
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:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
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.