dsh-ustc-quota 1.1.56 → 1.1.57

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
- - 右侧卡片宽度上限 420px(避免空状态把卡片拉得过宽),并与其它插件的右侧卡片(如 Codex Advisor)自动上下排开;测量一时失败时退回固定位置显示,不会整块消失。
115
+ - 右侧卡片宽度上限 480px,每列数值按该列最宽内容自动定宽,多余空间给进度条;与其它插件的右侧卡片(如 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.56';
14
+ const CLIENT_VERSION = '1.1.57';
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`;
@@ -1278,11 +1278,20 @@ window.__ModuleLoader__.load({
1278
1278
  const floored = span < 240;
1279
1279
  let stackTop = contentTop;
1280
1280
  try {
1281
- // Other plugins place their own right docks with the same anchor; stack below
1282
- // any of them that already occupy this band so the cards never overlap.
1281
+ // Other plugins place their own right docks on the same anchor. Deferring to
1282
+ // every neighbour that overlaps this band makes two docks chase each other
1283
+ // downwards: each one steps below the other, forever. Break the symmetry —
1284
+ // yield only to a neighbour that starts strictly above this slot, or that
1285
+ // starts at the same top and sorts earlier by id. Exactly one dock then
1286
+ // yields per pair, so the arrangement settles after a single step.
1287
+ const MY_DOCK_ID = 'ustc-quota';
1283
1288
  for (const node of document.querySelectorAll('[data-codex-advisor-dock="right"]')) {
1284
1289
  const rect = node.getBoundingClientRect();
1285
1290
  if (rect.height <= 0 || rect.width <= 0) continue;
1291
+ const NEIGHBOUR_DOCK_ID = 'codex-advisor';
1292
+ const startsAbove = rect.top < contentTop - 1;
1293
+ const tiedAndEarlier = Math.abs(rect.top - contentTop) <= 1 && NEIGHBOUR_DOCK_ID < MY_DOCK_ID;
1294
+ if (!startsAbove && !tiedAndEarlier) continue;
1286
1295
  if (rect.bottom > stackTop && rect.top < columnRect.bottom) {
1287
1296
  stackTop = Math.max(stackTop, Math.round(rect.bottom) + DOCK_GAP);
1288
1297
  }
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.56';
25
+ const PLUGIN_VERSION = '1.1.57';
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.56",
3
+ "version": "1.1.57",
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).",