Skip to content

Commit 7375da5

Browse files
committed
Merge branch 'codex/show-all-chats' into main
2 parents cfeb4d6 + 2831737 commit 7375da5

2 files changed

Lines changed: 36 additions & 9 deletions

File tree

src/components/sidebar/SidebarThreadTree.vue

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@
488488
<p v-if="isChatsSectionExpanded && chatThreads.length === 0" class="thread-tree-no-results">{{ t('No chats') }}</p>
489489
<ul v-else-if="isChatsSectionExpanded" class="thread-list thread-list-global">
490490
<li
491-
v-for="thread in chatThreads"
491+
v-for="thread in visibleChatThreads"
492492
:key="thread.id"
493493
class="thread-row-item"
494494
:data-menu-open="isThreadMenuOpen(thread.id) ? 'true' : 'false'"
@@ -562,6 +562,15 @@
562562
</SidebarMenuRow>
563563
</li>
564564
</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>
565574
</section>
566575

567576
<Teleport to="body">
@@ -895,6 +904,7 @@ const collapsedProjects = ref<Record<string, boolean>>({})
895904
const isPinnedSectionExpanded = ref(true)
896905
const isProjectsSectionExpanded = ref(true)
897906
const isChatsSectionExpanded = ref(true)
907+
const isChatsListExpanded = ref(false)
898908
const showChatsFirst = ref(loadBooleanStorage(CHATS_FIRST_STORAGE_KEY, false))
899909
const chatSortMode = ref<ChatSortMode>(loadChatSortMode())
900910
let hasLoadedPinnedThreadState = false
@@ -1127,6 +1137,16 @@ const chatThreads = computed(() => {
11271137
})
11281138
})
11291139
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+
11301150
const threadById = computed(() => {
11311151
const map = new Map<string, UiThread>()
11321152
@@ -1929,6 +1949,10 @@ function toggleProjectExpansion(projectName: string): void {
19291949
}
19301950
}
19311951
1952+
function toggleChatsListExpansion(): void {
1953+
isChatsListExpanded.value = !isChatsListExpanded.value
1954+
}
1955+
19321956
function toggleProjectCollapse(projectName: string): void {
19331957
if (suppressNextProjectToggleId.value === projectName) {
19341958
suppressNextProjectToggleId.value = ''

tests.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4895,25 +4895,28 @@ Newly created temporary and permanent worktrees are persisted in workspace roots
48954895

48964896
---
48974897

4898-
### Sidebar chats show all projectless chats
4898+
### Sidebar chats show more projectless chats
48994899

49004900
#### Feature/Change Name
4901-
The sidebar Chats section lists all projectless chats and no longer shows the per-section filter button.
4901+
The sidebar Chats section lists the first 10 projectless chats, offers Show more for the rest, and no longer shows the per-section filter button.
49024902

49034903
#### Prerequisites/Setup
49044904
1. Dev server running (`pnpm run dev`)
4905-
2. Thread history contains more than five projectless chats
4905+
2. Thread history contains more than 10 projectless chats
49064906
3. Light theme and dark theme both available from the appearance switcher
49074907

49084908
#### Steps
49094909
1. In light theme, open the sidebar Chats section.
4910-
2. Count the visible projectless chat rows and confirm older rows beyond the latest five are present.
4911-
3. Confirm the Chats section header only shows the New chat action and does not show a filter button.
4912-
4. Use the main sidebar search button and confirm global thread search still opens and filters chats/projects.
4913-
5. Switch to dark theme and repeat steps 1-4.
4910+
2. Count the visible projectless chat rows and confirm only 10 rows are shown initially.
4911+
3. Click Show more and confirm older projectless chat rows beyond the first 10 appear.
4912+
4. Click Show less and confirm the Chats section returns to 10 visible rows.
4913+
5. Confirm the Chats section header only shows the New chat action and does not show a filter button.
4914+
6. Use the main sidebar search button and confirm global thread search still opens and filters chats/projects without the 10-row browsing limit.
4915+
7. Switch to dark theme and repeat steps 1-6.
49144916

49154917
#### Expected Results
4916-
- All projectless chats are listed in the Chats section according to the selected chat sort mode.
4918+
- The Chats section shows 10 projectless chats by default according to the selected chat sort mode.
4919+
- Show more expands the section to all projectless chats, and Show less restores the 10-row default.
49174920
- The Chats header does not include a filter action.
49184921
- The New chat action remains available.
49194922
- The main sidebar search remains functional.

0 commit comments

Comments
 (0)