Part of Phase 1 (Sub-1c): Move trace timeline layout prefs to Zustand#3719
Conversation
Signed-off-by: Parship Chowdhury <parshipchowdhury@gmail.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3719 +/- ##
==========================================
+ Coverage 89.21% 89.22% +0.01%
==========================================
Files 330 331 +1
Lines 9889 9970 +81
Branches 2568 2591 +23
==========================================
+ Hits 8822 8896 +74
- Misses 925 931 +6
- Partials 142 143 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| }); | ||
|
|
||
| it('persists mode to localStorage', () => { | ||
| it('does not persist mode to localStorage (persistence moved to useTraceTimelineStore)', () => { |
There was a problem hiding this comment.
All changes in this file are similar, but the alternative approach would be to check that the settings DID persist, just in a different storage.
Having said that, detailPanelMode and timelineVisible are absolutely meant to be persisted to local storage as sticky configuration options (user profile style), they are not supposed to be lost when UI reloads.
There was a problem hiding this comment.
the tests are edited, just to stop them from failing.
The localStorage persistence is still there, it's now handled by useTraceTimelineStore, which is tested in src/stores/trace-timeline-store.test.ts.
The duck tests for these 4 actions are temporary, the duck itself will be deleted in next sub-PRs along with the remaining redux state. At that point, the only persistence tests will be the ones in trace-timeline-store.test.ts
There was a problem hiding this comment.
btw a future enhancement: #3720
our Zustand store is already a good foundation for it.
Which problem is this PR solving?
Description of the changes
localStorage(so they survive page refresh), reading fromlocalStorageon startup to restore our preferences. This is too much responsibility in one place. The goal of this PR(sub-pr 1) is to move thelocalStorageresponsibility into a new Zustand store.trace-timeline-store.ts+ tests; updatesTracePage,TraceTimelineViewer,duckand related tests.duck.tsHow was this change tested?
detailPanelModeinlocalStorage)timelineVisibleinlocalStorage)sidePanelWidthinlocalStorage)Checklist
make lint testAI Usage in this PR (choose one)
See AI Usage Policy.