File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -160,6 +160,13 @@ function uxCloseBlock(blockId: string) {
160160 const blockData = globalStore . get ( blockAtom ) ;
161161 const isAIFileDiff = blockData ?. meta ?. view === "aifilediff" ;
162162
163+ // If this is the last block, closing it will close the tab — route through simpleCloseStaticTab
164+ // so the tab:confirmclose setting is respected.
165+ if ( getStaticTabBlockCount ( ) === 1 ) {
166+ simpleCloseStaticTab ( ) ;
167+ return ;
168+ }
169+
163170 const layoutModel = getLayoutModelForStaticTab ( ) ;
164171 const node = layoutModel . getNodeByBlockId ( blockId ) ;
165172 if ( node ) {
@@ -199,6 +206,13 @@ function genericClose() {
199206 return ;
200207 }
201208
209+ // If this is the last block, closing it will close the tab — route through simpleCloseStaticTab
210+ // so the tab:confirmclose setting is respected.
211+ if ( blockCount === 1 ) {
212+ simpleCloseStaticTab ( ) ;
213+ return ;
214+ }
215+
202216 const layoutModel = getLayoutModelForStaticTab ( ) ;
203217 const focusedNode = globalStore . get ( layoutModel . focusedNode ) ;
204218 const blockId = focusedNode ?. data ?. blockId ;
You can’t perform that action at this time.
0 commit comments