dsh-hive-panel 1.0.7 → 1.0.8

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
@@ -4,6 +4,18 @@ All notable changes to this project are documented in this file. The format is
4
4
  based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and this project
5
5
  adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [1.0.8] - 2026-12-05
8
+
9
+ ### Fixed
10
+
11
+ - Renderer re-synced from hive-panel 1.0.4: card actions are single-flight (buttons
12
+ disabled while an action runs), a failure keeps the dialog open with the error, and
13
+ "not failed" results map to readable copy. Browser bundle rebuilt.
14
+
15
+ ### Tests
16
+
17
+ - 41 checks pass, including the synced single-flight card actions and the rebuilt client.
18
+
7
19
  ## [1.0.7] - 2026-12-05
8
20
 
9
21
  ### Fixed
@@ -16,6 +28,10 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
16
28
 
17
29
  - 41 checks pass, including the synced waiting-reclaim chip and the rebuilt client.
18
30
 
31
+ ### Published
32
+
33
+ - npm: `dsh-hive-panel@1.0.7` on 2026-12-05.
34
+
19
35
  ## [1.0.6] - 2026-12-05
20
36
 
21
37
  ### Changed
package/lib/client.js CHANGED
@@ -2370,6 +2370,9 @@ const messages = Object.freeze({
2370
2370
  "toast.dismiss": "Dismiss",
2371
2371
  "toast.planWritten": "Tasks written",
2372
2372
  "toast.taskRemoved": "Task deleted",
2373
+ "action.busy": "Working…",
2374
+ "action.retryNotFailed": "The task is no longer failed; it may have been requeued.",
2375
+ "toast.retryQueued": "Task requeued",
2373
2376
  "toast.pickupHint": "The supervisor will pick them up automatically.",
2374
2377
  }),
2375
2378
  zh: Object.freeze({
@@ -2621,6 +2624,9 @@ const messages = Object.freeze({
2621
2624
  "toast.dismiss": "关闭",
2622
2625
  "toast.planWritten": "任务已写入",
2623
2626
  "toast.taskRemoved": "任务已删除",
2627
+ "action.busy": "处理中…",
2628
+ "action.retryNotFailed": "任务已不在失败状态,可能已被重新派发",
2629
+ "toast.retryQueued": "已重新入队",
2624
2630
  "toast.pickupHint": "supervisor 会自动接任务。",
2625
2631
  }),
2626
2632
  });
@@ -3638,6 +3644,8 @@ function mount(root, options = {}) {
3638
3644
  let drawerNode = null;
3639
3645
  let drawerState = null;
3640
3646
  let drawerTrigger = null;
3647
+ let drawerActionBusy = false;
3648
+ let drawerActionButtons = [];
3641
3649
  let unsubscribeLocale = null;
3642
3650
  let statusKey = null;
3643
3651
  let statusKind = "info";
@@ -5266,6 +5274,8 @@ function mount(root, options = {}) {
5266
5274
  }
5267
5275
  drawerNode = null;
5268
5276
  drawerState = null;
5277
+ drawerActionBusy = false;
5278
+ drawerActionButtons = [];
5269
5279
  if (typeof doc.removeEventListener === "function") {
5270
5280
  doc.removeEventListener("keydown", onDrawerKeydown);
5271
5281
  }
@@ -5568,6 +5578,8 @@ function mount(root, options = {}) {
5568
5578
  ),
5569
5579
  );
5570
5580
  }
5581
+ drawerActionBusy = false;
5582
+ drawerActionButtons = [];
5571
5583
  if (runActions.length > 0 || actions.length > 0) {
5572
5584
  const foot = element(doc, "div", "hive-dialog-foot hive-card-actions");
5573
5585
  setAttr(foot, "aria-label", translate("drawer.cardActions"));
@@ -5591,8 +5603,14 @@ function mount(root, options = {}) {
5591
5603
  button.disabled = true;
5592
5604
  setAttr(button, "aria-disabled", "true");
5593
5605
  }
5606
+ drawerActionButtons.push({
5607
+ button,
5608
+ action: action.name,
5609
+ labelKey: action.labelKey,
5610
+ baseDisabled: button.disabled === true,
5611
+ });
5594
5612
  button.addEventListener("click", () => {
5595
- void runCardAction(action.name, card, lane);
5613
+ void runCardAction(action.name, card, lane, button);
5596
5614
  });
5597
5615
  foot.appendChild(button);
5598
5616
  }
@@ -5773,50 +5791,93 @@ function mount(root, options = {}) {
5773
5791
  }
5774
5792
  }
5775
5793
 
