File tree Expand file tree Collapse file tree 6 files changed +26
-2
lines changed
Expand file tree Collapse file tree 6 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -311,6 +311,20 @@ function makeViewMenu(
311311 {
312312 role : "togglefullscreen" ,
313313 } ,
314+ { type : "separator" } ,
315+ {
316+ label : "Toggle Widgets Bar" ,
317+ click : ( ) => {
318+ fireAndForget ( async ( ) => {
319+ const workspaceId = focusedWaveWindow ?. workspaceId ;
320+ if ( ! workspaceId ) return ;
321+ const oref = `workspace:${ workspaceId } ` ;
322+ const meta = await RpcApi . GetMetaCommand ( ElectronWshClient , { oref } ) ;
323+ const current = meta ?. [ "layout:widgetsvisible" ] ?? true ;
324+ await RpcApi . SetMetaCommand ( ElectronWshClient , { oref, meta : { "layout:widgetsvisible" : ! current } } ) ;
325+ } ) ;
326+ } ,
327+ } ,
314328 ] ;
315329}
316330
Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ class WorkspaceLayoutModel {
5656 private focusTimeoutRef : NodeJS . Timeout | null = null ;
5757 private debouncedPersistAIWidth : ( ) => void ;
5858 private debouncedPersistVTabWidth : ( ) => void ;
59+ widgetsSidebarVisibleAtom : jotai . Atom < boolean > ;
5960
6061 private constructor ( ) {
6162 this . aiPanelRef = null ;
@@ -71,6 +72,11 @@ class WorkspaceLayoutModel {
7172 this . vtabWidth = VTabBar_DefaultWidth ;
7273 this . vtabVisible = false ;
7374 this . panelVisibleAtom = jotai . atom ( false ) ;
75+ this . widgetsSidebarVisibleAtom = jotai . atom (
76+ ( get ) =>
77+ get ( getOrefMetaKeyAtom ( WOS . makeORef ( "workspace" , this . getWorkspaceId ( ) ) , "layout:widgetsvisible" ) ) ??
78+ true
79+ ) ;
7480 this . initializeFromMeta ( ) ;
7581
7682 this . handleWindowResize = this . handleWindowResize . bind ( this ) ;
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ const WorkspaceElem = memo(() => {
4646 const tabBarPosition = useAtomValue ( getSettingsKeyAtom ( "app:tabbar" ) ) ?? "top" ;
4747 const showLeftTabBar = tabBarPosition === "left" ;
4848 const aiPanelVisible = useAtomValue ( workspaceLayoutModel . panelVisibleAtom ) ;
49+ const widgetsSidebarVisible = useAtomValue ( workspaceLayoutModel . widgetsSidebarVisibleAtom ) ;
4950 const windowWidth = window . innerWidth ;
5051 const leftGroupInitialPct = workspaceLayoutModel . getLeftGroupInitialPercentage ( windowWidth , showLeftTabBar ) ;
5152 const innerVTabInitialPct = workspaceLayoutModel . getInnerVTabInitialPercentage ( windowWidth , showLeftTabBar ) ;
@@ -158,7 +159,7 @@ const WorkspaceElem = memo(() => {
158159 ) : (
159160 < div className = "flex flex-row h-full" >
160161 < TabContent key = { tabId } tabId = { tabId } noTopPadding = { showLeftTabBar && isMacOS ( ) } />
161- < Widgets />
162+ { widgetsSidebarVisible && < Widgets /> }
162163 </ div >
163164 ) }
164165 </ Panel >
Original file line number Diff line number Diff line change @@ -1161,6 +1161,7 @@ declare global {
11611161 "bg:bordercolor" ?: string ;
11621162 "bg:activebordercolor" ?: string ;
11631163 "layout:vtabbarwidth" ?: number ;
1164+ "layout:widgetsvisible" ?: boolean ;
11641165 "waveai:panelopen" ?: boolean ;
11651166 "waveai:panelwidth" ?: number ;
11661167 "waveai:model" ?: string ;
Original file line number Diff line number Diff line change @@ -100,6 +100,7 @@ const (
100100 MetaKey_BgActiveBorderColor = "bg:activebordercolor"
101101
102102 MetaKey_LayoutVTabBarWidth = "layout:vtabbarwidth"
103+ MetaKey_LayoutWidgetsVisible = "layout:widgetsvisible"
103104
104105 MetaKey_WaveAiPanelOpen = "waveai:panelopen"
105106 MetaKey_WaveAiPanelWidth = "waveai:panelwidth"
Original file line number Diff line number Diff line change @@ -102,7 +102,8 @@ type MetaTSType struct {
102102 BgActiveBorderColor string `json:"bg:activebordercolor,omitempty"` // frame:activebordercolor
103103
104104 // for workspace
105- LayoutVTabBarWidth int `json:"layout:vtabbarwidth,omitempty"`
105+ LayoutVTabBarWidth int `json:"layout:vtabbarwidth,omitempty"`
106+ LayoutWidgetsVisible * bool `json:"layout:widgetsvisible,omitempty"`
106107
107108 // for tabs+waveai
108109 WaveAiPanelOpen bool `json:"waveai:panelopen,omitempty"`
You can’t perform that action at this time.
0 commit comments