dsh-ds-balance 3.2.1 → 3.2.2

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
@@ -96,7 +96,7 @@ The ring itself is "what is going on right now", five states you can tell apart
96
96
  | Arc length | The balance as a share of that currency's **warning threshold**, capped at a full circle |
97
97
  | Colour | State only (normal / low / critical), never the amount; the **critical threshold only sets the colour** and takes no part in drawing the ring |
98
98
  | The mark in the middle | **+** means not connected yet; go configure; **cross** means no usable number here — it could not be read, or it was read but the account cannot be used |
99
- | Hover text | The **amount** when the number is trustworthy, that state's own line otherwise; collapsed and expanded say the same sentence |
99
+ | Hover text | The **amount** when the number is trustworthy, that state's own line otherwise; collapsed and expanded say the same sentence, and anywhere on the button shows it |
100
100
  | The source bracket | To the right of the popover title: which credential this number came from — a head-and-tail mask such as `sk-cf08d*****3b84`, or the signed-in account's name |
101
101
  | Data freshness | The "how long ago" in the popover, counted from the moment the data arrived |
102
102
  | Manual refresh | Cooldown applies; the cooldown restarts when the refresh finishes, and the seconds on the popover are the real ones left |
package/README_zh.md CHANGED
@@ -96,7 +96,7 @@
96
96
  | 弧长 | 余额占该币种**预警线**的比例,满格封顶一整圈 |
97
97
  | 颜色 | 只表示状态(正常 / 偏低 / 告急),与金额大小无关;**告急线只决定颜色**,不参与画环 |
98
98
  | 中心记号 | **+** 是还没接入,去配置;**叉**是这里没有可用的数字 —— 读不到,或者读到了但账户不能用 |
99
- | 悬停提示 | 数字可信时显示**金额**,其余情况显示这个状态自己的话;收起态与展开态说的是同一句 |
99
+ | 悬停提示 | 数字可信时显示**金额**,其余情况显示这个状态自己的话;收起态与展开态说的是同一句,且停在按钮的任意位置都会显示 |
100
100
  | 来源括号 | 浮层标题右侧:这份数字用的是**哪一份凭据** —— 首尾片段掩码如 `sk-cf08d*****3b84`,或已登录账号的名字 |
101
101
  | 数据新鲜度 | 浮层里的「多久之前」,从收到数据的时刻算起 |
102
102
  | 手动刷新 | 带冷却,冷却从刷完那一刻重新计时,浮层上的秒数就是真实剩余 |
