carbon-ui-builder icon indicating copy to clipboard operation
carbon-ui-builder copied to clipboard

remember the new fragment tile selection

Open csgeeek opened this issue 2 years ago • 1 comments

Signed-off-by: Balaji Yaswanth Vankala [email protected]

Related Tickets & Documents

  • Related Issue #203
  • Closes #203

What type of PR is this? (check all that apply)

  • [x] Feature
  • [ ] Bug Fix
  • [ ] Refactor
  • [ ] Documentation Update

Scope

This PR enhances the user experience by remembering the fragment tile selection and auto-selecting the most used fragment type by default.

Implementation

After a fragment is submitted then the frequency will be stored in the localstorage inside an object fragmentSelectionCount via global state context. The state of the defaultSelected fragment radio tile will be fetched from the localstorage every time. Out of all, the one with max count will be assigned to the defaultSelected.

For this feature the auto-selected value will be one of the following:-

  1. IMPORT_JSON
  2. EMPTY_PAGE
  3. EMPTY_FRAGMENT

Screenshots/Recordings/Diagrams:

How to test

We can verify the fragment selection with the fragmentSelectionCount object in localstorage from browser console.

[optional] To-do before merge

[optional] To-do after merge

csgeeek avatar Feb 05 '23 09:02 csgeeek

Deploy request for carbon-components-builder pending review.

Visit the deploys page to approve it

Name Link
Latest commit ca22290ef20410144e09a95c3dc4aa8e7b037c4a

netlify[bot] avatar Feb 05 '23 09:02 netlify[bot]