Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/en_US/release_notes_9_7.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ New features
| `Issue #6456 <https://github.com/pgadmin-org/pgadmin4/issues/6456>`_ - Added GENERIC_PLAN, MEMORY, SERIALIZE option to EXPLAIN/EXPLAIN ANALYZE command.
| `Issue #8917 <https://github.com/pgadmin-org/pgadmin4/issues/8917>`_ - Add support for server tag-based filtering in the Object Explorer.
| `Issue #8931 <https://github.com/pgadmin-org/pgadmin4/issues/8931>`_ - Added support for builtin locale provider while creating Collation.
| `Issue #8935 <https://github.com/pgadmin-org/pgadmin4/issues/8935>`_ - Added all new connection string parameters introduced in PostgreSQL 16 and later.

Housekeeping
************
Expand Down
23 changes: 17 additions & 6 deletions web/pgadmin/static/js/helpers/Layout/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ export default function Layout({groups, noContextGroups, getLayoutInstance, layo
const layoutDockerObj = React.useMemo(()=>new LayoutDocker(layoutId, props.defaultLayout, resetToTabPanel, noContextGroups), []);
const prefStore = usePreferences();
const dynamicTabsStyleRef = useRef();
const saveAppStateRef = useRef(prefStore?.getPreferencesForModule('misc')?.save_app_state);
const { deleteToolData } = useApplicationState();

useEffect(()=>{
Expand All @@ -411,6 +412,8 @@ export default function Layout({groups, noContextGroups, getLayoutInstance, layo

useEffect(()=>{
const dynamicTabs = prefStore.getPreferencesForModule('browser')?.dynamic_tabs;
const saveAppState = prefStore?.getPreferencesForModule('misc')?.save_app_state;

// Add a class to set max width for non dynamic Tabs
if(!dynamicTabs && !dynamicTabsStyleRef.current) {
const css = '.dock-tab:not(div.dock-tab-active) { max-width: 180px; }',
Expand All @@ -423,6 +426,12 @@ export default function Layout({groups, noContextGroups, getLayoutInstance, layo
dynamicTabsStyleRef.current.remove();
dynamicTabsStyleRef.current = null;
}

if(!saveAppState && saveAppStateRef.current){
saveAppStateRef.current = saveAppState;
layoutDockerObj.saveLayout();
}

}, [prefStore]);

const getTabMenuItems = (panelId)=>{
Expand Down Expand Up @@ -470,10 +479,8 @@ export default function Layout({groups, noContextGroups, getLayoutInstance, layo
const saveTab = (tab) => {
// 'tab' here is the full TabData object, potentially with 'title', 'content', etc.
// We only want to save the 'id' and any custom properties needed by loadTab.
const savedTab = {
id: tab.id,
};
if (tab.metaData && !BROWSER_PANELS.DEBUGGER_TOOL.includes(tab.id.split('_')[0])) {
const saveAppState = prefStore?.getPreferencesForModule('misc')?.save_app_state;
if (saveAppState && tab.metaData && !BROWSER_PANELS.DEBUGGER_TOOL.includes(tab.id.split('_')[0])) {
// add custom properties that were part of the original TabBase
const updatedMetaData = {
...tab.metaData,
Expand All @@ -485,9 +492,13 @@ export default function Layout({groups, noContextGroups, getLayoutInstance, layo
},
restore: true,
};
savedTab.metaData = updatedMetaData;
return {
id: tab.id,
metaData: updatedMetaData
};
}else{
return {id: tab.id};
}
return savedTab;
};

const flatDefaultLayout = useMemo(()=>{
Expand Down
Loading