PromucFlow_constructor/app/client/src/utils
Hetu Nandu aa9b19c995
refactor: Widget Selection (#19643)
## Description

This change is a refactor of widget selection logic. It consolidates all
the business logic to make it easy to maintain. It also improves the
performance a bit.

It touched a lot of features as we heavily rely on this 

```
Select one
Select multiple with drag
Select multiple with shift
Select multiple with cmd/ctrl
Selections should be on the same level of hierarchy
Unselect all by clicking on the canvas
Unselect all by pressing esc
Select all with cmd + a
Paste in main container
Paste in another container
Undo
Redo
Modal Selection
Modal child selection
Context switching
cmd click
snipping mode
new widget suggestion
onboarding
```

> Refactor widget selection logic

Fixes #19570

## Type of change

- Refactor


## How Has This Been Tested?

All existing tests should pass

### Test Plan
> Add Testsmith test cases links that relate to this PR

### Issues raised during DP testing

https://github.com/appsmithorg/appsmith/pull/19643#issuecomment-1383570810

https://github.com/appsmithorg/appsmith/pull/19643#issuecomment-1383607820

https://github.com/appsmithorg/appsmith/pull/19643#issuecomment-1385095478
[Bug bash
issues](https://www.notion.so/appsmith/610aa302f3e146a7b090b7dc6bc63ef9?v=0d277a9b07bf4aac9d717bcaf138c33a)

## Checklist:
### Dev activity
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] PR is being merged under a feature flag


### QA activity:
- [ ] Test plan has been approved by relevant developers
- [ ] Test plan has been peer reviewed by QA
- [ ] Cypress test cases have been added and approved by either SDET or
manual QA
- [ ] Organized project review call with relevant stakeholders after
Round 1/2 of QA
- [ ] Added Test Plan Approved label after reveiwing all Cypress test
2023-01-28 07:47:06 +05:30
..
autocomplete fix: Autocomplete does not suggest same function name that belongs to… (#19943) 2023-01-26 12:21:41 +05:30
autoHeight fix: Switch to preview mode performance issue (#18457) 2022-11-27 22:42:00 +05:30
CallbackHandler feat: Automatic height updates for widgets based on contents (Auto Height) (#18341) 2022-11-23 15:18:23 +05:30
editor feat: merge GraphQL plugin to release (#16554) 2022-09-09 21:29:47 +05:30
formControl fix: removed old key_val_input, updated keyval_array, show ds info (#18626) 2022-12-13 20:09:16 +05:30
hooks refactor: Widget Selection (#19643) 2023-01-28 07:47:06 +05:30
migrations feat: multi-line input and auto-resize textarea (#19141) 2023-01-17 18:46:35 +05:30
validation fix: update settings pane validations (#18739) 2022-12-12 10:21:14 +05:30
AnalyticsUtil.tsx chore: Use rolling window in the usage pulse call and send segment anonymous id for anonymous users (#19552) 2023-01-10 17:39:33 +05:30
ApiPaneUtils.test.ts fix: Action Selector menu goes out of viewport (#16878) 2022-09-23 10:46:26 +05:30
ApiPaneUtils.tsx fix: Return undefined for nonexistent action headers (#18724) 2023-01-18 15:31:08 +05:30
AppsmithConsole.ts fix: Aggregate calls to add and remove Appsmith errors (#18285) 2022-12-07 11:28:29 +01:00
AppsmithUtils.test.ts perf: Widget re-rendering refactor (#14485) 2022-08-19 15:40:36 +05:30
AppsmithUtils.tsx feat: Renamed design system package (#19854) 2023-01-23 09:20:47 +05:30
AppUtils.ts feat: Code Scanner Widget (#15990) 2022-09-16 10:25:32 +05:30
bootIntercom.ts chore: git sync cypress tests (#10006) 2022-02-25 06:13:16 +00:00
boxHelpers.test.ts feat: (Internal Change) Add auto height computation functions (#17962) 2022-11-20 11:42:32 +05:30
boxHelpers.ts feat: (Internal Change) Add auto height computation functions (#17962) 2022-11-20 11:42:32 +05:30
BrandingUtils.ts fix: Fix Appsmith logo in emails (#20030) 2023-01-26 14:13:24 +05:30
canvasStructureHelpers.test.ts
canvasStructureHelpers.ts refactor: Widget Development API (#6405) 2021-09-09 20:40:22 +05:30
DatasourceSagaUtils.tsx feat: Datasource autosave improvements (#17649) 2022-11-30 11:29:45 +05:30
DSLMigration.test.ts feat: multi-line input and auto-resize textarea (#19141) 2023-01-17 18:46:35 +05:30
DSLMigrations.ts feat: multi-line input and auto-resize textarea (#19141) 2023-01-17 18:46:35 +05:30
DSLMigrationsUtils.test.ts fix: Remove auto-height from list widget's children (#18755) 2022-12-18 01:33:35 +05:30
DynamicBindingUtils.test.ts fix: Refactoring to replace all usages of isEqual method from lodash with equal method from fast-deep-equal/es6 (#16439) 2022-09-02 14:46:30 +05:30
DynamicBindingUtils.ts chore: update imports for code split (#19085) 2022-12-22 12:04:28 +05:30
editorContextUtils.ts fix: google sheet ui issues, removed redundant code (#18785) 2022-12-20 20:40:18 +05:30
formhelpers.test.ts
formhelpers.ts fix: Login password length upper limit changed from 48 to 256 characters (#18176) 2022-12-13 16:40:47 +05:30
GenerateCrudUtil.ts
generators.tsx feat: new Widget Copy paste experience (#12906) 2022-05-04 13:28:57 +05:30
getPathAndValueFromActionDiffObject.ts fix: fixing missing where key (#9215) 2021-11-25 18:48:40 +05:30
getQueryParamsObject.ts feat: [Context Switching] Complex widgets and other Phase 2 items (#17046) 2022-12-08 12:51:58 +05:30
helpers.test.ts feat: Import javascript libraries (#17895) 2022-12-21 22:44:47 +05:30
helpers.tsx refactor: Widget Selection (#19643) 2023-01-28 07:47:06 +05:30
history.ts chore: Navigation analytics (#18781) 2022-12-15 09:36:13 +05:30
JSPaneUtils.test.ts feat: upgrade to create react app 5 (#14000) 2022-06-21 19:27:34 +05:30
JSPaneUtils.tsx fix: Saving variables as string rather than values in backend (#12999) 2022-06-24 09:36:52 +05:30
klona.test.ts fix: Refactoring to replace all usages of isEqual method from lodash with equal method from fast-deep-equal/es6 (#16439) 2022-09-02 14:46:30 +05:30
localStorage.test.ts fix: welcome tour ending on page refresh (#16079) 2022-09-02 18:45:48 +05:30
localStorage.tsx feat: Renamed design system package (#19854) 2023-01-23 09:20:47 +05:30
MessageUtil.ts feat: Import javascript libraries (#17895) 2022-12-21 22:44:47 +05:30
PerformanceTracker.ts refactor: code splitting to support third party sso/oidc in EE (#10201) 2022-01-07 11:38:17 +05:30
PropertyControlFactory.tsx fix: initial selected value not getting displayed (#15000) 2022-07-12 12:46:15 +00:00
PropertyControlRegistry.tsx chore: Adds analytics for Property Pane keyboard navigation (#13703) 2022-07-14 10:30:30 +05:30
ReducerUtils.ts Optimise code editor renders (#15405) 2022-08-04 11:10:44 +05:30
reflowHookUtils.ts feat: (Internal Change) Add auto height computation functions (#17962) 2022-11-20 11:42:32 +05:30
replayHelpers.test.js feat: upgrade to create react app 5 (#14000) 2022-06-21 19:27:34 +05:30
replayHelpers.tsx feat: Renamed design system package (#19854) 2023-01-23 09:20:47 +05:30
storage.ts chore: Navigation analytics (#18781) 2022-12-15 09:36:13 +05:30
testDSLs.ts fix: chart widget color fontfamily (#16750) 2022-09-16 19:50:29 +05:30
testPropertyPaneConfig.test.ts feat: Property pane search (#18164) 2022-12-11 20:12:32 +05:30
treeUtils.ts fix: table search text dependency deletion (#11608) 2022-04-12 13:09:26 +00:00
TypeHelpers.ts feat: Table widget v2 with support for non-ASCII characters and improved jest coverage (#11307) 2022-07-14 12:32:35 +05:30
URLUtils.ts feat: Change navigate to UI (#14856) 2022-09-16 10:00:16 +05:30
UseComposeRef.ts feat: multi-line input and auto-resize textarea (#19141) 2023-01-17 18:46:35 +05:30
widgetEvalUtils.ts fix: update def on widget property name update (#15490) 2022-08-10 10:50:08 +05:30
WidgetFactory.tsx feat: Property pane search (#18164) 2022-12-11 20:12:32 +05:30
WidgetFactoryHelpers.ts feat: Property pane search (#18164) 2022-12-11 20:12:32 +05:30
WidgetFeatures.test.ts feat: Automatic height updates for widgets based on contents (Auto Height) (#18341) 2022-11-23 15:18:23 +05:30
WidgetFeatures.ts fix: Enable auto height by default for JSONForm widget (#18932) 2022-12-23 17:05:27 +05:30
WidgetLoadingStateUtils.test.ts chore: perf data tree shrink (#18361) 2022-12-02 18:15:11 +05:30
WidgetLoadingStateUtils.ts chore: update imports for code split (#19085) 2022-12-22 12:04:28 +05:30
WidgetMigrationUtils.test.ts feat: Option to add new row in Table widget (#17515) 2022-11-05 15:24:20 +05:30
WidgetMigrationUtils.ts feat: Option to add new row in Table widget (#17515) 2022-11-05 15:24:20 +05:30
WidgetPropsUtils.test.tsx feat: Container Jump Improvements and Code for tracking Container Jumps (#12686) 2022-04-13 20:27:44 +05:30
WidgetPropsUtils.tsx feat: drag n drop and Container jump enhancements (#19047) 2023-01-06 22:27:40 +05:30
WidgetRegisterHelpers.tsx fix: Theme Stylesheet refactor (#18258) 2022-11-28 10:14:31 +05:30
WidgetRegistry.tsx feat: Automatic height updates for widgets based on contents (Auto Height) (#18341) 2022-11-23 15:18:23 +05:30
widgetRenderUtils.test.ts perf: Widget re-rendering refactor (#14485) 2022-08-19 15:40:36 +05:30
widgetRenderUtils.tsx perf: Widget re-rendering refactor (#14485) 2022-08-19 15:40:36 +05:30
WorkerUtil.test.ts chore: update Styled components to latest version and related cleanup (#19284) 2023-01-13 16:35:59 +05:30
WorkerUtil.ts feat: Import javascript libraries (#17895) 2022-12-21 22:44:47 +05:30