PromucFlow_constructor/app/client/src/sagas
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
..
__tests__ chore: send segment anonymous id (#19122) 2023-01-06 19:39:38 +05:30
ActionExecution feat: Renamed design system package (#19854) 2023-01-23 09:20:47 +05:30
autoHeightSagas fix: Auto height breaks for fixed modal's children (#18691) 2022-12-05 20:24:45 +05:30
CanvasSagas refactor: Widget Selection (#19643) 2023-01-28 07:47:06 +05:30
WebsocketSagas feat: Renamed design system package (#19854) 2023-01-23 09:20:47 +05:30
ActionSagas.ts feat: Renamed design system package (#19854) 2023-01-23 09:20:47 +05:30
ApiPaneSagas.ts feat: Renamed design system package (#19854) 2023-01-23 09:20:47 +05:30
ApplicationSagas.tsx feat: Renamed design system package (#19854) 2023-01-23 09:20:47 +05:30
AppThemingSaga.tsx feat: Renamed design system package (#19854) 2023-01-23 09:20:47 +05:30
BatchSagas.tsx feat: upgrade to create react app 5 (#14000) 2022-06-21 19:27:34 +05:30
CollectionSagas.ts feat: upgrade to create react app 5 (#14000) 2022-06-21 19:27:34 +05:30
CurlImportSagas.ts chore: Update text message for git remote url placeholder (#15553) 2022-08-02 12:55:51 +05:30
DatasourcesSagas.ts feat: Renamed design system package (#19854) 2023-01-23 09:20:47 +05:30
DebuggerSagas.ts fix: Batch operations on appsmith store for performance gains (#19247) 2023-01-10 10:23:08 +05:30
editorContextSagas.ts fix: set soft focus for property pane inputs (#19009) 2022-12-16 22:52:47 +05:30
ErrorSagas.tsx feat: Renamed design system package (#19854) 2023-01-23 09:20:47 +05:30
EvaluationsSaga.ts feat: Renamed design system package (#19854) 2023-01-23 09:20:47 +05:30
EvalWorkerActionSagas.ts chore: Refactor for JSFunction execution auditLogs (#19671) 2023-01-16 17:26:18 +05:30
FormEvaluationSaga.ts fix: datasource switching issue for Google sheets (#18397) 2022-12-03 15:25:42 +05:30
GitSyncSagas.ts feat: Renamed design system package (#19854) 2023-01-23 09:20:47 +05:30
GlobalSearchSagas.ts chore: Navigation analytics (#18781) 2022-12-15 09:36:13 +05:30
helper.ts feat: Renamed design system package (#19854) 2023-01-23 09:20:47 +05:30
InitSagas.ts feat: Automatic height updates for widgets based on contents (Auto Height) (#18341) 2022-11-23 15:18:23 +05:30
JSActionSagas.ts feat: Renamed design system package (#19854) 2023-01-23 09:20:47 +05:30
JSLibrarySaga.ts feat: Renamed design system package (#19854) 2023-01-23 09:20:47 +05:30
JSPaneSagas.ts feat: Renamed design system package (#19854) 2023-01-23 09:20:47 +05:30
LintingSagas.ts feat: Import javascript libraries (#17895) 2022-12-21 22:44:47 +05:30
ModalSagas.ts refactor: Widget Selection (#19643) 2023-01-28 07:47:06 +05:30
OnboardingSagas.ts refactor: Widget Selection (#19643) 2023-01-28 07:47:06 +05:30
PageSagas.tsx refactor: Widget Selection (#19643) 2023-01-28 07:47:06 +05:30
PageVisibilitySagas.ts feat: Fetch Appsmith version when browser tab comes on focus (#16153) 2022-09-01 14:17:29 +05:30
PluginSagas.ts fix: fetching the plugin form config for queries if datasource is not viewable (#18749) 2022-12-08 09:06:35 +05:30
PostEvaluationSagas.ts feat: Renamed design system package (#19854) 2023-01-23 09:20:47 +05:30
PostLintingSagas.ts chore: update imports for code split (#19085) 2022-12-22 12:04:28 +05:30
ProvidersSaga.ts feat: Renamed design system package (#19854) 2023-01-23 09:20:47 +05:30
QueryPaneSagas.ts feat: Renamed design system package (#19854) 2023-01-23 09:20:47 +05:30
RecentEntitiesSagas.ts chore: update imports for code split (#19085) 2022-12-22 12:04:28 +05:30
ReplaySaga.ts refactor: Widget Selection (#19643) 2023-01-28 07:47:06 +05:30
SaaSPaneSagas.ts feat: Datasource autosave improvements (#17649) 2022-11-30 11:29:45 +05:30
selectors.tsx feat: drag n drop and Container jump enhancements (#19047) 2023-01-06 22:27:40 +05:30
SnipingModeSagas.ts feat: Renamed design system package (#19854) 2023-01-23 09:20:47 +05:30
TemplatesSagas.ts feat: Renamed design system package (#19854) 2023-01-23 09:20:47 +05:30
ThemeSaga.tsx chore: Navigation analytics (#18781) 2022-12-15 09:36:13 +05:30
UtilSagas.ts feat: Refactor code for SAML integration (#12700) 2022-04-12 16:20:01 +05:30
WidgetAdditionSagas.ts feat: Renamed design system package (#19854) 2023-01-23 09:20:47 +05:30
WidgetBlueprintSagas.test.ts fix: Remove auto-height from list widget's children (#18755) 2022-12-18 01:33:35 +05:30
WidgetBlueprintSagas.ts feat: Renamed design system package (#19854) 2023-01-23 09:20:47 +05:30
WidgetDeletionSagas.ts refactor: Widget Selection (#19643) 2023-01-28 07:47:06 +05:30
WidgetEnhancementHelpers.ts fix: Remove auto-height from list widget's children (#18755) 2022-12-18 01:33:35 +05:30
WidgetLoadingSaga.ts feat: Refactor code for SAML integration (#12700) 2022-04-12 16:20:01 +05:30
WidgetOperationSaga.test.tsx feat: upgrade to create react app 5 (#14000) 2022-06-21 19:27:34 +05:30
WidgetOperationSagas.tsx refactor: Widget Selection (#19643) 2023-01-28 07:47:06 +05:30
WidgetOperationUtils.test.ts fix: Extra Space at the end of the Canvas in Viewmode (#16747) 2022-09-30 13:49:52 +05:30
WidgetOperationUtils.ts fix: offset while pasting widget from mouse position in Desktop mode (#19230) 2022-12-29 11:07:54 +00:00
WidgetSelectionSagas.ts refactor: Widget Selection (#19643) 2023-01-28 07:47:06 +05:30
WidgetSelectUtils.test.ts refactor: Widget Selection (#19643) 2023-01-28 07:47:06 +05:30
WidgetSelectUtils.ts refactor: Widget Selection (#19643) 2023-01-28 07:47:06 +05:30