logger fix + chat title

This commit is contained in:
Nate Kelley 2025-07-09 15:01:59 -06:00
parent 09ba7b315a
commit 35a160301a
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
2 changed files with 7 additions and 2 deletions

View File

@ -3,10 +3,11 @@ import pino from 'pino';
const isDev = process.env.NODE_ENV !== 'production';
const logLevel = process.env.LOG_LEVEL || 'info';
let isPinoPrettyAvailable = true;
// Create base pino instance
const createBaseLogger = () => {
if (isDev) {
if (isDev && isPinoPrettyAvailable) {
try {
// Only use pino-pretty transport in development
return pino({
@ -19,6 +20,7 @@ const createBaseLogger = () => {
} catch (error) {
console.warn('pino-pretty not available, falling back to JSON logging');
console.error(error);
isPinoPrettyAvailable = false;
}
}

View File

@ -21,6 +21,10 @@ export const ChatHeaderTitle: React.FC<{
}> = React.memo(({ chatTitle, chatId, isCompletedStream }) => {
const { mutateAsync: updateChat } = useUpdateChat();
if (!chatTitle) {
return null;
}
return (
<AnimatePresence mode="wait" initial={!isCompletedStream}>
<motion.div
@ -29,7 +33,6 @@ export const ChatHeaderTitle: React.FC<{
className="flex w-full items-center overflow-hidden">
<EditableTitle
className="w-full"
placeholder="New chat"
level={5}
disabled={!chatTitle}
id={CHAT_HEADER_TITLE_ID}