dsh-tide-theme 0.4.0 → 0.4.1

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.
package/README.md CHANGED
@@ -171,13 +171,13 @@ Tide Glass 为 DSH 提供冰蓝玻璃表面、冷灰文字与清晰的信息层
171
171
  dsh plugin --profile desktop add dsh-tide-theme
172
172
 
173
173
  # GitHub 源码
174
- dsh plugin --profile desktop add git+https://github.com/zdt3476/dsh-simplify-theme.git
174
+ dsh plugin --profile desktop add git+https://github.com/zdt3476/dsh-tide-theme.git
175
175
 
176
176
  # 本地开发软链(link)
177
177
  dsh plugin --profile desktop add link:"$PWD"
178
178
 
179
179
  # GitHub Release 预构建包
180
- dsh plugin --profile desktop add https://github.com/zdt3476/dsh-simplify-theme/releases/download/v0.4.0/dsh-tide-theme-0.4.0.tgz
180
+ dsh plugin --profile desktop add https://github.com/zdt3476/dsh-tide-theme/releases/download/v0.4.1/dsh-tide-theme-0.4.1.tgz
181
181
  ```
182
182
 
183
183
  安装后在 **设置 → 插件** 中启用,并按下 `Cmd/Ctrl + R` 重载客户端。
package/cordis.patch.yml CHANGED
@@ -7,5 +7,5 @@
7
7
  # 想临时关掉皮肤,直接在插件管理里禁用本插件即可;卸载 token 层后界面
8
8
  # 会立即还原成内置配色,不残留任何偏好设置。
9
9
  - insert:
10
- - id: tide-theme
10
+ - id: dsh-tide-theme
11
11
  name: dsh-tide-theme
package/lib/client.js CHANGED
@@ -3037,6 +3037,64 @@ body:not([data-ds-dark-theme]) [data-dsh-tide-pill][aria-expanded='true']:hover:
3037
3037
  color: var(--dsw-alias-label-primary);
3038
3038
  }
3039
3039
  `;
3040
+ //#endregion
3041
+ //#region src/client/legacy-migration.ts
3042
+ /**
3043
+ * 旧包名遗留的 localStorage 键 → 新键的一次性迁移。
3044
+ *
3045
+ * 0.4.0 把包名从 dsh-simplify-theme 改成 dsh-tide-theme,持久化键前缀随之
3046
+ * 变化。若不做迁移,升级用户的置顶工作区、折叠状态、用量统计和插件设置
3047
+ * 会全部「消失」——数据还在旧键里,只是新代码读不到,用户看到的是置顶和
3048
+ * 工作区分区凭空没了。
3049
+ *
3050
+ * 迁移规则(三条,保证不丢数据也不覆盖用户新设置):
3051
+ * 1. 旧键不存在 → 什么都不做;
3052
+ * 2. 新键已存在 → 保留新值,只删旧键(新值是用户在 0.4.0 之后改的,更权威);
3053
+ * 3. 新键不存在 → 把旧值搬到新键,再删旧键。
3054
+ *
3055
+ * 幂等:重复调用不会有副作用。
3056
+ */
3057
+ /** 旧键 → 新键。新增持久化键时记得在这里登记。 */
3058
+ const LEGACY_KEY_MAP = Object.freeze([
3059
+ ["dsh.simplify-theme.config", "dsh.tide-theme.config"],
3060
+ ["dsh-simplify-theme.usage", "dsh-tide-theme.usage"],
3061
+ ["dsh-simplify-theme.pinned-workspaces", "dsh-tide-theme.pinned-workspaces"],
3062
+ ["dsh-simplify-theme.workspaces-expanded", "dsh-tide-theme.workspaces-expanded"]
3063
+ ]);
3064
+ /**
3065
+ * 执行迁移。
3066
+ * @param storage 目标存储,默认取全局 localStorage;测试可注入替身。
3067
+ * @returns 迁移明细;无可用存储时返回空结果。
3068
+ */
3069
+ function migrateLegacyStorageKeys(storage) {
3070
+ const store = storage ?? (typeof localStorage === "undefined" ? void 0 : localStorage);
3071
+ if (store === void 0) return {
3072
+ migrated: [],
3073
+ discarded: []
3074
+ };
3075
+ const migrated = [];
3076
+ const discarded = [];
3077
+ for (const [legacy, current] of LEGACY_KEY_MAP) {
3078
+ let legacyValue;
3079
+ try {
3080
+ legacyValue = store.getItem(legacy);
3081
+ } catch {
3082
+ continue;
3083
+ }
3084
+ if (legacyValue === null) continue;
3085
+ try {
3086
+ if (store.getItem(current) === null) {
3087
+ store.setItem(current, legacyValue);
3088
+ migrated.push(current);
3089
+ } else discarded.push(legacy);
3090
+ store.removeItem(legacy);
3091
+ } catch {}
3092
+ }
3093
+ return {
3094
+ migrated,
3095
+ discarded
3096
+ };
3097
+ }
3040
3098
  //#endregion
