From b6f9b6f1bd9acc53683337277cb26d92c7fa43b5 Mon Sep 17 00:00:00 2001 From: ss Date: Sat, 20 Jun 2026 09:37:25 +0200 Subject: [PATCH 1/2] fix(ui): move menu checks to the right --- apps/web/src/components/chat/ChatComposer.tsx | 23 +++-- apps/web/src/components/chat/TraitsPicker.tsx | 83 ++++++++++++------- apps/web/src/components/ui/menu.tsx | 46 ++++++---- 3 files changed, 97 insertions(+), 55 deletions(-) diff --git a/apps/web/src/components/chat/ChatComposer.tsx b/apps/web/src/components/chat/ChatComposer.tsx index 3a5e06bce06..dded5becd7b 100644 --- a/apps/web/src/components/chat/ChatComposer.tsx +++ b/apps/web/src/components/chat/ChatComposer.tsx @@ -93,6 +93,7 @@ import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip"; import { toastManager } from "../ui/toast"; import { BotIcon, + CheckIcon, CircleAlertIcon, ListTodoIcon, PencilRulerIcon, @@ -271,16 +272,20 @@ const ComposerFooterModeControls = memo(function ComposerFooterModeControls(prop {runtimeModeOptions.map((mode) => { const option = runtimeModeConfig[mode]; const OptionIcon = option.icon; + const isSelected = props.runtimeMode === mode; return ( - -
- - - {option.label} - - - {option.description} - + +
+
+ + + {option.label} + + + {option.description} + +
+
); diff --git a/apps/web/src/components/chat/TraitsPicker.tsx b/apps/web/src/components/chat/TraitsPicker.tsx index 5a32a780289..0b701cdeba9 100644 --- a/apps/web/src/components/chat/TraitsPicker.tsx +++ b/apps/web/src/components/chat/TraitsPicker.tsx @@ -16,7 +16,7 @@ import { } from "@t3tools/shared/model"; import { memo, useCallback, useState } from "react"; import type { VariantProps } from "class-variance-authority"; -import { ChevronDownIcon } from "lucide-react"; +import { CheckIcon, ChevronDownIcon } from "lucide-react"; import { Button, buttonVariants } from "../ui/button"; import { Menu, @@ -298,25 +298,39 @@ export const TraitsMenuContent = memo(function TraitsMenuContentImpl({ option.
) : null} - { + const selectedValue = ultrathinkPromptControlled && descriptor.id === primarySelectDescriptor?.id ? "ultrathink" - : (getDescriptorStringValue(descriptor) ?? "") - } - onValueChange={(value) => handleSelectChange(descriptor, value)} - > - {descriptor.options.map((option) => ( - handleSelectChange(descriptor, value)} > - {option.label} - {option.isDefault ? " (default)" : ""} - - ))} - + {descriptor.options.map((option) => ( + + + + {option.label} + {option.isDefault ? " (default)" : ""} + + {option.id === selectedValue ? ( + + ) : null} + + + ))} + + ); + })()} ))} @@ -327,17 +341,30 @@ export const TraitsMenuContent = memo(function TraitsMenuContentImpl({
{descriptor.label}
- { - updateDescriptors( - replaceDescriptorCurrentValue(descriptors, descriptor.id, value === "on"), - ); - }} - > - On - Off - + {(() => { + const selectedValue = descriptor.currentValue === true ? "on" : "off"; + return ( + { + updateDescriptors( + replaceDescriptorCurrentValue(descriptors, descriptor.id, value === "on"), + ); + }} + > + {(["on", "off"] as const).map((value) => ( + + + {value === "on" ? "On" : "Off"} + {value === selectedValue ? ( + + ) : null} + + + ))} + + ); + })()} ))} diff --git a/apps/web/src/components/ui/menu.tsx b/apps/web/src/components/ui/menu.tsx index 07e27d23f46..e9ee42c8f65 100644 --- a/apps/web/src/components/ui/menu.tsx +++ b/apps/web/src/components/ui/menu.tsx @@ -147,32 +147,42 @@ function MenuRadioGroup(props: MenuPrimitive.RadioGroup.Props) { return ; } -function MenuRadioItem({ className, children, ...props }: MenuPrimitive.RadioItem.Props) { +function MenuRadioItem({ + className, + children, + hideIndicator = false, + ...props +}: MenuPrimitive.RadioItem.Props & { + hideIndicator?: boolean; +}) { return ( - - - - - - {children} + {hideIndicator ? null : ( + + + + + + )} + {children} ); } From 800412dbfe118c75318ab8e649a1f99a9f2012ed Mon Sep 17 00:00:00 2001 From: ss Date: Sat, 20 Jun 2026 09:37:53 +0200 Subject: [PATCH 2/2] fix(ui): make selected menu checks blue --- apps/web/src/components/chat/ChatComposer.tsx | 7 ++++++- apps/web/src/components/chat/TraitsPicker.tsx | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/web/src/components/chat/ChatComposer.tsx b/apps/web/src/components/chat/ChatComposer.tsx index dded5becd7b..9dcc897d62d 100644 --- a/apps/web/src/components/chat/ChatComposer.tsx +++ b/apps/web/src/components/chat/ChatComposer.tsx @@ -285,7 +285,12 @@ const ComposerFooterModeControls = memo(function ComposerFooterModeControls(prop {option.description} - +
); diff --git a/apps/web/src/components/chat/TraitsPicker.tsx b/apps/web/src/components/chat/TraitsPicker.tsx index 0b701cdeba9..a6e64d0a7de 100644 --- a/apps/web/src/components/chat/TraitsPicker.tsx +++ b/apps/web/src/components/chat/TraitsPicker.tsx @@ -323,7 +323,7 @@ export const TraitsMenuContent = memo(function TraitsMenuContentImpl({ {option.isDefault ? " (default)" : ""} {option.id === selectedValue ? ( - + ) : null} @@ -357,7 +357,7 @@ export const TraitsMenuContent = memo(function TraitsMenuContentImpl({ {value === "on" ? "On" : "Off"} {value === selectedValue ? ( - + ) : null}