|
488 | 488 | <p v-if="isChatsSectionExpanded && chatThreads.length === 0" class="thread-tree-no-results">{{ t('No chats') }}</p> |
489 | 489 | <ul v-else-if="isChatsSectionExpanded" class="thread-list thread-list-global"> |
490 | 490 | <li |
491 | | - v-for="thread in chatThreads" |
| 491 | + v-for="thread in visibleChatThreads" |
492 | 492 | :key="thread.id" |
493 | 493 | class="thread-row-item" |
494 | 494 | :data-menu-open="isThreadMenuOpen(thread.id) ? 'true' : 'false'" |
|
562 | 562 | </SidebarMenuRow> |
563 | 563 | </li> |
564 | 564 | </ul> |
| 565 | + |
| 566 | + <SidebarMenuRow v-if="isChatsSectionExpanded && hasHiddenChatThreads" class="thread-show-more-row"> |
| 567 | + <template #left> |
| 568 | + <span class="thread-show-more-spacer" /> |
| 569 | + </template> |
| 570 | + <button class="thread-show-more-button" type="button" @click="toggleChatsListExpansion"> |
| 571 | + {{ isChatsListExpanded ? 'Show less' : 'Show more' }} |
| 572 | + </button> |
| 573 | + </SidebarMenuRow> |
565 | 574 | </section> |
566 | 575 |
|
567 | 576 | <Teleport to="body"> |
@@ -895,6 +904,7 @@ const collapsedProjects = ref<Record<string, boolean>>({}) |
895 | 904 | const isPinnedSectionExpanded = ref(true) |
896 | 905 | const isProjectsSectionExpanded = ref(true) |
897 | 906 | const isChatsSectionExpanded = ref(true) |
| 907 | +const isChatsListExpanded = ref(false) |
898 | 908 | const showChatsFirst = ref(loadBooleanStorage(CHATS_FIRST_STORAGE_KEY, false)) |
899 | 909 | const chatSortMode = ref<ChatSortMode>(loadChatSortMode()) |
900 | 910 | let hasLoadedPinnedThreadState = false |
@@ -1127,6 +1137,16 @@ const chatThreads = computed(() => { |
1127 | 1137 | }) |
1128 | 1138 | }) |
1129 | 1139 |
|
| 1140 | +const visibleChatThreads = computed(() => { |
| 1141 | + if (isSearchActive.value) return chatThreads.value |
| 1142 | + return isChatsListExpanded.value ? chatThreads.value : chatThreads.value.slice(0, 10) |
| 1143 | +}) |
| 1144 | +
|
| 1145 | +const hasHiddenChatThreads = computed(() => { |
| 1146 | + if (isSearchActive.value) return false |
| 1147 | + return chatThreads.value.length > 10 |
| 1148 | +}) |
| 1149 | +
|
1130 | 1150 | const threadById = computed(() => { |
1131 | 1151 | const map = new Map<string, UiThread>() |
1132 | 1152 |
|
@@ -1929,6 +1949,10 @@ function toggleProjectExpansion(projectName: string): void { |
1929 | 1949 | } |
1930 | 1950 | } |
1931 | 1951 |
|
| 1952 | +function toggleChatsListExpansion(): void { |
| 1953 | + isChatsListExpanded.value = !isChatsListExpanded.value |
| 1954 | +} |
| 1955 | +
|
1932 | 1956 | function toggleProjectCollapse(projectName: string): void { |
1933 | 1957 | if (suppressNextProjectToggleId.value === projectName) { |
1934 | 1958 | suppressNextProjectToggleId.value = '' |
|
0 commit comments