Dont show new chat placeholders for recipes in sidebar (#6790)
This commit is contained in:
@@ -95,13 +95,14 @@ const menuItems: NavigationEntry[] = [
|
||||
];
|
||||
|
||||
const getSessionDisplayName = (session: Session): string => {
|
||||
if (!shouldShowNewChatTitle(session)) {
|
||||
return session.name;
|
||||
}
|
||||
if (session.recipe?.title) {
|
||||
return session.recipe.title;
|
||||
}
|
||||
return DEFAULT_CHAT_TITLE;
|
||||
|
||||
if (shouldShowNewChatTitle(session)) {
|
||||
return DEFAULT_CHAT_TITLE;
|
||||
}
|
||||
return session.name;
|
||||
};
|
||||
|
||||
const SessionList = React.memo<{
|
||||
|
||||
@@ -58,6 +58,7 @@ import {
|
||||
} from '../ui/dropdown-menu';
|
||||
import { getSearchShortcutText } from '../../utils/keyboardShortcuts';
|
||||
import { errorMessage } from '../../utils/conversionUtils';
|
||||
import { AppEvents } from '../../constants/events';
|
||||
|
||||
export default function RecipesView() {
|
||||
const setView = useNavigation();
|
||||
@@ -149,6 +150,9 @@ export default function RecipesView() {
|
||||
});
|
||||
const session = newAgent.data;
|
||||
trackRecipeStarted(true, undefined, false);
|
||||
|
||||
window.dispatchEvent(new CustomEvent(AppEvents.SESSION_CREATED, { detail: { session } }));
|
||||
|
||||
setView('pair', {
|
||||
disableAnimation: true,
|
||||
resumeSessionId: session.id,
|
||||
|
||||
@@ -9,6 +9,9 @@ import type { FixedExtensionEntry } from './components/ConfigContext';
|
||||
import { AppEvents } from './constants/events';
|
||||
|
||||
export function shouldShowNewChatTitle(session: Session): boolean {
|
||||
if (session.recipe) {
|
||||
return false;
|
||||
}
|
||||
return !session.user_set_name && session.message_count === 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user