Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/desktop/src/app/chat/sidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ import {
useRepoWorktreeMap
} from './projects'
import { WorktreeDialog } from './projects/worktree-dialog'
import { showProfileTagsInRecents } from './recents-profile-tags'
import { SidebarBlankState, SidebarPinnedEmptyState, SidebarSessionSkeletons } from './section-states'
import { buildSessionByAnyId, resolvePinnedSessions } from './session-index'
import { SidebarSessionsSection, VIRTUALIZE_THRESHOLD } from './sessions-section'
Expand Down Expand Up @@ -1836,6 +1837,7 @@ export function ChatSidebar({
!recentsVirtualizes && 'compact:min-h-0 compact:flex-none compact:overflow-visible'
)}
sessions={displayAgentSessions}
showProfileTags={showProfileTagsInRecents(showAllProfiles, profileGrouped)}
sortable={!showAllProfiles && agentSessions.length > 1}
/>
)}
Expand Down
16 changes: 16 additions & 0 deletions apps/desktop/src/app/chat/sidebar/recents-profile-tags.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { describe, expect, it } from 'vitest'

import { showProfileTagsInRecents } from './recents-profile-tags'

describe('showProfileTagsInRecents', () => {
it.each([
{ groupedByProfile: false, showAllProfiles: true, visible: true },
{ groupedByProfile: true, showAllProfiles: true, visible: false },
{ groupedByProfile: false, showAllProfiles: false, visible: false }
])(
'returns $visible when allProfiles=$showAllProfiles and groupedByProfile=$groupedByProfile',
({ groupedByProfile, showAllProfiles, visible }) => {
expect(showProfileTagsInRecents(showAllProfiles, groupedByProfile)).toBe(visible)
}
)
})
7 changes: 7 additions & 0 deletions apps/desktop/src/app/chat/sidebar/recents-profile-tags.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* Flat All Profiles recents need per-row ownership unless profile group
* headers already provide it. Named-profile filtering remains the row's job.
*/
export function showProfileTagsInRecents(showAllProfiles: boolean, groupedByProfile: boolean): boolean {
return showAllProfiles && !groupedByProfile
}
4 changes: 2 additions & 2 deletions apps/desktop/src/app/chat/sidebar/session-row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ interface SidebarSessionRowProps extends React.ComponentProps<'div'> {
dragging?: boolean
dragHandleProps?: React.HTMLAttributes<HTMLElement>
/** Tag the row with its owning profile (initial chip + tooltip). Used by
* flat cross-profile lists — Pinned and search results in the All-profiles
* view — where no group header communicates ownership (#66003). */
* flat cross-profile lists in the All-profiles view where no profile group
* header communicates ownership. */
showProfile?: boolean
/** Inbox-style card: workspace header, title + last-message preview, and a
* model · size footer. The flat recents list opts in via the filter menu;
Expand Down
5 changes: 2 additions & 3 deletions apps/desktop/src/app/chat/sidebar/sessions-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,8 @@ interface SidebarSessionsSectionProps {
// Rendered atop the entered-project body (a "back to overview" row).
projectBackRow?: React.ReactNode
dndSensors?: ReturnType<typeof useSensors>
// Tag every row with its owning profile. Set on the flat cross-profile
// lists (Pinned / search results) in the All-profiles view, where no group
// header communicates ownership (#66003).
// Tag every row with its owning profile. Set on flat cross-profile lists in
// the All-profiles view where no profile group header communicates ownership.
showProfileTags?: boolean
// Which dividers to fold into the flat list: `date` gives the chronological
// "Yesterday" / "Last week" separators (flat recents + entered-project lanes),
Expand Down