3041
3099
  //#region src/client/view-state.ts
3042
3100
  const VIEW_STORE_KEY = "dsh.workspace.view.v5";
@@ -3073,7 +3131,7 @@ body:not([data-ds-dark-theme]) [data-dsh-tide-pill][aria-expanded='true']:hover:
3073
3131
  turnDuration: true,
3074
3132
  themeOverrides: true
3075
3133
  });
3076
- const CONFIG_STORAGE_KEY = "dsh.simplify-theme.config";
3134
+ const CONFIG_STORAGE_KEY = "dsh.tide-theme.config";
3077
3135
  const CONFIG_CHANGE_EVENT = "dsh-tide-theme:config-change";
3078
3136
  function parseLimit(val, fallback) {
3079
3137
  if (typeof val === "number" && Number.isFinite(val) && val >= 0) return Math.min(100, Math.round(val));
@@ -5828,7 +5886,7 @@ body:not([data-ds-dark-theme]) [data-dsh-tide-pill][aria-expanded='true']:hover:
5828
5886
  * ModuleLoader 壳提供,这正是 tsdown client 构建保持 require 的原因。
5829
5887
  */
5830
5888
  const PLUGIN_ID = "dsh-tide-theme";
5831
- const BUILD = "0.4.0+2026-11-02T02:11:11.243Z";
5889
+ const BUILD = "0.4.1+2026-11-02T02:57:22.787Z";
5832
5890
  const name = PLUGIN_ID;
5833
5891
  const inject = [
5834
5892
  "slots",
@@ -6228,6 +6286,8 @@ body:not([data-ds-dark-theme]) [data-dsh-tide-pill][aria-expanded='true']:hover:
6228
6286
  function apply(ctx) {
6229
6287
  console.info(`[${PLUGIN_ID}] 已加载构建 ${BUILD}`);
6230
6288
  if (typeof document !== "undefined") document.documentElement.dataset.dshTideBuild = BUILD;
6289
+ const migration = migrateLegacyStorageKeys();
6290
+ if (migration.migrated.length > 0) console.info(`[${PLUGIN_ID}] 已从旧版本键迁移: ${migration.migrated.join(", ")}`);
6231
6291
  step("locale", () => ctx.locale.register(PLUGIN_ID, {
6232
6292
  zh: DICT_ZH,
6233
6293
  en: DICT_EN
package/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** dsh-tide-theme v0.4.0 — 潮汐玻璃(Tide Glass)——给 DeepSeek Harness 的冰蓝玻璃主题,附带侧栏分页与筛选、输入框下方模型/权限控件、底栏性能 HUD、子代理委派图等界面增强。 */
1
+ /** dsh-tide-theme v0.4.1 — 潮汐玻璃(Tide Glass)——给 DeepSeek Harness 的冰蓝玻璃主题,附带侧栏分页与筛选、输入框下方模型/权限控件、底栏性能 HUD、子代理委派图等界面增强。 */
2
2
  //#region src/host/index.ts
3
3
  /**
4
4
  * 潮汐玻璃主题 —— Host 侧入口。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-tide-theme",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -9,11 +9,11 @@
9
9
  "description": "潮汐玻璃(Tide Glass)——给 DeepSeek Harness 的冰蓝玻璃主题,附带侧栏分页与筛选、输入框下方模型/权限控件、底栏性能 HUD、子代理委派图等界面增强。",
10
10
  "repository": {
11
11
  "type": "git",
12
- "url": "git+https://github.com/zdt3476/dsh-simplify-theme.git"
12
+ "url": "git+https://github.com/zdt3476/dsh-tide-theme.git"
13
13
  },
14
- "homepage": "https://github.com/zdt3476/dsh-simplify-theme#readme",
14
+ "homepage": "https://github.com/zdt3476/dsh-tide-theme#readme",
15
15
  "bugs": {
16
- "url": "https://github.com/zdt3476/dsh-simplify-theme/issues"
16
+ "url": "https://github.com/zdt3476/dsh-tide-theme/issues"
17
17
  },
18
18
  "main": "lib/index.js",
19
19
  "types": "lib/index.d.ts",