@morehao/dsh-github-trending 0.8.15 → 0.8.17

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,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [v0.8.16] - 2026-11-03
4
+
5
+ ### Fixes
6
+
7
+ - **update**: surface restart notice right after in-panel update (#109)
8
+
9
+ **Full Changelog**: https://github.com/morehao/dsh-github-trending/compare/v0.8.15...v0.8.16
10
+
3
11
  ## [v0.8.12] - 2026-11-02
4
12
 
5
13
  ### Refactors
package/README.md CHANGED
@@ -33,7 +33,7 @@ GitHub 趋势榜的 **DeepSeek Harness 插件**:按日 / 周 / 月周期定时
33
33
 
34
34
  ### 概览
35
35
 
36
- 一屏回答「下次什么时候跑、四项就绪检查是否齐、上次交付了什么」。顶部是插件身份条(版本 / 包名 / GitHub / 检查更新),点包名打开「关于」弹层;右侧常驻下次运行与就绪 N/4。
36
+ 一屏回答「下次什么时候跑、四项就绪检查是否齐、上次交付了什么」。顶部是插件身份条(版本 / 包名 / 检查更新 / GitHub,两个图标紧跟包名),点包名打开「关于」弹层;右侧常驻下次运行与就绪 N/4。
37
37
 
38
38
  ![概览](docs/images/overview.png)
39
39
 
package/client.js CHANGED
@@ -1346,15 +1346,15 @@ var CSS = `
1346
1346
  .dshgt-id-sep{width:1px;height:16px;background:var(--gt-border);flex:none;}
1347
1347
  .dshgt-id-pkg{appearance:none;border:0;background:none;padding:2px 4px;border-radius:5px;color:var(--gt-muted);cursor:pointer;font-size:12px;max-width:min(44vw,360px);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:0 1 auto;}
1348
1348
  .dshgt-id-pkg:hover{color:var(--gt-fg);background:color-mix(in srgb,var(--gt-fg) 5%,var(--gt-bg));}
1349
- .dshgt-idbar-actions{margin-left:auto;position:relative;display:flex;align-items:center;gap:10px;flex:none;min-width:0;}
1349
+ /* 更新 / GitHub 入口:紧跟包名,不再靠右推到底,也不加分隔线(A 方案)。 */
1350
+ .dshgt-idbar-actions{margin-left:2px;position:relative;display:flex;align-items:center;gap:2px;flex:none;min-width:0;}
1350
1351
  .dshgt-id-gh{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:6px;color:var(--gt-muted);border:1px solid transparent;flex:none;}
1351
1352
  .dshgt-id-gh:hover{color:var(--gt-fg);background:color-mix(in srgb,var(--gt-fg) 6%,var(--gt-bg));border-color:var(--gt-border);}
1352
- /* 更新入口:版本徽标 + 纯图标刷新,作为一个整体;与 GitHub 图标同形制 */
1353
- .dshgt-upd-unit{display:inline-flex;align-items:center;gap:4px;flex:none;}
1354
1353
  /* 版本徽标:仅「有新版本」时出现,透明底细描边,高度对齐图标按钮中线 */
1355
1354
  .dshgt-ver-badge{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;height:22px;padding:0 8px;border-radius:999px;
1356
1355
  border:1px solid color-mix(in srgb,var(--gt-warn) 42%,transparent);background:transparent;color:var(--gt-warn);
1357
1356
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;line-height:1;font-variant-numeric:tabular-nums;white-space:nowrap;cursor:pointer;
1357
+ margin-left:6px;
1358
1358
  transition:background .12s ease,border-color .12s ease;}
1359
1359
  .dshgt-ver-badge:hover{background:color-mix(in srgb,var(--gt-warn) 12%,transparent);border-color:color-mix(in srgb,var(--gt-warn) 60%,transparent);}
1360
1360
  .dshgt-ver-badge:focus-visible{outline:2px solid var(--gt-accent);outline-offset:1px;}
@@ -1374,8 +1374,8 @@ var CSS = `
1374
1374
  .dshgt-refresh[data-state="error"]{color:var(--gt-err);}
1375
1375
  .dshgt-refresh[data-state="ok-flash"]{color:var(--gt-ok);}
1376
1376
  @keyframes dshgt-refresh-spin{to{transform:rotate(360deg);}}
1377
- /* 确认气泡:贴刷新图标右下方弹出 */
1378
- .dshgt-confirm-pop{position:absolute;top:calc(100% + 8px);right:0;z-index:30;box-sizing:border-box;min-width:210px;max-width:280px;
1377
+ /* 确认气泡:贴刷新图标左下方弹出(图标在条左侧,贴右会让气泡朝右伸出屏幕) */
1378
+ .dshgt-confirm-pop{position:absolute;top:calc(100% + 8px);left:0;z-index:30;box-sizing:border-box;min-width:210px;max-width:280px;
1379
1379
  display:flex;flex-direction:column;gap:10px;padding:12px;border-radius:12px;background:var(--gt-card);border:1px solid var(--gt-border);
1380
1380
  box-shadow:0 12px 32px rgba(0,0,0,.28);}
1381
1381
  .dshgt-confirm-title{font-size:12.5px;color:var(--gt-fg);line-height:1.45;}
@@ -5838,6 +5838,17 @@ function usePluginUpdate() {
5838
5838
  }, [controller]);
5839
5839
  return [state, controller];
5840
5840
  }
