Merge pull request #147 from replayio/PRO-1474-Update-app-name-in-header

Shrink chat description
This commit is contained in:
Strider 2025-06-09 17:40:20 -04:00 committed by GitHub
commit 17684daf02
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -19,18 +19,23 @@ export function ChatDescription() {
} }
return ( return (
<div className="flex items-center justify-center"> <div className="flex items-center justify-center max-w-400">
{editing ? ( {editing ? (
<form onSubmit={handleSubmit} className="flex items-center justify-center"> <form onSubmit={handleSubmit} className="flex items-center justify-center">
<input <input
type="text" type="text"
className="bg-bolt-elements-background-depth-1 text-bolt-elements-textPrimary rounded px-2 mr-2 w-fit" className="bg-bolt-elements-background-depth-1 text-bolt-elements-textPrimary rounded px-2 mr-2 w-fit text-ellipsis"
autoFocus autoFocus
value={currentTitle} value={currentTitle}
onChange={handleChange} onChange={handleChange}
onBlur={handleBlur} onBlur={handleBlur}
onKeyDown={handleKeyDown} onKeyDown={handleKeyDown}
style={{ width: `${Math.max(currentTitle.length * 8, 100)}px` }} style={{
width: `${Math.min(Math.max(currentTitle.length * 8, 100), 400)}px`,
maxWidth: '400px',
overflow: 'hidden',
textOverflow: 'ellipsis',
}}
/> />
<TooltipProvider> <TooltipProvider>
<WithTooltip tooltip="Save title"> <WithTooltip tooltip="Save title">
@ -46,7 +51,7 @@ export function ChatDescription() {
</form> </form>
) : ( ) : (
<> <>
{currentTitle} <div className="max-w-[400px] truncate">{currentTitle}</div>
<TooltipProvider> <TooltipProvider>
<WithTooltip tooltip="Rename chat"> <WithTooltip tooltip="Rename chat">
<div className="flex justify-between items-center p-2 rounded-md bg-bolt-elements-item-backgroundAccent ml-2"> <div className="flex justify-between items-center p-2 rounded-md bg-bolt-elements-item-backgroundAccent ml-2">