@lobehub/lobehub 2.0.0-next.212 → 2.0.0-next.214

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/.github/workflows/auto-i18n.yml +1 -1
  2. package/.github/workflows/bundle-analyzer.yml +1 -1
  3. package/.github/workflows/claude-auto-testing.yml +1 -1
  4. package/.github/workflows/claude-dedupe-issues.yml +1 -1
  5. package/.github/workflows/claude-issue-triage.yml +1 -1
  6. package/.github/workflows/claude-translate-comments.yml +1 -1
  7. package/.github/workflows/claude-translator.yml +1 -1
  8. package/.github/workflows/claude.yml +1 -1
  9. package/.github/workflows/desktop-build-electron.yml +2 -2
  10. package/.github/workflows/e2e.yml +1 -1
  11. package/.github/workflows/issue-auto-close-duplicates.yml +1 -1
  12. package/.github/workflows/lighthouse.yml +2 -2
  13. package/.github/workflows/lock-closed-issues.yml +1 -1
  14. package/.github/workflows/manual-build-desktop.yml +6 -6
  15. package/.github/workflows/pr-build-desktop.yml +5 -5
  16. package/.github/workflows/pr-build-docker.yml +2 -2
  17. package/.github/workflows/release-desktop-beta.yml +4 -4
  18. package/.github/workflows/release-docker.yml +2 -2
  19. package/.github/workflows/release.yml +1 -1
  20. package/.github/workflows/sync-database-schema.yml +1 -1
  21. package/.github/workflows/sync.yml +1 -1
  22. package/.github/workflows/test.yml +5 -5
  23. package/.github/workflows/verify-desktop-patch.yml +1 -1
  24. package/CHANGELOG.md +58 -0
  25. package/apps/desktop/package.json +3 -2
  26. package/apps/desktop/src/main/const/store.ts +1 -1
  27. package/apps/desktop/src/main/controllers/SystemCtr.ts +2 -3
  28. package/apps/desktop/src/main/core/App.ts +10 -3
  29. package/apps/desktop/src/main/types/store.ts +1 -1
  30. package/changelog/v1.json +14 -0
  31. package/locales/ar/models.json +35 -4
  32. package/locales/ar/providers.json +1 -0
  33. package/locales/bg-BG/models.json +24 -1
  34. package/locales/bg-BG/providers.json +1 -0
  35. package/locales/de-DE/models.json +30 -1
  36. package/locales/de-DE/providers.json +1 -0
  37. package/locales/en-US/models.json +1 -0
  38. package/locales/en-US/providers.json +1 -0
  39. package/locales/es-ES/models.json +32 -1
  40. package/locales/es-ES/providers.json +1 -0
  41. package/locales/fa-IR/models.json +48 -1
  42. package/locales/fa-IR/providers.json +1 -0
  43. package/locales/fr-FR/models.json +47 -1
  44. package/locales/fr-FR/providers.json +1 -0
  45. package/locales/it-IT/models.json +32 -1
  46. package/locales/it-IT/providers.json +1 -0
  47. package/locales/ja-JP/models.json +2 -1
  48. package/locales/ja-JP/providers.json +1 -0
  49. package/locales/ko-KR/models.json +24 -1
  50. package/locales/ko-KR/providers.json +1 -0
  51. package/locales/nl-NL/models.json +46 -1
  52. package/locales/nl-NL/providers.json +1 -0
  53. package/locales/pl-PL/models.json +41 -1
  54. package/locales/pl-PL/providers.json +1 -0
  55. package/locales/pt-BR/models.json +32 -1
  56. package/locales/pt-BR/providers.json +1 -0
  57. package/locales/ru-RU/models.json +54 -2
  58. package/locales/ru-RU/providers.json +1 -0
  59. package/locales/tr-TR/models.json +32 -1
  60. package/locales/tr-TR/providers.json +1 -0
  61. package/locales/vi-VN/models.json +37 -1
  62. package/locales/vi-VN/providers.json +1 -0
  63. package/locales/zh-CN/models.json +24 -3
  64. package/locales/zh-CN/providers.json +1 -0
  65. package/locales/zh-TW/models.json +11 -1
  66. package/locales/zh-TW/providers.json +1 -0
  67. package/package.json +4 -3
  68. package/packages/builtin-tool-knowledge-base/src/client/Render/SearchKnowledgeBase/Item/index.tsx +4 -2
  69. package/packages/builtin-tool-local-system/src/client/Intervention/EditLocalFile/index.tsx +3 -2
  70. package/packages/builtin-tool-local-system/src/client/Render/EditLocalFile/index.tsx +3 -2
  71. package/packages/const/src/theme.ts +0 -2
  72. package/packages/context-engine/src/engine/messages/types.ts +1 -1
  73. package/packages/desktop-bridge/src/routeVariants.ts +2 -9
  74. package/packages/electron-client-ipc/src/types/system.ts +1 -1
  75. package/packages/model-runtime/src/core/BaseAI.ts +1 -1
  76. package/packages/model-runtime/src/core/streams/qwen.test.ts +140 -0
  77. package/packages/model-runtime/src/core/streams/qwen.ts +17 -5
  78. package/packages/model-runtime/src/types/chat.ts +12 -12
  79. package/packages/model-runtime/src/types/error.ts +1 -1
  80. package/packages/model-runtime/src/types/image.ts +1 -1
  81. package/scripts/electronWorkflow/modifiers/nextConfig.mts +41 -13
  82. package/src/app/[variants]/(auth)/_layout/index.tsx +3 -2
  83. package/src/app/[variants]/(auth)/_layout/style.ts +8 -18
  84. package/src/app/[variants]/(auth)/layout.tsx +7 -3
  85. package/src/app/[variants]/(desktop)/desktop-onboarding/_layout/index.tsx +4 -2
  86. package/src/app/[variants]/(desktop)/desktop-onboarding/_layout/style.ts +3 -0
  87. package/src/app/[variants]/(main)/_layout/DesktopLayoutContainer.tsx +3 -2
  88. package/src/app/[variants]/(main)/chat/features/Conversation/Header/index.tsx +2 -1
  89. package/src/app/[variants]/(main)/chat/profile/features/ProfileEditor/PluginTag.tsx +3 -2
  90. package/src/app/[variants]/(main)/community/(list)/_layout/Footer.tsx +3 -2
  91. package/src/app/[variants]/(main)/group/features/Conversation/ChatItem/Thread.tsx +3 -2
  92. package/src/app/[variants]/(main)/group/profile/features/AgentBuilder/index.tsx +0 -1
  93. package/src/app/[variants]/(main)/group/profile/features/ProfileEditor/PluginTag.tsx +3 -2
  94. package/src/app/[variants]/(main)/home/_layout/Body/Agent/List/AgentItem/Editing.tsx +2 -2
  95. package/src/app/[variants]/(main)/home/_layout/Footer/index.tsx +1 -1
  96. package/src/app/[variants]/(main)/home/_layout/index.tsx +3 -2
  97. package/src/app/[variants]/(main)/home/features/CommunityAgents/Item.tsx +3 -2
  98. package/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/AspectRatioSelect/index.tsx +4 -2
  99. package/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/ModelSelect/ImageModelItem.tsx +3 -2
  100. package/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/Select/index.tsx +4 -2
  101. package/src/app/[variants]/(main)/image/features/PromptInput/index.tsx +3 -2
  102. package/src/app/[variants]/(main)/memory/features/TimeLineView/index.tsx +9 -4
  103. package/src/app/[variants]/(main)/page/_layout/Body/List/Item/Editing.tsx +2 -2
  104. package/src/app/[variants]/(main)/settings/common/features/Common/Common.tsx +11 -11
  105. package/src/app/[variants]/(main)/settings/provider/(list)/ProviderGrid/Card.tsx +3 -2
  106. package/src/app/[variants]/(main)/settings/stats/features/overview/ShareButton/TotalCard.tsx +4 -2
  107. package/src/app/[variants]/(mobile)/me/(home)/features/Header.tsx +6 -8
  108. package/src/app/[variants]/layout.tsx +10 -15
  109. package/src/app/[variants]/onboarding/_layout/index.tsx +3 -2
  110. package/src/app/[variants]/onboarding/features/ModeSelectionStep.tsx +3 -2
  111. package/src/app/[variants]/router/index.tsx +12 -8
  112. package/src/components/Cell/Divider.tsx +4 -2
  113. package/src/components/DataStyleModal/index.tsx +4 -2
  114. package/src/components/FeatureList/index.tsx +4 -2
  115. package/src/components/FileParsingStatus/EmbeddingStatus.tsx +3 -2
  116. package/src/components/FileParsingStatus/index.tsx +3 -2
  117. package/src/components/Notification/index.tsx +4 -2
  118. package/src/components/client/ClientOnly.tsx +17 -0
  119. package/src/features/AlertBanner/CloudBanner.tsx +4 -3
  120. package/src/features/CommandMenu/ThemeMenu.tsx +1 -1
  121. package/src/features/CommandMenu/types.ts +5 -2
  122. package/src/features/CommandMenu/useCommandMenu.ts +3 -2
  123. package/src/features/Conversation/Markdown/plugins/LobeArtifact/Render/index.tsx +3 -2
  124. package/src/features/Conversation/Messages/components/FileChunks/ChunkItem.tsx +3 -2
  125. package/src/features/Conversation/Messages/components/FileChunks/index.tsx +4 -2
  126. package/src/features/Conversation/Messages/components/SearchGrounding.tsx +3 -2
  127. package/src/features/ElectronTitlebar/hooks/useWatchThemeUpdate.ts +21 -38
  128. package/src/features/GroupChatSettings/AgentCard.tsx +3 -2
  129. package/src/features/GroupChatSettings/HostMemberCard.tsx +3 -2
  130. package/src/features/PageEditor/DiffAllToolbar.tsx +4 -2
  131. package/src/features/User/UserPanel/ThemeButton.tsx +18 -29
  132. package/src/hooks/useIsDark.ts +11 -0
  133. package/src/layout/AuthProvider/Clerk/useAppearance.ts +4 -2
  134. package/src/layout/AuthProvider/MarketAuth/MarketAuthConfirmModal.tsx +3 -2
  135. package/src/layout/GlobalProvider/AppTheme.tsx +15 -19
  136. package/src/layout/GlobalProvider/NextThemeProvider.tsx +22 -0
  137. package/src/layout/GlobalProvider/StyleRegistry.tsx +18 -13
  138. package/src/layout/GlobalProvider/index.tsx +38 -36
  139. package/src/libs/next/proxy/define-config.ts +2 -11
  140. package/src/server/services/comfyui/config/constants.ts +7 -7
  141. package/src/server/services/comfyui/config/promptToolConst.ts +26 -26
  142. package/src/server/services/comfyui/utils/promptSplitter.ts +23 -23
  143. package/src/server/services/comfyui/utils/weightDType.ts +4 -5
  144. package/src/store/global/action.test.ts +0 -15
  145. package/src/store/global/actions/__tests__/general.test.ts +0 -37
  146. package/src/store/global/actions/general.ts +0 -21
  147. package/src/store/global/initialState.ts +0 -6
  148. package/src/store/global/selectors/systemStatus.test.ts +0 -20
  149. package/src/store/global/selectors/systemStatus.ts +0 -2
  150. package/src/styles/global.ts +0 -2
  151. package/src/utils/server/routeVariants.test.ts +17 -51
  152. package/src/utils/server/routeVariants.ts +0 -1
