Skip to content

Commit 74150ed

Browse files
committed
fix focus state UI
1 parent 0937a48 commit 74150ed

2 files changed

Lines changed: 14 additions & 10 deletions

File tree

frontend/app/aipanel/aipanel.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const AIPanelComponent = memo(({ className, onClose }: AIPanelProps) => {
3333
const inputRef = useRef<AIPanelInputRef>(null);
3434
const isLayoutMode = jotai.useAtomValue(atoms.controlShiftDelayAtom);
3535
const showOverlayBlockNums = jotai.useAtomValue(getSettingsKeyAtom("app:showoverlayblocknums")) ?? true;
36-
const isInputFocused = jotai.useAtomValue(atoms.waveAIFocusedAtom);
36+
const isFocused = jotai.useAtomValue(atoms.waveAIFocusedAtom);
3737
const telemetryEnabled = jotai.useAtomValue(getSettingsKeyAtom("telemetry:enabled")) ?? false;
3838

3939
const { messages, sendMessage, status, setMessages, error } = useChat({
@@ -163,7 +163,7 @@ const AIPanelComponent = memo(({ className, onClose }: AIPanelProps) => {
163163
const handleDragOver = (e: React.DragEvent) => {
164164
e.preventDefault();
165165
e.stopPropagation();
166-
166+
167167
const hasFiles = hasFilesDragged(e.dataTransfer);
168168
if (hasFiles && !isDragOver) {
169169
setIsDragOver(true);
@@ -175,7 +175,7 @@ const AIPanelComponent = memo(({ className, onClose }: AIPanelProps) => {
175175
const handleDragEnter = (e: React.DragEvent) => {
176176
e.preventDefault();
177177
e.stopPropagation();
178-
178+
179179
if (hasFilesDragged(e.dataTransfer)) {
180180
setIsDragOver(true);
181181
}
@@ -235,15 +235,15 @@ const AIPanelComponent = memo(({ className, onClose }: AIPanelProps) => {
235235
return (
236236
<div
237237
className={cn(
238-
"bg-gray-900 flex flex-col relative h-[calc(100%-3px)] mt-1",
238+
"bg-gray-900 flex flex-col relative h-[calc(100%-4px)] mt-1",
239239
className,
240240
isDragOver && "bg-gray-800 border-accent",
241-
isInputFocused ? "border-t border-accent" : "border-t border-gray-600"
241+
isFocused ? "border-2 border-accent" : "border-2 border-transparent"
242242
)}
243243
style={{
244-
borderRight: isInputFocused ? "1px solid var(--accent-color)" : "1px solid rgb(75, 85, 99)",
245-
borderTopRightRadius: "var(--block-border-radius)",
246-
borderBottomRightRadius: "var(--block-border-radius)",
244+
borderTopRightRadius: 10,
245+
borderBottomRightRadius: 10,
246+
borderBottomLeftRadius: 10,
247247
}}
248248
onDragOver={handleDragOver}
249249
onDragEnter={handleDragEnter}

frontend/app/aipanel/aipanelinput.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export interface AIPanelInputRef {
2121

2222
export const AIPanelInput = memo(
2323
forwardRef<AIPanelInputRef, AIPanelInputProps>(({ input, setInput, onSubmit, status }, ref) => {
24+
const isFocused = useAtomValue(atoms.waveAIFocusedAtom);
2425
const textareaRef = useRef<HTMLTextAreaElement>(null);
2526
const isPanelOpen = useAtomValue(workspaceLayoutModel.panelVisibleAtom);
2627

@@ -68,7 +69,7 @@ export const AIPanelInput = memo(
6869
}, [isPanelOpen, resizeTextarea]);
6970

7071
return (
71-
<div className="border-t border-gray-600">
72+
<div className={cn("border-t", isFocused ? "border-accent/50" : "border-gray-600")}>
7273
<form onSubmit={onSubmit}>
7374
<div className="relative">
7475
<textarea
@@ -79,7 +80,10 @@ export const AIPanelInput = memo(
7980
onFocus={handleFocus}
8081
onBlur={handleBlur}
8182
placeholder="Ask Wave AI anything..."
82-
className="w-full bg-gray-800 text-white px-2 py-2 pr-6 focus:outline-none resize-none overflow-hidden"
83+
className={cn(
84+
"w-full text-white px-2 py-2 pr-6 focus:outline-none resize-none overflow-hidden",
85+
isFocused ? "bg-accent-900/50" : "bg-gray-800"
86+
)}
8387
style={{ fontSize: "13px" }}
8488
rows={2}
8589
/>

0 commit comments

Comments
 (0)