feat: add style pack store v1#429
Conversation
PR Reviewer Guide 🔍(Review updated until commit 426bd8f)Here are some key observations to aid the review process:
|
|
先别动我的PR 别动 别动 别动,等github的review,等我自己的review,等测试 |
|
Persistent review updated to latest commit 7616ef0 |
|
Persistent review updated to latest commit c77d9f4 |
|
Persistent review updated to latest commit 0a19ad3 |
|
Persistent review updated to latest commit 0c6cc8b |
|
Persistent review updated to latest commit 16dd99c |
|
补充一轮 review fix:
本地验证:
|
|
Persistent review updated to latest commit a4c4cc2 |
|
Persistent review updated to latest commit ae2c7e4 |
|
Persistent review updated to latest commit c77e235 |
Final merge-ready review summary这一轮我按 复核范围
过程中的关键问题与修复1. 导出未保存 draft 时导出的是旧持久化内容
2. tray / 热键切换 style 后 UI 与 prefs 不同步
3. builtin style pack 保存/重置后,store 与 prefs 兼容字段可能重新分叉
本地验证结果
CI 结果当前 PR head 已更新为
最终结论这一轮复核里发现过真实阻塞项,但都已经用最小必要改动修复并完成本地回归 + CI 回归。以当前 PR head 来看,我这边的结论是:已达到 merge-ready,可继续正常评审/合并。 唯一保留说明:主 crate 的 |
|
Persistent review updated to latest commit c77e235 |
Constraint: types.rs must remain the shared value layer and must not depend on polish.rs Rejected: keeping polish::prompts as the source of defaults | preserves the reverse dependency and backend test shim Confidence: high Scope-risk: narrow Directive: keep built-in Style Pack defaults owned by types.rs unless the value-layer boundary changes explicitly Tested: npm run build; npx tsx src/lib/stylePrefs.test.ts; cargo check --manifest-path src-tauri/Cargo.toml; cargo test --manifest-path src-tauri/Cargo.toml --lib Not-tested: desktop runtime smoke on macOS/Windows
|
Persistent review updated to latest commit 3563c8e |
Constraint: type_unicode_chunk returns the actual count of inserted characters, including partial failures Rejected: appending the full delta after every successful call | hides short writes and makes typed_text diverge from the screen Confidence: high Scope-risk: narrow Directive: preserve typed_text as the source of truth for what actually reached the focused field during streaming insertion Tested: cargo fmt --manifest-path src-tauri/Cargo.toml; git diff --check; cargo check --manifest-path src-tauri/Cargo.toml; cargo test --manifest-path src-tauri/Cargo.toml --lib Not-tested: desktop runtime smoke on macOS/Windows
|
Persistent review updated to latest commit 97e91ec |
Constraint: hotword wording appears in both effective system prompts and preview diagnostics Rejected: keeping the slash form | less natural and leaves preview wording harder to read Confidence: high Scope-risk: narrow Directive: keep hotword preview wording aligned with the system prompt wording Tested: cargo fmt --manifest-path src-tauri/Cargo.toml; git diff --check; cargo test --manifest-path src-tauri/Cargo.toml --lib polish::tests:: Not-tested: full app build; desktop runtime smoke on macOS/Windows
|
Persistent review updated to latest commit b3a2bc3 |
Constraint: legacy preferences may have defaultMode without activeStylePackId, and Raw style packs may still use the LLM path Rejected: defaulting missing activeStylePackId to builtin.light | silently changes Raw, Structured, and Formal users during upgrade Rejected: skipping script normalization for Raw LLM output | lets Simplified/Traditional preferences be bypassed by raw style packs Confidence: high Scope-risk: narrow Directive: treat missing activeStylePackId as a migration case derived from defaultMode, not as the new-user default Tested: cargo fmt --manifest-path src-tauri/Cargo.toml; git diff --check; cargo test --manifest-path src-tauri/Cargo.toml --lib types::tests::missing_active_style_pack_id_uses_legacy_default_mode; cargo test --manifest-path src-tauri/Cargo.toml --lib types::tests::explicit_active_style_pack_id_is_preserved; cargo test --manifest-path src-tauri/Cargo.toml --lib coordinator::dictation::tests::raw_llm_output_still_applies_script_preference; cargo test --manifest-path src-tauri/Cargo.toml --lib Not-tested: full app build; desktop runtime smoke on macOS/Windows
|
Persistent review updated to latest commit 426bd8f |
feat(style-pack): rework UI + 模板新建 + 清理 PR #429 遗留死代码
UI: - 「原文」改成标题旁的 pill 切换器,与 builtin 卡分离 - builtin 卡片按 light → structured → formal 排序,followed by imported 包 - 「+ 新建风格包」tile 固定在网格末位 - imported 卡片右上角换成红色 trash 删除按钮(builtin 显示装饰 sparkle 图标,无 delete) - builtin 卡片背景做灰底处理;编辑按钮 disabled,"只读" - 编辑按钮挪到底部,紧接「导出」右边 后端: - 新增 IPC create_style_pack_from_template / persistence.create_from_template,「+」走这条路径直接落盘 - 编辑面板出场加 modal-backdrop-out / modal-drawer-out 两个 keyframe 清理: - 删除 Settings.tsx 里 PR Open-Less#429 留下的"润色 System Prompt 已迁移"死告示卡 - 删除 11 个相关 i18n key 跨 5 种语言 - 删除卡片上的「轮换 ON/OFF」按钮 + 编辑面板里同款 + metaStatus item - BusyAction 移除 'toggling' 变体 - 删除 BUILTIN 选中态与 active 共用 highlight 的 bug - SavedToast 统一替换 inline notice/error banner
User description
Summary
betasettings structure so the feature lands cleanly on the active development baseVerification
npm run buildcargo check --manifest-path src-tauri/Cargo.tomlnpx tsx src/lib/stylePrefs.test.tsPR Type
Enhancement, Bug fix, Tests
Description
Add persistent style pack store
Drive polish prompts from active packs
Add style manager UI and IPC
Update translations and regression tests
Diagram Walkthrough
File Walkthrough
17 files
Define style pack models and defaultsAssemble prompts from style pack contentPersist style packs and migration stateThread style prompts into Gemini requestsSelect active style pack during dictationAdd style pack command handlersWire style pack state into coordinatorExport style pack modules to TauriBuild style pack management screenExtend IPC types for style packsTranslate style pack settings copyTranslate style pack settings copyTranslate style pack settings copyTranslate style pack settings copyTranslate style pack settings copySurface style pack controls in settingsMirror style pack frontend data types1 files
Restore clickable button cursor affordance1 files
Update style preference fixture coverage