package/lib/client.js CHANGED
@@ -2189,8 +2189,7 @@ function PercentRing({
2189
2189
  state,
2190
2190
  marker = null,
2191
2191
  ratio = 1,
2192
- size = 18,
2193
- title
2192
+ size = 18
2194
2193
  }) {
2195
2194
  const clamped = Number.isFinite(ratio) ? Math.min(1, Math.max(0, ratio)) : 1;
2196
2195
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
@@ -2204,7 +2203,6 @@ function PercentRing({
2204
2203
  "aria-hidden": "true",
2205
2204
  focusable: "false",
2206
2205
  children: [
2207
- title === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("title", { children: title }),
2208
2206
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { className: PercentRing_default.track, cx: CENTER, cy: CENTER, r: RADIUS }),
2209
2207
  state === "ongoing" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("g", { className: PercentRing_default.spin, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
2210
2208
  "circle",
@@ -2557,14 +2555,14 @@ function SidebarBalance({
2557
2555
  state: ring.state,
2558
2556
  marker: ring.marker,
2559
2557
  ratio: ringRatio,
2560
- size: 24,
2561
- title: hoverText ?? void 0
2558
+ size: 24
2562
2559
  }
2563
2560
  )
2564
2561
  }
2565
2562
  );
2563
+ const hoverableTrigger = hoverText === null ? trigger : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_dsh_client_ui_primitives5.Tooltip, { label: hoverText, side: "right", delayMs: 500, disabled: open, children: trigger });
2566
2564
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { ref: rootRef, className: SidebarBalance_default.root, "data-mode": wide ? "wide" : "rail", tabIndex: -1, children: [
2567
- wide && hoverText !== null ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_dsh_client_ui_primitives5.Tooltip, { label: hoverText, side: "right", delayMs: 500, disabled: open, children: trigger }) : trigger,
2565
+ hoverableTrigger,
2568
2566
  open ? (0, import_react_dom.createPortal)(
2569
2567
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2570
2568
  BalancePopover,
@@ -38,12 +38,14 @@ export interface PercentRingProps {
38
38
  ratio?: number;
39
39
  /** 渲染边长(px),默认 18。 */
40
40
  size?: number;
41
- /** 可选的原生悬停提示,由 SVG 的 <title> 子元素承载。 */
42
- title?: string;
43
41
  }
44
42
  /**
45
43
  * 渲染状态圆环。
46
- * @param props - 状态、边长与可选提示。
44
+ *
45
+ * **不带悬停提示**:提示挂在外面那条触发按钮上(`SidebarBalance` 的官方 `Tooltip`),
46
+ * 锚是整条按钮的命中区而不是这个 24px 图形 —— 环若自己挂 SVG 原生 `<title>`,
47
+ * 按钮边缘那圈有悬浮灰底却没有提示,同一块悬浮区内圈外圈不一致。
48
+ * @param props - 状态、记号、弧长比例与边长。
47
49
  * @returns 圆环 svg;自身 aria-hidden,语义名由调用方的 aria-label 提供。
48
50
  */
49
- export declare function PercentRing({ state, marker, ratio, size, title, }: PercentRingProps): JSX.Element;
51
+ export declare function PercentRing({ state, marker, ratio, size, }: PercentRingProps): JSX.Element;
@@ -128,8 +128,10 @@ export declare function familyOf(situation: Situation): SituationFamily;
128
128
  * 3. 收起态还多一个「DeepSeek 余额状态 」前缀,同一个处境两态文字不同。
129
129
  *
130
130
  * 收敛到一个返回值之后,两态**不可能**再分叉 —— 这是结构保证,不是靠两处对齐。
131
- * 交付通道仍分两条(收起态走 SVG 原生 `<title>`、展开态走官方 `Tooltip` 原语),
132
- * 但那是「怎么显示」的差别,与「说什么」无关。
131
+ * 交付通道也只有一条(两态都挂官方 `Tooltip` 原语、锚是整条触发按钮):
132
+ * 文案一致还不够,**命中区**也得一致 —— 收起态从前挂 24px 的 SVG 原生 `<title>`,
133
+ * 而原生 title 的命中面就是那个 `<svg>`,于是按钮边缘那圈有悬浮灰底却不弹。
134
+ * 见 [决策记录](../../../.agents/notes/2026-11-14-hover-hit-area-is-the-button.md)。
133
135
  * @param shown - 实际展示的那条余额;`null` 表示没有数字。
134
136
  * @param stateText - 处境的文案;`null` 表示这个处境没什么要说的(数字可信)。
135
137
  * @returns 悬停要显示的那一句;`null` 表示两态都不挂悬停。
package/lib/version.d.ts CHANGED
@@ -8,5 +8,5 @@
8
8
  /** 线上 schema 版本。响应里逐条回传,消费方据此判断兼容性。 */
9
9
  export declare const SCHEMA_VERSION = 1;
10
10
  /** 插件版本。与 `package.json` 的 `version` 一致(有测试兜底)。 */
11
- export declare const PLUGIN_VERSION = "3.2.1";
11
+ export declare const PLUGIN_VERSION = "3.2.2";
12
12
  //# sourceMappingURL=version.d.ts.map
package/lib/version.js CHANGED
@@ -8,5 +8,5 @@
8
8
  /** 线上 schema 版本。响应里逐条回传,消费方据此判断兼容性。 */
9
9
  export const SCHEMA_VERSION = 1;
10
10
  /** 插件版本。与 `package.json` 的 `version` 一致(有测试兜底)。 */
11
- export const PLUGIN_VERSION = '3.2.1';
11
+ export const PLUGIN_VERSION = '3.2.2';
12
12
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-ds-balance",
3
- "version": "3.2.1",
3
+ "version": "3.2.2",
4
4
  "icon": "./icon.svg",
5
5
  "description": "DSH plugin: shows the DeepSeek account balance at the bottom of the sidebar, with a configuration card on the Plugins page.",
6
6
  "keywords": [