mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-09 05:39:12 +00:00
Improve agent pill, detail card styling. Handle null chatInputRef
- Remove border from agent detail hover card on home page - Do not wrap long agent names in agent pills on home page - Handle scenario where chatInputRef is null
This commit is contained in:
@@ -256,7 +256,7 @@ export const ChatInputArea = forwardRef<HTMLTextAreaElement, ChatInputProps>((pr
|
|||||||
|
|
||||||
const chatInputRef = ref as React.MutableRefObject<HTMLTextAreaElement>;
|
const chatInputRef = ref as React.MutableRefObject<HTMLTextAreaElement>;
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!chatInputRef.current) return;
|
if (!chatInputRef?.current) return;
|
||||||
chatInputRef.current.style.height = "auto";
|
chatInputRef.current.style.height = "auto";
|
||||||
chatInputRef.current.style.height =
|
chatInputRef.current.style.height =
|
||||||
Math.max(chatInputRef.current.scrollHeight - 24, 64) + "px";
|
Math.max(chatInputRef.current.scrollHeight - 24, 64) + "px";
|
||||||
|
|||||||
@@ -241,13 +241,13 @@ function ChatBodyData(props: ChatBodyDataProps) {
|
|||||||
setIsPopoverOpen(false);
|
setIsPopoverOpen(false);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<CardTitle className="text-center text-md font-medium flex justify-center items-center">
|
<CardTitle className="text-center text-md font-medium flex justify-center items-center whitespace-nowrap">
|
||||||
{agentIcons[index]} {agent.name}
|
{agentIcons[index]} {agent.name}
|
||||||
</CardTitle>
|
</CardTitle>
|
||||||
</Card>
|
</Card>
|
||||||
</PopoverTrigger>
|
</PopoverTrigger>
|
||||||
<PopoverContent
|
<PopoverContent
|
||||||
className="w-80 p-0"
|
className="w-80 p-0 border-none bg-transparent shadow-none"
|
||||||
onMouseLeave={() => {
|
onMouseLeave={() => {
|
||||||
setHoveredAgent(null);
|
setHoveredAgent(null);
|
||||||
setIsPopoverOpen(false);
|
setIsPopoverOpen(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user