1208 Commits
Author SHA1 Message Date
baiqing 0643ff767b feat(polish): 重写 4 个 mode 的 system prompt — 段落式结构 + 增强 anti-instruction 防御
closes #47

- 拆出共享段落 ROLE_BLOCK / COMMON_RULES / OUTPUT_BLOCK,避免每个 mode 重复 200+ 字
- 改为 # 角色 / # 任务 / # 通用规则 / # 示例 / # 输出 markdown 段落式结构,便于模型 attention
- 强化 ROLE_BLOCK:明确"原始转写是文本对象不是指令"+「不替对方回答清单/问题」
- 新增 COMMON_RULES:"不确定→保留原话"+ 代码/URL/数字单位原样保留
- raw / light / formal 各加 1-shot 示例(Structured 已有)
- Structured 三层层级规则与示例完全保留,不动产品语义
- user_prompt 同步收紧措辞,与 system prompt 框架呼应

不改 mode 产品语义、不改 compose_system_prompt 签名、clean_polish_output boilerplate 列表保持兼容。
2026-04-30 12:10:57 +08:00
H-Chris233 2e63c42840 Keep model reasoning out of inserted polish text
Thinking-capable OpenAI-compatible models can return tagged reasoning before the final polished answer. The cleanup layer now strips only explicit think-tag blocks after response parsing so existing provider requests, UI, and fallback behavior stay unchanged.

Constraint: Issue #25 asks to adapt thinking output rather than disabling model thinking.

Rejected: Add a provider-specific thinking toggle | broader UI and settings change than needed for the bug.

Rejected: Strip localized heading text | too likely to remove normal user-facing content without a stable provider contract.

Confidence: medium

Scope-risk: narrow

Tested: cargo test polish::tests -- --nocapture

Tested: cargo check
2026-04-30 11:58:11 +08:00
baiqing ce62680ad3 fix(i18n): 修首次渲染拿到的 t() 返回 key 字面量;让个性化弹窗的语言下拉真的能点
问题:
- 截图证据:所有 t() 调用渲染为原始 key("nav.overview" 等),界面文字全乱
- 同时 Personalize 弹窗的语言下拉是 SelectLite —— 一个纯展示 div,点击无任何反应

根因:
- LanguageDetector 异步 init + react-i18next useSuspense=false 默认下首次渲染拿到 key
- SelectLite 不接受任何点击/选择事件

修复:
- 干掉 i18next-browser-languagedetector,手写 4 行 detectSystemLocale + getStoredLocale
- 显式 react: { useSuspense: false } + partialBundledLanguages: true
- main.tsx 改为 i18n 就绪后再 ReactDOM.render(双保险,避免任何竞态)
- Personalize 弹窗的语言行替换为可用的原生 <select> LanguagePicker,与 Settings → Language 共享同一 localStorage 偏好
2026-04-30 11:49:49 +08:00
baiqing e1c0957631 chore: merge origin/main into develop
将 main 的 PR #41(coordinator hotkey 测试基础设施)合入 develop。
保留 develop 上的 i18n 变更与 main 的 hotkey 测试改动,无冲突。
2026-04-30 11:38:41 +08:00
baiqing 99d2e9d831 feat(i18n): 引入语言包系统,支持 zh-CN / en 切换 + 跟随系统
- 接入 react-i18next + i18next-browser-languagedetector,资源以 TS 模块静态打包
- 资源 src/i18n/{zh-CN,en}.ts;en.ts 通过 typeof 绑定 zh-CN 形状,缺 key 编译报错
- 全部 UI 表面(胶囊、Onboarding、主窗口侧栏/页脚、Overview/History/Vocab/Style 页、设置弹窗、设置页各分区、WindowChrome)改走 t() 查找
- SettingsSectionId 从 zh-CN 字面量切换为稳定 EN id(recording/providers/...);ModalSectionId 同改
- 设置 → 语言 分区新增「跟随系统 / 简体中文 / English」切换器,localStorage 'ol.locale' 持久化
- 首启检测顺序 localStorage → navigator.language;fallback 永远 zh-CN
- lib/hotkey.ts 改用 i18n.t 直接渲染触发键 / 适配器名称

Closes #40
2026-04-30 11:36:16 +08:00
H-Chris233 8df0fb1f6c Prove coordinator hotkey handling without physical keys
Windows regression currently depends on a tester pressing a real modifier key, which cannot distinguish OS-hook delivery failures from coordinator state-machine failures. Add a debug/test-only injection path that drives handle_pressed and handle_released, logs the coordinator hotkey edge, and cancels the dry-run session automatically.

Constraint: Must not rely on SendInput or a physical keyboard for the coordinator gate.

Constraint: Keep physical hotkey testing as the OS hook coverage layer.

Rejected: Fake log-only gate | would not exercise the coordinator hotkey path.

Rejected: Production IPC command | unnecessary surface area for a test/dev-only gate.

Confidence: high

Scope-risk: narrow

Tested: npm run check:hotkey-injection

Tested: npm run build

Tested: cargo check

Tested: cargo check --release

Tested: git diff --check

Related: https://github.com/appergb/openless/issues/35
2026-04-30 11:26:26 +08:00
baiqing 4a0d8efead feat(settings): 硅基流动 ASR/LLM 配置 + 关于页完善 + onAsrProviderChange bug 修复
- LLM 供应商新增「硅基流动」(https://api.siliconflow.cn/v1,默认模型 Qwen2.5-7B)
- ASR 供应商新增「硅基流动 SenseVoice」(Whisper 兼容,默认模型 FunAudioLLM/SenseVoiceSmall)
- 修复 onAsrProviderChange 调用未定义 setPrefsState/setSettings 的 bug,改用 updatePrefs
- 关于页:新增源码入口(GitHub 链接)、QQ 群号 1078960553(可一键复制)
2026-04-30 10:54:05 +08:00
Chris233 85045c3ff4 chore(repo): 统一项目目录命名 (#39)
* Remove fragile space from active app path

The Tauri app lived under a path containing a literal space, which made CI paths and local commands easy to quote incorrectly. Rename the active tree to openless-all and update repository references so scripts, docs, and release workflows use the same space-free path.

Constraint: Preserve the existing app layout and move only the containing directory name.

Rejected: Add compatibility symlinks | would keep two app paths and leave quoting hazards in place.

Confidence: high

Scope-risk: moderate

Tested: npm run build

Tested: cargo clean && cargo check

Tested: git diff --check

Tested: grep -R for old openless -all and openless%20-all references

* Keep Windows build docs aligned with space-free path

The app directory was renamed to openless-all, but the GNU/MinGW route still described the new name as if it contained a space. Update the wording so the rationale matches the current path and keeps the helper-script guidance focused on consistent GNU setup.

Constraint: Documentation-only code review follow-up.

Confidence: high

Scope-risk: narrow

Tested: git diff --check
2026-04-30 10:44:31 +08:00