|
2 | 2 | <div ref="panelRef" class="agent-panel" :class="{ resizing: isResizing }"> |
3 | 3 | <!-- 拖拽手柄 --> |
4 | 4 | <div class="resize-handle" @pointerdown="startResize"></div> |
5 | | - <div class="panel-header"> |
6 | | - <div class="panel-title"> |
7 | | - <FolderCode :size="20" class="header-icon" /> |
8 | | - <span><strong>文件系统</strong></span> |
| 5 | + <div class="panel-header" :class="{ 'is-compact': isCompactHeader }"> |
| 6 | + <div class="panel-header-main"> |
| 7 | + <div class="panel-title"> |
| 8 | + <span><strong>文件系统</strong></span> |
| 9 | + </div> |
| 10 | + <div class="window-actions"> |
| 11 | + <button |
| 12 | + class="header-action-btn" |
| 13 | + :title="isExpanded ? '恢复高度' : '向上展开'" |
| 14 | + @click="emit('toggle-expand')" |
| 15 | + > |
| 16 | + <component :is="isExpanded ? ChevronsDownUp : ChevronsUpDown" :size="15" /> |
| 17 | + </button> |
| 18 | + <button class="close-btn" @click="$emit('close')"> |
| 19 | + <X :size="18" /> |
| 20 | + </button> |
| 21 | + </div> |
9 | 22 | </div> |
10 | | - <div class="header-actions"> |
| 23 | + <div class="file-toolbar"> |
11 | 24 | <button |
12 | 25 | class="header-action-btn" |
13 | 26 | title="新建文件夹" |
|
27 | 40 | <button class="header-action-btn" title="刷新" @click="emitRefresh"> |
28 | 41 | <RefreshCw :size="15" /> |
29 | 42 | </button> |
30 | | - <span class="header-divider"></span> |
31 | | - <button |
32 | | - class="header-action-btn" |
33 | | - :title="isExpanded ? '恢复高度' : '向上展开'" |
34 | | - @click="emit('toggle-expand')" |
35 | | - > |
36 | | - <component :is="isExpanded ? ChevronsDownUp : ChevronsUpDown" :size="15" /> |
37 | | - </button> |
38 | | - <button class="close-btn" @click="$emit('close')"> |
39 | | - <X :size="18" /> |
40 | | - </button> |
41 | 43 | </div> |
42 | 44 | </div> |
43 | 45 | <input |
@@ -166,7 +168,6 @@ import { |
166 | 168 | ChevronsDownUp, |
167 | 169 | ChevronsUpDown, |
168 | 170 | Download, |
169 | | - FolderCode, |
170 | 171 | FolderPlus, |
171 | 172 | RefreshCw, |
172 | 173 | Trash2, |
@@ -239,6 +240,7 @@ const expandedKeys = ref([]) |
239 | 240 | const deletingPaths = ref(new Set()) |
240 | 241 |
|
241 | 242 | const useInlinePreview = computed(() => panelWidth.value >= INLINE_PREVIEW_MIN_WIDTH) |
| 243 | +const isCompactHeader = computed(() => panelWidth.value > 0 && panelWidth.value < 360) |
242 | 244 |
|
243 | 245 | const buildDisplayName = (fullPath) => { |
244 | 246 | const normalized = String(fullPath || '').replace(/\/+$/, '') |
@@ -866,10 +868,41 @@ watch(useInlinePreview, (isInline) => { |
866 | 868 | display: flex; |
867 | 869 | align-items: center; |
868 | 870 | justify-content: space-between; |
| 871 | + gap: 8px; |
869 | 872 | padding: 4px 16px; |
870 | | - height: 56px; |
| 873 | + min-height: 56px; |
871 | 874 | background: var(--gray-25); |
872 | 875 | flex-shrink: 0; |
| 876 | +
|
| 877 | + &.is-compact { |
| 878 | + align-items: stretch; |
| 879 | + flex-direction: column; |
| 880 | + gap: 6px; |
| 881 | + padding: 8px 12px; |
| 882 | +
|
| 883 | + .panel-header-main { |
| 884 | + display: flex; |
| 885 | + align-items: center; |
| 886 | + justify-content: space-between; |
| 887 | + gap: 8px; |
| 888 | + min-width: 0; |
| 889 | + } |
| 890 | +
|
| 891 | + .file-toolbar { |
| 892 | + order: 2; |
| 893 | + width: 100%; |
| 894 | + justify-content: flex-start; |
| 895 | + padding: 4px; |
| 896 | + border-right: none; |
| 897 | + border: 1px solid var(--gray-150); |
| 898 | + border-radius: 8px; |
| 899 | + background: var(--gray-0); |
| 900 | + } |
| 901 | + } |
| 902 | +} |
| 903 | +
|
| 904 | +.panel-header-main { |
| 905 | + display: contents; |
873 | 906 | } |
874 | 907 |
|
875 | 908 | .header-action-btn { |
@@ -902,26 +935,41 @@ watch(useInlinePreview, (isInline) => { |
902 | 935 | display: flex; |
903 | 936 | align-items: center; |
904 | 937 | gap: 12px; |
| 938 | + order: 1; |
| 939 | + flex: 1; |
| 940 | + min-width: 0; |
905 | 941 | font-weight: 600; |
906 | 942 | font-size: 14px; |
907 | 943 | color: var(--gray-900); |
908 | 944 |
|
| 945 | + span { |
| 946 | + overflow: hidden; |
| 947 | + text-overflow: ellipsis; |
| 948 | + white-space: nowrap; |
| 949 | + } |
| 950 | +
|
909 | 951 | .header-icon { |
| 952 | + flex-shrink: 0; |
910 | 953 | color: var(--gray-700); |
911 | 954 | } |
912 | 955 | } |
913 | 956 |
|
914 | | -.header-actions { |
| 957 | +.file-toolbar, |
| 958 | +.window-actions { |
915 | 959 | display: flex; |
916 | 960 | align-items: center; |
917 | 961 | gap: 4px; |
918 | 962 | } |
919 | 963 |
|
920 | | -.header-divider { |
921 | | - width: 1px; |
922 | | - height: 16px; |
923 | | - background: var(--gray-300); |
924 | | - margin: 0 4px; |
| 964 | +.file-toolbar { |
| 965 | + order: 2; |
| 966 | + padding-right: 8px; |
| 967 | + border-right: 1px solid var(--gray-300); |
| 968 | +} |
| 969 | +
|
| 970 | +.window-actions { |
| 971 | + order: 3; |
| 972 | + flex-shrink: 0; |
925 | 973 | } |
926 | 974 |
|
927 | 975 | .hidden-file-input { |
|
0 commit comments