Skip to content
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

Save virtual control positions, Closes #30 #31

Merged
merged 15 commits into from
Dec 18, 2023

Conversation

thenick775
Copy link
Owner

@thenick775 thenick775 commented Dec 18, 2023

High Level Details

Feedback is welcome, feel free to leave comments here!

Technical details

  • lifts initial positions and drag/resize positions once edited to a context that is persisted to localStorage

  • issues with other hooks libraries prompted me to switch to @uidotdev/usehooks, as multiple localStorage state updates without a re-render in between were used in the current approach

    • issues could be seen when relying on using an updater function with the current state value when updating localStorage
  • switch to controlled components for both rnd and draggable elements to preserve and manage their layouts

Deploy Checklist

  • Physical Device Testing

Nick VanCise added 14 commits December 10, 2023 13:26
- control panel bounds can now live in the layout provider

- import order
- tentative move to @uidotdev/usehooks for useLocalStorage

- the implementation there satisfies our needs, with the exception of useInterval, the peer deps in use in this repo prevent me from using react@experimental at this time

- packages are small enough and tree shaken properly, so this isnt a big blocker for me at this time

- this fixes the issue of using an updater function when updating local storage data values
…r provider

- definitions for this diverge here, as we want no value in the emulator provider for the current key bindings

- defaults are synced for emulator volume
- fixes race conditions when setting default values, as the defaults are persisted to local storage instantly, unlike the behavior in usehooks-ts -> localStorage is not set by the default value
@thenick775 thenick775 added the enhancement New feature or request label Dec 18, 2023
@thenick775 thenick775 linked an issue Dec 18, 2023 that may be closed by this pull request
@thenick775 thenick775 merged commit 3346ca4 into master Dec 18, 2023
@thenick775 thenick775 deleted the save-virtual-control-positions branch December 18, 2023 05:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Awesome Job!
1 participant