5841
+ function isUpdateSettled(state) {
5842
+ return state.status === "applied" || state.status === "restart-required";
5843
+ }
5844
+ function deriveSettledNotice(state, stored, now = Date.now()) {
5845
+ if (!isUpdateSettled(state)) return null;
5846
+ if (stored !== null) return stored;
5847
+ const from = state.view?.currentVersion ?? "";
5848
+ const to = state.view?.latestVersion ?? from;
5849
+ if (to === "") return null;
5850
+ return { from, to, at: now };
5851
+ }
5841
5852
 
5842
5853
  // node_modules/@morehao/dsh-plugin-kit/dist/update-restore.js
5843
5854
  var PENDING_TTL_MS = 24 * 60 * 60 * 1e3;
@@ -6019,43 +6030,37 @@ function IdentityBar(props) {
6019
6030
  { type: "button", className: "dshgt-id-pkg dshgt-mono", title: t("about.title"), onClick: () => props.onOpenAbout() },
6020
6031
  plugin.name
6021
6032
  ),
6022
- // 更新入口:版本徽标 + 纯图标刷新,放在 GitHub 图标左侧、与之一组右对齐。
6033
+ // 更新与仓库入口:紧跟包名,作为身份条的第二段。
6034
+ // 有新版本时版本徽标排在 GitHub 之后,图标位置不随状态跳动。
6023
6035
  h(
6024
6036
  "div",
6025
6037
  { className: "dshgt-idbar-actions" },
6026
6038
  h(
6027
- "div",
6028
- { className: "dshgt-upd-unit" },
6029
- showBadge ? h(
6030
- "button",
6031
- {
6032
- type: "button",
6033
- className: "dshgt-ver-badge",
6034
- title: t("shell.update.badgeTitle", { version: latestVersion }),
6035
- "aria-label": t("shell.update.badgeTitle", { version: latestVersion }),
6036
- onClick: () => setConfirming((v) => !v)
6037
- },
6038
- `v${latestVersion}`
6039
- ) : null,
6040
- h(
6041
- "button",
6042
- {
6043
- type: "button",
6044
- className: "dshgt-refresh",
6045
- "data-state": st.state,
6046
- disabled: busy,
6047
- title: st.tip,
6048
- "aria-label": st.tip,
6049
- "aria-expanded": confirmOpen ? "true" : void 0,
6050
- onClick: onRefreshClick
6051
- },
6052
- refreshIcon()
6053
- )
6039
+ "button",
6040
+ {
6041
+ type: "button",
6042
+ className: "dshgt-refresh",
6043
+ "data-state": st.state,
6044
+ disabled: busy,
6045
+ title: st.tip,
6046
+ "aria-label": st.tip,
6047
+ "aria-expanded": confirmOpen ? "true" : void 0,
6048
+ onClick: onRefreshClick
6049
+ },
6050
+ refreshIcon()
6054
6051
  ),
6055
- plugin.repository === void 0 ? null : [
6056
- h("span", { key: "gh-sep", className: "dshgt-id-sep dshgt-id-sep-gh" }),
6057
- h("a", { key: "gh", className: "dshgt-id-gh", href: plugin.repository, target: "_blank", rel: "noreferrer", title: t("about.repo"), "aria-label": t("about.repo") }, githubIcon())
6058
- ],
6052
+ plugin.repository === void 0 ? null : h("a", { className: "dshgt-id-gh", href: plugin.repository, target: "_blank", rel: "noreferrer", title: t("about.repo"), "aria-label": t("about.repo") }, githubIcon()),
6053
+ showBadge ? h(
6054
+ "button",
6055
+ {
6056
+ type: "button",
6057
+ className: "dshgt-ver-badge",
6058
+ title: t("shell.update.badgeTitle", { version: latestVersion }),
6059
+ "aria-label": t("shell.update.badgeTitle", { version: latestVersion }),
6060
+ onClick: () => setConfirming((v) => !v)
6061
+ },
6062
+ `v${latestVersion}`
6063
+ ) : null,
6059
6064
  confirmOpen ? h(
6060
6065
  "div",
6061
6066
  { className: "dshgt-confirm-pop", role: "dialog", "aria-label": t("shell.update.confirmHint") },
@@ -6280,6 +6285,11 @@ function apply(ctx) {
6280
6285
  import_react.default.useEffect(() => {
6281
6286
  setPendingUpdate(readPendingUpdate());
6282
6287
  }, []);
6288
+ const [updateState] = usePluginUpdate();
6289
+ import_react.default.useEffect(() => {
6290
+ if (!isUpdateSettled(updateState)) return;
6291
+ setPendingUpdate((current) => current ?? deriveSettledNotice(updateState, readPendingUpdate()));
6292
+ }, [updateState]);
6283
6293
  const openDigest = import_react.default.useCallback((target) => {
6284
6294
  if (target !== void 0) setDigestTarget(target);
6285
6295
  setView("digest");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@morehao/dsh-github-trending",
3
- "version": "0.8.15",
3
+ "version": "0.8.17",
4
4
  "description": "GitHub 趋势日报的 DeepSeek Harness 插件:按日 / 周 / 月周期定时 spawn 本地 trendradar 核心,抓取 Trending、生成中文简介与周期总结,并可选把订阅仓库的新 Release 合成中文摘要,一起提交到你的仓库、自动开 PR 合并;内置概览 / 榜单 / 运行记录 / 订阅 / 设置工作台。",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",