Skip to content

Commit 1eea4d9

Browse files
authored
better ux for thinkingmode control (more responsive, less likely to overlap message) (#2565)
1 parent 3b97084 commit 1eea4d9

File tree

5 files changed

+12
-5
lines changed

5 files changed

+12
-5
lines changed

frontend/app/aipanel/aimessage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ export const AIMessage = memo(({ message, isStreaming }: AIMessageProps) => {
223223
className={cn(
224224
"px-2 rounded-lg [&>*:first-child]:!mt-0",
225225
message.role === "user"
226-
? "py-2 bg-accent-800 text-white max-w-[calc(90%-10px)]"
226+
? "py-2 bg-accent-800 text-white max-w-[calc(100%-50px)] @w450:max-w-[calc(100%-105px)]"
227227
: "min-w-[min(100%,500px)]"
228228
)}
229229
>

frontend/app/aipanel/aipanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ const AIPanelComponentInner = memo(() => {
464464
ref={containerRef}
465465
data-waveai-panel="true"
466466
className={cn(
467-
"bg-gray-900 flex flex-col relative",
467+
"@container bg-gray-900 flex flex-col relative",
468468
model.inBuilder ? "mt-0 h-full" : "mt-1 h-[calc(100%-4px)]",
469469
(isDragOver || isReactDndDragOver) && "bg-gray-800 border-accent",
470470
isFocused ? "border-2 border-accent" : "border-2 border-transparent"

frontend/app/aipanel/aipanelheader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const AIPanelHeader = memo(() => {
1616
};
1717

1818
return (
19-
<div className="@container py-2 pl-3 pr-1 @xs:p-2 @xs:pl-4 border-b border-gray-600 flex items-center justify-between min-w-0">
19+
<div className="py-2 pl-3 pr-1 @xs:p-2 @xs:pl-4 border-b border-gray-600 flex items-center justify-between min-w-0">
2020
<h2 className="text-white text-sm @xs:text-lg font-semibold flex items-center gap-2 flex-shrink-0 whitespace-nowrap">
2121
<i className="fa fa-sparkles text-accent"></i>
2222
Wave AI

frontend/app/aipanel/thinkingmode.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
import { atoms } from "@/app/store/global";
5+
import { cn } from "@/util/util";
56
import { useAtomValue } from "jotai";
67
import { memo, useRef, useState } from "react";
78
import { WaveAIModel } from "./waveai-model";
@@ -64,11 +65,16 @@ export const ThinkingLevelDropdown = memo(() => {
6465
<div className="relative" ref={dropdownRef}>
6566
<button
6667
onClick={() => setIsOpen(!isOpen)}
67-
className="flex items-center gap-1.5 px-2 py-1 text-xs text-gray-300 hover:text-white bg-gray-800/50 hover:bg-gray-700/50 rounded transition-colors cursor-pointer border border-gray-600/50"
68+
className={cn(
69+
"group flex items-center gap-1.5 px-2 py-1 text-xs text-gray-300 hover:text-white rounded transition-colors cursor-pointer border border-gray-600/50",
70+
isOpen ? "bg-gray-700" : "bg-gray-800/50 hover:bg-gray-700"
71+
)}
6872
title={`Thinking: ${currentMetadata.name}`}
6973
>
7074
<i className={`fa ${currentMetadata.icon} text-[10px]`}></i>
71-
<span className="text-[11px]">{currentMetadata.name}</span>
75+
<span className={`text-[11px] ${isOpen ? "inline" : "hidden group-hover:inline @w450:inline"}`}>
76+
{currentMetadata.name}
77+
</span>
7278
<i className="fa fa-chevron-down text-[8px]"></i>
7379
</button>
7480

frontend/tailwindsetup.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
--ansi-brightcyan: #b7b8cb;
6666
--ansi-brightwhite: #f0f0f0;
6767

68+
--container-w450: 450px;
6869
--container-xs: 300px;
6970
--container-xxs: 200px;
7071
--container-tiny: 120px;

0 commit comments

Comments
 (0)