@@ -6,7 +6,12 @@ import {getSuitesTreeViewData} from '@/static/new-ui/features/suites/components/
66import { findTreeNodeByBrowserId , findTreeNodeById , getGroupId } from '@/static/new-ui/features/suites/utils' ;
77import * as localStorageWrapper from '../local-storage-wrapper' ;
88import { MIN_SECTION_SIZE_PERCENT } from '@/static/new-ui/features/suites/constants' ;
9- import { TIME_TRAVEL_PLAYER_VISIBILITY_KEY , TWO_UP_DIFF_VISIBILITY_KEY , TWO_UP_FIT_MODE_KEY } from '@/constants/local-storage' ;
9+ import {
10+ SUITES_PAGE_EXPANDED_SECTIONS_KEY ,
11+ TIME_TRAVEL_PLAYER_VISIBILITY_KEY ,
12+ TWO_UP_DIFF_VISIBILITY_KEY ,
13+ TWO_UP_FIT_MODE_KEY
14+ } from '@/constants/local-storage' ;
1015import { Page , TwoUpFitMode } from '@/constants' ;
1116
1217const SECTION_SIZES_LOCAL_STORAGE_KEY = 'suites-page-section-sizes' ;
@@ -62,6 +67,7 @@ export default (state: State, action: SomeAction): State => {
6267 const isSnapshotsPlayerVisible = Boolean ( localStorageWrapper . getItem ( TIME_TRAVEL_PLAYER_VISIBILITY_KEY , true ) ) ;
6368 const is2UpDiffVisible = Boolean ( localStorageWrapper . getItem ( TWO_UP_DIFF_VISIBILITY_KEY , true ) ) ;
6469 const twoUpFitMode = localStorageWrapper . getItem ( TWO_UP_FIT_MODE_KEY , TwoUpFitMode . FitToView ) as TwoUpFitMode ;
70+ const expandedSectionsById = localStorageWrapper . getItem ( SUITES_PAGE_EXPANDED_SECTIONS_KEY , { } ) as Record < string , boolean > ;
6571
6672 return applyStateUpdate ( state , {
6773 app : {
@@ -73,6 +79,7 @@ export default (state: State, action: SomeAction): State => {
7379 ui : {
7480 suitesPage : {
7581 expandedTreeNodesById,
82+ expandedSectionsById,
7683 treeViewMode,
7784 sectionSizes : suitesSectionSizes ,
7885 isSnapshotsPlayerVisible
@@ -131,12 +138,16 @@ export default (state: State, action: SomeAction): State => {
131138 } ) as State ;
132139 }
133140 case actionNames . SUITES_PAGE_SET_SECTION_EXPANDED : {
141+ const expandedSectionsById = {
142+ ...state . ui . suitesPage . expandedSectionsById ,
143+ [ action . payload . sectionId ] : action . payload . isExpanded
144+ } ;
145+ localStorageWrapper . setItem ( SUITES_PAGE_EXPANDED_SECTIONS_KEY , expandedSectionsById ) ;
146+
134147 return applyStateUpdate ( state , {
135148 ui : {
136149 suitesPage : {
137- expandedSectionsById : {
138- [ action . payload . sectionId ] : action . payload . isExpanded
139- }
150+ expandedSectionsById
140151 }
141152 }
142153 } ) as State ;
0 commit comments