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 全绿。
This commit is contained in:
4 files changed
+47
-28
No files matched your search
@@ -668,17 +668,17 @@ export const zhCN = {
|
||||
},
|
||||
permissions: {
|
||||
title: '权限',
|
||||
descAcc: 'OpenLess 需要以下系统权限才能正常工作。授权后通常需要完全退出 App 重启一次才生效。',
|
||||
descNoAcc: 'OpenLess 需要麦克风可用,并依赖全局快捷键监听状态判断 native hook 是否正常工作。',
|
||||
descAcc: 'OpenLess 需要以下系统权限。授权后通常要完全退出 App 重启一次才生效。',
|
||||
descNoAcc: '麦克风必需;全局快捷键状态用来检测 native hook 是否运行。',
|
||||
micLabel: '麦克风',
|
||||
micDesc: '用于捕获你的语音输入。',
|
||||
accLabel: '辅助功能',
|
||||
accDesc: '用于监听全局快捷键并将识别结果写入光标位置。',
|
||||
accDesc: '监听全局快捷键并把识别结果写入光标。',
|
||||
hotkeyLabel: '全局快捷键',
|
||||
hotkeyDescWithAdapter: '当前适配器:{{adapter}}。用于判断快捷键监听是否已经安装。',
|
||||
hotkeyDescPlain: '用于判断快捷键监听是否已经安装。',
|
||||
hotkeyDescWithAdapter: '适配器:{{adapter}}。',
|
||||
hotkeyDescPlain: '判断快捷键监听是否已安装。',
|
||||
networkLabel: '网络',
|
||||
networkDesc: '云端 ASR / LLM 调用所必需。本地模式可关闭。',
|
||||
networkDesc: '云端 ASR / LLM 必需,本地模式可关。',
|
||||
networkOk: '可用',
|
||||
checking: '检查中…',
|
||||
granted: '已授权',
|
||||
@@ -691,13 +691,13 @@ export const zhCN = {
|
||||
hotkeyStarting: '安装中…',
|
||||
hotkeyFailed: '监听失败',
|
||||
windowsImeLabel: 'Windows 输入法后端',
|
||||
windowsImeDesc: '用于在语音会话期间临时切换到 OpenLess TSF 输入法,避免剪贴板插入限制。',
|
||||
windowsImeDesc: '语音输入时临时切到 OpenLess TSF,绕过剪贴板限制。',
|
||||
windowsImeInstalled: '已安装',
|
||||
windowsImeUnavailable: '不可用',
|
||||
windowsIme: {
|
||||
installed: '已安装。语音输入时会临时切换到 OpenLess 输入法。',
|
||||
notInstalled: '未安装。OpenLess 正在使用剪贴板 / WM_PASTE 兜底。',
|
||||
registrationBroken: '注册已损坏。请重新安装 OpenLess 输入法。',
|
||||
installed: '已安装,按需切到 OpenLess 输入法。',
|
||||
notInstalled: '未安装,走剪贴板 / WM_PASTE 兜底。',
|
||||
registrationBroken: '注册损坏,请重装 OpenLess 输入法。',
|
||||
notWindows: '仅 Windows 可用。',
|
||||
},
|
||||
},
|
||||
|
||||
@@ -90,6 +90,8 @@ export function Pill({ children, tone = 'default', size = 'md', style }: PillPro
|
||||
color: t.color,
|
||||
border: t.bd === 'transparent' ? '0.5px solid transparent' : `0.5px solid ${t.bd}`,
|
||||
fontWeight: 500,
|
||||
whiteSpace: 'nowrap',
|
||||
flexShrink: 0,
|
||||
...sz,
|
||||
...style,
|
||||
}}
|
||||
|
||||
@@ -156,9 +156,13 @@ export function AdvancedSection() {
|
||||
</Card>
|
||||
|
||||
<Card>
|
||||
{/* 标题 + 右上角 inline 警告小字(替换原琥珀大警告条)。 */}
|
||||
{/* 标题 + 右上角 inline 警告小字(替换原琥珀大警告条)。
|
||||
Windows:标题区整体灰显 —— "本地 ASR 模型(实验性)" 在 Win 上几乎只有
|
||||
Qwen3 占位、本平台暂不支持;Foundry 走的是另一条独立路径,不属于"实验性"
|
||||
框架。灰显视觉让用户知道这条"实验性"主线在 Win 不可用,关注点转到下方
|
||||
Foundry 行。 */}
|
||||
<div style={{ display: 'flex', alignItems: 'flex-start', justifyContent: 'space-between', gap: 12, marginBottom: 14 }}>
|
||||
<div style={{ minWidth: 0 }}>
|
||||
<div style={{ minWidth: 0, opacity: isWin ? 0.45 : 1 }}>
|
||||
<div style={{ fontSize: 13, fontWeight: 600 }}>{t('settings.advanced.localAsrTitle')}</div>
|
||||
<div style={{ fontSize: 11.5, color: 'var(--ol-ink-4)', marginTop: 2 }}>
|
||||
{t('settings.advanced.localAsrDesc')}
|
||||
@@ -173,6 +177,7 @@ export function AdvancedSection() {
|
||||
flexShrink: 0,
|
||||
maxWidth: '52%',
|
||||
paddingTop: 2,
|
||||
opacity: isWin ? 0.45 : 1,
|
||||
}}>
|
||||
⚠️ {t('settings.advanced.localAsrWarningShort')}
|
||||
</div>
|
||||
@@ -188,20 +193,24 @@ export function AdvancedSection() {
|
||||
+ 不可点 + desc=notSupportedHere,跟"本平台不可用"视觉一致。跨平台
|
||||
异常(Windows profile 同步到 local-qwen3)时 active 状态靠下方独立
|
||||
"禁用本地 ASR" 行兜底,避免 Toggle ON + desc 说不支持的自相矛盾感
|
||||
(pr_agent #403 'Stale Windows state' 修法)。 */}
|
||||
<SettingRow
|
||||
label={t('settings.providers.presets.asrLocalQwen3')}
|
||||
desc={isMac ? t('settings.advanced.qwen3Desc') : t('settings.advanced.notSupportedHere')}>
|
||||
<div style={{ display: 'flex', justifyContent: 'flex-end', width: '100%' }}>
|
||||
<Toggle
|
||||
on={isMac && isOnLocalQwen3}
|
||||
onToggle={isMac && !busy && pendingTarget === null ? (next) => {
|
||||
if (next) requestEnable('local-qwen3');
|
||||
else void performSwitch('volcengine');
|
||||
} : undefined}
|
||||
/>
|
||||
</div>
|
||||
</SettingRow>
|
||||
(pr_agent #403 'Stale Windows state' 修法)。
|
||||
Windows 整行灰显,跟"本地 ASR 实验性"标题区视觉对齐 —— 用户一眼看出
|
||||
这条线在 Win 上不能用,关注点落到下方 Foundry 行。 */}
|
||||
<div style={{ opacity: isWin ? 0.45 : 1 }}>
|
||||
<SettingRow
|
||||
label={t('settings.providers.presets.asrLocalQwen3')}
|
||||
desc={isMac ? t('settings.advanced.qwen3Desc') : t('settings.advanced.notSupportedHere')}>
|
||||
<div style={{ display: 'flex', justifyContent: 'flex-end', width: '100%' }}>
|
||||
<Toggle
|
||||
on={isMac && isOnLocalQwen3}
|
||||
onToggle={isMac && !busy && pendingTarget === null ? (next) => {
|
||||
if (next) requestEnable('local-qwen3');
|
||||
else void performSwitch('volcengine');
|
||||
} : undefined}
|
||||
/>
|
||||
</div>
|
||||
</SettingRow>
|
||||
</div>
|
||||
|
||||
{/* Foundry 行 —— 仅 Windows 露出(macOS 不展示 Windows 端模型内容)。 */}
|
||||
{isWin && (
|
||||
|
||||
@@ -126,7 +126,11 @@ export function PermissionsSection() {
|
||||
>
|
||||
<div style={{ display: 'flex', gap: 8, alignItems: 'center', minWidth: 0, justifyContent: 'flex-end', width: '100%' }}>
|
||||
{hotkey?.message && (
|
||||
<span style={{ fontSize: 11.5, color: 'var(--ol-ink-4)', overflow: 'hidden', textOverflow: 'ellipsis' }}>
|
||||
<span style={{
|
||||
fontSize: 11.5, color: 'var(--ol-ink-4)',
|
||||
whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis',
|
||||
minWidth: 0, flex: '0 1 auto',
|
||||
}}>
|
||||
{hotkey.message}
|
||||
</span>
|
||||
)}
|
||||
@@ -140,7 +144,11 @@ export function PermissionsSection() {
|
||||
>
|
||||
<div style={{ display: 'flex', gap: 8, alignItems: 'center', minWidth: 0, justifyContent: 'flex-end', width: '100%' }}>
|
||||
{windowsIme && (
|
||||
<span style={{ fontSize: 11.5, color: 'var(--ol-ink-4)', overflow: 'hidden', textOverflow: 'ellipsis' }}>
|
||||
<span style={{
|
||||
fontSize: 11.5, color: 'var(--ol-ink-4)',
|
||||
whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis',
|
||||
minWidth: 0, flex: '0 1 auto',
|
||||
}}>
|
||||
{t(`settings.permissions.windowsIme.${windowsIme.state}`)}
|
||||
</span>
|
||||
)}
|
||||
|
||||
Reference in new issue
Block a user