From c0150fd3cc5a790b3c55d91c9a1aa57ef3a03ed3 Mon Sep 17 00:00:00 2001 From: NekoWings Date: Tue, 23 Sep 2025 19:32:25 +0800 Subject: [PATCH 1/9] feat(Darkmode): introduce darkmode theme with color variables - Update components with new theme variables - Add ThemeSelector for light, dark and system mode - Fix some ui layouts --- app.config.ts | 4 +- assets/icons/logo-ollama.svg | 10 +- assets/icons/md-highlight-action.svg | 5 + assets/icons/md-search-action.svg | 5 + assets/icons/md-summarize-action.svg | 5 + components/AutoExpandTextArea.vue | 2 +- components/Checkbox.vue | 4 +- components/ConfirmPanel.vue | 2 +- components/IconSelector.vue | 6 +- components/Input.vue | 12 +- components/Loading.vue | 6 +- components/Logo.vue | 2 +- components/MarkdownViewer.vue | 16 +- components/Modal.vue | 2 +- components/ModelLogo.vue | 2 +- components/ModelSelector.vue | 8 +- components/ProgressBar.vue | 4 +- components/RadioGroup.vue | 6 +- components/RootProvider.vue | 9 + components/ScrollContainer.vue | 2 +- components/ScrollTarget.vue | 2 +- components/Selector.vue | 8 +- components/StatusBadge.vue | 8 +- components/Textarea.vue | 12 +- components/ThemeSelector.vue | 29 ++ components/ToastGroup.vue | 9 +- components/UILanguageSelector.vue | 2 +- components/ui/Button.vue | 14 +- components/ui/Divider.vue | 2 +- components/ui/Text.vue | 2 +- components/ui/Tooltip.vue | 8 +- components/web-components/reading-task.ts | 16 +- composables/useConfirm.tsx | 8 +- .../GmailTools/GmailComposeCard.vue | 28 +- .../components/GmailTools/GmailReplyCard.vue | 16 +- .../content/components/GmailTools/index.vue | 14 +- .../components/WritingTools/EditableEntry.vue | 14 +- .../WritingTools/SuggestionCard.vue | 10 +- .../content/components/WritingTools/index.vue | 10 +- .../content/components/WritingTools/style.css | 12 +- .../utils/page-injection/gmail-tools.ts | 337 ++++++++++-------- .../utils/translator/utils/dom-utils.ts | 24 +- entrypoints/settings/components/Block.vue | 4 +- .../ChatSettings/QuickAction/EditCard.vue | 2 +- .../components/CollapsibleSection.vue | 4 +- .../components/DebugSettings/Block.vue | 2 +- .../components/DebugSettings/index.vue | 98 ++--- .../Blocks/LMStudioConfiguration.vue | 4 +- .../Blocks/ModelManagement/Card.vue | 6 +- .../Blocks/ModelManagement/LMStudio.vue | 6 +- .../Blocks/ModelManagement/Ollama.vue | 12 +- .../Blocks/OllamaConfiguration.vue | 9 +- .../components/GeneralSettings/index.vue | 25 +- entrypoints/settings/components/Layout.vue | 10 +- .../components/OllamaDownloadModal.vue | 8 +- entrypoints/settings/components/Sidebar.vue | 4 +- .../components/TranslationSettings/index.vue | 2 +- .../components/WebLLMDownloadModal.vue | 10 +- .../components/AttachmentSelector.vue | 36 +- .../components/Chat/Messages/Action.vue | 9 +- .../Chat/Messages/AgentTaskGroup.vue | 4 +- .../components/Chat/Messages/Assistant.vue | 8 +- .../components/Chat/Messages/Task.vue | 2 +- .../components/Chat/OnlineSearchSwitch.vue | 2 +- .../components/Chat/ThinkingModeSwitch.vue | 2 +- .../sidepanel/components/Chat/index.vue | 22 +- .../components/ChatHistory/ChatItem.vue | 22 +- .../components/ChatHistory/index.vue | 8 +- entrypoints/sidepanel/components/Main.vue | 20 +- .../Onboarding/BackendDownloadModal.vue | 8 +- .../Onboarding/BackendModelDownloader.vue | 10 +- .../BackendSelectionTutorialCard.vue | 14 +- .../components/Onboarding/SloganCard.vue | 2 +- .../Onboarding/WebLLMTutorialCard.vue | 4 +- .../sidepanel/components/Onboarding/index.vue | 6 +- .../sidepanel/utils/chat/side-effects.ts | 2 +- entrypoints/sidepanel/utils/chat/texts.ts | 2 +- .../sidepanel/utils/chat/tool-calls/index.ts | 10 +- .../sidepanel/utils/markdown/content.ts | 6 + .../utils/translator/utils/dom-utils.ts | 24 +- locales/de.json | 5 +- locales/en.json | 5 +- locales/es.json | 5 +- locales/fr.json | 5 +- locales/id.json | 5 +- locales/ja.json | 5 +- locales/ko.json | 5 +- locales/pt.json | 5 +- locales/ru.json | 5 +- locales/th.json | 5 +- locales/vi.json | 5 +- locales/zh-CN.json | 5 +- locales/zh-TW.json | 5 +- styles/style.css | 213 ++++++++++- tests/html/writing-tools/input.html | 2 +- utils/icon.ts | 6 + utils/theme/composable.ts | 98 +++++ utils/theme/index.ts | 2 + utils/user-config/index.ts | 5 + 99 files changed, 1013 insertions(+), 504 deletions(-) create mode 100644 assets/icons/md-highlight-action.svg create mode 100644 assets/icons/md-search-action.svg create mode 100644 assets/icons/md-summarize-action.svg create mode 100644 components/ThemeSelector.vue create mode 100644 utils/theme/composable.ts create mode 100644 utils/theme/index.ts diff --git a/app.config.ts b/app.config.ts index f93afc06..0c9b0137 100644 --- a/app.config.ts +++ b/app.config.ts @@ -3,10 +3,10 @@ import { defineAppConfig } from 'wxt/utils/define-app-config' // Define types for your config declare module 'wxt/utils/define-app-config' { export interface WxtAppConfig { - theme?: 'light' | 'dark' + theme?: 'light' | 'dark' | 'system' } } export default defineAppConfig({ - theme: 'light', + theme: 'system', }) diff --git a/assets/icons/logo-ollama.svg b/assets/icons/logo-ollama.svg index b522b7bc..9afd954a 100644 --- a/assets/icons/logo-ollama.svg +++ b/assets/icons/logo-ollama.svg @@ -1,17 +1,17 @@ + fill="currentColor" /> + fill="currentColor" /> + fill="currentColor" /> + fill="currentColor" /> + fill="currentColor" /> \ No newline at end of file diff --git a/assets/icons/md-highlight-action.svg b/assets/icons/md-highlight-action.svg new file mode 100644 index 00000000..29cc63e3 --- /dev/null +++ b/assets/icons/md-highlight-action.svg @@ -0,0 +1,5 @@ + + + \ No newline at end of file diff --git a/assets/icons/md-search-action.svg b/assets/icons/md-search-action.svg new file mode 100644 index 00000000..7580cf5f --- /dev/null +++ b/assets/icons/md-search-action.svg @@ -0,0 +1,5 @@ + + + \ No newline at end of file diff --git a/assets/icons/md-summarize-action.svg b/assets/icons/md-summarize-action.svg new file mode 100644 index 00000000..5e2d17ae --- /dev/null +++ b/assets/icons/md-summarize-action.svg @@ -0,0 +1,5 @@ + + + \ No newline at end of file diff --git a/components/AutoExpandTextArea.vue b/components/AutoExpandTextArea.vue index 8c3afd73..894459cc 100644 --- a/components/AutoExpandTextArea.vue +++ b/components/AutoExpandTextArea.vue @@ -3,7 +3,7 @@ ref="textareaRef" v-model="inputValue" rows="1" - :class="classNames(props.class, 'field-sizing-content scrollbar-hide wrap-anywhere')" + :class="classNames(props.class, 'field-sizing-content scrollbar-hide wrap-anywhere text-text-primary')" @input="onInput" @paste="emit('paste', $event)" /> diff --git a/components/Checkbox.vue b/components/Checkbox.vue index 8272de46..cdbc6d0c 100644 --- a/components/Checkbox.vue +++ b/components/Checkbox.vue @@ -6,8 +6,8 @@
diff --git a/components/ConfirmPanel.vue b/components/ConfirmPanel.vue index abc151fe..2e297cbb 100644 --- a/components/ConfirmPanel.vue +++ b/components/ConfirmPanel.vue @@ -13,7 +13,7 @@ const emit = defineEmits(['cancel', 'ok'])