chore(release): polish 3.2.0 changes\n\n- Docs: add 3.2.0 release notes to CHANGELOG\n- UI: silence debug logs in production via import.meta.env.DEV\n- CSS: replace pseudo-element Tailwind @apply with explicit selectors to fix minifier warnings
This commit is contained in:
27
CHANGELOG.md
27
CHANGELOG.md
@@ -5,6 +5,33 @@ All notable changes to CC Switch will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [3.2.0] - 2025-09-13
|
||||
|
||||
### ✨ New Features
|
||||
- System tray provider switching with dynamic menu for Claude/Codex
|
||||
- Frontend receives `provider-switched` events and refreshes active app
|
||||
- Built-in update flow via Tauri Updater plugin with dismissible UpdateBadge
|
||||
|
||||
### 🔧 Improvements
|
||||
- Single source of truth for provider configs; no duplicate copy files
|
||||
- One-time migration imports existing copies into `config.json` and archives originals
|
||||
- Duplicate provider de-duplication by name + API key at startup
|
||||
- Atomic writes for Codex `auth.json` + `config.toml` with rollback on failure
|
||||
- Logging standardized (Rust): use `log::{info,warn,error}` instead of stdout prints
|
||||
- Tailwind v4 integration and refined dark mode handling
|
||||
|
||||
### 🐛 Fixes
|
||||
- Remove/minimize debug console logs in production builds
|
||||
- Fix CSS minifier warnings for scrollbar pseudo-elements
|
||||
- Prettier formatting across codebase for consistent style
|
||||
|
||||
### 📦 Dependencies
|
||||
- Tauri: 2.8.x (core, updater, process, opener, log plugins)
|
||||
- React: 18.2.x · TypeScript: 5.3.x · Vite: 5.x
|
||||
|
||||
### 🔄 Notes
|
||||
- `connect-src` CSP remains permissive for compatibility; can be tightened later as needed
|
||||
|
||||
## [3.1.1] - 2025-09-03
|
||||
|
||||
### 🐛 Bug Fixes
|
||||
|
||||
@@ -44,18 +44,15 @@ export function useDarkMode() {
|
||||
try {
|
||||
if (isDarkMode) {
|
||||
document.documentElement.classList.add("dark");
|
||||
if (isDev)
|
||||
console.log("[DarkMode] Added dark class to document");
|
||||
if (isDev) console.log("[DarkMode] Added dark class to document");
|
||||
} else {
|
||||
document.documentElement.classList.remove("dark");
|
||||
if (isDev)
|
||||
console.log("[DarkMode] Removed dark class from document");
|
||||
if (isDev) console.log("[DarkMode] Removed dark class from document");
|
||||
}
|
||||
|
||||
// 检查类名是否已成功应用
|
||||
const hasClass = document.documentElement.classList.contains("dark");
|
||||
if (isDev)
|
||||
console.log("[DarkMode] Document has dark class:", hasClass);
|
||||
if (isDev) console.log("[DarkMode] Document has dark class:", hasClass);
|
||||
} catch (error) {
|
||||
console.error("[DarkMode] Error applying dark class:", error);
|
||||
}
|
||||
@@ -70,8 +67,7 @@ export function useDarkMode() {
|
||||
|
||||
try {
|
||||
localStorage.setItem("darkMode", isDarkMode.toString());
|
||||
if (isDev)
|
||||
console.log("[DarkMode] Saved to localStorage:", isDarkMode);
|
||||
if (isDev) console.log("[DarkMode] Saved to localStorage:", isDarkMode);
|
||||
} catch (error) {
|
||||
console.error("[DarkMode] Error saving preference:", error);
|
||||
}
|
||||
@@ -80,8 +76,7 @@ export function useDarkMode() {
|
||||
const toggleDarkMode = () => {
|
||||
setIsDarkMode((prev) => {
|
||||
const newValue = !prev;
|
||||
if (isDev)
|
||||
console.log("[DarkMode] Toggling from", prev, "to", newValue);
|
||||
if (isDev) console.log("[DarkMode] Toggling from", prev, "to", newValue);
|
||||
return newValue;
|
||||
});
|
||||
};
|
||||
|
||||
@@ -26,13 +26,29 @@ html.dark {
|
||||
}
|
||||
|
||||
/* 滚动条样式(避免在伪元素中使用自定义 dark 变体,消除构建警告) */
|
||||
::-webkit-scrollbar { width: 0.375rem; height: 0.375rem; }
|
||||
::-webkit-scrollbar-track { background-color: #f4f4f5; }
|
||||
html.dark ::-webkit-scrollbar-track { background-color: #27272a; }
|
||||
::-webkit-scrollbar-thumb { background-color: #d4d4d8; border-radius: 0.25rem; }
|
||||
html.dark ::-webkit-scrollbar-thumb { background-color: #52525b; }
|
||||
::-webkit-scrollbar-thumb:hover { background-color: #a1a1aa; }
|
||||
html.dark ::-webkit-scrollbar-thumb:hover { background-color: #71717a; }
|
||||
::-webkit-scrollbar {
|
||||
width: 0.375rem;
|
||||
height: 0.375rem;
|
||||
}
|
||||
::-webkit-scrollbar-track {
|
||||
background-color: #f4f4f5;
|
||||
}
|
||||
html.dark ::-webkit-scrollbar-track {
|
||||
background-color: #27272a;
|
||||
}
|
||||
::-webkit-scrollbar-thumb {
|
||||
background-color: #d4d4d8;
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
html.dark ::-webkit-scrollbar-thumb {
|
||||
background-color: #52525b;
|
||||
}
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background-color: #a1a1aa;
|
||||
}
|
||||
html.dark ::-webkit-scrollbar-thumb:hover {
|
||||
background-color: #71717a;
|
||||
}
|
||||
|
||||
/* 焦点样式 */
|
||||
*:focus-visible {
|
||||
|
||||
Reference in New Issue
Block a user