Skip to content

Commit 1dde501

Browse files
committed
Merge theme management from 'dev' into 'main'
feat(dashboard): add theme auto-switching and add theme management in customizer feat(dashboard): enhance types in Settings
1 parent 1292faa commit 1dde501

30 files changed

Lines changed: 1193 additions & 495 deletions

dashboard/src/assets/mdi-subset/materialdesignicons-subset.css

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Auto-generated MDI subset – 247 icons */
1+
/* Auto-generated MDI subset – 252 icons */
22
/* Do not edit manually. Run: pnpm run subset-icons */
33

44
@font-face {
@@ -316,6 +316,10 @@
316316
content: "\F164B";
317317
}
318318

319+
.mdi-database-import::before {
320+
content: "\F095D";
321+
}
322+
319323
.mdi-database-off::before {
320324
content: "\F1640";
321325
}
@@ -352,6 +356,10 @@
352356
content: "\F01DA";
353357
}
354358

359+
.mdi-earth::before {
360+
content: "\F01E7";
361+
}
362+
355363
.mdi-emoticon::before {
356364
content: "\F0C68";
357365
}
@@ -652,6 +660,10 @@
652660
content: "\F0375";
653661
}
654662

663+
.mdi-moon-waning-crescent::before {
664+
content: "\F0F65";
665+
}
666+
655667
.mdi-music-note-outline::before {
656668
content: "\F0F74";
657669
}
@@ -696,6 +708,10 @@
696708
content: "\F0601";
697709
}
698710

711+
.mdi-palette::before {
712+
content: "\F03D8";
713+
}
714+
699715
.mdi-paperclip::before {
700716
content: "\F03E2";
701717
}
@@ -900,6 +916,10 @@
900916
content: "\F060D";
901917
}
902918

919+
.mdi-sync::before {
920+
content: "\F04E6";
921+
}
922+
903923
.mdi-text::before {
904924
content: "\F09A8";
905925
}
Binary file not shown.
Binary file not shown.

dashboard/src/components/chat/Chat.vue

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -259,15 +259,15 @@
259259
<v-list-item
260260
class="styled-menu-item"
261261
rounded="md"
262-
@click="toggleTheme"
262+
@click="useCustomizerStore().TOGGLE_DARK_MODE()"
263263
>
264264
<template #prepend>
265265
<v-icon size="18">{{
266266
isDark ? "mdi-white-balance-sunny" : "mdi-weather-night"
267267
}}</v-icon>
268268
</template>
269269
<v-list-item-title>{{
270-
isDark ? tm("modes.lightMode") : tm("modes.darkMode")
270+
isDark ? tm("modes.light") : tm("modes.dark")
271271
}}</v-list-item-title>
272272
</v-list-item>
273273
</div>
@@ -848,7 +848,7 @@ watch(transportMode, (mode) => {
848848
localStorage.setItem("chat.transportMode", mode);
849849
});
850850
851-
const isDark = computed(() => customizer.uiTheme === "PurpleThemeDark");
851+
const isDark = computed(() => customizer.isDarkTheme);
852852
const canSend = computed(
853853
() =>
854854
Boolean(draft.value.trim() || stagedFiles.value.length) && !sending.value,
@@ -1393,10 +1393,6 @@ async function stopCurrentSession() {
13931393
}
13941394
}
13951395
1396-
function toggleTheme() {
1397-
customizer.SET_UI_THEME(isDark.value ? "PurpleTheme" : "PurpleThemeDark");
1398-
}
1399-
14001396
function formatTime(value: string) {
14011397
const date = new Date(value);
14021398
if (Number.isNaN(date.getTime())) return "";

dashboard/src/components/chat/ChatInput.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,9 +365,7 @@ const emit = defineEmits<{
365365
}>();
366366
367367
const { tm } = useModuleI18n("features/chat");
368-
const isDark = computed(
369-
() => useCustomizerStore().uiTheme === "PurpleThemeDark",
370-
);
368+
const isDark = computed(() => useCustomizerStore().isDarkTheme);
371369
372370
const inputField = ref<HTMLTextAreaElement | null>(null);
373371
const imageInputRef = ref<HTMLInputElement | null>(null);

dashboard/src/components/chat/LiveMode.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,15 @@
5454

5555
<script setup lang="ts">
5656
import { ref, computed, onBeforeUnmount, watch } from 'vue';
57-
import { useTheme } from 'vuetify';
5857
import { useVADRecording } from '@/composables/useVADRecording';
5958
import SiriOrb from './LiveOrb.vue';
59+
import { useCustomizerStore } from '@/stores/customizer';
6060
6161
const emit = defineEmits<{
6262
'close': [];
6363
}>();
6464
65-
const theme = useTheme();
66-
const isDark = computed(() => theme.global.current.value.dark);
65+
const isDark = computed(() => (useCustomizerStore()).isDarkTheme);
6766
6867
// 使用 VAD Recording composable
6968
const vadRecording = useVADRecording();

dashboard/src/components/chat/StandaloneChat.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ const messagesContainer = ref<HTMLElement | null>(null);
217217
const inputRef = ref<InstanceType<typeof ChatInput> | null>(null);
218218
const imagePreview = reactive({ visible: false, url: "" });
219219
220-
const isDark = computed(() => customizer.uiTheme === "PurpleThemeDark");
220+
const isDark = computed(() => customizer.isDarkTheme);
221221
const customMarkdownTags = ["ref"];
222222
223223
const {

dashboard/src/components/shared/ReadmeDialog.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<script setup>
22
import { ref, watch, computed, onUnmounted } from "vue";
3-
import { useTheme } from "vuetify";
43
import MarkdownIt from "markdown-it";
54
import axios from "axios";
65
import DOMPurify from "dompurify";
76
import { useI18n } from "@/i18n/composables";
7+
import { useCustomizerStore } from "@/stores/customizer";
88
import {
99
escapeHtml,
1010
ensureShikiLanguages,
@@ -46,7 +46,6 @@ const props = defineProps({
4646
4747
const emit = defineEmits(["update:show"]);
4848
const { t, locale } = useI18n();
49-
const theme = useTheme();
5049
5150
const content = ref(null);
5251
const error = ref(null);
@@ -57,7 +56,7 @@ const lastRequestId = ref(0);
5756
const lastRenderId = ref(0);
5857
const scrollContainer = ref(null);
5958
const renderedHtml = ref("");
60-
const isDark = computed(() => theme.global.current.value.dark);
59+
const isDark = computed(() => (useCustomizerStore()).isDarkTheme);
6160
6261
const MARKDOWN_SANITIZE_OPTIONS = {
6362
ALLOWED_TAGS: [

dashboard/src/i18n/locales/en-US/features/auth.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"subtitle": "Welcome"
99
},
1010
"theme": {
11-
"switchToDark": "Switch to Dark Theme",
12-
"switchToLight": "Switch to Light Theme"
11+
"light": "Light Mode",
12+
"dark": "Dark Mode"
1313
}
1414
}

dashboard/src/i18n/locales/en-US/features/chat.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@
7373
"confirmDelete": "Are you sure you want to delete \"{name}\"? This action cannot be undone."
7474
},
7575
"modes": {
76-
"darkMode": "Switch to Dark Mode",
77-
"lightMode": "Switch to Light Mode"
76+
"light": "Light Mode",
77+
"dark": "Dark Mode"
7878
},
7979
"shortcuts": {
8080
"help": "Get Help",

0 commit comments

Comments
 (0)