-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Split canvas widget reducers #39327
Conversation
WalkthroughThis pull request updates numerous import statements across the codebase to reflect a new module organization. In particular, types such as CanvasWidgetsReduxState, FlattenedWidgetProps, and UpdateWidgetsPayload are now imported from the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🔭 Outside diff range comments (1)
app/client/src/ce/reducers/index.tsx (1)
161-163
: 🛠️ Refactor suggestionAddress TODOs and remove
any
types.There are multiple TODOs with
eslint-disable
directives andany
types that should be addressed:
moduleInstanceEntities: any
- Form reducer's key type
- Tenant reducer's generic type
Consider creating proper type definitions for these cases to improve type safety. Would you like me to help define these types?
Also applies to: 176-178, 181-183
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (107)
app/client/src/PluginActionEditor/components/PluginActionResponse/components/BindDataButton.tsx
(1 hunks)app/client/src/WidgetProvider/factory/index.tsx
(1 hunks)app/client/src/actions/autoLayoutActions.ts
(1 hunks)app/client/src/actions/controlActions.tsx
(1 hunks)app/client/src/actions/pageActions.tsx
(1 hunks)app/client/src/ce/entities/DataTree/types.ts
(1 hunks)app/client/src/ce/reducers/entityReducers/canvasWidgetsReducer.test.ts
(1 hunks)app/client/src/ce/reducers/entityReducers/canvasWidgetsReducer.ts
(1 hunks)app/client/src/ce/reducers/entityReducers/index.ts
(1 hunks)app/client/src/ce/reducers/index.tsx
(1 hunks)app/client/src/ce/sagas/JSActionSagas.ts
(1 hunks)app/client/src/ce/sagas/PageSagas.tsx
(1 hunks)app/client/src/ce/selectors/entitiesSelector.ts
(1 hunks)app/client/src/ee/reducers/entityReducers/canvasWidgetsReducer.ts
(1 hunks)app/client/src/ee/reducers/entityReducers/canvasWidgetsStructureReducer.ts
(1 hunks)app/client/src/entities/AppTheming/utils.ts
(1 hunks)app/client/src/entities/DataTree/dataTreeFactory.ts
(1 hunks)app/client/src/entities/DataTree/dataTreeWidget.test.ts
(1 hunks)app/client/src/entities/DataTree/dataTreeWidget.ts
(1 hunks)app/client/src/entities/Replay/ReplayEntity/ReplayCanvas.ts
(1 hunks)app/client/src/entities/Widget/utils.ts
(1 hunks)app/client/src/layoutSystems/anvil/editor/canvasArenas/hooks/useAnvilDnDListenerStates.ts
(1 hunks)app/client/src/layoutSystems/anvil/editor/canvasArenas/utils/utils.ts
(1 hunks)app/client/src/layoutSystems/anvil/integrations/sagas/anvilDraggingSagas/index.ts
(1 hunks)app/client/src/layoutSystems/anvil/integrations/sagas/anvilSpaceDistributionSagas.ts
(1 hunks)app/client/src/layoutSystems/anvil/integrations/sagas/anvilWidgetAdditionSagas/helpers.test.ts
(1 hunks)app/client/src/layoutSystems/anvil/integrations/sagas/anvilWidgetAdditionSagas/helpers.ts
(1 hunks)app/client/src/layoutSystems/anvil/integrations/sagas/anvilWidgetAdditionSagas/index.ts
(1 hunks)app/client/src/layoutSystems/anvil/integrations/sagas/pasteSagas/index.ts
(1 hunks)app/client/src/layoutSystems/anvil/integrations/sagas/sectionSagas.ts
(1 hunks)app/client/src/layoutSystems/anvil/layoutComponents/components/zone/useZoneMinWidth.ts
(1 hunks)app/client/src/layoutSystems/anvil/sectionSpaceDistributor/utils/spaceRedistributionSagaUtils.ts
(1 hunks)app/client/src/layoutSystems/anvil/utils/anvilChecksUtils.ts
(1 hunks)app/client/src/layoutSystems/anvil/utils/layouts/update/deletionUtils.ts
(1 hunks)app/client/src/layoutSystems/anvil/utils/layouts/update/mainCanvasLayoutUtils.ts
(1 hunks)app/client/src/layoutSystems/anvil/utils/layouts/update/moveUtils.test.ts
(1 hunks)app/client/src/layoutSystems/anvil/utils/layouts/update/moveUtils.ts
(1 hunks)app/client/src/layoutSystems/anvil/utils/layouts/update/sectionUtils.ts
(1 hunks)app/client/src/layoutSystems/anvil/utils/layouts/update/zoneUtils.ts
(1 hunks)app/client/src/layoutSystems/anvil/utils/paste/destinationUtils/index.ts
(1 hunks)app/client/src/layoutSystems/anvil/utils/paste/mainCanvasPasteUtils.ts
(1 hunks)app/client/src/layoutSystems/anvil/utils/paste/sectionPasteUtils.ts
(1 hunks)app/client/src/layoutSystems/anvil/utils/paste/types.ts
(1 hunks)app/client/src/layoutSystems/anvil/utils/paste/utils.ts
(1 hunks)app/client/src/layoutSystems/anvil/utils/paste/zonePasteUtils.ts
(1 hunks)app/client/src/layoutSystems/anvil/utils/sectionOperationUtils.ts
(1 hunks)app/client/src/layoutSystems/autolayout/utils/AutoLayoutUtils.ts
(1 hunks)app/client/src/layoutSystems/autolayout/utils/autoLayoutDraggingUtils.test.ts
(1 hunks)app/client/src/layoutSystems/autolayout/utils/autoLayoutDraggingUtils.ts
(1 hunks)app/client/src/layoutSystems/autolayout/utils/autoLayoutUtils.test.ts
(1 hunks)app/client/src/layoutSystems/autolayout/utils/heightUpdateUtils.ts
(1 hunks)app/client/src/layoutSystems/autolayout/utils/highlightUtils.ts
(1 hunks)app/client/src/layoutSystems/autolayout/utils/positionUtils.test.ts
(1 hunks)app/client/src/layoutSystems/autolayout/utils/positionUtils.ts
(1 hunks)app/client/src/layoutSystems/common/DSLConversions/autoToFixedLayout.ts
(1 hunks)app/client/src/layoutSystems/common/DSLConversions/tests/autoToFixedLayout.test.ts
(1 hunks)app/client/src/layoutSystems/common/utils/canvasDraggingUtils.ts
(1 hunks)app/client/src/modules/ui-builder/ui/wds/WDSCustomWidget/config/defaultsConfig.ts
(1 hunks)app/client/src/modules/ui-builder/ui/wds/WDSModalWidget/config/defaultsConfig.ts
(1 hunks)app/client/src/modules/ui-builder/ui/wds/WDSModalWidget/widget/index.tsx
(1 hunks)app/client/src/modules/ui-builder/ui/wds/WDSSectionWidget/config/defaultConfig.ts
(1 hunks)app/client/src/modules/ui-builder/ui/wds/WDSSectionWidget/widget/index.tsx
(1 hunks)app/client/src/modules/ui-builder/ui/wds/WDSTableWidget/widget/index.tsx
(1 hunks)app/client/src/modules/ui-builder/ui/wds/WDSZoneWidget/widget/config/defaultConfig.ts
(1 hunks)app/client/src/modules/ui-builder/ui/wds/WDSZoneWidget/widget/index.tsx
(1 hunks)app/client/src/pages/Editor/FirstTimeUserOnboarding/Checklist.tsx
(1 hunks)app/client/src/reducers/entityReducers/metaWidgetsReducer.ts
(1 hunks)app/client/src/sagas/AppThemingSaga.tsx
(1 hunks)app/client/src/sagas/AutoLayoutUpdateSagas.tsx
(1 hunks)app/client/src/sagas/BuildingBlockSagas/BuildingBlockAdditionSagas.ts
(1 hunks)app/client/src/sagas/BuildingBlockSagas/tests/fixtures.ts
(1 hunks)app/client/src/sagas/CanvasSagas/AutoLayoutDraggingSagas.ts
(1 hunks)app/client/src/sagas/CanvasSagas/DraggingCanvasSagas.ts
(1 hunks)app/client/src/sagas/CanvasSagas/SelectionCanvasSagas.ts
(1 hunks)app/client/src/sagas/ModalSagas.ts
(1 hunks)app/client/src/sagas/PartialImportExportSagas/PartialExportSagas.ts
(1 hunks)app/client/src/sagas/PasteWidgetUtils/index.ts
(1 hunks)app/client/src/sagas/SnipingModeSagas.ts
(1 hunks)app/client/src/sagas/WidgetAdditionSagas.ts
(1 hunks)app/client/src/sagas/WidgetBlueprintSagas.ts
(1 hunks)app/client/src/sagas/WidgetDeletionSagas.ts
(1 hunks)app/client/src/sagas/WidgetEnhancementHelpers.ts
(1 hunks)app/client/src/sagas/WidgetOperationSagas.tsx
(1 hunks)app/client/src/sagas/WidgetOperationUtils.test.ts
(1 hunks)app/client/src/sagas/WidgetOperationUtils.ts
(1 hunks)app/client/src/sagas/WidgetSelectUtils.test.ts
(1 hunks)app/client/src/sagas/WidgetSelectUtils.ts
(1 hunks)app/client/src/sagas/WidgetSelectionSagas.ts
(1 hunks)app/client/src/sagas/autoHeightSagas/batcher.ts
(1 hunks)app/client/src/sagas/autoHeightSagas/containers.ts
(1 hunks)app/client/src/sagas/autoHeightSagas/helpers.ts
(1 hunks)app/client/src/sagas/autoHeightSagas/widgets.ts
(1 hunks)app/client/src/sagas/selectors.tsx
(1 hunks)app/client/src/selectors/debuggerSelectors.test.ts
(1 hunks)app/client/src/selectors/debuggerSelectors.tsx
(1 hunks)app/client/src/selectors/editorSelectors.tsx
(1 hunks)app/client/src/selectors/flattenedChildCanvasSelector.ts
(1 hunks)app/client/src/selectors/propertyPaneSelectors.tsx
(1 hunks)app/client/src/selectors/widgetEnhancementSelectors.ts
(1 hunks)app/client/src/selectors/widgetSelectors.ts
(1 hunks)app/client/src/utils/WidgetPropsUtils.tsx
(1 hunks)app/client/src/utils/helpers.test.ts
(1 hunks)app/client/src/utils/helpers.tsx
(1 hunks)app/client/src/utils/reflowHookUtils.ts
(1 hunks)app/client/src/utils/widgetRenderUtils.test.ts
(1 hunks)app/client/src/utils/widgetRenderUtils.tsx
(1 hunks)app/client/src/widgets/BaseWidget.tsx
(1 hunks)
⛔ Files not processed due to max files limit (12)
- app/client/src/widgets/ContainerWidget/widget/index.tsx
- app/client/src/widgets/FormWidget/widget/index.tsx
- app/client/src/widgets/ListWidgetV2/widget/defaultProps.ts
- app/client/src/widgets/ModalWidget/widget/index.tsx
- app/client/src/widgets/StatboxWidget/widget/index.tsx
- app/client/src/widgets/WidgetUtils.ts
- app/client/src/workers/Evaluation/ReplayDSL.ts
- app/client/src/workers/Evaluation/fns/resetWidget.ts
- app/client/src/workers/Evaluation/handlers/evalTree.ts
- app/client/src/workers/Evaluation/replayUtils.ts
- app/client/src/workers/Evaluation/types.ts
- app/client/test/testCommon.ts
✅ Files skipped from review due to trivial changes (97)
- app/client/src/ce/entities/DataTree/types.ts
- app/client/src/selectors/debuggerSelectors.tsx
- app/client/src/layoutSystems/anvil/integrations/sagas/anvilWidgetAdditionSagas/helpers.test.ts
- app/client/src/WidgetProvider/factory/index.tsx
- app/client/src/layoutSystems/anvil/editor/canvasArenas/hooks/useAnvilDnDListenerStates.ts
- app/client/src/layoutSystems/anvil/utils/paste/zonePasteUtils.ts
- app/client/src/sagas/BuildingBlockSagas/tests/fixtures.ts
- app/client/src/ce/reducers/entityReducers/canvasWidgetsReducer.ts
- app/client/src/layoutSystems/anvil/utils/paste/sectionPasteUtils.ts
- app/client/src/layoutSystems/anvil/layoutComponents/components/zone/useZoneMinWidth.ts
- app/client/src/sagas/CanvasSagas/SelectionCanvasSagas.ts
- app/client/src/ee/reducers/entityReducers/canvasWidgetsStructureReducer.ts
- app/client/src/sagas/CanvasSagas/DraggingCanvasSagas.ts
- app/client/src/sagas/AppThemingSaga.tsx
- app/client/src/layoutSystems/anvil/utils/sectionOperationUtils.ts
- app/client/src/sagas/PasteWidgetUtils/index.ts
- app/client/src/sagas/autoHeightSagas/batcher.ts
- app/client/src/utils/helpers.tsx
- app/client/src/layoutSystems/anvil/utils/anvilChecksUtils.ts
- app/client/src/sagas/WidgetDeletionSagas.ts
- app/client/src/layoutSystems/anvil/utils/paste/mainCanvasPasteUtils.ts
- app/client/src/ce/reducers/entityReducers/canvasWidgetsReducer.test.ts
- app/client/src/layoutSystems/autolayout/utils/positionUtils.ts
- app/client/src/sagas/autoHeightSagas/containers.ts
- app/client/src/sagas/WidgetEnhancementHelpers.ts
- app/client/src/entities/Replay/ReplayEntity/ReplayCanvas.ts
- app/client/src/widgets/BaseWidget.tsx
- app/client/src/layoutSystems/anvil/utils/layouts/update/deletionUtils.ts
- app/client/src/ee/reducers/entityReducers/canvasWidgetsReducer.ts
- app/client/src/entities/AppTheming/utils.ts
- app/client/src/layoutSystems/anvil/integrations/sagas/pasteSagas/index.ts
- app/client/src/sagas/SnipingModeSagas.ts
- app/client/src/modules/ui-builder/ui/wds/WDSZoneWidget/widget/config/defaultConfig.ts
- app/client/src/utils/widgetRenderUtils.tsx
- app/client/src/layoutSystems/autolayout/utils/autoLayoutUtils.test.ts
- app/client/src/entities/DataTree/dataTreeWidget.test.ts
- app/client/src/utils/WidgetPropsUtils.tsx
- app/client/src/sagas/WidgetSelectUtils.ts
- app/client/src/layoutSystems/anvil/integrations/sagas/anvilSpaceDistributionSagas.ts
- app/client/src/layoutSystems/autolayout/utils/autoLayoutDraggingUtils.test.ts
- app/client/src/sagas/PartialImportExportSagas/PartialExportSagas.ts
- app/client/src/actions/pageActions.tsx
- app/client/src/modules/ui-builder/ui/wds/WDSSectionWidget/widget/index.tsx
- app/client/src/utils/reflowHookUtils.ts
- app/client/src/layoutSystems/anvil/editor/canvasArenas/utils/utils.ts
- app/client/src/layoutSystems/anvil/sectionSpaceDistributor/utils/spaceRedistributionSagaUtils.ts
- app/client/src/actions/autoLayoutActions.ts
- app/client/src/layoutSystems/autolayout/utils/highlightUtils.ts
- app/client/src/sagas/autoHeightSagas/widgets.ts
- app/client/src/sagas/selectors.tsx
- app/client/src/utils/helpers.test.ts
- app/client/src/layoutSystems/anvil/utils/layouts/update/moveUtils.test.ts
- app/client/src/selectors/widgetSelectors.ts
- app/client/src/layoutSystems/anvil/integrations/sagas/anvilWidgetAdditionSagas/helpers.ts
- app/client/src/pages/Editor/FirstTimeUserOnboarding/Checklist.tsx
- app/client/src/actions/controlActions.tsx
- app/client/src/selectors/propertyPaneSelectors.tsx
- app/client/src/sagas/WidgetSelectionSagas.ts
- app/client/src/sagas/autoHeightSagas/helpers.ts
- app/client/src/ce/sagas/PageSagas.tsx
- app/client/src/sagas/WidgetOperationSagas.tsx
- app/client/src/PluginActionEditor/components/PluginActionResponse/components/BindDataButton.tsx
- app/client/src/layoutSystems/autolayout/utils/heightUpdateUtils.ts
- app/client/src/layoutSystems/anvil/integrations/sagas/anvilWidgetAdditionSagas/index.ts
- app/client/src/layoutSystems/common/DSLConversions/tests/autoToFixedLayout.test.ts
- app/client/src/layoutSystems/common/DSLConversions/autoToFixedLayout.ts
- app/client/src/ce/sagas/JSActionSagas.ts
- app/client/src/utils/widgetRenderUtils.test.ts
- app/client/src/sagas/WidgetBlueprintSagas.ts
- app/client/src/layoutSystems/autolayout/utils/AutoLayoutUtils.ts
- app/client/src/layoutSystems/anvil/utils/layouts/update/moveUtils.ts
- app/client/src/layoutSystems/anvil/utils/paste/types.ts
- app/client/src/layoutSystems/anvil/utils/paste/utils.ts
- app/client/src/sagas/AutoLayoutUpdateSagas.tsx
- app/client/src/selectors/widgetEnhancementSelectors.ts
- app/client/src/sagas/BuildingBlockSagas/BuildingBlockAdditionSagas.ts
- app/client/src/layoutSystems/autolayout/utils/positionUtils.test.ts
- app/client/src/sagas/ModalSagas.ts
- app/client/src/entities/Widget/utils.ts
- app/client/src/modules/ui-builder/ui/wds/WDSTableWidget/widget/index.tsx
- app/client/src/selectors/debuggerSelectors.test.ts
- app/client/src/layoutSystems/anvil/utils/layouts/update/mainCanvasLayoutUtils.ts
- app/client/src/layoutSystems/anvil/utils/paste/destinationUtils/index.ts
- app/client/src/layoutSystems/common/utils/canvasDraggingUtils.ts
- app/client/src/layoutSystems/anvil/utils/layouts/update/zoneUtils.ts
- app/client/src/layoutSystems/anvil/integrations/sagas/sectionSagas.ts
- app/client/src/layoutSystems/anvil/integrations/sagas/anvilDraggingSagas/index.ts
- app/client/src/layoutSystems/autolayout/utils/autoLayoutDraggingUtils.ts
- app/client/src/sagas/WidgetSelectUtils.test.ts
- app/client/src/layoutSystems/anvil/utils/layouts/update/sectionUtils.ts
- app/client/src/sagas/CanvasSagas/AutoLayoutDraggingSagas.ts
- app/client/src/entities/DataTree/dataTreeWidget.ts
- app/client/src/sagas/WidgetOperationUtils.test.ts
- app/client/src/selectors/editorSelectors.tsx
- app/client/src/sagas/WidgetOperationUtils.ts
- app/client/src/ce/selectors/entitiesSelector.ts
- app/client/src/sagas/WidgetAdditionSagas.ts
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: perform-test / client-build / client-build
- GitHub Check: client-unit-tests / client-unit-tests
- GitHub Check: client-lint / client-lint
- GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
- GitHub Check: client-build / client-build
🔇 Additional comments (9)
app/client/src/modules/ui-builder/ui/wds/WDSSectionWidget/config/defaultConfig.ts (1)
9-9
:❓ Verification inconclusive
LGTM! Import path updated correctly.
The import path change aligns with the PR objective of restructuring the canvas widget reducers.
Let's verify that the module exists in the new location:
🏁 Script executed:
#!/bin/bash # Verify the existence of the canvasWidgetsReducer in the ee directory fd -t f "canvasWidgetsReducer.ts" -p "ee/reducers/entityReducers"Length of output: 177
LGTM! The updated import path aligns with the PR objective of restructuring the canvas widget reducers.
However, our automated check using the provided shell script didn’t locate the file under "ee/reducers/entityReducers". Please verify manually that thecanvasWidgetsReducer
module exists in its new expected location.app/client/src/modules/ui-builder/ui/wds/WDSModalWidget/config/defaultsConfig.ts (1)
9-9
: LGTM! Import path updated correctly.The import path change is consistent with the codebase restructuring.
app/client/src/ce/reducers/entityReducers/index.ts (1)
3-4
: LGTM! Import paths updated correctly.Both canvas widget reducers have been moved to the enterprise edition namespace, maintaining consistency with the PR objective.
app/client/src/selectors/flattenedChildCanvasSelector.ts (1)
7-7
: LGTM! Import path updated correctly.The import path change is consistent with other files in the PR.
app/client/src/modules/ui-builder/ui/wds/WDSCustomWidget/config/defaultsConfig.ts (1)
9-9
:❓ Verification inconclusive
Verify the import path change impact.
The import path has been updated to use the enterprise edition (ee) path. Please ensure all consumers of this module have been updated accordingly.
🏁 Script executed:
#!/bin/bash # Search for any remaining old import paths rg "from ['\"]reducers/entityReducers/canvasWidgetsReducer['\"]"Length of output: 70
Action Required: Double-check Consumers of the Updated Import Path
The change to use the enterprise import
"ee/reducers/entityReducers/canvasWidgetsReducer"
inapp/client/src/modules/ui-builder/ui/wds/WDSCustomWidget/config/defaultsConfig.ts
appears consistent. A grep for the old import path ("reducers/entityReducers/canvasWidgetsReducer"
) returned no instances. However, please manually verify that every consumer—whether in tests or in runtime usage—has been updated to use the enterprise edition path.
- File:
app/client/src/modules/ui-builder/ui/wds/WDSCustomWidget/config/defaultsConfig.ts
(line 9)- Action: Confirm that no part of the codebase is still referencing the old import path.
app/client/src/modules/ui-builder/ui/wds/WDSZoneWidget/widget/index.tsx (1)
28-28
: LGTM! Import path updated correctly.The import path change aligns with the codebase restructuring.
app/client/src/entities/DataTree/dataTreeFactory.ts (1)
12-12
: LGTM! Import path updated correctly.The import path change is consistent with other enterprise edition imports in this file.
app/client/src/modules/ui-builder/ui/wds/WDSModalWidget/widget/index.tsx (1)
12-12
: LGTM! Import path updated correctly.The import path change aligns with the enterprise edition structure.
app/client/src/reducers/entityReducers/metaWidgetsReducer.ts (1)
9-9
:✅ Verification successful
LGTM! Import path update aligns with reducer split.
The change from relative to absolute import path is consistent with the PR's objective to split canvas widget reducers.
Let's verify that the new import path exists and is correctly structured:
🏁 Script executed:
#!/bin/bash # Verify the new import path exists fd -t f "canvasWidgetsReducer.ts" "ee/reducers/entityReducers" # Verify the type is exported from the new location ast-grep --pattern 'export type UpdateWidgetsPayload = $_'Length of output: 843
LGTM! The updated absolute import path is correctly aligned with the reducer refactor.
We verified that the
UpdateWidgetsPayload
type is exported from the file (located atapp/client/src/ce/reducers/entityReducers/canvasWidgetsReducer.ts
), which indicates that theee
alias (as configured in your TypeScript paths) correctly maps to the intended file. Note that thefd
error is expected since path aliases aren’t resolved through direct filesystem lookup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
app/client/src/ce/reducers/entityReducers/canvasWidgetsStructureReducer.ts (1)
34-50
: Consider enhancing type safety for handlers.While the extraction of handlers is good for maintainability, we can improve type safety.
Consider this type-safe approach:
-export const handlers = { +type Handlers = { + [K in ReduxActionTypes]?: ( + state: CanvasWidgetsStructureReduxState, + action: ReduxAction<UpdateCanvasPayload> + ) => CanvasWidgetsStructureReduxState; +}; + +export const handlers: Handlers = {
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
app/client/src/ce/reducers/entityReducers/canvasWidgetsReducer.ts
(3 hunks)app/client/src/ce/reducers/entityReducers/canvasWidgetsStructureReducer.ts
(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- app/client/src/ce/reducers/entityReducers/canvasWidgetsReducer.ts
⏰ Context from checks skipped due to timeout of 90000ms (8)
- GitHub Check: perform-test / client-build / client-build
- GitHub Check: perform-test / rts-build / build
- GitHub Check: perform-test / server-build / server-unit-tests
- GitHub Check: client-lint / client-lint
- GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
- GitHub Check: client-unit-tests / client-unit-tests
- GitHub Check: client-build / client-build
- GitHub Check: client-prettier / prettier-check
🔇 Additional comments (2)
app/client/src/ce/reducers/entityReducers/canvasWidgetsStructureReducer.ts (2)
27-32
: LGTM! Good practice to export the initial state.Exporting the initial state enhances testability and reusability.
52-55
: LGTM! Clean reducer implementation.The reducer creation is clean and properly utilizes the extracted handlers.
Description
Split canvasWidgetsReducer and canvasWidgetsStructureReducer for UI modules
Fixes #39326
Automation
/ok-to-test tags="@tag.All"
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/13385385883
Commit: ec13bb0
Cypress dashboard.
Tags:
@tag.All
Spec:
Tue, 18 Feb 2025 08:41:34 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
CanvasWidgetsReduxState
,FlattenedWidgetProps
, and related types to reflect a new organizational structure.