mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-25 09:51:28 +00:00
feat: add focus mode for split panes
This commit is contained in:
1 parent
afc02116a8
commit
5db74fbb2d
26 files changed
+869
-60
No files matched your search
@@ -5,7 +5,9 @@ import {
|
||||
createSidePanelLayout,
|
||||
focusSidePanelPane,
|
||||
getFocusedSidePanelPane,
|
||||
maximizeSidePanelPane,
|
||||
resizeSidePanelSplit,
|
||||
restoreSidePanelLayout,
|
||||
selectSidePanelTool,
|
||||
splitSidePanelPane,
|
||||
type SidePanelLayout,
|
||||
@@ -118,6 +120,20 @@ export function useTerminalSidePanelLayoutState() {
|
||||
setSidePanelLayouts(layouts);
|
||||
}, []);
|
||||
|
||||
const maximizePane = useCallback((tabId: string, paneId: string) => {
|
||||
const layout = sidePanelLayoutsRef.current.get(tabId);
|
||||
if (!layout) return;
|
||||
const nextLayout = maximizeSidePanelPane(layout, paneId);
|
||||
if (nextLayout !== layout) commitLayout(tabId, nextLayout);
|
||||
}, [commitLayout]);
|
||||
|
||||
const restoreLayout = useCallback((tabId: string) => {
|
||||
const layout = sidePanelLayoutsRef.current.get(tabId);
|
||||
if (!layout) return;
|
||||
const nextLayout = restoreSidePanelLayout(layout);
|
||||
if (nextLayout !== layout) commitLayout(tabId, nextLayout);
|
||||
}, [commitLayout]);
|
||||
|
||||
return {
|
||||
sidePanelOpenTabs,
|
||||
setSidePanelOpenTabs,
|
||||
@@ -129,5 +145,7 @@ export function useTerminalSidePanelLayoutState() {
|
||||
splitPane,
|
||||
closePane,
|
||||
resizeSplit,
|
||||
maximizePane,
|
||||
restoreLayout,
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user