mirror of
https://github.com/usebruno/bruno.git
synced 2026-07-09 06:55:03 +00:00
feat(snapshot): implement active workspace tab type tracking (#8487)
* feat(snapshot): implement active workspace tab type tracking and restoration * feat(snapshot): introduce workspace tab types and update related logic
This commit is contained in:
@@ -30,6 +30,13 @@ const IGNORED_TAB_TYPES = new Set([
|
||||
'v4-migration'
|
||||
]);
|
||||
|
||||
export const WORKSPACE_TAB_UID_SUFFIX_BY_TYPE = {
|
||||
workspaceOverview: 'overview',
|
||||
workspaceEnvironments: 'environments'
|
||||
};
|
||||
|
||||
export const WORKSPACE_TAB_TYPES = new Set(Object.keys(WORKSPACE_TAB_UID_SUFFIX_BY_TYPE));
|
||||
|
||||
export const SAVE_TRIGGERS = new Map([
|
||||
['app/setSnapshotReady', null],
|
||||
['tabs/addTab', null],
|
||||
@@ -143,6 +150,9 @@ const normalizeWorkspaceSnapshotEntry = (pathname, entry = {}) => {
|
||||
? entry.lastActiveCollectionPathname
|
||||
: null,
|
||||
sorting: typeof entry.sorting === 'string' ? entry.sorting : 'default',
|
||||
activeWorkspaceTabType: WORKSPACE_TAB_TYPES.has(entry.activeWorkspaceTabType)
|
||||
? entry.activeWorkspaceTabType
|
||||
: null,
|
||||
collections
|
||||
};
|
||||
};
|
||||
@@ -226,6 +236,7 @@ export const hydrateSnapshotLookups = (snapshot = {}) => {
|
||||
pathname: workspace.pathname,
|
||||
lastActiveCollectionPathname: workspace.lastActiveCollectionPathname,
|
||||
sorting: workspace.sorting,
|
||||
activeWorkspaceTabType: workspace.activeWorkspaceTabType,
|
||||
collections: workspace.collections
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user