dsh-desktop-statusbar 2.2.2 → 3.0.0

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/locale/en.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "meta": {
3
3
  "title": "Desktop Status Bar",
4
- "description": "Replaces the stats line under the DSH desktop conversation with a configurable status bar: 10 optional reorderable fields, official peak/off-peak cost estimates, custom model prices and account balance."
4
+ "description": "Replaces the stats line under the DSH desktop conversation with a configurable status bar: 9 optional reorderable fields plus the context ring at the head of the bar, official peak/off-peak cost estimates, custom model prices and account balance."
5
5
  }
6
6
  }
package/locale/zh.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "meta": {
3
3
  "title": "桌面状态栏",
4
- "description": "把 DSH 桌面端对话区底部的统计行换成可配置状态栏:10 个字段可选可排序,按官方峰谷口径估算费用,支持自定义模型单价与账户余额。"
4
+ "description": "把 DSH 桌面端对话区底部的统计行换成可配置状态栏:9 个可选字段可排序 + 栏首上下文圆环,按官方峰谷口径估算费用,支持自定义模型单价与账户余额。"
5
5
  }
6
6
  }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "dsh-desktop-statusbar",
3
- "version": "2.2.2",
3
+ "version": "3.0.0",
4
4
  "type": "module",
5
- "description": "把 DSH 桌面端对话区底部的统计行换成可配置状态栏:10 个字段可选可排序,按官方峰谷口径估算费用,支持自定义模型单价与账户余额。",
5
+ "description": "把 DSH 桌面端对话区底部的统计行换成可配置状态栏:9 个可选字段可排序 + 栏首上下文圆环,按官方峰谷口径估算费用,支持自定义模型单价与账户余额。",
6
6
  "icon": "icon.svg",
7
7
  "license": "MIT",
