dsh-opencode-status 0.4.6 → 0.4.7

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.7
4
+
5
+ - **修复悬浮微卡三条进度条长度不可比**:右侧「百分比」与「倒计时」两列原本是 `minWidth` 自适应,`⏱ 18d15h` 比 `⏱ 3h26m` 宽,会把该行进度条挤短——于是 99% 的条反而比 87% 的短,三条进度条的满格基准各不相同。现在两列改为固定宽度(标签 28 / 百分比 32 / 倒计时 50),三条进度条共用同一基准,长度可以直接横向比较。
6
+ - 进度条轨道对比度从 16% 提到 28%,能看清 100% 的边界位置。
7
+ - 移除标题旁的 `GO` 徽章:标题已经是「OpenCode GO 用量」,徽章属于重复。
8
+
3
9
  ## 0.4.6
4
10
 
5
11
  - **移除「可用时长估算」**:按当前速率推算「还能撑多久」需要先累计 10 分钟采样、再与重置时间比较,实际信息量低于直接看进度条;功能整体删除,包括采样记录、`localStorage` 持久化、「采样中」状态与时长粗化。面板只保留剩余百分比与 `⏱` 重置倒计时。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-opencode-status",
3
- "version": "0.4.6",
3
+ "version": "0.4.7",
4
4
  "description": "OpenCode GO quota status panel for DeepSeek Harness: click to open a usage panel with manual refresh, per-window remaining quota, a hover overview card, and in-app connection settings",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
package/src/client.js CHANGED
@@ -526,25 +526,6 @@ window.__ModuleLoader__.load({
526
526
  [
527
527
  h('div', { key: 'hd', style: { display: 'flex', alignItems: 'center', gap: 6, marginBottom: 8 } }, [
528
528
  h('span', { key: 't', style: { fontWeight: 600, fontSize: 12, color: T.label } }, 'OpenCode GO 用量'),
529
- // Go 标识(纯展示徽章,不是按钮)
530
- h(
531
- 'span',
532
- {
533
- key: 'go',
534
- style: {
535
- fontSize: 9,
536
- fontWeight: 700,
537
- letterSpacing: 0.4,
538
- color: '#fff',
539
- background: T.brand,
540
- borderRadius: 4,
541
- padding: '1px 5px',
542
- lineHeight: '13px',
543
- flexShrink: 0,
544
- },
545
- },
546
- 'GO',
547
- ),
548
529
  h(
549
530
  'span',
550
531
  {
@@ -575,18 +556,21 @@ window.__ModuleLoader__.load({
575
556
  const w = props.window
576
557
  const remaining = w?.remainingPct ?? null
577
558
  const color = remainingColor(remaining)
559
+ // 右侧两列必须是**固定宽度**:若按内容自适应,「⏱ 18d15h」比「⏱ 3h26m」宽,
560
+ // 会把该行的进度条挤短,三条进度条的满格基准就各不相同,百分比再准也无法横向比较。
561
+ // 标签列同样固定,短标签最长 2 个字符(5h / 周 / 月)。
578
562
  return h('div', { style: { display: 'flex', alignItems: 'center', gap: 6 } }, [
579
- h('span', { key: 'n', style: { width: 46, flexShrink: 0, fontSize: 10, color: T.secondary, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } }, w?.shortLabel ?? w?.label ?? '—'),
563
+ h('span', { key: 'n', style: { width: 28, flexShrink: 0, fontSize: 10, color: T.secondary, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } }, w?.shortLabel ?? w?.label ?? '—'),
580
564
  h(
581
565
  'div',
582
- { key: 'bar', style: { flex: 1, minWidth: 0, height: 3, borderRadius: 2, background: `color-mix(in srgb, ${color} 16%, transparent)`, overflow: 'hidden' } },
566
+ { key: 'bar', style: { flex: 1, minWidth: 0, height: 3, borderRadius: 2, background: `color-mix(in srgb, ${color} 28%, transparent)`, overflow: 'hidden' } },
583
567
  remaining === null
584
568
  ? null
585
569
  : h('div', { style: { height: '100%', width: `${clampPct(remaining)}%`, background: color, borderRadius: 2 } }),
586
570
  ),
587
- h('span', { key: 'v', style: { minWidth: 30, flexShrink: 0, textAlign: 'right', fontSize: 10, fontWeight: 600, color, fontVariantNumeric: 'tabular-nums' } }, remaining === null ? '—' : pctText(remaining)),
571
+ h('span', { key: 'v', style: { width: 32, flexShrink: 0, textAlign: 'right', fontSize: 10, fontWeight: 600, color, fontVariantNumeric: 'tabular-nums' } }, remaining === null ? '—' : pctText(remaining)),
588
572
  // 倒计时用 ⏱ 区分刷新动作的 ↻,避免两个图标同义混淆。
589
- h('span', { key: 'r', style: { minWidth: 34, flexShrink: 0, textAlign: 'right', fontSize: 10, color: T.secondary, fontVariantNumeric: 'tabular-nums' } }, w?.resetAt ? `⏱ ${timeUntil(w.resetAt)}` : ''),
573
+ h('span', { key: 'r', style: { width: 50, flexShrink: 0, textAlign: 'right', fontSize: 10, color: T.secondary, fontVariantNumeric: 'tabular-nums' } }, w?.resetAt ? `⏱ ${timeUntil(w.resetAt)}` : ''),
590
574
  ])
591
575
  }
592
576