feat: 对macos支持浅色和深色模式切换模型功能 - #1006
Open
2287560043 wants to merge 1 commit into
Open
2287560043 wants to merge 1 commit into
2287560043 wants to merge 1 commit into
Conversation
2287560043
commented
Aug 1, 2026
There was a problem hiding this comment.
Pull request overview
该 PR 为 macOS 的浅色/深色模式切换引入“自动切换桌宠模型”的能力:允许用户分别为浅色与深色模式指定模型,并在系统主题变化且应用主题设置为 auto 时自动切换主窗口桌宠模型。
Changes:
- 在
modelstore 中新增lightModelId/darkModelId用于记录浅色/深色模式对应的模型选择,并在模型列表变更时做有效性清理 - 偏好设置-模型页新增浅色/深色模型设置入口(含多语言 tooltip)
- 将主题监听/主题应用逻辑从偏好设置的 theme-mode 组件迁移至
App.vue统一处理,并在自动主题下驱动模型切换
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/stores/model.ts | 新增浅色/深色模式对应模型 ID,并在初始化时校验有效性 |
| src/pages/preference/components/model/index.vue | UI 增加浅色/深色模型快捷设置(sun/moon)并在删除模型时清理引用 |
| src/pages/preference/components/general/components/theme-mode/index.vue | 移除窗口主题监听与 DOM class 切换逻辑,改由 App 统一处理 |
| src/locales/zh-TW.json | 新增浅色/深色模型 tooltip 文案 |
| src/locales/zh-CN.json | 新增浅色/深色模型 tooltip 文案 |
| src/locales/vi-VN.json | 新增浅色/深色模型 tooltip 文案 |
| src/locales/pt-BR.json | 新增浅色/深色模型 tooltip 文案 |
| src/locales/en-US.json | 新增浅色/深色模型 tooltip 文案 |
| src/App.vue | 统一主题应用/监听逻辑,并在 auto 主题下按浅/深色配置自动切换模型 |
| src-tauri/src/core/setup/mod.rs | 移除 debug 下默认打开 devtools 的行为 |
Suppressed comments (1)
src/pages/preference/components/model/index.vue:130
- These new theme-model icons are clickable but not keyboard-accessible. Consider adding
role="button",tabindex, and Enter/Space key handlers so the action can be triggered without a mouse.
<i
:aria-label="$t('pages.preference.model.tooltips.darkModel')"
class="i-lucide:moon"
:class="{ 'text-blue-5': data.id === modelStore.darkModelId }"
@click.stop="handleThemeModel(data, 'dark')"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+88
to
+92
| watch(() => generalStore.appearance.theme, (value) => { | ||
| if (!themeReady.value) return | ||
|
|
||
| applyTheme(value) | ||
| }) |
Comment on lines
+117
to
+122
| <i | ||
| :aria-label="$t('pages.preference.model.tooltips.lightModel')" | ||
| class="i-lucide:sun" | ||
| :class="{ 'text-orange-5': data.id === modelStore.lightModelId }" | ||
| @click.stop="handleThemeModel(data, 'light')" | ||
| /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.