@@ -1,16 +1,16 @@
1
1
  /**
2
2
  * Prompt Optimizer Configuration
3
- * 提示词优化器配置 - 用于智能分割和优化提示词
3
+ * Prompt optimizer configuration - for intelligent splitting and optimization of prompts
4
4
  */
5
5
 
6
6
  /**
7
7
  * Style keywords configuration - organized by category
8
- * 风格关键词配置 - 按类别组织便于维护和扩展
8
+ * Style keyword configuration - organized by category for easy maintenance and extension
9
9
  */
10
10
 
11
11
  /* eslint-disable sort-keys-fix/sort-keys-fix */
12
12
  export const STYLE_KEYWORDS = {
13
- // Artists and platforms / 艺术家和平台
13
+ // Artists and platforms
14
14
  ARTISTS: [
15
15
  'by greg rutkowski',
16
16
  'by artgerm',
@@ -34,7 +34,7 @@ export const STYLE_KEYWORDS = {
34
34
  'digital painting',
35
35
  ],
36
36
 
37
- // Art styles / 艺术风格
37
+ // Art styles
38
38
  ART_STYLES: [
39
39
  'photorealistic',
40
40
  'photo realistic',
@@ -90,7 +90,7 @@ export const STYLE_KEYWORDS = {
90
90
  'retrowave',
91
91
  ],
92
92
 
93
- // Lighting effects / 光照效果
93
+ // Lighting effects
94
94
  LIGHTING: [
95
95
  'dramatic lighting',
96
96
  'soft lighting',
@@ -131,7 +131,7 @@ export const STYLE_KEYWORDS = {
131
131
  'incandescent',
132
132
  ],
133
133
 
134
- // Photography terms / 摄影术语
134
+ // Photography terms
135
135
  PHOTOGRAPHY: [
136
136
  'depth of field',
137
137
  'shallow depth of field',
@@ -184,7 +184,7 @@ export const STYLE_KEYWORDS = {
184
184
  'instant photo',
185
185
  ],
186
186
 
187
- // Quality descriptions / 质量描述
187
+ // Quality descriptions
188
188
  QUALITY: [
189
189
  'high quality',
190
190
  'best quality',
@@ -227,7 +227,7 @@ export const STYLE_KEYWORDS = {
227
227
  'exquisite',
228
228
  ],
229
229
 
230
- // Rendering and effects / 渲染和效果
230
+ // Rendering and effects
231
231
  RENDERING: [
232
232
  'octane render',
233
233
  'octane',
@@ -270,7 +270,7 @@ export const STYLE_KEYWORDS = {
270
270
  'high dynamic range',
271
271
  ],
272
272
 
273
- // Color and mood / 颜色和氛围
273
+ // Color and mood
274
274
  COLOR_MOOD: [
275
275
  'vibrant',
276
276
  'vibrant colors',
@@ -330,7 +330,7 @@ export const STYLE_KEYWORDS = {
330
330
  'gothic atmosphere',
331
331
  ],
332
332
 
333
- // Texture and materials / 纹理和材质
333
+ // Texture and materials
334
334
  TEXTURE_MATERIAL: [
335
335
  'glossy',
336
336
  'matte',
@@ -397,7 +397,7 @@ export const STYLE_KEYWORDS = {
397
397
 
398
398
  /**
399
399
  * Style synonyms mapping for better recognition
400
- * 同义词映射,提高识别准确率
400
+ * Synonym mapping to improve recognition accuracy
401
401
  */
402
402
  export const STYLE_SYNONYMS: Record<string, string[]> = {
403
403
  // Photography variations
@@ -443,7 +443,7 @@ export const STYLE_SYNONYMS: Record<string, string[]> = {
443
443
 
444
444
  /**
445
445
  * Compound styles that should be recognized as a whole
446
- * 组合风格,应该作为整体识别
446
+ * Compound styles that should be recognized as a complete unit
447
447
  */
448
448
  export const COMPOUND_STYLES = [
449
449
  // Studio and brand styles
@@ -536,37 +536,37 @@ export const COMPOUND_STYLES = [
536
536
 
537
537
  /**
538
538
  * Precise adjective patterns for style extraction
539
- * 精确的形容词模式,用于风格提取
539
+ * Precise adjective patterns for style extraction
540
540
  */
541
541
  export const STYLE_ADJECTIVE_PATTERNS = {
542
- // Visual quality related / 视觉质量相关
542
+ // Visual quality related
543
543
  quality:
544
544
  /^(sharp|blur(ry)?|clear|crisp|clean|smooth|rough|grainy|noisy|pristine|flawless|perfect|polished)$/i,
545
545
 
546
- // Artistic style related / 艺术风格相关
546
+ // Artistic style related
547
547
  artistic:
548
548
  /^(abstract|surreal|minimal(ist)?|ornate|baroque|gothic|modern|contemporary|traditional|classical|vintage|retro|antique|futuristic|avant-garde)$/i,
549
549
 
550
- // Color and lighting / 颜色和光照
550
+ // Color and lighting
551
551
  visual:
552
552
  /^(bright|dark|dim|vibrant|vivid|muted|saturated|desaturated|warm|cool|cold|hot|soft|hard|harsh|gentle|subtle|bold|pale|rich|deep)$/i,
553
553
 
554
- // Mood and atmosphere / 情绪和氛围
554
+ // Mood and atmosphere
555
555
  mood: /^(dramatic|peaceful|chaotic|serene|calm|mysterious|mystical|magical|epic|legendary|heroic|romantic|melancholic|nostalgic|whimsical|playful|serious|solemn|cheerful|gloomy|ominous|eerie|creepy|scary|dreamy|ethereal|fantastical|moody|atmospheric)$/i,
556
556
 
557
- // Texture and material / 纹理和材质
557
+ // Texture and material
558
558
  texture:
559
559
  /^(metallic|wooden|glass(y)?|crystalline|fabric|leather|plastic|rubber|organic|synthetic|liquid|solid|transparent|translucent|opaque|reflective|matte|glossy|satin|rough|smooth|wet|dry|dusty|rusty|weathered|aged|new|fresh|worn)$/i,
560
560
 
561
- // Size and scale / 尺寸和规模
561
+ // Size and scale
562
562
  scale:
563
563
  /^(tiny|small|medium|large|huge|massive|gigantic|colossal|enormous|microscopic|miniature|oversized|epic-scale|human-scale|intimate|vast|infinite)$/i,
564
564
 
565
- // Complexity and detail / 复杂度和细节
565
+ // Complexity and detail
566
566
  detail:
567
567
  /^(simple|complex|intricate|elaborate|detailed|minimal|advanced|sophisticated|primitive|refined|crude|delicate|robust)$/i,
568
568
 
569
- // Professional quality / 专业质量
569
+ // Professional quality
570
570
  professional:
571
571
  /^(professional|amateur|masterful|skilled|expert|novice|polished|raw|finished|unfinished|complete|incomplete|refined|rough)$/i,
572
572
  } as const;
@@ -575,7 +575,7 @@ export const STYLE_ADJECTIVE_PATTERNS = {
575
575
 
576
576
  /**
577
577
  * Get all style keywords as a flattened array
578
- * 获取所有风格关键词的扁平数组
578
+ * Get all style keywords as a flattened array
579
579
  */
580
580
  export function getAllStyleKeywords(): readonly string[] {
581
581
  return Object.values(STYLE_KEYWORDS).flat();
@@ -583,7 +583,7 @@ export function getAllStyleKeywords(): readonly string[] {
583
583
 
584
584
  /**
585
585
  * Get all compound styles
586
- * 获取所有组合风格
586
+ * Get all compound styles
587
587
  */
588
588
  export function getCompoundStyles(): readonly string[] {
589
589
  return COMPOUND_STYLES;
@@ -591,7 +591,7 @@ export function getCompoundStyles(): readonly string[] {
591
591
 
592
592
  /**
593
593
  * Normalize a style term using synonyms
594
- * 使用同义词标准化风格术语
594
+ * Normalize a style term using synonyms
595
595
  */
596
596
  export function normalizeStyleTerm(term: string): string {
597
597
  const lowerTerm = term.toLowerCase();
@@ -608,7 +608,7 @@ export function normalizeStyleTerm(term: string): string {
608
608
 
609
609
  /**
610
610
  * Check if a word matches any style adjective pattern
611
- * 检查词语是否匹配任何风格形容词模式
611
+ * Check if a word matches any style adjective pattern
612
612
  */
613
613
  export function isStyleAdjective(word: string): boolean {
614
614
  const lowerWord = word.toLowerCase();
@@ -617,7 +617,7 @@ export function isStyleAdjective(word: string): boolean {
617
617
 
618
618
  /**
619
619
  * Extract style adjectives from words based on precise patterns
620
- * 基于精确模式从词语中提取风格形容词
620
+ * Extract style adjectives from words based on precise patterns
621
621
  */
622
622
  export function extractStyleAdjectives(words: string[]): string[] {
623
623
  return words.filter((word) => isStyleAdjective(word));
@@ -6,37 +6,37 @@ import {
6
6
  } from '@/server/services/comfyui/config/promptToolConst';
7
7
 
8
8
  /**
9
- * FLUX CLIP提示词智能分割工具
10
- * 将单一prompt分离为T5-XXLCLIP-L的不同输入
9
+ * FLUX dual-CLIP prompt intelligent splitter
10
+ * Separates a single prompt into different inputs for T5-XXL and CLIP-L
11
11
  */
12
12
  export function splitPromptForDualCLIP(prompt: string): {
13
- // 风格关键词,给CLIP-L理解视觉概念
13
+ // Style keywords for CLIP-L to understand visual concepts
14
14
  clipLPrompt: string;
15
- // 完整描述,给T5-XXL理解语义
15
+ // Full description for T5-XXL to understand semantics
16
16
  t5xxlPrompt: string;
17
17
  } {
18
18
  if (!prompt) {
19
19
  return { clipLPrompt: '', t5xxlPrompt: '' };
20
20
  }
21
21
 
22
- // 获取所有风格配置
22
+ // Get all style configurations
23
23
  const styleKeywords = getAllStyleKeywords();
24
24
  const compoundStyles = getCompoundStyles();
25
25
 
26
- // 分离风格关键词
26
+ // Separate style keywords
27
27
  const lowerPrompt = prompt.toLowerCase();
28
28
  const words = prompt.split(/[\s,]+/);
29
29
  const lowerWords = lowerPrompt.split(/[\s,]+/);
30
- const stylePhrases: string[] = []; // 改为存储完整短语
30
+ const stylePhrases: string[] = []; // Changed to store complete phrases
31
31
  const contentWords: string[] = [];
32
32
  const processedIndices = new Set<number>();
33
33
 
34
- // 1. 首先检查组合风格(优先级最高)
34
+ // 1. First check compound styles (highest priority)
35
35
  for (const compound of compoundStyles) {
36
36
  const compoundLower = compound.toLowerCase();
37
37
  const index = lowerPrompt.indexOf(compoundLower);
38
38
  if (index !== -1) {
39
- // 找到组合风格,提取对应的原始短语
39
+ // Found compound style, extract corresponding original phrase
40
40
  const beforeWords = prompt
41
41
  .slice(0, Math.max(0, index))
42
42
  .split(/[\s,]+/)
@@ -56,23 +56,23 @@ export function splitPromptForDualCLIP(prompt: string): {
56
56
  }
57
57
  }
58
58
 
59
- // 2. 检查单个风格关键词和同义词
59
+ // 2. Check individual style keywords and synonyms
60
60
  for (let i = 0; i < words.length; i++) {
61
- if (processedIndices.has(i)) continue; // 跳过已处理的词
61
+ if (processedIndices.has(i)) continue; // Skip already processed words
62
62
 
63
63
  const word = words[i];
64
64
  const lowerWord = lowerWords[i];
65
65
  let isStyleWord = false;
66
66
 
67
- // 2.1 先检查同义词并标准化
67
+ // 2.1 First check synonyms and normalize
68
68
  const normalizedWord = normalizeStyleTerm(lowerWord);
69
69
 
70
- // 2.2 检查是否是风格关键词
70
+ // 2.2 Check if it's a style keyword
71
71
  for (const keyword of styleKeywords) {
72
72
  const keywordWords = keyword.toLowerCase().split(/\s+/);
73
73
 
74
74
  if (keywordWords.length === 1) {
75
- // 单词匹配(包括标准化后的词)
75
+ // Single word matching (including normalized words)
76
76
  if (lowerWord === keywordWords[0] || normalizedWord === keywordWords[0]) {
77
77
  stylePhrases.push(word);
78
78
  processedIndices.add(i);
@@ -80,7 +80,7 @@ export function splitPromptForDualCLIP(prompt: string): {
80
80
  break;
81
81
  }
82
82
  } else if (keywordWords.length > 1 && i + keywordWords.length <= words.length) {
83
- // 多词短语匹配
83
+ // Multi-word phrase matching
84
84
  const sequence = lowerWords.slice(i, i + keywordWords.length).join(' ');
85
85
  if (sequence === keyword.toLowerCase()) {
86
86
  const phraseWords: string[] = [];
@@ -89,14 +89,14 @@ export function splitPromptForDualCLIP(prompt: string): {
89
89
  processedIndices.add(i + j);
90
90
  }
91
91
  stylePhrases.push(phraseWords.join(' '));
92
- i += keywordWords.length - 1; // 跳过已匹配的词
92
+ i += keywordWords.length - 1; // Skip matched words
93
93
  isStyleWord = true;
94
94
  break;
95
95
  }
96
96
  }
97
97
  }
98
98
 
99
- // 2.3 如果不是关键词,检查是否是风格形容词
99
+ // 2.3 If not a keyword, check if it's a style adjective
100
100
  if (!isStyleWord && !processedIndices.has(i)) {
101
101
  const adjectives = extractStyleAdjectives([word]);
102
102
  if (adjectives.length > 0) {
@@ -106,25 +106,25 @@ export function splitPromptForDualCLIP(prompt: string): {
106
106
  }
107
107
  }
108
108
 
109
- // 2.4 记录非风格词
109
+ // 2.4 Record non-style words
110
110
  if (!isStyleWord && !processedIndices.has(i)) {
111
111
  contentWords.push(word);
112
112
  }
113
113
  }
114
114
 
115
- // 构建结果
115
+ // Build result
116
116
  if (stylePhrases.length > 0) {
117
- // 短语级别去重,保持多词短语的完整性
117
+ // Phrase-level deduplication, maintaining integrity of multi-word phrases
118
118
  const uniquePhrases = [...new Set(stylePhrases)];
119
119
  return {
120
- // CLIP-L专注风格和视觉概念
120
+ // CLIP-L focuses on style and visual concepts
121
121
  clipLPrompt: uniquePhrases.join(' '),
122
- // T5-XXL接收完整context以理解语义关系
122
+ // T5-XXL receives complete context to understand semantic relationships
123
123
  t5xxlPrompt: prompt,
124
124
  };
125
125
  }
126
126
 
127
- // 无风格词时的fallback:相同prompt(保证兼容性)
127
+ // Fallback when no style words: same prompt (ensures compatibility)
128
128
  return {
129
129
  clipLPrompt: prompt,
130
130
  t5xxlPrompt: prompt,
@@ -1,13 +1,12 @@
1
1
  import { resolveModel } from './staticModelLookup';
2
2
 
3
3
  /**
4
- * FLUX 模型权重类型选择工具 / FLUX Model Weight Dtype Selection Tool
4
+ * FLUX Model Weight Dtype Selection Tool
5
5
  *
6
- * @description 自动选择模型权重类型:优先使用ModelNameStandardizer推荐值,未知模型返回'default'
7
- * Automatic weight type selection: prioritize ModelNameStandardizer recommendations, return 'default' for unknown models
6
+ * @description Automatic weight type selection: prioritize ModelNameStandardizer recommendations, return 'default' for unknown models
8
7
  *
9
- * @param {string} modelName - 模型文件名或路径 / Model filename or path
10
- * @returns {string} 权重类型字符串 / Weight type string
8
+ * @param {string} modelName - Model filename or path
9
+ * @returns {string} Weight type string
11
10
  */
12
11
  export function selectOptimalWeightDtype(modelName: string): string {
13
12
  const config = resolveModel(modelName);
@@ -408,19 +408,4 @@ describe('createPreferenceSlice', () => {
408
408
  expect(result.current.status.noWideScreen).toEqual(false);
409
409
  });
410
410
  });
411
-
412
- describe('switchThemeMode', () => {
413
- it('should switch theme mode', async () => {
414
- const { result } = renderHook(() => useGlobalStore());
415
-
416
- // Perform the action
417
- act(() => {
418
- useGlobalStore.setState({ isStatusInit: true });
419
- result.current.switchThemeMode('light');
420
- });
421
-
422
- // Assert that updateUserSettings was called with the correct theme mode
423
- expect(result.current.status.themeMode).toEqual('light');
424
- });
425
- });
426
411
  });
@@ -1,5 +1,4 @@
1
1
  import { act, renderHook } from '@testing-library/react';
2
- import { ThemeMode } from 'antd-style';
3
2
  import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
4
3
  import { withSWR } from '~test-utils';
5
4
 
@@ -117,42 +116,6 @@ describe('generalActionSlice', () => {
117
116
  });
118
117
  });
119
118
 
120
- describe('switchThemeMode', () => {
121
- it('should update theme mode in system status', () => {
122
- const { result } = renderHook(() => useGlobalStore());
123
- const themeMode: ThemeMode = 'dark';
124
-
125
- act(() => {
126
- useGlobalStore.setState({ isStatusInit: true });
127
- result.current.switchThemeMode(themeMode);
128
- });
129
-
130
- expect(result.current.status.themeMode).toBe(themeMode);
131
- });
132
-
133
- it('should not update theme mode if status is not initialized', () => {
134
- const { result } = renderHook(() => useGlobalStore());
135
- const themeMode: ThemeMode = 'dark';
136
-
137
- act(() => {
138
- result.current.switchThemeMode(themeMode);
139
- });
140
-
141
- expect(result.current.status.themeMode).toBe(initialState.status.themeMode);
142
- });
143
-
144
- it('should handle light theme mode', () => {
145
- const { result } = renderHook(() => useGlobalStore());
146
-
147
- act(() => {
148
- useGlobalStore.setState({ isStatusInit: true });
149
- result.current.switchThemeMode('light');
150
- });
151
-
152
- expect(result.current.status.themeMode).toBe('light');
153
- });
154
- });
155
-
156
119
  describe('useInitSystemStatus', () => {
157
120
  it('should reset transient UI states when loading from localStorage', async () => {
158
121
  const mockStatus = {
@@ -1,16 +1,13 @@
1
- import { type ThemeMode } from 'antd-style';
2
1
  import isEqual from 'fast-deep-equal';
3
2
  import { gt, parse, valid } from 'semver';
4
3
  import { type SWRResponse } from 'swr';
5
4
  import type { StateCreator } from 'zustand/vanilla';
6
5
 
7
- import { LOBE_THEME_APPEARANCE } from '@/const/theme';
8
6
  import { CURRENT_VERSION, isDesktop } from '@/const/version';
9
7
  import { useOnlyFetchOnceSWR } from '@/libs/swr';
10
8
  import { globalService } from '@/services/global';
11
9
  import type { SystemStatus } from '@/store/global/initialState';
12
10
  import { type LocaleMode } from '@/types/locale';
13
- import { setCookie } from '@/utils/client/cookie';
14
11
  import { switchLang } from '@/utils/client/switchLang';
15
12
  import { merge } from '@/utils/merge';
16
13
  import { setNamespace } from '@/utils/storeDebug';
@@ -23,7 +20,6 @@ export interface GlobalGeneralAction {
23
20
  openAgentInNewWindow: (agentId: string) => Promise<void>;
24
21
  openTopicInNewWindow: (agentId: string, topicId: string) => Promise<void>;
25
22
  switchLocale: (locale: LocaleMode, params?: { skipBroadcast?: boolean }) => void;
26
- switchThemeMode: (themeMode: ThemeMode, params?: { skipBroadcast?: boolean }) => void;
27
23
  updateSystemStatus: (status: Partial<SystemStatus>, action?: any) => void;
28
24
  useCheckLatestVersion: (enabledCheck?: boolean) => SWRResponse<string>;
29
25
  useInitSystemStatus: () => SWRResponse;
@@ -114,23 +110,6 @@ export const generalActionSlice: StateCreator<
114
110
  })();
115
111
  }
116
112
  },
117
- switchThemeMode: (themeMode, { skipBroadcast } = {}) => {
118
- get().updateSystemStatus({ themeMode });
119
-
120
- setCookie(LOBE_THEME_APPEARANCE, themeMode === 'auto' ? undefined : themeMode);
121
-
122
- if (isDesktop && !skipBroadcast) {
123
- (async () => {
124
- try {
125
- const { ensureElectronIpc } = await import('@/utils/electron/ipc');
126
-
127
- await ensureElectronIpc().system.updateThemeModeHandler(themeMode);
128
- } catch (error) {
129
- console.error('Failed to update theme in main process:', error);
130
- }
131
- })();
132
- }
133
- },
134
113
  updateSystemStatus: (status, action) => {
135
114
  if (!get().isStatusInit) return;
136
115
 
@@ -1,4 +1,3 @@
1
- import type { ThemeMode } from 'antd-style';
2
1
  import type { NavigateFunction } from 'react-router-dom';
3
2
 
4
3
  import { DatabaseLoadingState, type MigrationSQL, type MigrationTableItem } from '@/types/clientDB';
@@ -129,10 +128,6 @@ export interface SystemStatus {
129
128
  showRightPanel?: boolean;
130
129
  showSystemRole?: boolean;
131
130
  systemRoleExpandedMap: Record<string, boolean>;
132
- /**
133
- * theme mode
134
- */
135
- themeMode?: ThemeMode;
136
131
  /**
137
132
  * 是否使用短格式显示 token
138
133
  */
@@ -196,7 +191,6 @@ export const INITIAL_STATUS = {
196
191
  showRightPanel: true,
197
192
  showSystemRole: false,
198
193
  systemRoleExpandedMap: {},
199
- themeMode: 'auto',
200
194
  tokenDisplayFormatShort: true,
201
195
  topicPageSize: 20,
202
196
  zenMode: false,
@@ -87,24 +87,4 @@ describe('systemStatusSelectors', () => {
87
87
  expect(systemStatusSelectors.portalWidth(noPortalWidth)).toBe(400);
88
88
  });
89
89
  });
90
-
91
- describe('theme mode', () => {
92
- it('should return the correct theme', () => {
93
- const s: GlobalState = merge(initialState, {
94
- status: {
95
- themeMode: 'light',
96
- },
97
- });
98
- expect(systemStatusSelectors.themeMode(s)).toBe('light');
99
- });
100
-
101
- it('should return auto if not set', () => {
102
- const s: GlobalState = merge(initialState, {
103
- status: {
104
- themeMode: undefined,
105
- },
106
- });
107
- expect(systemStatusSelectors.themeMode(s)).toBe('auto');
108
- });
109
- });
110
90
  });
@@ -23,7 +23,6 @@ const showImagePanel = (s: GlobalState) => s.status.showImagePanel;
23
23
  const showImageTopicPanel = (s: GlobalState) => s.status.showImageTopicPanel;
24
24
  const hidePWAInstaller = (s: GlobalState) => s.status.hidePWAInstaller;
25
25
  const isShowCredit = (s: GlobalState) => s.status.isShowCredit;
26
- const themeMode = (s: GlobalState) => s.status.themeMode || 'auto';
27
26
  const language = (s: GlobalState) => s.status.language || 'auto';
28
27
 
29
28
  const showChatHeader = (s: GlobalState) => !s.status.zenMode;
@@ -80,7 +79,6 @@ export const systemStatusSelectors = {
80
79
  showRightPanel,
81
80
  showSystemRole,
82
81
  systemStatus,
83
- themeMode,
84
82
  tokenDisplayFormatShort,
85
83
  topicGroupKeys,
86
84
  topicPageSize,
@@ -16,8 +16,6 @@ export default ({ token }: { prefixCls: string; token: Theme }) => css`
16
16
  min-height: 100dvh;
17
17
  max-height: 100dvh;
18
18
 
19
- background: ${token.colorBgLayout};
20
-
21
19
  @media (min-device-width: 576px) {
22
20
  overflow: hidden;
23
21
  }