1
0
mirror of https://github.com/ialley-workshop-open/uni-halo.git synced 2026-09-12 16:40:40 +08:00

refactor(preference): 重构偏好设置开关交互与UI展示

1. 移除冗余的switch组件,统一使用内联分段器替代开关选择
2. 调整布尔设置项的UI布局,优化视觉展示
3. 简化值变更逻辑,移除站点默认判断逻辑
4. 更新重置弹窗文案与按钮颜色
This commit is contained in:
小莫唐尼
2026-09-09 16:48:22 +08:00
parent 1c9a4f5d46
commit d49a918ba4
3 changed files with 66 additions and 62 deletions
+2 -7
View File
@@ -147,16 +147,11 @@ export function usePreferenceRows() {
/** 开关类:选值等于站点默认则还原为跟随(只存差异) */
function handleBoolChange(path: string[], next: boolean): void {
if (next === siteDefaultOf(path)) {
settingStore.savePreference(buildPatch(path, null));
} else {
settingStore.savePreference(buildPatch(path, next));
}
settingStore.savePreference(buildPatch(path, next));
}
/** 枚举选值:null 或等于站点默认则还原为跟随,否则写入差异(内联分段器与弹层共用) */
function handleChoose(path: string[], value: string | null): void {
if (value === null || value === siteDefaultOf(path)) {
if (value === null) {
handleRevert(path);
} else {
settingStore.savePreference(buildPatch(path, value));