Skip to content

Commit ceda87f

Browse files
authored
fix(settings-ui): 权限页徽章不换行 + 本地 ASR 区块 Win 灰显 (#473)
Windows 真机反馈的两条 UI 问题,纯 frontend: - 权限页徽章 3 行 wrap — Pill 加 whiteSpace:nowrap + flexShrink:0;message span 加 ellipsis 五件套;zh-CN 描述大段精简 - 本地 ASR 区块 Win 灰显不完整 — Win 上标题区 + 警告 + Qwen3 行整组 opacity:0.45,Foundry 保持正常色 cherry-pick from main (be24bb7),PR base=beta 保持双线同步。pr_agent 一轮 clean、Claude LGTM、三平台 CI 全绿。
1 parent a4ef682 commit ceda87f

4 files changed

Lines changed: 47 additions & 28 deletions

File tree

openless-all/app/src/i18n/zh-CN.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -668,17 +668,17 @@ export const zhCN = {
668668
},
669669
permissions: {
670670
title: '权限',
671-
descAcc: 'OpenLess 需要以下系统权限才能正常工作。授权后通常需要完全退出 App 重启一次才生效。',
672-
descNoAcc: 'OpenLess 需要麦克风可用,并依赖全局快捷键监听状态判断 native hook 是否正常工作。',
671+
descAcc: 'OpenLess 需要以下系统权限。授权后通常要完全退出 App 重启一次才生效。',
672+
descNoAcc: '麦克风必需;全局快捷键状态用来检测 native hook 是否运行。',
673673
micLabel: '麦克风',
674674
micDesc: '用于捕获你的语音输入。',
675675
accLabel: '辅助功能',
676-
accDesc: '用于监听全局快捷键并将识别结果写入光标位置。',
676+
accDesc: '监听全局快捷键并把识别结果写入光标。',
677677
hotkeyLabel: '全局快捷键',
678-
hotkeyDescWithAdapter: '当前适配器:{{adapter}}。用于判断快捷键监听是否已经安装。',
679-
hotkeyDescPlain: '用于判断快捷键监听是否已经安装。',
678+
hotkeyDescWithAdapter: '适配器:{{adapter}}。',
679+
hotkeyDescPlain: '判断快捷键监听是否已安装。',
680680
networkLabel: '网络',
681-
networkDesc: '云端 ASR / LLM 调用所必需。本地模式可关闭。',
681+
networkDesc: '云端 ASR / LLM 必需,本地模式可关。',
682682
networkOk: '可用',
683683
checking: '检查中…',
684684
granted: '已授权',
@@ -691,13 +691,13 @@ export const zhCN = {
691691
hotkeyStarting: '安装中…',
692692
hotkeyFailed: '监听失败',
693693
windowsImeLabel: 'Windows 输入法后端',
694-
windowsImeDesc: '用于在语音会话期间临时切换到 OpenLess TSF 输入法,避免剪贴板插入限制。',
694+
windowsImeDesc: '语音输入时临时切到 OpenLess TSF,绕过剪贴板限制。',
695695
windowsImeInstalled: '已安装',
696696
windowsImeUnavailable: '不可用',
697697
windowsIme: {
698-
installed: '已安装。语音输入时会临时切换到 OpenLess 输入法。',
699-
notInstalled: '未安装。OpenLess 正在使用剪贴板 / WM_PASTE 兜底。',
700-
registrationBroken: '注册已损坏。请重新安装 OpenLess 输入法。',
698+
installed: '已安装,按需切到 OpenLess 输入法。',
699+
notInstalled: '未安装,走剪贴板 / WM_PASTE 兜底。',
700+
registrationBroken: '注册损坏,请重装 OpenLess 输入法。',
701701
notWindows: '仅 Windows 可用。',
702702
},
703703
},

openless-all/app/src/pages/_atoms.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ export function Pill({ children, tone = 'default', size = 'md', style }: PillPro
9090
color: t.color,
9191
border: t.bd === 'transparent' ? '0.5px solid transparent' : `0.5px solid ${t.bd}`,
9292
fontWeight: 500,
93+
whiteSpace: 'nowrap',
94+
flexShrink: 0,
9395
...sz,
9496
...style,
9597
}}

openless-all/app/src/pages/settings/AdvancedSection.tsx

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,13 @@ export function AdvancedSection() {
156156
</Card>
157157

158158
<Card>
159-
{/* 标题 + 右上角 inline 警告小字(替换原琥珀大警告条)。 */}
159+
{/* 标题 + 右上角 inline 警告小字(替换原琥珀大警告条)。
160+
Windows:标题区整体灰显 —— "本地 ASR 模型(实验性)" 在 Win 上几乎只有
161+
Qwen3 占位、本平台暂不支持;Foundry 走的是另一条独立路径,不属于"实验性"
162+
框架。灰显视觉让用户知道这条"实验性"主线在 Win 不可用,关注点转到下方
163+
Foundry 行。 */}
160164
<div style={{ display: 'flex', alignItems: 'flex-start', justifyContent: 'space-between', gap: 12, marginBottom: 14 }}>
161-
<div style={{ minWidth: 0 }}>
165+
<div style={{ minWidth: 0, opacity: isWin ? 0.45 : 1 }}>
162166
<div style={{ fontSize: 13, fontWeight: 600 }}>{t('settings.advanced.localAsrTitle')}</div>
163167
<div style={{ fontSize: 11.5, color: 'var(--ol-ink-4)', marginTop: 2 }}>
164168
{t('settings.advanced.localAsrDesc')}
@@ -173,6 +177,7 @@ export function AdvancedSection() {
173177
flexShrink: 0,
174178
maxWidth: '52%',
175179
paddingTop: 2,
180+
opacity: isWin ? 0.45 : 1,
176181
}}>
177182
⚠️ {t('settings.advanced.localAsrWarningShort')}
178183
</div>
@@ -188,20 +193,24 @@ export function AdvancedSection() {
188193
+ 不可点 + desc=notSupportedHere,跟"本平台不可用"视觉一致。跨平台
189194
异常(Windows profile 同步到 local-qwen3)时 active 状态靠下方独立
190195
"禁用本地 ASR" 行兜底,避免 Toggle ON + desc 说不支持的自相矛盾感
191-
(pr_agent #403 'Stale Windows state' 修法)。 */}
192-
<SettingRow
193-
label={t('settings.providers.presets.asrLocalQwen3')}
194-
desc={isMac ? t('settings.advanced.qwen3Desc') : t('settings.advanced.notSupportedHere')}>
195-
<div style={{ display: 'flex', justifyContent: 'flex-end', width: '100%' }}>
196-
<Toggle
197-
on={isMac && isOnLocalQwen3}
198-
onToggle={isMac && !busy && pendingTarget === null ? (next) => {
199-
if (next) requestEnable('local-qwen3');
200-
else void performSwitch('volcengine');
201-
} : undefined}
202-
/>
203-
</div>
204-
</SettingRow>
196+
(pr_agent #403 'Stale Windows state' 修法)。
197+
Windows 整行灰显,跟"本地 ASR 实验性"标题区视觉对齐 —— 用户一眼看出
198+
这条线在 Win 上不能用,关注点落到下方 Foundry 行。 */}
199+
<div style={{ opacity: isWin ? 0.45 : 1 }}>
200+
<SettingRow
201+
label={t('settings.providers.presets.asrLocalQwen3')}
202+
desc={isMac ? t('settings.advanced.qwen3Desc') : t('settings.advanced.notSupportedHere')}>
203+
<div style={{ display: 'flex', justifyContent: 'flex-end', width: '100%' }}>
204+
<Toggle
205+
on={isMac && isOnLocalQwen3}
206+
onToggle={isMac && !busy && pendingTarget === null ? (next) => {
207+
if (next) requestEnable('local-qwen3');
208+
else void performSwitch('volcengine');
209+
} : undefined}
210+
/>
211+
</div>
212+
</SettingRow>
213+
</div>
205214

206215
{/* Foundry 行 —— 仅 Windows 露出(macOS 不展示 Windows 端模型内容)。 */}
207216
{isWin && (

openless-all/app/src/pages/settings/PermissionsSection.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,11 @@ export function PermissionsSection() {
126126
>
127127
<div style={{ display: 'flex', gap: 8, alignItems: 'center', minWidth: 0, justifyContent: 'flex-end', width: '100%' }}>
128128
{hotkey?.message && (
129-
<span style={{ fontSize: 11.5, color: 'var(--ol-ink-4)', overflow: 'hidden', textOverflow: 'ellipsis' }}>
129+
<span style={{
130+
fontSize: 11.5, color: 'var(--ol-ink-4)',
131+
whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis',
132+
minWidth: 0, flex: '0 1 auto',
133+
}}>
130134
{hotkey.message}
131135
</span>
132136
)}
@@ -140,7 +144,11 @@ export function PermissionsSection() {
140144
>
141145
<div style={{ display: 'flex', gap: 8, alignItems: 'center', minWidth: 0, justifyContent: 'flex-end', width: '100%' }}>
142146
{windowsIme && (
143-
<span style={{ fontSize: 11.5, color: 'var(--ol-ink-4)', overflow: 'hidden', textOverflow: 'ellipsis' }}>
147+
<span style={{
148+
fontSize: 11.5, color: 'var(--ol-ink-4)',
149+
whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis',
150+
minWidth: 0, flex: '0 1 auto',
151+
}}>
144152
{t(`settings.permissions.windowsIme.${windowsIme.state}`)}
145153
</span>
146154
)}

0 commit comments

Comments
 (0)