Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 43 additions & 39 deletions components/chat-area.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ export function ChatArea({
ts !== null &&
(nextTs === null ||
new Date(ts).toDateString() !==
new Date(nextTs).toDateString());
new Date(nextTs).toDateString());

return (
<React.Fragment key={message.id}>
Expand Down Expand Up @@ -389,44 +389,48 @@ export function ChatArea({
)}
</ChatMessages>

<ChatToolbar className="border-t border-border bg-card px-2 md:px-4">
<ChatToolbarAddon align="inline-start">
<ChatToolbarButton
type="button"
onClick={() => fileInputRef.current?.click()}
aria-label="Attach document"
>
<Paperclip className="size-4" />
</ChatToolbarButton>
</ChatToolbarAddon>

<ChatToolbarTextarea
value={input}
onChange={(e) => setInput(e.target.value)}
onSubmit={handleSend}
disabled={isGenerating}
placeholder={
isGenerating
? "AI is generating..."
: "Type your message... (Shift+Enter for new line)"
}
className="max-h-50 bg-background"
/>

<ChatToolbarAddon align="inline-end">
<ChatToolbarButton
onClick={handleSend}
disabled={!input.trim() || isGenerating}
aria-label="Send message"
>
<Send className="size-4" />
</ChatToolbarButton>
</ChatToolbarAddon>
</ChatToolbar>

<p className="px-4 pb-2 text-center text-xs text-muted-foreground md:px-6">
AI can make mistakes. Verify important information.
</p>
<div className="border-t border-border bg-card">
<ChatToolbar className="px-2 md:px-4">
<ChatToolbarAddon align="inline-start">
<ChatToolbarButton
type="button"
onClick={() => fileInputRef.current?.click()}
aria-label="Attach document"
className="text-muted-foreground hover:bg-transparent"
>
<Paperclip className="size-5 left-1 relative" strokeWidth={1.8} />
</ChatToolbarButton>
</ChatToolbarAddon>

<ChatToolbarTextarea
value={input}
onChange={(e) => setInput(e.target.value)}
onSubmit={handleSend}
disabled={isGenerating}
placeholder={
isGenerating
? "AI is generating..."
: "Ask me anything..."
}
className="max-h-[200px] bg-background text-base h-[36px] my-auto ml-2"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Verify how ChatToolbarTextarea handles height/autoresize
fd 'chat-toolbar.tsx' --exec sed -n '1,260p' {}

echo
echo "== Usages of ChatToolbarTextarea className constraints =="
rg -n "ChatToolbarTextarea|h-\\[36px\\]|min-h-\\[36px\\]|max-h-\\[200px\\]" components

Repository: PointerRAG/Project

Length of output: 7194


Change fixed h-[36px] to min-h-[36px] to preserve textarea multiline growth.

The fixed height constraint caps the textarea at 36px and prevents it from expanding for multiline input. Use min-h-[36px] instead to maintain minimum height while allowing content-driven growth, which aligns with the component's h-fit design.

Suggested tweak
-            className="max-h-[200px] bg-background text-base h-[36px] my-auto ml-2"
+            className="max-h-[200px] bg-background text-base min-h-[36px] my-auto ml-2"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@components/chat-area.tsx` at line 415, The textarea currently uses a fixed
height class "h-[36px]" which prevents multiline growth; in the textarea element
inside components/chat-area.tsx (the element with className containing
"max-h-[200px] bg-background text-base h-[36px] my-auto ml-2") replace
"h-[36px]" with "min-h-[36px]" so the component keeps a 36px minimum height but
can expand (h-fit / multiline) while still respecting max-h.

/>

<ChatToolbarAddon align="inline-end">
<ChatToolbarButton
onClick={handleSend}
disabled={!input.trim() || isGenerating}
aria-label="Send message"
className="size-9 rounded-xl bg-primary hover:bg-primary/90 text-primary-foreground disabled:bg-muted disabled:text-muted-foreground mr-0.5"
>
<Send className="size-[18px] ml-0.5" strokeWidth={2} />
</ChatToolbarButton>
</ChatToolbarAddon>
</ChatToolbar>

<p className="px-4 pb-2 text-center text-xs text-muted-foreground md:px-6">
AI can make mistakes. Verify important information.
</p>
</div>
</ChatLayout>
);
}
8 changes: 5 additions & 3 deletions components/chat-sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -308,14 +308,14 @@ export function ChatSidebar({ chats, currentUser }: ChatSidebarProps) {
</ScrollArea>
</SidebarContent>

<SidebarFooter className="border-t border-sidebar-border p-4">
<SidebarFooter className="border-t border-sidebar-border px-4 py-2">
<SidebarMenu>
<SidebarMenuItem>
<DropdownMenu>
<DropdownMenuTrigger asChild>
<SidebarMenuButton
size="lg"
className="data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground"
size="default"
className="data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground h-auto py-1"
>
<Avatar className="rounded-sm" size="default">
<AvatarImage src={userImage} alt={userName} />
Expand Down Expand Up @@ -349,6 +349,8 @@ export function ChatSidebar({ chats, currentUser }: ChatSidebarProps) {
</DropdownMenu>
</SidebarMenuItem>
</SidebarMenu>
{/* Spacer matching the height of the right-side disclaimer text */}
<div className="h-5" />
Comment on lines +352 to +353
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hard-coded spacer (<div className="h-5" />) is a fragile, magic-number workaround; any copy/line-height change to the disclaimer can reintroduce misalignment. Prefer solving this at the layout level (e.g., shared footer height/padding, CSS grid rows, or aligning both sidebars and main content within the same parent container) so the two areas stay in sync without manual pixel matching.

Copilot uses AI. Check for mistakes.
</SidebarFooter>
</Sidebar>
);
Expand Down
5 changes: 3 additions & 2 deletions components/chat/chat-toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ export function ChatToolbar({
>
<div
className={cn(
"border rounded-md py-2 px-3",
"flex flex-wrap items-start gap-x-2",
"p-1.5 px-3",
"flex flex-wrap items-end gap-x-2",
"border border-input rounded-2xl bg-background shadow-sm",
)}
>
{children}
Expand Down
Loading
Loading