From 25fcf55179bf7a7c5d9a94ba9276b14994fd57b8 Mon Sep 17 00:00:00 2001 From: Chris Sherwood Date: Fri, 10 Jul 2026 23:36:15 -0700 Subject: [PATCH] feat(AI): thinking toggle as NOMAD Switch + info tooltip Address review feedback on the per-model thinking control: - Use the shared Switch component (matches AI Assistant settings) instead of a raw checkbox. - Label "Thinking:" with a colon to match the adjacent "Model:" label. - Add an InfoTooltip explaining what thinking does and where the default lives. Extend InfoTooltip with optional `position` ('top'|'bottom') and `align` ('center'|'right') so it opens downward and expands leftward from the right-edge header slot instead of being clipped/crushed against the viewport edge. Defaults preserve existing (benchmark page) behavior. Co-Authored-By: Claude Opus 4.8 (1M context) --- admin/inertia/components/InfoTooltip.tsx | 34 +++++++++++++++++++++--- admin/inertia/components/chat/index.tsx | 25 +++++++++-------- 2 files changed, 44 insertions(+), 15 deletions(-) diff --git a/admin/inertia/components/InfoTooltip.tsx b/admin/inertia/components/InfoTooltip.tsx index f41a90d..172ee5a 100644 --- a/admin/inertia/components/InfoTooltip.tsx +++ b/admin/inertia/components/InfoTooltip.tsx @@ -4,9 +4,21 @@ import { useState } from 'react' interface InfoTooltipProps { text: string className?: string + // Which side of the icon the tooltip pops toward. Defaults to 'top' (existing behavior); + // use 'bottom' when the icon sits near the top of the viewport so it isn't clipped. + position?: 'top' | 'bottom' + // Horizontal anchoring. 'center' (default) centers the bubble on the icon. Use 'right' when + // the icon sits near the right edge so the bubble expands leftward into open space instead of + // being squeezed against the viewport edge (which forces one-word-per-line wrapping). + align?: 'center' | 'right' } -export default function InfoTooltip({ text, className = '' }: InfoTooltipProps) { +export default function InfoTooltip({ + text, + className = '', + position = 'top', + align = 'center', +}: InfoTooltipProps) { const [isVisible, setIsVisible] = useState(false) return ( @@ -23,10 +35,24 @@ export default function InfoTooltip({ text, className = '' }: InfoTooltipProps) {isVisible && ( -
-
+
+
{text} -
+
)} diff --git a/admin/inertia/components/chat/index.tsx b/admin/inertia/components/chat/index.tsx index 7536be3..c8c9f39 100644 --- a/admin/inertia/components/chat/index.tsx +++ b/admin/inertia/components/chat/index.tsx @@ -12,6 +12,8 @@ import classNames from '~/lib/classNames' import { IconX } from '@tabler/icons-react' import { DEFAULT_QUERY_REWRITE_MODEL } from '../../../constants/ollama' import { useSystemSetting } from '~/hooks/useSystemSetting' +import Switch from '~/components/inputs/Switch' +import InfoTooltip from '~/components/InfoTooltip' interface ChatProps { enabled: boolean @@ -534,18 +536,19 @@ export default function Chat({ )}
{selectedModelSupportsThinking && ( -