feat(web): group onebox sidebar navigation

This commit is contained in:
2026-05-21 18:38:44 +00:00
parent ba370cbce8
commit 3f6b058ce5
4 changed files with 279 additions and 83 deletions
+11 -2
View File
@@ -64,6 +64,7 @@ export interface IAppStoreState {
export interface IUiState {
activeView: string;
activeSubview: string | null;
autoRefresh: boolean;
refreshInterval: number;
pendingAppTemplate?: any;
@@ -161,6 +162,7 @@ export const uiStatePart = await appState.getStatePart<IUiState>(
'ui',
{
activeView: 'dashboard',
activeSubview: null,
autoRefresh: true,
refreshInterval: 30000,
},
@@ -1016,10 +1018,17 @@ export const setBackupPasswordAction = settingsStatePart.createAction<{ password
// UI Actions
// ============================================================================
export const setActiveViewAction = uiStatePart.createAction<{ view: string }>(
export const setActiveViewAction = uiStatePart.createAction<{ view: string; subview?: string | null }>(
async (statePartArg, dataArg) => {
const normalizedView = dataArg.view.toLowerCase().replace(/\s+/g, '-');
return { ...statePartArg.getState(), activeView: normalizedView };
const normalizedSubview = dataArg.subview
? dataArg.subview.toLowerCase().replace(/\s+/g, '-')
: null;
return {
...statePartArg.getState(),
activeView: normalizedView,
activeSubview: normalizedSubview,
};
},
);