PromucFlow_constructor/app/client/src/utils/hooks
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
..
useWidgetFocus fix: Improving form widget keyboard accessibility (#18991) 2022-12-30 15:52:11 +01:00
autoHeightUIHooks.ts fix: Updating page permissions in view mode to solve error message for updating the page (#18946) 2022-12-14 20:32:13 +05:30
dragResizeHooks.tsx refactor: deprecate commenting and notifications (#15484) 2022-08-03 12:32:49 +05:30
localstorage.tsx Moving all toast messages to messages.ts file (#2798) 2021-03-13 19:54:45 +05:30
useAllowEditorDragToSelect.ts feat: Add type inference for redux's useSelector hook (#18257) 2022-11-28 08:13:17 +00:00
useAutoGrow.tsx fix: added missed analytic events for git sync (#10953) 2022-02-08 21:46:16 +05:30
useBrandingTheme.ts fix: Rebranding changes for design system components (#19773) 2023-01-17 11:10:49 +05:30
useCanvasMinHeightUpdateHook.ts feat: Add type inference for redux's useSelector hook (#18257) 2022-11-28 08:13:17 +00:00
useClick.tsx chore: update Styled components to latest version and related cleanup (#19284) 2023-01-13 16:35:59 +05:30
useClickToSelectWidget.tsx refactor: Widget Selection (#19643) 2023-01-28 07:47:06 +05:30
useClipboard.tsx
useDeepEffect.test.ts feat: upgrade to create react app 5 (#14000) 2022-06-21 19:27:34 +05:30
useDeepEffect.ts feat: JSON Form widget (#8472) 2022-03-24 12:43:25 +05:30
useDeviceDetect.ts feat: Homepage mobile UI (#10255) 2022-02-17 22:08:36 +05:30
useDSEvent.ts chore: Adds analytics for Property Pane keyboard navigation (#13703) 2022-07-14 10:30:30 +05:30
useDynamicAppLayout.tsx feat: Multi Pane IDE: Phase 1 (#19261) 2023-01-09 10:54:41 +05:30
useGoogleFont.tsx feat: App Theming (#9714) 2022-05-04 15:15:57 +05:30
useHorizontalResize.tsx use clientWidth instead of getBoundingClientRect 2022-02-21 22:11:50 +05:30
useInteractionAnalyticsEvent.ts chore: Adds analytics for Property Pane keyboard navigation (#13703) 2022-07-14 10:30:30 +05:30
useIsScrolledToBottom.tsx Comments feature related fixes (#6156) 2021-07-28 12:32:11 +05:30
useOnClickOutside.tsx feat: App Theming (#9714) 2022-05-04 15:15:57 +05:30
useOnUpgrade.ts chore: redirect to pricing page on upgrade hooks (#20064) 2023-01-26 16:50:34 +05:30
usePositionedContainerZIndex.ts feat: Add type inference for redux's useSelector hook (#18257) 2022-11-28 08:13:17 +00:00
usePrevious.tsx fix: AppViewer init and page fetch logic (#14294) 2022-06-10 18:22:59 +00:00
useProceedToNextTourStep.tsx chore: code split sagas and reducer's index file (#16261) 2022-08-24 17:46:32 +05:30
useReflow.ts fix: Container jump temporary undroppable state of dragging widget (#19737) 2023-01-17 19:45:54 +05:30
useResize.tsx feat: Entity explorer pages section resize (#13576) 2022-05-16 12:09:32 +05:30
useResizeObserver.tsx feat: js object v1 run and settings redesign (#11456) 2022-04-28 17:51:02 +01:00
useScript.tsx
useThrottledRAF.ts Implement new designs for the editor and viewer's navbar (#2750) 2021-02-04 12:32:36 +05:30
useWidgetConfig.ts feat: Automatic height updates for widgets based on contents (Auto Height) (#18341) 2022-11-23 15:18:23 +05:30
useWidgetSelection.ts refactor: Widget Selection (#19643) 2023-01-28 07:47:06 +05:30
useWindowDimensions.tsx Initialise comments (#3328) 2021-04-29 16:03:51 +05:30
useWorkspace.tsx chore: Splitting files to support groups on members page in EE (#18085) 2022-11-03 22:09:51 +05:30