dsh-theme-gallery 0.1.2 → 0.1.4

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 renjie2026
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # dsh-theme-gallery
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/dsh-theme-gallery.svg)](https://www.npmjs.com/package/dsh-theme-gallery)
4
+ [![license](https://img.shields.io/github/license/renjie2026/dsh-theme-gallery.svg)](https://github.com/renjie2026/dsh-theme-gallery/blob/main/LICENSE)
5
+
3
6
  给 DeepSeek Harness 的**主题画廊**:一个插件 + 一堆 JSON 皮肤。装一次,拿到全部主题;加皮肤**不用改代码、不用重启、不用重新装包**。
4
7
 
5
8
  | 你想要 | 怎么做 |
@@ -84,22 +87,27 @@ const CUBES = [light, dark, system]
84
87
 
85
88
  ### 三种安装方式
86
89
 
87
- **① 下载构建产物(推荐,零构建授权)**
90
+ **① 用包名安装(推荐)** —— 包已发布到 npm:<https://www.npmjs.com/package/dsh-theme-gallery>
88
91
 
89
- 1. 到 [Releases](https://github.com/renjie2026/dsh-theme-gallery/releases/latest) 下载 `dsh-theme-gallery-<版本>.tgz`
90
- 2. **设置 → 插件 → 添加插件** → 粘贴该文件的**完整路径**
91
- 3. **重启应用**
92
- 4. 左侧栏底部出现 **主题皮肤** 入口(**不在**「设置 → 通用 → 外观」里,原因见下文),
92
+ 1. **设置 → 插件 → 添加插件** → 填 **`dsh-theme-gallery`**
93
+ 2. **重启应用**
94
+ 3. 左侧栏底部出现 **主题皮肤** 入口(**不在**「设置 → 通用 → 外观」里,原因见下文),
93
95
  当前三个主题:山青婷彩 / 梦海游鱼 / 深色
94
96
 
95
- **② 用包名安装**(需要本包已发布到 npm;桌面版在「添加插件」里直接填包名即可)
97
+ Web / CLI profile 用官方 CLI 装同一个包:
96
98
 
97
99
  ```sh
98
100
  dsh plugin --profile web add dsh-theme-gallery
99
101
  ```
100
102
 
101
103
  > 桌面版的 profile 由 Electron 独占,`dsh plugin --profile desktop …` 会被拒绝 ——
102
- > 桌面用户请走上面的界面,这条 CLI 写法适用于 Web / CLI profile。
104
+ > 桌面用户请走上面的界面。
105
+
106
+ **② 下载构建产物**(不经过 npm 的等价方式,零构建授权)
107
+
108
+ 1. 到 [Releases](https://github.com/renjie2026/dsh-theme-gallery/releases/latest) 下载 `dsh-theme-gallery-<版本>.tgz`
109
+ 2. **设置 → 插件 → 添加插件** → 粘贴该文件的**完整路径**
110
+ 3. **重启应用**
103
111
 
104
112
  **③ 用仓库地址安装**(`github:renjie2026/dsh-theme-gallery`,拉的是**源码**,不推荐)
105
113
 
package/lib/client.js CHANGED
@@ -1118,22 +1118,36 @@ window.__ModuleLoader__.load({
1118
1118
  }
1119
1119
 
1120
1120
  /**
1121
- * Whether the gallery shows its diagnostic line.
1121
+ * Where the debug switch is remembered.
1122
1122
  *
1123
- * Opt-in through the URL hash — `#theme-gallery-debug` — so the page stays
1124
- * clean in normal use while the one tool that actually located the token and
1125
- * presenter faults stays one reload away. From outside the app, "selected but
1126
- * nothing changed" cannot be split into "not registered", "not selected",
1127
- * "registered with broken tokens", or "painted over by our own CSS"; this line
1128
- * splits it by showing what the theme SERVICE believes next to what the
1129
- * document actually resolves.
1130
- * @returns true when the debug line should render.
1123
+ * A localStorage flag in addition to the URL fragment, because this plugin
1124
+ * ships as a package inside the desktop app: there is no address bar to add
1125
+ * `#theme-gallery-debug` to, so DevTools is the way in.
1126
+ */
1127
+ const DEBUG_KEY = 'theme-gallery:debug'
1128
+
1129
+ /**
1130
+ * Whether the gallery shows its diagnostic detail lines.
1131
+ *
1132
+ * The raw readings — token counts, geometry, hit tests, the attempt log — are
1133
+ * for whoever is debugging, not for whoever is picking a skin, and this is a
1134
+ * shipped package. So they are opt-in, through either switch:
1135
+ *
1136
+ * DevTools console: localStorage.setItem('theme-gallery:debug', '1')
1137
+ * …or a URL with #theme-gallery-debug
1138
+ * turn it off: localStorage.removeItem('theme-gallery:debug')
1139
+ *
1140
+ * The switch gates DETAIL, never bad news: a line that reports a problem prints
1141
+ * whether or not it is on (see `sceneryLineIsWarning`), because "没有报错" and
1142
+ * "没有观测到报错" have been confused in this project before.
1143
+ * @returns true when the detail lines should render.
1131
1144
  */
1132
1145
  function debugEnabled() {
1133
1146
  try {
1134
- return typeof window !== 'undefined'
1147
+ if (typeof window !== 'undefined'
1135
1148
  && typeof window.location?.hash === 'string'
1136
- && window.location.hash.includes('theme-gallery-debug')
1149
+ && window.location.hash.includes('theme-gallery-debug')) return true
1150
+ return typeof window !== 'undefined' && window.localStorage?.getItem(DEBUG_KEY) === '1'
1137
1151
  } catch {
1138
1152
  return false
1139
1153
  }
@@ -1211,12 +1225,15 @@ window.__ModuleLoader__.load({
1211
1225
  /**
1212
1226
  * The one-line scenery status shown on the panel.
1213
1227
  *
1214
- * Deliberately unconditional during bring-up, and deliberately dumb: it prints
1215
- * the report whatever it says. The previous revision only spoke when a
1216
- * self-check considered something wrong, so a check that passed while the
1217
- * scenery was still invisible produced **silence** — the worst possible output
1218
- * for a diagnostic. Printing the numbers always means the reader sees the
1219
- * geometry even when the code's opinion of it is wrong.
1228
+ * Deliberately dumb: it prints the report whatever it says. An earlier
1229
+ * revision only spoke when a self-check considered something wrong, so a check
1230
+ * that PASSED while the scenery was still invisible produced **silence** — the
1231
+ * worst possible output for a diagnostic. Keeping the numbers means the reader
1232
+ * sees the geometry even when the code's opinion of it is wrong.
1233
+ *
1234
+ * It was unconditional while the scenery was being brought up; now that the
1235
+ * package is public the RENDER SITE decides: routine reports wait for
1236
+ * `debugEnabled()`, while warnings and errors always print.
1220
1237
  * @param selected - the preference the page is showing as selected.
1221
1238
  * @returns the line, or null when the active theme asks for no scenery.
1222
1239
  */
@@ -1231,6 +1248,20 @@ window.__ModuleLoader__.load({
1231
1248
  }
1232
1249
  }
1233
1250
 
1251
+ /**
1252
+ * Whether the scenery line reports a problem rather than a routine pass.
1253
+ *
1254
+ * The line has three shapes: `装饰自检通过 · …` (routine), `⚠ <warning> · …`,
1255
+ * and `装饰自检失败: …`. Only the first may hide behind the debug switch — a
1256
+ * failure has to reach the person looking at the panel without them knowing
1257
+ * that a switch exists.
1258
+ * @param line - the scenery line.
1259
+ * @returns true when the line carries a warning or an error.
1260
+ */
1261
+ function sceneryLineIsWarning(line) {
1262
+ return typeof line === 'string' && (line.startsWith('⚠') || line.includes('失败'))
1263
+ }
1264
+
1234
1265
  /**
1235
1266
  * Render the scenery report as one line.
1236
1267
  * @returns the report text.
@@ -2879,6 +2910,9 @@ window.__ModuleLoader__.load({
2879
2910
  ],
2880
2911
  })
2881
2912
  }
2913
+ // Detail lines are opt-in; a line that reports a problem is not detail.
2914
+ const scenery = sceneryLine(selected)
2915
+ const showScenery = scenery !== null && (debugEnabled() || sceneryLineIsWarning(scenery))
2882
2916
  return jsxs('div', {
2883
2917
  className: 'tg-page',
2884
2918
  children: [
@@ -2891,16 +2925,15 @@ window.__ModuleLoader__.load({
2891
2925
  ],
2892
2926
  }),
2893
2927
  debugEnabled() ? jsx('div', { className: 'tg-debug', children: themeDiagnostics(selected) }) : null,
2894
- // Unconditional while the scenery is being brought up: when the active
2895
- // skin's decorations are not on screen, the reason has to reach the person
2896
- // looking at it. Shows nothing once the report says the layer is drawn and
2897
- // inside the column.
2898
- sceneryLine(selected) === null
2899
- ? null
2900
- : jsx('div', {
2928
+ // Routine reports wait for the debug switch; warnings and errors print
2929
+ // regardless — when the active skin's decorations are missing, the reason
2930
+ // has to reach the person looking at the panel.
2931
+ showScenery
2932
+ ? jsx('div', {
2901
2933
  className: `tg-debug${ambientWarning(selected) === null ? '' : ' tg-warn'}`,
2902
- children: sceneryLine(selected),
2903
- }),
2934
+ children: scenery,
2935
+ })
2936
+ : null,
2904
2937
  jsx('div', {
2905
2938
  className: 'tg-grid',
2906
2939
  children: ids.map((id) => jsx(ThemeCard, {
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "dsh-theme-gallery",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "A community theme gallery for DeepSeek Harness (DSH): JSON-defined skins with full-screen coverage and ported sidebar scenery, switched from the plugin's own sidebar panel — adding skins needs no code change",
5
- "author": "renjie2026 <renjie330@163.com> (https://github.com/renjie2026)",
5
+ "author": "renjie2026 (https://github.com/renjie2026)",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",