refactor: remove OMO common config two-layer merge system

Each OMO provider now stores its complete configuration directly in
settings_config.otherFields instead of relying on a shared OmoGlobalConfig
merged at write time. This simplifies the data flow from a 4-tuple
(agents, categories, otherFields, useCommonConfig) to a 3-tuple and
eliminates an entire DB table, two Tauri commands, and ~1700 lines of
merge/sync code across frontend and backend.

Backend:
- Delete database/dao/omo.rs (OmoGlobalConfig struct + get/save methods)
- Remove get/set_config_snippet from settings DAO
- Remove get/set_common_config_snippet Tauri commands
- Replace merge_config() with build_config() in services/omo.rs
- Simplify OmoVariant (remove config_key, known_keys)
- Simplify import_from_local and build_local_file_data
- Rewrite all OMO service tests

Frontend:
- Delete OmoCommonConfigEditor.tsx and OmoGlobalConfigFields.tsx
- Delete src/lib/api/config.ts
- Remove OmoGlobalConfig type and merge preview functions
- Remove useGlobalConfig/useSaveGlobalConfig query hooks
- Simplify useOmoDraftState (remove all common config state)
- Replace OmoCommonConfigEditor with read-only JsonEditor preview
- Clean i18n keys (zh/en/ja)
This commit is contained in:
Jason
2026-02-26 19:31:43 +08:00
parent 3e9815f5d2
commit e7766d4d22
21 changed files with 74 additions and 1733 deletions
-4
View File
@@ -1807,10 +1807,6 @@
"enabled": "Enabled",
"disabled": "OMO disabled",
"disableFailed": "Failed to disable OMO: {{error}}",
"writeCommonConfig": "Write to common config",
"editCommonConfig": "Edit common config",
"editCommonConfigTitle": "Common Config",
"commonConfigHint": "OMO common config will be merged into all OMO configs that enable it",
"selectPlaceholder": "Select...",
"clear": "Clear",
"clearWrapped": "(Clear)",
-4
View File
@@ -1807,10 +1807,6 @@
"enabled": "有効中",
"disabled": "OMO を無効化しました",
"disableFailed": "OMO の無効化に失敗しました: {{error}}",
"writeCommonConfig": "共通設定に書き込む",
"editCommonConfig": "共通設定を編集",
"editCommonConfigTitle": "共通設定",
"commonConfigHint": "OMO 共通設定は有効にしたすべての OMO 設定に統合されます",
"selectPlaceholder": "選択してください...",
"clear": "クリア",
"clearWrapped": "(クリア)",
-4
View File
@@ -1807,10 +1807,6 @@
"enabled": "启用中",
"disabled": "OMO 已停用",
"disableFailed": "停用 OMO 失败: {{error}}",
"writeCommonConfig": "写入通用配置",
"editCommonConfig": "编辑通用配置",
"editCommonConfigTitle": "通用配置",
"commonConfigHint": "OMO 通用配置将合并到所有启用它的 OMO 配置中",
"selectPlaceholder": "请选择...",
"clear": "清空",
"clearWrapped": "(清空)",