dsh-ustc-quota 1.1.22 → 1.1.23

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
@@ -108,7 +108,7 @@ key-c 8.7/30 29% 8.7/70 12% 11.1/100 11%
108
108
  ## 面板位置
109
109
 
110
110
  - 卡片默认在左侧边栏底部。**鼠标移到卡片上时,标题左边的品牌图标会变成方向图标**(`→` 移到右侧、`←` 移回左侧),点一下即可换边;移开鼠标图标复原。选择会记住,重启后保持。
111
- - 右侧位置停在**对话列里、聊天内容与轮次导航条之间的空白**:左右各留 24px,宽度随空白自适应,不遮挡右侧原生按钮,也不侵入轮次导航条。拖动对话边界或开关任一侧边栏时,卡片跟着走。
111
+ - 右侧位置停在**对话列里、聊天内容与轮次导航条之间的空白**:左右各留 24px,宽度随空白自适应,不遮挡右侧原生按钮,也不侵入轮次导航条。上沿从「对话 / 轨迹 / 看板」选项卡下的分隔线以下开始,不会压住分隔线。拖动对话边界或开关任一侧边栏时,卡片跟着走。
112
112
  - 换边不重新加载:两处卡片共用同一份已取到的数据,切换时直接显示,之后在后台刷新。
113
113
  ## 更新
114
114
 
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.22';
14
+ const CLIENT_VERSION = '1.1.23';
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`;
@@ -1048,17 +1048,38 @@ window.__ModuleLoader__.load({
1048
1048
  style: { display: 'block' },
1049
1049
  'data-ustc-mark-glyph': showSwitch ? 'switch' : 'brand',
1050
1050
  }, children);
1051
- const switchGlyph = targetRight
1052
- ? [
1053
- h('rect', { key: 'f', x: 2.4, y: 4.6, width: 19.2, height: 14.8, rx: 2.6, stroke: 'currentColor', strokeWidth: 1.5 }),
1054
- h('path', { key: 'a', d: 'M7.4 12h7.4', stroke: 'currentColor', strokeWidth: 1.6, strokeLinecap: 'round' }),
1055
- h('path', { key: 'b', d: 'M12.2 9.1 15.4 12l-3.2 2.9', stroke: 'currentColor', strokeWidth: 1.6, strokeLinecap: 'round', strokeLinejoin: 'round' }),
1056
- ]
1057
- : [
1058
- h('rect', { key: 'f', x: 2.4, y: 4.6, width: 19.2, height: 14.8, rx: 2.6, stroke: 'currentColor', strokeWidth: 1.5 }),
1059
- h('path', { key: 'a', d: 'M16.6 12H9.2', stroke: 'currentColor', strokeWidth: 1.6, strokeLinecap: 'round' }),
1060
- h('path', { key: 'b', d: 'M11.8 9.1 8.6 12l3.2 2.9', stroke: 'currentColor', strokeWidth: 1.6, strokeLinecap: 'round', strokeLinejoin: 'round' }),
1061
- ];
1051
+ // A layout glyph, not an arrow: a panel frame whose narrow band marks where
1052
+ // the card is about to sit. Reads as "dock to this side" at 13 px.
1053
+ const panelBand = targetRight ? 15.4 : 8.6;
1054
+ const pillX = targetRight ? 17.1 : 3.9;
1055
+ const switchGlyph = [
1056
+ h('rect', {
1057
+ key: 'frame',
1058
+ x: 2.6,
1059
+ y: 4.4,
1060
+ width: 18.8,
1061
+ height: 15.2,
1062
+ rx: 3,
1063
+ stroke: 'currentColor',
1064
+ strokeWidth: 1.5,
1065
+ }),
1066
+ h('path', {
1067
+ key: 'split',
1068
+ d: 'M' + panelBand + ' 4.4V19.6',
1069
+ stroke: 'currentColor',
1070
+ strokeWidth: 1.5,
1071
+ strokeLinecap: 'round',
1072
+ }),
1073
+ h('rect', {
1074
+ key: 'band',
1075
+ x: pillX,
1076
+ y: 9.4,
1077
+ width: 2.9,
1078
+ height: 5.2,
1079
+ rx: 1.45,
1080
+ fill: 'currentColor',
1081
+ }),
1082
+ ];
1062
1083
  return h('span', { style: STYLE.brandMark, 'aria-hidden': true, 'data-ustc-mark': '' },
1063
1084
  frame(showSwitch
1064
1085
  ? switchGlyph
@@ -1142,11 +1163,24 @@ window.__ModuleLoader__.load({
1142
1163
  }
1143
1164
  width = Math.max(DOCK_MIN_WIDTH, Math.min(width, Math.round(columnRect.width - DOCK_GAP * 2)));
1144
1165
 
1166
+ // Vertical bound: the dock may never cross or touch the separator under the
1167
+ // conversation tab strip (对话 / 轨迹 / 看板 / Codex).
1168
+ let contentTop = Math.round(columnRect.top) + 16;
1169
+ const tabStrip = document.querySelector('[data-conversation-tabs]');
1170
+ if (tabStrip) {
1171
+ const row = tabStrip.parentElement || tabStrip;
1172
+ const rowRect = row.getBoundingClientRect();
1173
+ if (rowRect.height > 0 && rowRect.bottom > columnRect.top && rowRect.bottom < columnRect.bottom) {
1174
+ contentTop = Math.max(contentTop, Math.round(rowRect.bottom) + DOCK_GAP);
1175
+ }
1176
+ }
1177
+ const bottomEdge = Math.round(columnRect.bottom);
1178
+
1145
1179
  return {
1146
- top: Math.max(8, Math.round(columnRect.top) + 16),
1180
+ top: contentTop,
1147
1181
  right: Math.max(8, Math.round(window.innerWidth - navLeft) + DOCK_GAP),
1148
1182
  width,
1149
- maxHeight: Math.max(160, Math.round(columnRect.height) - 32),
1183
+ maxHeight: Math.max(120, bottomEdge - contentTop - DOCK_GAP / 2),
1150
1184
  };
1151
1185
  }
1152
1186
 
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.22';
25
+ const PLUGIN_VERSION = '1.1.23';
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.22",
3
+ "version": "1.1.23",
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).",