5776
- async function runCardAction(name, card, lane) {
5777
- if (destroyed) return;
5778
- let ok = false;
5779
- switch (name) {
5780
- case "claim": {
5781
- const agent = ask(translate("prompt.claimAgent"), "panel");
5782
- if (agent === null) return;
5783
- ok = await postAction("claim", { id: card.id, agent: agent.trim() || "panel" });
5784
- break;
5785
- }
5786
- case "done": {
5787
- const sha = ask(translate("prompt.commitSha"), "");
5788
- if (sha === null) return;
5789
- const body = { id: card.id };
5790
- if (sha.trim()) body.sha = sha.trim();
5791
- ok = await postAction("done", body);
5792
- break;
5794
+ function setDrawerActionBusy(activeButton, busy) {
5795
+ for (const entry of drawerActionButtons) {
5796
+ if (busy) {
5797
+ entry.button.disabled = true;
5798
+ setAttr(entry.button, "aria-busy", "true");
5799
+ } else {
5800
+ entry.button.disabled = entry.baseDisabled;
5801
+ if (typeof entry.button.removeAttribute === "function") entry.button.removeAttribute("aria-busy");
5802
+ else delete entry.button.attributes["aria-busy"];
5793
5803
  }
5794
- case "fail": {
5795
- const reason = ask(translate("prompt.failReason"), "");
5796
- if (reason === null || !reason.trim()) return;
5797
- ok = await postAction("fail", { id: card.id, reason: reason.trim() });
5798
- break;
5804
+ }
5805
+ if (!activeButton) return;
5806
+ if (busy) {
5807
+ activeButton.textContent = translate("action.busy");
5808
+ } else {
5809
+ const entry = drawerActionButtons.find((item) => item.button === activeButton);
5810
+ if (entry) activeButton.textContent = translate(entry.labelKey);
5811
+ }
5812
+ }
5813
+
5814
+ function cardActionErrorMessage(name, error) {
5815
+ const detail = actionErrorDetail(error) || translate("status.actionFailed");
5816
+ if (name === "retry" && /not failed/i.test(detail)) return translate("action.retryNotFailed");
5817
+ return detail;
5818
+ }
5819
+
5820
+ async function runCardAction(name, card, lane, button) {
5821
+ if (destroyed || drawerActionBusy) return;
5822
+ drawerActionBusy = true;
5823
+ setDrawerActionBusy(button, true);
5824
+ try {
5825
+ let body = null;
5826
+ switch (name) {
5827
+ case "claim": {
5828
+ const agent = ask(translate("prompt.claimAgent"), "panel");
5829
+ if (agent === null) return;
5830
+ body = { id: card.id, agent: agent.trim() || "panel" };
5831
+ break;
5832
+ }
5833
+ case "done": {
5834
+ const sha = ask(translate("prompt.commitSha"), "");
5835
+ if (sha === null) return;
5836
+ body = { id: card.id };
5837
+ if (sha.trim()) body.sha = sha.trim();
5838
+ break;
5839
+ }
5840
+ case "fail": {
5841
+ const reason = ask(translate("prompt.failReason"), "");
5842
+ if (reason === null || !reason.trim()) return;
5843
+ body = { id: card.id, reason: reason.trim() };
5844
+ break;
5845
+ }
5846
+ case "retry":
5847
+ case "supersede":
5848
+ body = { id: card.id };
5849
+ break;
5850
+ case "remove": {
5851
+ const title = card.title || card.id || translate("card.untitled");
5852
+ const message = translate("confirm.remove").replace("{title}", title);
5853
+ if (!askConfirm(message)) return;
5854
+ body = { id: card.id };
5855
+ break;
5856
+ }
5857
+ default:
5858
+ return;
5799
5859
  }
5800
- case "retry":
5801
- ok = await postAction("retry", { id: card.id });
5802
- break;
5803
- case "remove": {
5804
- const name = card.title || card.id || translate("card.untitled");
5805
- const message = translate("confirm.remove").replace("{title}", name);
5806
- if (!askConfirm(message)) return;
5807
- ok = await postAction("remove", { id: card.id });
5808
- break;
5860
+
5861
+ const result = await requestAction(name, body);
5862
+ if (!result.ok) {
5863
+ if (!destroyed) {
5864
+ setStatus("status.actionFailed", "error");
5865
+ reportError(result.error);
5866
+ showToast("error", translate("status.actionFailed"), cardActionErrorMessage(name, result.error));
5867
+ }
5868
+ return;
5809
5869
  }
5810
- default:
5811
- break;
5812
- }
5813
- if (ok && !destroyed) {
5814
- if (name === "remove") showToast("success", translate("toast.taskRemoved"), "");
5870
+ if (destroyed) return;
5815
5871
  closeDrawer();
5816
- void refresh();
5872
+ await forceRefresh();
5873
+ if (destroyed) return;
5874
+ if (name === "remove") showToast("success", translate("toast.taskRemoved"), "");
5875
+ else if (name === "retry") showToast("success", translate("toast.retryQueued"), "");
5876
+ } finally {
5877
+ if (!destroyed && drawerNode) setDrawerActionBusy(button, false);
5878
+ drawerActionBusy = false;
5817
5879
  }
5818
5880
  }
5819
-
5820
5881
  // --- rendering -----------------------------------------------------------
5821
5882
 
5822
5883
  function renderInit(model) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-hive-panel",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "Hive board and queen mode inside DSH Web: a conversation view scoped to the Session's repository, with allowlisted task-card actions over DSH's shell seam.",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
package/src/panel.js CHANGED
@@ -2297,6 +2297,9 @@ export const messages = Object.freeze({
2297
2297
  "toast.dismiss": "Dismiss",
2298
2298
  "toast.planWritten": "Tasks written",
2299
2299
  "toast.taskRemoved": "Task deleted",
2300
+ "action.busy": "Working…",
2301
+ "action.retryNotFailed": "The task is no longer failed; it may have been requeued.",
2302
+ "toast.retryQueued": "Task requeued",
2300
2303
  "toast.pickupHint": "The supervisor will pick them up automatically.",
2301
2304
  }),
2302
2305
  zh: Object.freeze({
@@ -2548,6 +2551,9 @@ export const messages = Object.freeze({
2548
2551
  "toast.dismiss": "关闭",
2549
2552
  "toast.planWritten": "任务已写入",
2550
2553
  "toast.taskRemoved": "任务已删除",
2554
+ "action.busy": "处理中…",
2555
+ "action.retryNotFailed": "任务已不在失败状态,可能已被重新派发",
2556
+ "toast.retryQueued": "已重新入队",
2551
2557
  "toast.pickupHint": "supervisor 会自动接任务。",
2552
2558
  }),
2553
2559
  });
@@ -3565,6 +3571,8 @@ export function mount(root, options = {}) {
3565
3571
  let drawerNode = null;
3566
3572
  let drawerState = null;
3567
3573
  let drawerTrigger = null;
3574
+ let drawerActionBusy = false;
3575
+ let drawerActionButtons = [];
3568
3576
  let unsubscribeLocale = null;
3569
3577
  let statusKey = null;
3570
3578
  let statusKind = "info";
@@ -5193,6 +5201,8 @@ export function mount(root, options = {}) {
5193
5201
  }
5194
5202
  drawerNode = null;
5195
5203
  drawerState = null;
5204
+ drawerActionBusy = false;
5205
+ drawerActionButtons = [];
5196
5206
  if (typeof doc.removeEventListener === "function") {
5197
5207
  doc.removeEventListener("keydown", onDrawerKeydown);
5198
5208
  }
@@ -5495,6 +5505,8 @@ export function mount(root, options = {}) {
5495
5505
  ),
5496
5506
  );
5497
5507
  }
5508
+ drawerActionBusy = false;
5509
+ drawerActionButtons = [];
5498
5510
  if (runActions.length > 0 || actions.length > 0) {
5499
5511
  const foot = element(doc, "div", "hive-dialog-foot hive-card-actions");
5500
5512
  setAttr(foot, "aria-label", translate("drawer.cardActions"));
@@ -5518,8 +5530,14 @@ export function mount(root, options = {}) {
5518
5530
  button.disabled = true;
5519
5531
  setAttr(button, "aria-disabled", "true");
5520
5532
  }
5533
+ drawerActionButtons.push({
5534
+ button,
5535
+ action: action.name,
5536
+ labelKey: action.labelKey,
5537
+ baseDisabled: button.disabled === true,
5538
+ });
5521
5539
  button.addEventListener("click", () => {
5522
- void runCardAction(action.name, card, lane);
5540
+ void runCardAction(action.name, card, lane, button);
5523
5541
  });
5524
5542
  foot.appendChild(button);
5525
5543
  }
@@ -5700,50 +5718,93 @@ export function mount(root, options = {}) {
5700
5718
  }
5701
5719
  }
5702
5720
 
5703
- async function runCardAction(name, card, lane) {
5704
- if (destroyed) return;
5705
- let ok = false;
5706
- switch (name) {
5707
- case "claim": {
5708
- const agent = ask(translate("prompt.claimAgent"), "panel");
5709
- if (agent === null) return;
5710
- ok = await postAction("claim", { id: card.id, agent: agent.trim() || "panel" });
5711
- break;
5712
- }
5713
- case "done": {
5714
- const sha = ask(translate("prompt.commitSha"), "");
5715
- if (sha === null) return;
5716
- const body = { id: card.id };
5717
- if (sha.trim()) body.sha = sha.trim();
5718
- ok = await postAction("done", body);
5719
- break;
5721
+ function setDrawerActionBusy(activeButton, busy) {
5722
+ for (const entry of drawerActionButtons) {
5723
+ if (busy) {
5724
+ entry.button.disabled = true;
5725
+ setAttr(entry.button, "aria-busy", "true");
5726
+ } else {
5727
+ entry.button.disabled = entry.baseDisabled;
5728
+ if (typeof entry.button.removeAttribute === "function") entry.button.removeAttribute("aria-busy");
5729
+ else delete entry.button.attributes["aria-busy"];
5720
5730
  }
5721
- case "fail": {
5722
- const reason = ask(translate("prompt.failReason"), "");
5723
- if (reason === null || !reason.trim()) return;
5724
- ok = await postAction("fail", { id: card.id, reason: reason.trim() });
5725
- break;
5731
+ }
5732
+ if (!activeButton) return;
5733
+ if (busy) {
5734
+ activeButton.textContent = translate("action.busy");
5735
+ } else {
5736
+ const entry = drawerActionButtons.find((item) => item.button === activeButton);
5737
+ if (entry) activeButton.textContent = translate(entry.labelKey);
5738
+ }
5739
+ }
5740
+
5741
+ function cardActionErrorMessage(name, error) {
5742
+ const detail = actionErrorDetail(error) || translate("status.actionFailed");
5743
+ if (name === "retry" && /not failed/i.test(detail)) return translate("action.retryNotFailed");
5744
+ return detail;
5745
+ }
5746
+
5747
+ async function runCardAction(name, card, lane, button) {
5748
+ if (destroyed || drawerActionBusy) return;
5749
+ drawerActionBusy = true;
5750
+ setDrawerActionBusy(button, true);
5751
+ try {
5752
+ let body = null;
5753
+ switch (name) {
5754
+ case "claim": {
5755
+ const agent = ask(translate("prompt.claimAgent"), "panel");
5756
+ if (agent === null) return;
5757
+ body = { id: card.id, agent: agent.trim() || "panel" };
5758
+ break;
5759
+ }
5760
+ case "done": {
5761
+ const sha = ask(translate("prompt.commitSha"), "");
5762
+ if (sha === null) return;
5763
+ body = { id: card.id };
5764
+ if (sha.trim()) body.sha = sha.trim();
5765
+ break;
5766
+ }
5767
+ case "fail": {
5768
+ const reason = ask(translate("prompt.failReason"), "");
5769
+ if (reason === null || !reason.trim()) return;
5770
+ body = { id: card.id, reason: reason.trim() };
5771
+ break;
5772
+ }
5773
+ case "retry":
5774
+ case "supersede":
5775
+ body = { id: card.id };
5776
+ break;
5777
+ case "remove": {
5778
+ const title = card.title || card.id || translate("card.untitled");
5779
+ const message = translate("confirm.remove").replace("{title}", title);
5780
+ if (!askConfirm(message)) return;
5781
+ body = { id: card.id };
5782
+ break;
5783
+ }
5784
+ default:
5785
+ return;
5726
5786
  }
5727
- case "retry":
5728
- ok = await postAction("retry", { id: card.id });
5729
- break;
5730
- case "remove": {
5731
- const name = card.title || card.id || translate("card.untitled");
5732
- const message = translate("confirm.remove").replace("{title}", name);
5733
- if (!askConfirm(message)) return;
5734
- ok = await postAction("remove", { id: card.id });
5735
- break;
5787
+
5788
+ const result = await requestAction(name, body);
5789
+ if (!result.ok) {
5790
+ if (!destroyed) {
5791
+ setStatus("status.actionFailed", "error");
5792
+ reportError(result.error);
5793
+ showToast("error", translate("status.actionFailed"), cardActionErrorMessage(name, result.error));
5794
+ }
5795
+ return;
5736
5796
  }
5737
- default:
5738
- break;
5739
- }
5740
- if (ok && !destroyed) {
5741
- if (name === "remove") showToast("success", translate("toast.taskRemoved"), "");
5797
+ if (destroyed) return;
5742
5798
  closeDrawer();
5743
- void refresh();
5799
+ await forceRefresh();
5800
+ if (destroyed) return;
5801
+ if (name === "remove") showToast("success", translate("toast.taskRemoved"), "");
5802
+ else if (name === "retry") showToast("success", translate("toast.retryQueued"), "");
5803
+ } finally {
5804
+ if (!destroyed && drawerNode) setDrawerActionBusy(button, false);
5805
+ drawerActionBusy = false;
5744
5806
  }
5745
5807
  }
5746
-
5747
5808
  // --- rendering -----------------------------------------------------------
5748
5809
 
5749
5810
  function renderInit(model) {