Skip to content

Commit b25938f

Browse files
committed
refactor(app-shell): name the drawer's recent-conversation fetch size
The drawer reads the caller's newest conversations at the AI home's page size (DRAWER_RECENT_FETCH_LIMIT = ASK_RECENT_FETCH_LIMIT), so a caller with many app-home or other-agent threads still sees the drawer agent's own. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwARdVa47nQacLfco1
1 parent 775b059 commit b25938f

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

‎ui/packages/app-shell/src/console/ai/EmptyConversation.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import { useConversationList, type ConversationListItem } from '../../hooks/useC
2828
import { timeAgo } from '../../utils/relativeTime.js';
2929
import {
3030
DRAWER_RECENT_COUNT,
31+
DRAWER_RECENT_FETCH_LIMIT,
3132
greetingForHour,
3233
greetingName,
3334
selectDrawerRecent,
@@ -231,7 +232,7 @@ export function DrawerRecentConversations({
231232
agentName: string | undefined;
232233
onOpen: (conversation: { id: string; agentId?: string }) => void;
233234
}) {
234-
const { conversations, isLoading, error } = useConversationList({ userId, apiBase, limit: 20 });
235+
const { conversations, isLoading, error } = useConversationList({ userId, apiBase, limit: DRAWER_RECENT_FETCH_LIMIT });
235236
const recent = React.useMemo(
236237
() => selectDrawerRecent(conversations, agentName, DRAWER_RECENT_COUNT[size]),
237238
[conversations, agentName, size],

‎ui/packages/app-shell/src/console/ai/emptyConversationModel.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { agentAliasGroup, isAskAgent } from '@object-ui/plugin-chatbot/core';
1616
import type { ChatSurfaceContext } from '../../layout/chatSurfaceContext.js';
1717
import type { ConversationListItem } from '../../hooks/useConversationList.js';
1818
import { buildAgentSuggestions } from './agentCopy.js';
19+
import { ASK_RECENT_FETCH_LIMIT } from './appAskPageModel.js';
1920

2021
type TranslationFn = (key: string, options?: Record<string, unknown>) => string;
2122

@@ -142,6 +143,13 @@ export function appHomeSuggestions(texts: readonly string[]): EmptySuggestion[]
142143
return texts.map((text) => ({ text, mode: 'send' }));
143144
}
144145

146+
/**
147+
* How many of the caller's newest conversations the drawer reads to pick its
148+
* recent ones from: the AI home's page size, so a
149+
* caller with many app-home or other-agent threads still sees the drawer's own.
150+
*/
151+
export const DRAWER_RECENT_FETCH_LIMIT = ASK_RECENT_FETCH_LIMIT;
152+
145153
/** How many recent conversations each size lists in the drawer. */
146154
export const DRAWER_RECENT_COUNT: Record<EmptyConversationSize, number> = { large: 5, compact: 3 };
147155

0 commit comments

Comments
 (0)