@@ -348,7 +348,7 @@ function clampTreeSize(size: number, mode = resizeMode.value): number {
348348}
349349
350350function syncResizeMode() {
351- const width = explorerEl . value ?. clientWidth ?? window .innerWidth
351+ const width = window .innerWidth
352352 const nextMode = width <= 768 ? ' vertical' : ' horizontal'
353353 resizeMode .value = nextMode
354354 if (nextMode === ' vertical' ) {
@@ -396,7 +396,14 @@ onMounted(() => {
396396 </script >
397397
398398<template >
399- <div ref =" explorerEl" class =" chatui-git-explorer" :class =" { 'chatui-git-explorer--resizing': resizing }" >
399+ <div
400+ ref =" explorerEl"
401+ class =" chatui-git-explorer"
402+ :class =" {
403+ 'chatui-git-explorer--resizing': resizing,
404+ 'chatui-git-explorer--vertical': resizeMode === 'vertical',
405+ }"
406+ >
400407 <STree class="chatui-explorer-tree" :style =" treeStyle " >
401408 <div v-if =" !props.root" class =" chatui-explorer-empty-tip" >{{ L.explorerPickRootHint }}</div >
402409 <div v-else-if =" gitLoading && gitItems.length === 0" class =" chatui-explorer-empty-tip" >{{ L.loading }}</div >
@@ -797,41 +804,40 @@ onMounted(() => {
797804 color : var (--chatui-diff-add-fg , #116329 );
798805}
799806
800- @media (max-width : 768px ) {
801- .chatui-git-explorer { flex-direction : column ; }
802- .chatui-explorer-tree {
803- width : 100% !important ;
804- min-width : 0 ;
805- max-width : none ;
806- min-height : 140px ;
807- max-height : calc (100% - 180px );
808- }
809- .chatui-explorer-splitter {
810- width : 100% ;
811- height : 8px ;
812- margin : -4px 0 ;
813- cursor : row-resize ;
814- }
815- .chatui-explorer-splitter ::after {
816- top : 3px ;
817- bottom : auto ;
818- left : 0 ;
819- right : 0 ;
820- width : auto ;
821- height : 1px ;
822- }
823- .chatui-git-explorer--resizing .chatui-explorer-splitter {
824- cursor : row-resize ;
825- }
826- .chatui-explorer-toolbar {
827- grid-template-columns : 1fr ;
828- align-items : stretch ;
829- }
830- .chatui-explorer-diff-tabs {
831- justify-self : start ;
832- }
833- .chatui-explorer-git-toolbar-right {
834- justify-content : flex-start ;
835- }
807+ .chatui-git-explorer--vertical { flex-direction : column ; }
808+ .chatui-git-explorer--vertical .chatui-explorer-tree {
809+ width : 100% !important ;
810+ min-width : 0 ;
811+ max-width : none ;
812+ min-height : 140px ;
813+ max-height : calc (100% - 180px );
814+ align-self : auto ;
815+ }
816+ .chatui-git-explorer--vertical .chatui-explorer-splitter {
817+ width : 100% ;
818+ height : 8px ;
819+ margin : -4px 0 ;
820+ cursor : row-resize ;
821+ }
822+ .chatui-git-explorer--vertical .chatui-explorer-splitter ::after {
823+ top : 3px ;
824+ bottom : auto ;
825+ left : 0 ;
826+ right : 0 ;
827+ width : auto ;
828+ height : 1px ;
829+ }
830+ .chatui-git-explorer--vertical.chatui-git-explorer--resizing .chatui-explorer-splitter {
831+ cursor : row-resize ;
832+ }
833+ .chatui-git-explorer--vertical .chatui-explorer-toolbar {
834+ grid-template-columns : 1fr ;
835+ align-items : stretch ;
836+ }
837+ .chatui-git-explorer--vertical .chatui-explorer-diff-tabs {
838+ justify-self : start ;
839+ }
840+ .chatui-git-explorer--vertical .chatui-explorer-git-toolbar-right {
841+ justify-content : flex-start ;
836842}
837843 </style >
0 commit comments