@@ -128,6 +128,7 @@ export default function Page() {
128128 userInteracted : false ,
129129 stepsExpanded : true ,
130130 mobileTabsOpen : false ,
131+ mobileTerminalFullscreen : false ,
131132 diffSplit : false ,
132133 } )
133134 let inputRef ! : HTMLDivElement
@@ -152,6 +153,25 @@ export default function Page() {
152153 layout . mobileReview . unregister ( )
153154 } )
154155
156+ // Register mobile message navigation in header when there are multiple messages
157+ createEffect ( ( ) => {
158+ const messages = visibleUserMessages ( )
159+ if ( messages . length > 1 ) {
160+ const currentIndex = messages . findIndex ( ( m ) => m . id === activeMessage ( ) ?. id )
161+ layout . mobileMessageNav . register (
162+ messages . map ( ( m ) => ( { id : m . id , title : m . summary ?. title } ) ) ,
163+ currentIndex >= 0 ? currentIndex : 0 ,
164+ ( index ) => setActiveMessage ( messages [ index ] )
165+ )
166+ } else {
167+ layout . mobileMessageNav . unregister ( )
168+ }
169+ } )
170+
171+ onCleanup ( ( ) => {
172+ layout . mobileMessageNav . unregister ( )
173+ } )
174+
155175 createEffect ( ( ) => {
156176 if ( layout . terminal . opened ( ) ) {
157177 if ( terminal . all ( ) . length === 0 ) {
@@ -872,24 +892,36 @@ export default function Page() {
872892 < DragDropSensors />
873893 < ConstrainDragYAxis />
874894 < Tabs variant = "alt" value = { terminal . active ( ) } onChange = { terminal . open } >
875- < Tabs . List class = "h-10" >
876- < SortableProvider ids = { terminal . all ( ) . map ( ( t : LocalPTY ) => t . id ) } >
877- < For each = { terminal . all ( ) } > { ( pty ) => < SortableTerminalTab terminal = { pty } /> } </ For >
878- </ SortableProvider >
879- < div class = "h-full flex items-center justify-center" >
880- < Tooltip
881- value = {
882- < div class = "flex items-center gap-2" >
883- < span > New terminal</ span >
884- < span class = "text-icon-base text-12-medium" > { command . keybind ( "terminal.new" ) } </ span >
885- </ div >
886- }
887- class = "flex items-center"
888- >
889- < IconButton icon = "plus-small" variant = "ghost" iconSize = "large" onClick = { terminal . new } />
895+ < div class = "flex h-10" >
896+ < Tabs . List class = "h-10 flex-1 min-w-0 overflow-x-auto" >
897+ < SortableProvider ids = { terminal . all ( ) . map ( ( t : LocalPTY ) => t . id ) } >
898+ < For each = { terminal . all ( ) } > { ( pty ) => < SortableTerminalTab terminal = { pty } /> } </ For >
899+ </ SortableProvider >
900+ < div class = "h-full flex items-center justify-center" >
901+ < Tooltip
902+ value = {
903+ < div class = "flex items-center gap-2" >
904+ < span > New terminal</ span >
905+ < span class = "text-icon-base text-12-medium" > { command . keybind ( "terminal.new" ) } </ span >
906+ </ div >
907+ }
908+ class = "flex items-center"
909+ >
910+ < IconButton icon = "plus-small" variant = "ghost" iconSize = "large" onClick = { terminal . new } />
911+ </ Tooltip >
912+ </ div >
913+ </ Tabs . List >
914+ < div class = "sm:hidden h-full flex items-center justify-center shrink-0 px-2 border-l border-border-weak-base" >
915+ < Tooltip value = "Fullscreen terminal" class = "flex items-center" >
916+ < IconButton
917+ icon = "expand"
918+ variant = "ghost"
919+ iconSize = "small"
920+ onClick = { ( ) => setStore ( "mobileTerminalFullscreen" , true ) }
921+ />
890922 </ Tooltip >
891923 </ div >
892- </ Tabs . List >
924+ </ div >
893925 < For each = { terminal . all ( ) } >
894926 { ( pty ) => (
895927 < Tabs . Content value = { pty . id } >
@@ -1083,6 +1115,62 @@ export default function Page() {
10831115 </ div >
10841116 </ div >
10851117 </ Show >
1118+
1119+ { /* Mobile terminal fullscreen overlay */ }
1120+ < Show when = { store . mobileTerminalFullscreen } >
1121+ < div
1122+ class = "fixed inset-0 z-50 sm:hidden flex flex-col bg-background-base"
1123+ style = { {
1124+ "padding-top" : "var(--safe-area-inset-top)" ,
1125+ "padding-bottom" : "var(--safe-area-inset-bottom)" ,
1126+ "padding-left" : "var(--safe-area-inset-left)" ,
1127+ "padding-right" : "var(--safe-area-inset-right)" ,
1128+ } }
1129+ >
1130+ < div class = "flex-1 min-h-0 overflow-hidden flex flex-col" >
1131+ < Tabs variant = "alt" value = { terminal . active ( ) } onChange = { terminal . open } class = "flex flex-col h-full" >
1132+ < div class = "shrink-0 flex h-10" >
1133+ < Tabs . List class = "flex-1 min-w-0 overflow-x-auto" >
1134+ < For each = { terminal . all ( ) } >
1135+ { ( pty ) => (
1136+ < Tabs . Trigger value = { pty . id } class = "max-w-40 truncate" >
1137+ { pty . title }
1138+ </ Tabs . Trigger >
1139+ ) }
1140+ </ For >
1141+ < div class = "h-full flex items-center justify-center" >
1142+ < IconButton
1143+ icon = "plus-small"
1144+ variant = "ghost"
1145+ iconSize = "large"
1146+ onClick = { terminal . new }
1147+ aria-label = "New terminal"
1148+ />
1149+ </ div >
1150+ </ Tabs . List >
1151+ < div class = "h-full flex items-center justify-center shrink-0 px-2 border-l border-border-weak-base" >
1152+ < Tooltip value = "Exit fullscreen" class = "flex items-center" >
1153+ < IconButton
1154+ icon = "collapse"
1155+ variant = "ghost"
1156+ iconSize = "small"
1157+ onClick = { ( ) => setStore ( "mobileTerminalFullscreen" , false ) }
1158+ aria-label = "Exit fullscreen"
1159+ />
1160+ </ Tooltip >
1161+ </ div >
1162+ </ div >
1163+ < For each = { terminal . all ( ) } >
1164+ { ( pty ) => (
1165+ < Tabs . Content value = { pty . id } class = "flex-1 min-h-0" >
1166+ < Terminal pty = { pty } onCleanup = { terminal . update } onConnectError = { ( ) => terminal . clone ( pty . id ) } />
1167+ </ Tabs . Content >
1168+ ) }
1169+ </ For >
1170+ </ Tabs >
1171+ </ div >
1172+ </ div >
1173+ </ Show >
10861174 </ Portal >
10871175 </ div >
10881176 )
0 commit comments