From f8f1a98e1be97b06dcd7ff773fe951231e0539f7 Mon Sep 17 00:00:00 2001 From: jisongniu <529058747@qq.com> Date: Sat, 11 Jul 2026 21:08:08 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat(settings):=20=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E9=A1=B9=E6=82=AC=E5=81=9C=E6=98=BE=E7=A4=BA=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E8=AF=B4=E6=98=8E=EF=BC=8C=E9=99=8D=E4=BD=8E=20Less=20Computer?= =?UTF-8?q?=20/=20=E5=BD=95=E9=9F=B3=E8=83=B6=E5=9B=8A=E7=AD=89=E7=9A=84?= =?UTF-8?q?=E7=90=86=E8=A7=A3=E9=97=A8=E6=A7=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 页面瘦身后设置页描述小字全部隐藏,Less Computer、录音胶囊这类光看名字 猜不出用途的功能只剩一个标签,理解成本高。本次把已有的 desc 文案以 Tooltip 形式挂回标签文字上: - Tooltip 新增 wrap 模式,整句说明允许换行(默认 nowrap 不变) - SettingRow 的 desc 恢复生效:悬停标签文字弹出说明,虚线下划线 + help 光标做「可悬停」暗示,布局保持紧凑 - SectionTitle 新增 hint,Less Computer / Claude 控制台 / 录音与输入 三个板块标题接上已有的 desc 文案 - 录音与输入里录音胶囊 / 录音方式 / 首选麦克风 / 录音时静音 / 插入剪贴板等行补传现成的 i18n desc 文案全部复用现有 i18n key,五种语言无需新增翻译。 --- openless-all/app/src/components/Tooltip.tsx | 19 +++++- .../pages/settings/ClaudeConsoleSection.tsx | 2 +- .../src/pages/settings/CodingAgentSection.tsx | 2 +- .../pages/settings/RecordingInputSection.tsx | 22 +++--- .../app/src/pages/settings/shared.tsx | 68 +++++++++++++------ 5 files changed, 75 insertions(+), 38 deletions(-) diff --git a/openless-all/app/src/components/Tooltip.tsx b/openless-all/app/src/components/Tooltip.tsx index b4e44ea7..fb5e2ae4 100644 --- a/openless-all/app/src/components/Tooltip.tsx +++ b/openless-all/app/src/components/Tooltip.tsx @@ -21,10 +21,12 @@ interface TooltipProps { content: ReactNode; /** 提示出现在锚点的哪一侧,默认 right(适合左侧栏菜单)。 */ placement?: 'right' | 'top' | 'bottom'; + /** 整句说明类提示允许换行;默认 nowrap 适合菜单名等短文案。 */ + wrap?: boolean; children: ReactNode; } -export function Tooltip({ content, placement = 'right', children }: TooltipProps) { +export function Tooltip({ content, placement = 'right', wrap = false, children }: TooltipProps) { const anchorRef = useRef(null); const timerRef = useRef(null); const [pos, setPos] = useState<{ x: number; y: number } | null>(null); @@ -81,7 +83,14 @@ export function Tooltip({ content, placement = 'right', children }: TooltipProps {children} {pos != null && createPortal( - + {content} , document.body, @@ -120,6 +129,12 @@ const bubbleStyle: CSSProperties = { animation: 'ol-tooltip-in 0.12s ease-out both', }; +const wrapBubbleStyle: CSSProperties = { + whiteSpace: 'normal', + width: 'max-content', + maxWidth: 280, +}; + const TOOLTIP_KEYFRAMES = ` @keyframes ol-tooltip-in { from { opacity: 0; scale: .96; } diff --git a/openless-all/app/src/pages/settings/ClaudeConsoleSection.tsx b/openless-all/app/src/pages/settings/ClaudeConsoleSection.tsx index ee0ef786..15ac74c3 100644 --- a/openless-all/app/src/pages/settings/ClaudeConsoleSection.tsx +++ b/openless-all/app/src/pages/settings/ClaudeConsoleSection.tsx @@ -154,7 +154,7 @@ export function ClaudeConsoleSection() { onClick={() => setExpanded(v => !v)} style={{ all: 'unset', cursor: 'pointer', display: 'flex', alignItems: 'center', gap: 8, width: '100%' }} > - {t('settings.codingConsole.title')} + {t('settings.codingConsole.title')} {expanded ? `${t('common.hide')} ▴` : `${t('common.show')} ▾`} diff --git a/openless-all/app/src/pages/settings/CodingAgentSection.tsx b/openless-all/app/src/pages/settings/CodingAgentSection.tsx index d54e83ce..0414a04e 100644 --- a/openless-all/app/src/pages/settings/CodingAgentSection.tsx +++ b/openless-all/app/src/pages/settings/CodingAgentSection.tsx @@ -55,7 +55,7 @@ export function CodingAgentSection() { return ( - {t('settings.codingAgent.title')} + {t('settings.codingAgent.title')} {t('settings.codingAgent.desc')} diff --git a/openless-all/app/src/pages/settings/RecordingInputSection.tsx b/openless-all/app/src/pages/settings/RecordingInputSection.tsx index e6281eb1..af909536 100644 --- a/openless-all/app/src/pages/settings/RecordingInputSection.tsx +++ b/openless-all/app/src/pages/settings/RecordingInputSection.tsx @@ -26,7 +26,7 @@ import type { import { useHotkeySettings } from '../../state/HotkeySettingsContext'; import { SelectLite } from '../../components/ui/SelectLite'; import { Card, Collapsible } from '../_atoms'; -import { SettingRow, Toggle, inputStyle, segmentedTrackStyle } from './shared'; +import { SectionTitle, SettingRow, Toggle, inputStyle, segmentedTrackStyle } from './shared'; import { MicrophoneSelect } from './MicrophoneSelect'; import { detectOS } from '../../components/WindowChrome'; @@ -182,11 +182,9 @@ export function RecordingInputSection() { return ( <> -
-
- {t('settings.recording.title')} -
-
+ + {t('settings.recording.title')} + {isHotkeyModeMigrationNoticeActive() && showDesktopHotkey && (
)} {showDesktopHotkey && ( - +
{choices.map(([v, l]) => ( + + {t('settings.codingConsole.desc')} {expanded && ( diff --git a/openless-all/app/src/pages/settings/shared.tsx b/openless-all/app/src/pages/settings/shared.tsx index 29961993..64a312ff 100644 --- a/openless-all/app/src/pages/settings/shared.tsx +++ b/openless-all/app/src/pages/settings/shared.tsx @@ -37,7 +37,7 @@ export function SectionTitle({ return ( // display:flex 让 Tooltip 的锚点收缩到标题文字本身,提示贴着文字弹出。
- + {children}
@@ -88,8 +88,8 @@ export function SettingRow({ {/* display:flex 让 Tooltip 锚点收缩到文字宽度,提示贴着文字弹出。 */}
{desc ? ( - -
{label}
+ + {label} ) : (
{label}