History

Prevent ChatView header overflow with long thread titles

- add `min-w-0` to ChatView container wrappers to allow proper flex shrinking - make thread title truncatable with `truncate` and `title` tooltip - keep action controls fixed-width with `shrink-0` to preserve header layout

Julius Marminge committed 9 months ago

Commit 7a5dd621 parent f64c26e1 file · +7 −5Browse files

Unified · Split

apps/web/src/components/ChatView.tsx+7−5
@@ -969,7 +969,7 @@ export default function ChatView() { · 968 unmodified lines
969969 // Empty state: no active thread
970970 if (!activeThread) {
971971 return (
972− <div className="flex min-h-0 flex-1 flex-col bg-background text-muted-foreground/40">
972+ <div className="flex min-h-0 min-w-0 flex-1 flex-col bg-background text-muted-foreground/40">
973973 {isElectron && (
974974 <div className="drag-region flex h-[52px] shrink-0 items-center border-b border-border px-5">
975975 <span className="text-xs text-muted-foreground/50">No active thread</span>
@@ -985,7 +985,7 @@ export default function ChatView() { · 9 unmodified lines
985985 }
986986
987987 return (
988− <div className="flex min-h-0 flex-1 flex-col bg-background">
988+ <div className="flex min-h-0 min-w-0 flex-1 flex-col bg-background">
989989 {/* Top bar */}
990990 <header
991991 className={`flex items-center justify-between border-b border-border px-5 ${isElectron ? "drag-region h-[52px]" : "py-3"}`}
@@ -1304,11 +1304,13 @@ const ChatHeader = memo(function ChatHeader({ · 312 unmodified lines
13041304 }: ChatHeaderProps) {
13051305 return (
13061306 <>
1307− <div className="flex items-center gap-3">
1308− <h2 className="text-sm font-medium text-foreground">{activeThreadTitle}</h2>
1307+ <div className="flex min-w-0 flex-1 items-center gap-3">
1308+ <h2 className="truncate text-sm font-medium text-foreground" title={activeThreadTitle}>
1309+ {activeThreadTitle}
1310+ </h2>
13091311 {activeProjectName && <Badge variant="outline">{activeProjectName}</Badge>}
13101312 </div>
1311− <div className="flex items-center gap-3">
1313+ <div className="shrink-0 flex items-center gap-3">
13121314 {activeProjectName && <OpenInPicker keybindings={keybindings} />}
13131315 {activeProjectName && <GitActionsControl api={api} gitCwd={gitCwd} />}
13141316 <Button