Merge branch 'gzy' into 'master'

feat: 按钮样式变更

See merge request knowledge-base-bj/deerflow-server!131
This commit is contained in:
g zy committed 2026-06-17 06:29:32 +00:00
commit dd631d57d4
1 file changed
+33 -33
+33 -33
View File
@@ -3,7 +3,6 @@
import { import {
BookMarkedIcon, BookMarkedIcon,
BrainCircuitIcon, BrainCircuitIcon,
CheckIcon,
FileTextIcon, FileTextIcon,
GraduationCapIcon, GraduationCapIcon,
} from "lucide-react"; } from "lucide-react";
@@ -23,7 +22,9 @@ import {
} from "@/components/workspace/messages"; } from "@/components/workspace/messages";
import { ThreadContext } from "@/components/workspace/messages/context"; import { ThreadContext } from "@/components/workspace/messages/context";
import { TodoList } from "@/components/workspace/todo-list"; import { TodoList } from "@/components/workspace/todo-list";
import { Tooltip } from "@/components/workspace/tooltip";
import { Button } from "@/components/ui/button"; import { Button } from "@/components/ui/button";
import { TooltipProvider } from "@/components/ui/tooltip";
import { useAgentSelector } from "@/core/agents"; import { useAgentSelector } from "@/core/agents";
import { getAccessToken } from "@/core/auth"; import { getAccessToken } from "@/core/auth";
import { useI18n } from "@/core/i18n/hooks"; import { useI18n } from "@/core/i18n/hooks";
@@ -369,7 +370,7 @@ export default function IframeChatPage() {
}, [handleInterrupt, handleSubmit]); }, [handleInterrupt, handleSubmit]);
const isLandingState = isNewThread && !hasStartedConversation; const isLandingState = isNewThread && !hasStartedConversation;
const bottomBarHeightClass = "pb-28"; const bottomBarHeightClass = "pb-24";
const modeButtons = [ const modeButtons = [
{ {
key: "writing", key: "writing",
@@ -377,8 +378,7 @@ export default function IframeChatPage() {
icon: FileTextIcon, icon: FileTextIcon,
active: !!settings.context.writing_mode, active: !!settings.context.writing_mode,
onClick: toggleWritingMode, onClick: toggleWritingMode,
activeClassName: activeClassName: "text-amber-600 hover:text-amber-700",
"border-amber-300 bg-amber-50 text-amber-700 hover:bg-amber-100",
}, },
{ {
key: "memory", key: "memory",
@@ -386,8 +386,7 @@ export default function IframeChatPage() {
icon: BrainCircuitIcon, icon: BrainCircuitIcon,
active: settings.context.memory_injection_enabled ?? true, active: settings.context.memory_injection_enabled ?? true,
onClick: toggleMemoryInjection, onClick: toggleMemoryInjection,
activeClassName: activeClassName: "text-blue-600 hover:text-blue-700",
"border-blue-300 bg-blue-50 text-blue-700 hover:bg-blue-100",
}, },
{ {
key: "references", key: "references",
@@ -396,8 +395,7 @@ export default function IframeChatPage() {
active: ragModeEnabled, active: ragModeEnabled,
onClick: toggleRagMode, onClick: toggleRagMode,
disabled: ragModeLocked, disabled: ragModeLocked,
activeClassName: activeClassName: "text-emerald-600 hover:text-emerald-700",
"border-emerald-300 bg-emerald-50 text-emerald-700 hover:bg-emerald-100",
}, },
{ {
key: "pro", key: "pro",
@@ -405,8 +403,7 @@ export default function IframeChatPage() {
icon: GraduationCapIcon, icon: GraduationCapIcon,
active: proModeEnabled, active: proModeEnabled,
onClick: toggleProMode, onClick: toggleProMode,
activeClassName: activeClassName: "text-violet-600 hover:text-violet-700",
"border-violet-300 bg-violet-50 text-violet-700 hover:bg-violet-100",
}, },
] as const; ] as const;
@@ -496,29 +493,32 @@ export default function IframeChatPage() {
</div> </div>
</div> </div>
<div className="absolute right-0 bottom-0 left-0 z-40 border-t bg-background/95 backdrop-blur"> <div className="absolute right-0 bottom-0 left-0 z-40 border-t bg-background/95 backdrop-blur">
<div className="mx-auto flex max-w-(--container-width-lg) flex-wrap items-center justify-center gap-2 px-4 py-4"> <TooltipProvider delayDuration={250}>
{modeButtons.map((button) => { <div className="mx-auto flex max-w-(--container-width-lg) flex-wrap items-center justify-center gap-0 px-0 py-1">
const Icon = button.icon; {modeButtons.map((button) => {
return ( const Icon = button.icon;
<Button return (
key={button.key} <Tooltip key={button.key} content={button.label}>
type="button" <Button
variant="outline" type="button"
disabled={button.disabled || isUploading} variant="ghost"
onClick={button.onClick} size="icon"
className={cn( aria-label={button.label}
"gap-1.5 rounded-full border border-transparent bg-muted/40 text-muted-foreground shadow-none hover:bg-muted hover:text-foreground", disabled={button.disabled || isUploading}
button.active && button.activeClassName, onClick={button.onClick}
button.disabled && "cursor-not-allowed opacity-80", className={cn(
)} "size-9 rounded-full text-muted-foreground shadow-none hover:bg-muted/60 hover:text-foreground",
> button.active && button.activeClassName,
{button.active && <CheckIcon className="size-3.5" />} button.disabled && "cursor-not-allowed opacity-80",
<Icon className="size-3.5" /> )}
<span className="text-xs font-normal">{button.label}</span> >
</Button> <Icon className="size-4" />
); </Button>
})} </Tooltip>
</div> );
})}
</div>
</TooltipProvider>
</div> </div>
</main> </main>
</div> </div>