900 B
900 B
Work Plan - Persist Resize State
Request
The user wants resized areas (sidebar and pool) to be remembered (persisted) so they reopen with the same sizes.
Changes
-
DraftView.tsx:
- Updated initialization of
sidebarWidthstate to read fromlocalStorage.getItem('draft_sidebarWidth'). - Added
useEffectto savesidebarWidthtolocalStoragewhenever it changes. - Verified
poolHeightpersistence logic already exists.
- Updated initialization of
-
DeckBuilderView.tsx:
- Updated initialization of
sidebarWidthandpoolHeightPercentto read fromlocalStoragekeysdeck_sidebarWidthanddeck_poolHeightPercent. - Added
useEffecthooks to persist both values tolocalStorage. - Added
useEffectto imports (fixed lint error).
- Updated initialization of
Verification
- Test: Refreshing the page after resizing the sidebar or pool panel should restore the previous dimensions exactly.