Make icons stable
This commit is contained in:
@@ -27,6 +27,7 @@ function Title({ className }: { className?: string }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function NewThread() {
|
function NewThread() {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
const [_, setThreadId] = useQueryParam("threadId", StringParam);
|
const [_, setThreadId] = useQueryParam("threadId", StringParam);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { BranchSwitcher, CommandBar } from "./shared";
|
|||||||
import { Avatar, AvatarFallback } from "@/components/ui/avatar";
|
import { Avatar, AvatarFallback } from "@/components/ui/avatar";
|
||||||
import { MarkdownText } from "../markdown-text";
|
import { MarkdownText } from "../markdown-text";
|
||||||
import { LoadExternalComponent } from "@langchain/langgraph-sdk/react-ui/client";
|
import { LoadExternalComponent } from "@langchain/langgraph-sdk/react-ui/client";
|
||||||
|
import { cn } from "@/lib/utils";
|
||||||
|
|
||||||
function CustomComponent({
|
function CustomComponent({
|
||||||
message,
|
message,
|
||||||
@@ -67,7 +68,12 @@ export function AssistantMessage({
|
|||||||
<MarkdownText>{contentString}</MarkdownText>
|
<MarkdownText>{contentString}</MarkdownText>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className="flex gap-2 items-center mr-auto opacity-0 group-hover:opacity-100 transition-opacity">
|
<div
|
||||||
|
className={cn(
|
||||||
|
"flex gap-2 items-center mr-auto transition-opacity",
|
||||||
|
"opacity-0 group-focus-within:opacity-100 group-hover:opacity-100",
|
||||||
|
)}
|
||||||
|
>
|
||||||
<BranchSwitcher
|
<BranchSwitcher
|
||||||
branch={meta?.branch}
|
branch={meta?.branch}
|
||||||
branchOptions={meta?.branchOptions}
|
branchOptions={meta?.branchOptions}
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ function EditableContent({
|
|||||||
value={value}
|
value={value}
|
||||||
onChange={(e) => setValue(e.target.value)}
|
onChange={(e) => setValue(e.target.value)}
|
||||||
onKeyDown={handleKeyDown}
|
onKeyDown={handleKeyDown}
|
||||||
|
className="focus-visible:ring-0"
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -57,7 +58,7 @@ export function HumanMessage({
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={cn(
|
className={cn(
|
||||||
"flex items-center ml-auto gap-2 px-4 py-2 group",
|
"flex items-center ml-auto gap-2 group",
|
||||||
isEditing && "w-full max-w-xl",
|
isEditing && "w-full max-w-xl",
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
@@ -69,9 +70,16 @@ export function HumanMessage({
|
|||||||
onSubmit={handleSubmitEdit}
|
onSubmit={handleSubmitEdit}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<p className="text-right">{contentString}</p>
|
<p className="text-right py-1">{contentString}</p>
|
||||||
)}
|
)}
|
||||||
<div className="flex gap-2 items-center ml-auto opacity-0 group-hover:opacity-100 transition-opacity">
|
|
||||||
|
<div
|
||||||
|
className={cn(
|
||||||
|
"flex gap-2 items-center ml-auto transition-opacity",
|
||||||
|
"opacity-0 group-focus-within:opacity-100 group-hover:opacity-100",
|
||||||
|
isEditing && "opacity-100",
|
||||||
|
)}
|
||||||
|
>
|
||||||
<BranchSwitcher
|
<BranchSwitcher
|
||||||
branch={meta?.branch}
|
branch={meta?.branch}
|
||||||
branchOptions={meta?.branchOptions}
|
branchOptions={meta?.branchOptions}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ function ContentCopyable({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<TooltipIconButton
|
<TooltipIconButton
|
||||||
onClick={(e: any) => handleCopy(e)}
|
onClick={(e) => handleCopy(e)}
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
tooltip="Copy content"
|
tooltip="Copy content"
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
@@ -82,6 +82,7 @@ export function BranchSwitcher({
|
|||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="icon"
|
size="icon"
|
||||||
|
className="size-6 p-1"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
const prevBranch = branchOptions[index - 1];
|
const prevBranch = branchOptions[index - 1];
|
||||||
if (!prevBranch) return;
|
if (!prevBranch) return;
|
||||||
@@ -97,6 +98,7 @@ export function BranchSwitcher({
|
|||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="icon"
|
size="icon"
|
||||||
|
className="size-6 p-1"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
const nextBranch = branchOptions[index + 1];
|
const nextBranch = branchOptions[index + 1];
|
||||||
if (!nextBranch) return;
|
if (!nextBranch) return;
|
||||||
|
|||||||
Reference in New Issue
Block a user