normalize controls onto lists

This commit is contained in:
jeffvli
2025-11-08 14:28:22 -08:00
parent d6dce29955
commit d5020b7a43
15 changed files with 401 additions and 347 deletions
@@ -13,9 +13,9 @@ export type ItemListAction =
| { type: 'CLEAR_SELECTED' };
export interface ItemListItem {
_serverId: string;
id: string;
itemType: LibraryItem;
serverId: string;
}
export interface ItemListState {
@@ -81,6 +81,8 @@ export const itemListReducer = (state: ItemListState, action: ItemListAction): I
const newExpanded = new Set<string>();
const newExpandedItems = new Map<string, ItemListItem>();
console.log('SET_EXPANDED', action.payload);
if (action.payload.length > 0) {
const firstItem = action.payload[0];
newExpanded.add(firstItem.id);
@@ -158,9 +160,6 @@ export const itemListReducer = (state: ItemListState, action: ItemListAction): I
}
};
/**
* Initial state for item grid
*/
export const initialItemListState: ItemListState = {
expanded: new Set(),
expandedItems: new Map(),