dsh-ustc-quota 1.1.47 → 1.1.49

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
@@ -112,7 +112,7 @@ key-c 8.7/30 29% 8.7/70 12% 11.1/100 11%
112
112
  - 右侧位置会在对话区右侧**预留一条槽**:插件给对话列加右侧内边距(约列宽的 26%,封顶 34%),正文与轮次导航条整体左移,卡片占住这条槽——因此不遮挡正文、不遮挡轮次导航条、也不遮挡右侧原生按钮。上沿从「对话 / 轨迹 / 看板」选项卡下的分隔线以下 6px 开始。
113
113
  - 窄窗口或打开侧栏时槽宽自动收窄(下限 140px),卡片始终可见;如果连正文最小宽度都不够,则允许卡片比常规更窄,而不是消失。
114
114
  - 换边不重新加载:两处卡片共用同一份已取到的数据。底色用左侧边栏的底色(`--dsw-specific-sidebar-fill`),阴影与左侧一致。
115
- - 右侧卡片与其它插件的右侧卡片(如 Codex Advisor)会自动上下排开,不会重叠;测量一时失败时退回固定位置显示,不会整块消失。
115
+ - 右侧卡片宽度上限 420px(避免空状态把卡片拉得过宽),并与其它插件的右侧卡片(如 Codex Advisor)自动上下排开;测量一时失败时退回固定位置显示,不会整块消失。
116
116
  ## 更新
117
117
 
118
118
  - 标题「USTC 词元额度」右侧显示灰色小字版本号;点击版本号可手动检查更新;
package/client.js CHANGED
@@ -11,7 +11,7 @@ window.__ModuleLoader__.load({
11
11
  const UPDATE_ENDPOINT = 'plugins/dsh-ustc-quota/update';
12
12
  const UPDATE_APPLY_ENDPOINT = 'plugins/dsh-ustc-quota/update/apply';
13
13
  const WINDOW_IDS = ['3h', '12h', '24h'];
14
- const CLIENT_VERSION = '1.1.47';
14
+ const CLIENT_VERSION = '1.1.49';
15
15
  const UPDATE_INTERVAL_MS = 24 * 60 * 60 * 1000;
16
16
  const CLIENT_VERSION_KEY = `${NS}:client-version`;
17
17
  const CLIENT_RELOAD_KEY = `${NS}:client-reload`;
@@ -1189,8 +1189,8 @@ window.__ModuleLoader__.load({
1189
1189
  // conversation when either side is dragged or toggled.
1190
1190
  const DOCK_GAP = 6;
1191
1191
  const DOCK_MIN_WIDTH = 200;
1192
- const DOCK_MAX_WIDTH = 340;
1193
1192
  const DOCK_FLOOR_WIDTH = 140;
1193
+ const DOCK_MAX_WIDTH = 420;
1194
1194
  const DOCK_TRANSCRIPT_FLOOR = 360;
1195
1195
 
1196
1196
 
@@ -1279,7 +1279,7 @@ window.__ModuleLoader__.load({
1279
1279
  return {
1280
1280
  top: stackTop,
1281
1281
  left: floored ? Math.max(0, rightEdge - 240) : leftEdge,
1282
- width: floored ? 240 : span,
1282
+ width: floored ? 240 : Math.min(span, DOCK_MAX_WIDTH),
1283
1283
  naturalSpan: span,
1284
1284
  columnWidth: Math.round(columnRect.width),
1285
1285
  maxHeight: Math.max(120, Math.round(columnRect.bottom) - contentTop - DOCK_GAP),
@@ -1906,6 +1906,9 @@ window.__ModuleLoader__.load({
1906
1906
  if (text.length > valueChars) valueChars = text.length;
1907
1907
  }
1908
1908
  }
1909
+ // Stale windows render an '≈ ' prefix, so the value column needs those chars too.
1910
+ const hasStaleWindow = keys.some((key) => (key.windows || []).some((window) => window.state === 'stale'));
1911
+ if (hasStaleWindow) valueChars += 2;
1909
1912
  const tableStyle = {
1910
1913
  ...STYLE.table,
1911
1914
  '--ustc-key-col': `${keyColumnWidth}px`,
package/index.js CHANGED
@@ -22,7 +22,7 @@ const ROUTE_PATH = '/plugins/dsh-ustc-quota/snapshot';
22
22
  const UPDATE_PATH = '/plugins/dsh-ustc-quota/update';
23
23
  const UPDATE_APPLY_PATH = '/plugins/dsh-ustc-quota/update/apply';
24
24
  const UPDATE_TOKEN_TTL_MS = 30 * 60 * 1000;
25
- const PLUGIN_VERSION = '1.1.47';
25
+ const PLUGIN_VERSION = '1.1.49';
26
26
  const KEY_INFO_PATH = 'key/info';
27
27
  const USER_INFO_PATH = 'user/info';
28
28
  const DISCOVERY_TTL_MS = 30000;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-ustc-quota",
3
- "version": "1.1.47",
3
+ "version": "1.1.49",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Live 3h/12h/24h USTC token quota card in the DSH sidebar (works with the USTC TokenWorks distribution).",