@@ -47,16 +47,21 @@ struct RootTabs: View {
4747 @ State private var suppressedExecApprovalPromptIDForNotificationSettings : String ?
4848
4949 private static var initialTab : AppTab {
50- let arguments = ProcessInfo . processInfo . arguments
50+ Self . initialTab ( arguments : ProcessInfo . processInfo . arguments )
51+ }
52+
53+ static func initialTab ( arguments : [ String ] ) -> AppTab {
5154 guard let flagIndex = arguments . firstIndex ( of : " --openclaw-initial-tab " ) else {
52- return . control
55+ return self . fallbackInitialTab ( arguments : arguments )
5356 }
5457 let valueIndex = arguments . index ( after : flagIndex )
5558 guard arguments . indices . contains ( valueIndex ) else {
56- return . control
59+ return Self . fallbackInitialTab ( arguments : arguments )
5760 }
5861
5962 switch arguments [ valueIndex ] . lowercased ( ) {
63+ case " control " , " overview " :
64+ return . control
6065 case " chat " :
6166 return . chat
6267 case " talk " , " voice " :
@@ -66,10 +71,14 @@ struct RootTabs: View {
6671 case " settings " :
6772 return . settings
6873 default :
69- return . control
74+ return Self . fallbackInitialTab ( arguments : arguments )
7075 }
7176 }
7277
78+ private static func fallbackInitialTab ( arguments : [ String ] ) -> AppTab {
79+ self . requestedInitialSidebarDestination ( arguments : arguments ) ? . appTab ?? . chat
80+ }
81+
7382 private static var initialSidebarDestination : SidebarDestination {
7483 if let requested = requestedInitialSidebarDestination {
7584 return requested
@@ -78,7 +87,10 @@ struct RootTabs: View {
7887 }
7988
8089 private static var requestedInitialSidebarDestination : SidebarDestination ? {
81- let arguments = ProcessInfo . processInfo . arguments
90+ Self . requestedInitialSidebarDestination ( arguments : ProcessInfo . processInfo . arguments )
91+ }
92+
93+ static func requestedInitialSidebarDestination ( arguments : [ String ] ) -> SidebarDestination ? {
8294 guard let flagIndex = arguments . firstIndex ( of : " --openclaw-initial-destination " ) else {
8395 return nil
8496 }
@@ -139,14 +151,6 @@ struct RootTabs: View {
139151
140152 private var phoneTabContent : some View {
141153 TabView ( selection : self . $selectedTab ) {
142- RootTabsPhoneControlHub (
143- groups : Self . phoneControlGroups ,
144- initialDestination : Self . requestedInitialSidebarDestination ,
145- openRootDestination : { self . selectSidebarDestination ( $0 ) } )
146- . tabItem { Label ( " Control " , systemImage : " square.grid.2x2 " ) }
147- . badge ( self . appModel . pendingExecApprovalPrompt == nil ? 0 : 1 )
148- . tag ( AppTab . control )
149-
150154 ChatProTab ( openSettings : { self . selectSidebarDestination ( . gateway ) } )
151155 . tabItem { Label ( " Chat " , systemImage : " bubble.left.fill " ) }
152156 . tag ( AppTab . chat )
@@ -159,6 +163,14 @@ struct RootTabs: View {
159163 }
160164 . tag ( AppTab . talk )
161165
166+ RootTabsPhoneControlHub (
167+ groups : Self . phoneControlGroups ,
168+ initialDestination : Self . requestedInitialSidebarDestination ,
169+ openRootDestination : { self . selectSidebarDestination ( $0 ) } )
170+ . tabItem { Label ( " Control " , systemImage : " square.grid.2x2 " ) }
171+ . badge ( self . appModel . pendingExecApprovalPrompt == nil ? 0 : 1 )
172+ . tag ( AppTab . control )
173+
162174 NavigationStack {
163175 AgentProTab (
164176 directRoute : . agents ,
0 commit comments