From 8cf1783159da5b87343753e177376b47271566e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=91=98=E9=98=BF=E6=B1=9F=28Relakkes?= =?UTF-8?q?=29?= Date: Mon, 13 Jul 2026 11:01:56 +0800 Subject: [PATCH] fix(desktop): compact effort slider popover #1007 --- .../controls/ReasoningEffortPopover.test.tsx | 13 ++++++++++ .../controls/ReasoningEffortPopover.tsx | 26 ++++++++++--------- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/desktop/src/components/controls/ReasoningEffortPopover.test.tsx b/desktop/src/components/controls/ReasoningEffortPopover.test.tsx index 3808291b..3896960c 100644 --- a/desktop/src/components/controls/ReasoningEffortPopover.test.tsx +++ b/desktop/src/components/controls/ReasoningEffortPopover.test.tsx @@ -40,6 +40,19 @@ function renderPopover(overrides: Partial { + it('keeps the effort visual compact without non-functional icon controls', () => { + renderPopover() + + const popover = screen.getByTestId('reasoning-effort-popover') + expect(popover).toHaveStyle({ width: '280px' }) + expect(popover).toHaveClass('px-4', 'pb-4', 'pt-3.5') + expect(popover.querySelectorAll('svg')).toHaveLength(0) + expect(screen.getByTestId('reasoning-effort-label')).toHaveClass('mb-3', 'text-[15px]') + expect(screen.getByRole('slider', { name: '推理强度' })).toHaveClass('h-11') + expect(screen.getByTestId('reasoning-effort-track')).toHaveClass('h-[30px]') + expect(screen.getByTestId('reasoning-effort-thumb')).toHaveClass('h-10', 'w-10') + }) + it('renders every model-supported stop and exposes the selected localized value', () => { renderPopover() diff --git a/desktop/src/components/controls/ReasoningEffortPopover.tsx b/desktop/src/components/controls/ReasoningEffortPopover.tsx index 3302cbcd..c26dff8f 100644 --- a/desktop/src/components/controls/ReasoningEffortPopover.tsx +++ b/desktop/src/components/controls/ReasoningEffortPopover.tsx @@ -1,6 +1,5 @@ import { useEffect, useLayoutEffect, useRef, useState } from 'react' import { createPortal } from 'react-dom' -import { ChevronRight, Zap } from 'lucide-react' import type { ReasoningEffortLevel } from '../../types/settings' @@ -21,7 +20,7 @@ type PopoverPosition = { width: number } -const POPOVER_WIDTH = 360 +const POPOVER_WIDTH = 280 const VIEWPORT_MARGIN = 16 const POPOVER_GAP = 10 @@ -108,15 +107,14 @@ export function ReasoningEffortPopover({
-
-
- {labels[value]} -
-