8
8
  "engines": {
package/tools/shot.cjs CHANGED
@@ -226,8 +226,11 @@ function settingsShot(locale) {
226
226
  /** 只要价格区:前两块隐藏、展开第一张卡,并把币种下拉收起(展开会压住右边那列输入框) */
227
227
  function pricingShot(locale) {
228
228
  /* SettingsSection 里 useState 的顺序(组件加了 hook 就要回来重数一遍):
229
- 0 devOn / 1 drag / 2 newModel / 3 hostModel / 4 editing / 5 draft /
230
- 6 holidayBusy / 7 holidayNote / 8 currencyOpen。
229
+ 0 drag / 1 newModel / 2 hostModel / 3 editing / 4 draft /
230
+ 5 holidayBusy / 6 holidayNote / 7 currencyOpen。
231
+ **2026-10-22 起前移了一位**:开发模式的状态改从模块级快照读(`useDevState` 的 const),
232
+ 组件里不再有 `devOn` 那个 useState,于是它后面所有 hook 整体前移一位 ——
233
+ editing 4→3、draft 5→4、currencyOpen 8→7。不改的话第一张卡展不开(探针 dsb-edit-pop=0)。
231
234
  2026-10-05 之前按下标写的是旧顺序(把 editing 当第 5 个、holidayNote 当第 6 个),
232
235
  结果第一张卡展不开、还把草稿对象塞进了 holidayNote,卡片里冒出一句「抓取失败(undefined)」。
233
236
  2026-10-13 又踩了一次同类的坑:新增 devOn(开发模式胶囊)插在最前面,
@@ -235,11 +238,11 @@ function pricingShot(locale) {
235
238
  presets[4] 从 draft 变成 editing、presets[7] 从 currencyOpen 变成 holidayNote。
236
239
  教训:**下标是脆的**,加 hook 必须回来重数,并用 `node tools/shot.cjs` 实际生成一次确认。 */
237
240
  const presets = [];
238
- presets[4] = 'deepseek-flash';
241
+ presets[3] = 'deepseek-flash';
239
242
  /* 浮层里的数字也要跟着币种走:预设草稿按语言挑人民币或美元那套。
240
243
  **`currency` 必须一起写**:下拉按钮显示的正是 `draft.currency`(不是 config.currency),
241
244
  漏了它英文截图就会退回默认的 CNY —— 与整页英文界面自相矛盾(2026-10 实际踩过)。 */
242
- presets[5] = locale === 'en'
245
+ presets[4] = locale === 'en'
243
246
  ? {
244
247
  tiered: true,
245
248
  currency: 'USD',
@@ -252,7 +255,7 @@ function pricingShot(locale) {
252
255
  peak: { input: '2', cacheRead: '0.04', cacheWrite: '0', output: '8' },
253
256
  offPeak: { input: '1', cacheRead: '0.02', cacheWrite: '0', output: '4' }
254
257
  };
255
- presets[8] = false; /* 币种下拉收起:展开会压住右边那列输入框 */
258
+ presets[7] = false; /* 币种下拉收起:展开会压住右边那列输入框 */
256
259
  const loaded = loadPlugin(locale, locale === 'en' ? SETTINGS_USD : SETTINGS_CONFIG, presets);
257
260
  const t = translator(loaded.shot, locale);
258
261
  const tree = loaded.shot.SettingsSection({
@@ -270,7 +273,14 @@ function statusbarShot(locale) {
270
273
  /* StatusBar 里 useState 的顺序:now → balance → tipId → tipPos → tipTick。
271
274
  余额平时靠 effect 轮询拿,静态渲染要直接喂进去。 */
272
275
  const presets = [];
273
- presets[1] = { ok: true, total: '10.32', toppedUp: '8.00', granted: '2.32', currency: 'CNY', at: Date.now() };
276
+ /* 余额故意给**双币种**(3.0.0 起底栏支持 `¥13.14+$5.21` 这种并列显示):
277
+ README 的图要能体现这个能力,只给单币种会让"支持双币种"的说法与图对不上。
278
+ 数值是用户挑的吉祥数(13.14 一生一世 / 5.21 我爱你),纯为截图好看。
279
+ `total` 保持两个币种之和(18.35),与 balances 自洽、不制造假数据。 */
280
+ presets[1] = {
281
+ ok: true, total: '18.35', toppedUp: '18.35', granted: '0.00', currency: 'CNY', at: Date.now(),
282
+ balances: [{ currency: 'CNY', total: '13.14' }, { currency: 'USD', total: '5.21' }]
283
+ };
274
284
  const loaded = loadPlugin(locale, SETTINGS_CONFIG, presets);
275
285
  const t = translator(loaded.shot, locale);
276
286
  const calls = SAMPLE.calls;
@@ -287,7 +297,13 @@ function statusbarShot(locale) {
287
297
  }
288
298
  if (name === 'desktopStatusbarTiming') return SAMPLE.timing;
289
299
  if (name === 'desktopStatusbarActiveTime') return { turns: 12, steps: 268, since: Date.now() - 3152000, stepSince: null };
290
- if (name === 'desktopStatusbarBalance') return { ok: true, total: '10.32', toppedUp: '8.00', granted: '2.32', currency: 'CNY', at: Date.now() };
300
+ if (name === 'desktopStatusbarBalance') {
301
+ /* 与上面 presets[1] 必须是**同一份**双币种数据(两处都喂给底栏,不一致会截出前后矛盾的两版) */
302
+ return {
303
+ ok: true, total: '18.35', toppedUp: '18.35', granted: '0.00', currency: 'CNY', at: Date.now(),
304
+ balances: [{ currency: 'CNY', total: '13.14' }, { currency: 'USD', total: '5.21' }]
305
+ };
306
+ }
291
307
  if (name === 'desktopStatusbarModel') return { provider: 'deepseek', model: 'deepseek-v4-pro', at: Date.now() };
292
308
  return undefined;
293
309
  },
@@ -308,9 +324,11 @@ function statusbarShot(locale) {
308
324
  }
309
325
 
310
326
  /* status 场景生成的底栏是**合成**的(自己摆的示例数据 + 假对话区背景)。
311
- 2026-10-05 起 README 里的 docs/statusbar*.png 换成了真机截图(用户自己在 DSH 里截的),
312
- 所以**跑全量会把它覆盖掉** —— 只想更新设置页/价格区就单跑那两张:
313
- node tools/shot.cjs zh settings && node tools/shot.cjs zh pricing(en 同理)。 */
327
+ **2026-10-29 更正**:这里原先写着"2026-10-05 起 docs/statusbar*.png 换成了真机截图,
328
+ 跑全量会覆盖掉",但实际不是 —— 旧图尺寸 2360x460 正好等于 SIZES.status(1180,230)× 2 倍
329
+ 缩放,一直是本工具生成的合成图。那条警告是错的,会让下一个人不敢重跑 status 场景。
330
+ 现在三张场景图**全部**由本工具生成,`node tools/shot.cjs` 可以放心跑全量。
331
+ 只想更新其中一张就单跑:node tools/shot.cjs zh settings(scene ∈ status/settings/pricing)。 */
314
332
  const SCENES = { settings: settingsShot, pricing: pricingShot, status: statusbarShot };
315
333
  /* 窗口高度按内容量出来的(上下留白对齐到页面自己的 30px 内边距):
316
334
  settings 内容底 1050、pricing 内容底 315.5。改了场景内容要重量一遍再调这里。 */