dsh-hive-panel 0.1.5 → 0.1.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
@@ -1,3 +1,25 @@
1
+ ## [0.1.8] - 2026-12-04
2
+
3
+ ### Fixed
4
+
5
+ - Settings no longer repeat the repository path line.
6
+ - The queen notice only documents `/queen off` as the exit; the "dismissing does not
7
+ change state" clarification moved into the close button's title/aria-label.
8
+
9
+ ## [0.1.6] - 2026-12-04
10
+
11
+ ### Changed
12
+
13
+ - Settings open as two independent tabs, "Concurrency" (并发上限) and "Add role"
14
+ (新增角色), each with its own bottom-right actions; the forms stay right-aligned on
15
+ narrow screens.
16
+ - Modal backdrops are transparent so the board stays visible behind card and task
17
+ dialogs; browser bundle rebuilt.
18
+
19
+ ### Published
20
+
21
+ - npm: `dsh-hive-panel@0.1.6` on 2026-12-04.
22
+
1
23
  ## [0.1.5] - 2026-12-04
2
24
 
3
25
  ### Added
@@ -25,6 +47,10 @@
25
47
  `ok:false, code:2` plus that stderr. The shared renderer's drawer exposes the action
26
48
  as a red button with a second confirmation. `lib/client.js` rebuilt.
27
49
 
50
+ ### Published
51
+
52
+ - npm: `dsh-hive-panel@0.1.5` on 2026-12-04.
53
+
28
54
  ## [0.1.4] - 2026-12-04
29
55
 
30
56
  ### Changed
package/lib/client.js CHANGED
@@ -157,7 +157,9 @@ const PANEL_STYLES = `.hive { position: relative; }
157
157
  align-items: center;
158
158
  justify-content: center;
159
159
  padding: 12px;
160
- background: rgb(0 0 0 / 45%);
160
+ background: transparent;
161
+ backdrop-filter: none;
162
+ -webkit-backdrop-filter: none;
161
163
  }
162
164
 
163
165
  .hive-help {
@@ -1282,15 +1284,59 @@ const PANEL_STYLES = `.hive { position: relative; }
1282
1284
  .hive-toast { right: 8px; bottom: 8px; width: calc(100% - 16px); }
1283
1285
  }
1284
1286
 
1285
- .hive-settings-actions {
1287
+
1288
+ .hive-settings-dialog { max-height: 80vh; }
1289
+
1290
+ .hive-settings-dialog .hive-dialog-body { overflow: auto; }
1291
+
1292
+ .hive-settings-tabs {
1293
+ display: flex;
1294
+ align-items: center;
1295
+ gap: 4px;
1296
+ border-bottom: 1px solid var(--hive-line, #232b38);
1297
+ }
1298
+
1299
+ .hive-settings-tab {
1300
+ flex: 0 0 auto;
1301
+ padding: 7px 10px 8px;
1302
+ border: 0;
1303
+ border-bottom: 2px solid transparent;
1304
+ background: transparent;
1305
+ color: var(--hive-fg-soft);
1306
+ font-size: 11.5px;
1307
+ line-height: 1.3;
1308
+ cursor: pointer;
1309
+ }
1310
+
1311
+ .hive-settings-tab:hover { color: var(--hive-fg, #e6edf3); }
1312
+
1313
+ .hive-settings-tab[aria-selected="true"] {
1314
+ border-bottom-color: var(--hive-accent, #58c4dc);
1315
+ color: var(--hive-fg, #e6edf3);
1316
+ }
1317
+
1318
+ .hive-settings-tab:focus-visible {
1319
+ outline: 2px solid var(--hive-accent, #58c4dc);
1320
+ outline-offset: -2px;
1321
+ }
1322
+
1323
+ .hive-settings-tabpanel[hidden] { display: none; }
1324
+
1325
+ .hive-settings-tabpanel .hive-settings-section {
1326
+ padding-top: 0;
1327
+ border-top: 0;
1328
+ }
1329
+
1330
+ .hive-settings-form-actions {
1286
1331
  display: flex;
1287
1332
  align-items: center;
1288
1333
  justify-content: flex-end;
1289
1334
  gap: 8px;
1290
1335
  width: 100%;
1336
+ margin-top: 2px;
1291
1337
  }
1292
1338
 
1293
- .hive-settings-actions .hive-btn {
1339
+ .hive-settings-form-actions .hive-btn {
1294
1340
  display: inline-flex;
1295
1341
  flex: 0 0 auto;
1296
1342
  align-items: center;
@@ -1303,6 +1349,11 @@ const PANEL_STYLES = `.hive { position: relative; }
1303
1349
  line-height: 1;
1304
1350
  }
1305
1351
 
1352
+ .hive-settings-form-actions .hive-btn:disabled {
1353
+ opacity: 0.55;
1354
+ cursor: not-allowed;
1355
+ }
1356
+
1306
1357
  .hive-settings-primary {
1307
1358
  border-color: color-mix(in srgb, var(--hive-accent, #58c4dc) 70%, var(--hive-line, #232b38));
1308
1359
  background: var(--hive-accent, #58c4dc);
@@ -1327,21 +1378,11 @@ const PANEL_STYLES = `.hive { position: relative; }
1327
1378
  color: var(--hive-fg, #e6edf3);
1328
1379
  }
1329
1380
 
1330
- .hive-settings-actions .hive-btn:disabled {
1381
+ .hive-settings-form-actions .hive-btn:disabled {
1331
1382
  opacity: 0.55;
1332
1383
  cursor: not-allowed;
1333
1384
  }
1334
1385
 
1335
- @media (max-width: 420px) {
1336
- .hive-settings-actions { justify-content: stretch; }
1337
- .hive-settings-actions .hive-btn { flex: 1 1 0; }
1338
- }
1339
-
1340
- @container hiveboard (max-width: 419px) {
1341
- .hive-settings-actions { justify-content: stretch; }
1342
- .hive-settings-actions .hive-btn { flex: 1 1 0; }
1343
- }
1344
-
1345
1386
  .hive-card-scrim { padding: 12px; }
1346
1387
 
1347
1388
  .hive-card-dialog {
@@ -1570,6 +1611,9 @@ const messages = Object.freeze({
1570
1611
  "limits.closeAria": "Close agent concurrency settings",
1571
1612
  "settings.openAria": "Open settings for this repository",
1572
1613
  "settings.title": "Settings",
1614
+ "settings.tabLimits": "Concurrency limit",
1615
+ "settings.tabRole": "Add role",
1616
+ "settings.tabsAria": "Settings sections",
1573
1617
  "settings.aria": "Settings for this repository",
1574
1618
  "settings.addRole": "Add role",
1575
1619
  "settings.roleName": "Role name",
@@ -1644,9 +1688,9 @@ const messages = Object.freeze({
1644
1688
  "init.queen": "This session's input now routes to the Queen (it splits tasks, it does not do the work).",
1645
1689
  "init.queenOutput": "Initialisation output",
1646
1690
  "queen.dismiss": "Dismiss",
1647
- "queen.dismissAria": "Dismiss the Queen notice for this repository",
1691
+ "queen.dismissAria": "Close this notice; it does not change Queen mode",
1648
1692
  "help.queen": "Queen mode",
1649
- "help.queenDesc": "Type /queen off to exit. After exiting, this session returns to normal coding mode. Hiding the notice does not change Queen mode.",
1693
+ "help.queenDesc": "Type /queen off to exit Queen mode; this session then returns to normal coding mode.",
1650
1694
  "queen.status.active": "Queen active",
1651
1695
  "queen.status.inactive": "Queen not active",
1652
1696
  "queen.source.auto": "auto",
@@ -1801,6 +1845,9 @@ const messages = Object.freeze({
1801
1845
  "limits.closeAria": "关闭智能体的并发上限设置",
1802
1846
  "settings.openAria": "打开这个仓库的设置",
1803
1847
  "settings.title": "设置",
1848
+ "settings.tabLimits": "并发上限",
1849
+ "settings.tabRole": "添加角色",
1850
+ "settings.tabsAria": "设置分区",
1804
1851
  "settings.aria": "这个仓库的设置",
1805
1852
  "settings.addRole": "新增角色",
1806
1853
  "settings.roleName": "角色名",
@@ -1875,9 +1922,9 @@ const messages = Object.freeze({
1875
1922
  "init.queen": "本会话输入框已接入女王模式(女王只拆解任务,不亲自干活)。",
1876
1923
  "init.queenOutput": "初始化输出",
1877
1924
  "queen.dismiss": "关闭提示",
1878
- "queen.dismissAria": "关闭这个仓库的女王提示",
1925
+ "queen.dismissAria": "关闭提示,不影响女王状态",
1879
1926
  "help.queen": "女王模式",
1880
- "help.queenDesc": "输入 /queen off 退出,退出后本会话恢复普通编码模式;关闭提示不影响女王状态。",
1927
+ "help.queenDesc": "输入 /queen off 退出女王模式,退出后本会话恢复普通编码模式。",
1881
1928
  "queen.status.active": "女王已接管",
1882
1929
  "queen.status.inactive": "女王未接管",
1883
1930
  "queen.source.auto": "自动",
@@ -2428,6 +2475,16 @@ function makeHiveIcon(doc, kind) {
2428
2475
  return svg;
2429
2476
  }
2430
2477
 
2478
+ function setHidden(node, hidden) {
2479
+ if (!node) return;
2480
+ if (hidden) {
2481
+ setAttr(node, "hidden", "");
2482
+ return;
2483
+ }
2484
+ if (typeof node.removeAttribute === "function") node.removeAttribute("hidden");
2485
+ else if (node.attributes) delete node.attributes.hidden;
2486
+ }
2487
+
2431
2488
  function setAttr(node, name, value) {
2432
2489
  if (node && typeof node.setAttribute === "function") {
2433
2490
  node.setAttribute(name, value === null || value === undefined ? "" : String(value));
@@ -2758,6 +2815,7 @@ function mount(root, options = {}) {
2758
2815
  let limitsState = null;
2759
2816
  let limitsTriggerButton = null;
2760
2817
  let limitsFocusables = [];
2818
+ let settingsActiveTab = "limits";
2761
2819
 
2762
2820
  // --- shell ---------------------------------------------------------------
2763
2821
 
@@ -3595,7 +3653,7 @@ function mount(root, options = {}) {
3595
3653
  if (!event || !event.target || event.target === overlay) closeLimitsDialog();
3596
3654
  });
3597
3655
 
3598
- const dialog = element(doc, "div", "hive-dialog");
3656
+ const dialog = element(doc, "div", "hive-dialog hive-settings-dialog");
3599
3657
  setAttr(dialog, "role", "dialog");
3600
3658
  setAttr(dialog, "aria-modal", "true");
3601
3659
  setAttr(dialog, "aria-label", translate("settings.aria"));
@@ -3615,18 +3673,11 @@ function mount(root, options = {}) {
3615
3673
  dialog.appendChild(head);
3616
3674
 
3617
3675
  const body = element(doc, "div", "hive-dialog-body");
3618
- const repoLine = element(doc, "div", "hive-limits-repo");
3619
- repoLine.appendChild(element(doc, "span", "hive-limits-repo-label", translate("init.repo")));
3620
- const repoPath = element(doc, "code", "hive-limits-repo-path", repo);
3621
- setAttr(repoPath, "title", repo);
3622
- repoLine.appendChild(repoPath);
3623
- body.appendChild(repoLine);
3624
3676
  if (!writable) {
3625
3677
  body.appendChild(element(doc, "div", "hive-settings-note", translate("settings.readOnly")));
3626
3678
  }
3627
3679
 
3628
3680
  const roleSection = element(doc, "section", "hive-settings-section");
3629
- roleSection.appendChild(element(doc, "div", "hive-settings-section-title", translate("settings.addRole")));
3630
3681
  const roleForm = element(doc, "div", "hive-field-row hive-settings-role-form");
3631
3682
  const roleNameField = element(doc, "label", "hive-field");
3632
3683
  roleNameField.appendChild(element(doc, "span", "hive-field-label", translate("settings.roleName")));
@@ -3683,7 +3734,12 @@ function mount(root, options = {}) {
3683
3734
 
3684
3735
  const roleErrorNode = element(doc, "div", "hive-limits-error is-hidden", "");
3685
3736
  roleSection.appendChild(roleErrorNode);
3686
- const addRoleButton = element(doc, "button", "hive-btn hive-settings-add-role", translate("settings.addRoleButton"));
3737
+ const addRoleButton = element(
3738
+ doc,
3739
+ "button",
3740
+ "hive-btn hive-settings-add-role hive-settings-secondary",
3741
+ translate("settings.addRoleButton"),
3742
+ );
3687
3743
  setAttr(addRoleButton, "type", "button");
3688
3744
  setAttr(addRoleButton, "title", translate("settings.addRoleAria"));
3689
3745
  setAttr(addRoleButton, "aria-label", translate("settings.addRoleAria"));
@@ -3691,16 +3747,16 @@ function mount(root, options = {}) {
3691
3747
  addRoleButton.addEventListener("click", () => {
3692
3748
  void saveRole();
3693
3749
  });
3750
+ const roleActions = element(doc, "div", "hive-settings-form-actions hive-settings-role-actions");
3751
+ roleActions.appendChild(addRoleButton);
3752
+ roleSection.appendChild(roleActions);
3694
3753
  if (!writable) {
3695
3754
  roleNameInput.disabled = true;
3696
3755
  adapterInput.disabled = true;
3697
3756
  modelInput.disabled = true;
3698
3757
  roleDescriptionInput.disabled = true;
3699
3758
  }
3700
- body.appendChild(roleSection);
3701
-
3702
3759
  const limitsSection = element(doc, "section", "hive-settings-section");
3703
- limitsSection.appendChild(element(doc, "div", "hive-settings-section-title", translate("limits.title")));
3704
3760
  limitsSection.appendChild(element(doc, "div", "hive-limits-description", translate("limits.description")));
3705
3761
  const rowNodes = [];
3706
3762
  if (!supervisorAvailable) {
@@ -3741,18 +3797,12 @@ function mount(root, options = {}) {
3741
3797
 
3742
3798
  const errorNode = element(doc, "div", "hive-limits-error is-hidden", "");
3743
3799
  limitsSection.appendChild(errorNode);
3744
- body.appendChild(limitsSection);
3745
-
3746
- const queenSection = element(doc, "section", "hive-settings-section");
3747
- queenSection.appendChild(element(doc, "div", "hive-settings-section-title", translate("help.queen")));
3748
- queenSection.appendChild(element(doc, "div", "hive-help-desc hive-help-queen", translate("help.queenDesc")));
3749
- body.appendChild(queenSection);
3750
- dialog.appendChild(body);
3751
-
3752
- const foot = element(doc, "div", "hive-dialog-foot");
3753
- const settingsActions = element(doc, "div", "hive-settings-actions");
3754
- addRoleButton.className = "hive-btn hive-settings-add-role hive-settings-secondary";
3755
- const saveButton = element(doc, "button", "hive-btn hive-settings-save hive-settings-primary", translate("settings.saveLimits"));
3800
+ const saveButton = element(
3801
+ doc,
3802
+ "button",
3803
+ "hive-btn hive-settings-save hive-settings-primary",
3804
+ translate("settings.saveLimits"),
3805
+ );
3756
3806
  setAttr(saveButton, "type", "button");
3757
3807
  setAttr(saveButton, "title", translate("limits.saveAria").replace("{repo}", repo));
3758
3808
  setAttr(saveButton, "aria-label", translate("limits.saveAria").replace("{repo}", repo));
@@ -3760,10 +3810,82 @@ function mount(root, options = {}) {
3760
3810
  saveButton.addEventListener("click", () => {
3761
3811
  void saveBeeCounts();
3762
3812
  });
3763
- settingsActions.appendChild(addRoleButton);
3764
- settingsActions.appendChild(saveButton);
3765
- foot.appendChild(settingsActions);
3766
- dialog.appendChild(foot);
3813
+ const limitsActions = element(doc, "div", "hive-settings-form-actions hive-settings-limits-actions");
3814
+ limitsActions.appendChild(saveButton);
3815
+ limitsSection.appendChild(limitsActions);
3816
+
3817
+ const queenSection = element(doc, "section", "hive-settings-section");
3818
+ queenSection.appendChild(element(doc, "div", "hive-settings-section-title", translate("help.queen")));
3819
+ queenSection.appendChild(element(doc, "div", "hive-help-desc hive-help-queen", translate("help.queenDesc")));
3820
+ const tabs = element(doc, "div", "hive-settings-tabs");
3821
+ setAttr(tabs, "role", "tablist");
3822
+ setAttr(tabs, "aria-label", translate("settings.tabsAria"));
3823
+ const panelWrap = element(doc, "div", "hive-settings-panels");
3824
+ const tabEntries = [
3825
+ { id: "limits", labelKey: "settings.tabLimits", section: limitsSection },
3826
+ { id: "role", labelKey: "settings.tabRole", section: roleSection },
3827
+ ];
3828
+ const tabNodes = new Map();
3829
+ const panelNodes = new Map();
3830
+
3831
+ function selectSettingsTab(name, focusTab) {
3832
+ const active = name === "role" ? "role" : "limits";
3833
+ settingsActiveTab = active;
3834
+ for (const entry of tabEntries) {
3835
+ const selected = entry.id === active;
3836
+ const tab = tabNodes.get(entry.id);
3837
+ const panel = panelNodes.get(entry.id);
3838
+ setAttr(tab, "aria-selected", selected ? "true" : "false");
3839
+ setAttr(tab, "tabindex", selected ? "0" : "-1");
3840
+ setHidden(panel, !selected);
3841
+ }
3842
+ if (focusTab) focusNode(tabNodes.get(active));
3843
+ }
3844
+
3845
+ function onSettingsTabKeydown(event, current) {
3846
+ if (!event) return;
3847
+ if (event.key !== "ArrowLeft" && event.key !== "ArrowRight" && event.key !== "Home" && event.key !== "End") {
3848
+ return;
3849
+ }
3850
+ if (typeof event.preventDefault === "function") event.preventDefault();
3851
+ const index = tabEntries.findIndex((entry) => entry.id === current);
3852
+ let next = index;
3853
+ if (event.key === "ArrowLeft") next = index === 0 ? tabEntries.length - 1 : index - 1;
3854
+ else if (event.key === "ArrowRight") next = index === tabEntries.length - 1 ? 0 : index + 1;
3855
+ else if (event.key === "Home") next = 0;
3856
+ else if (event.key === "End") next = tabEntries.length - 1;
3857
+ selectSettingsTab(tabEntries[next].id, true);
3858
+ }
3859
+
3860
+ for (const entry of tabEntries) {
3861
+ const tabId = "hive-settings-tab-" + entry.id;
3862
+ const panelId = "hive-settings-panel-" + entry.id;
3863
+ const tab = element(doc, "button", "hive-settings-tab", translate(entry.labelKey));
3864
+ setAttr(tab, "type", "button");
3865
+ setAttr(tab, "role", "tab");
3866
+ setAttr(tab, "id", tabId);
3867
+ setAttr(tab, "aria-controls", panelId);
3868
+ setAttr(tab, "aria-selected", "false");
3869
+ setAttr(tab, "tabindex", "-1");
3870
+ tab.addEventListener("click", () => selectSettingsTab(entry.id, true));
3871
+ tab.addEventListener("keydown", (event) => onSettingsTabKeydown(event, entry.id));
3872
+ tabs.appendChild(tab);
3873
+ tabNodes.set(entry.id, tab);
3874
+
3875
+ const panel = element(doc, "div", "hive-settings-tabpanel");
3876
+ setAttr(panel, "role", "tabpanel");
3877
+ setAttr(panel, "id", panelId);
3878
+ setAttr(panel, "aria-labelledby", tabId);
3879
+ setHidden(panel, true);
3880
+ panel.appendChild(entry.section);
3881
+ panelWrap.appendChild(panel);
3882
+ panelNodes.set(entry.id, panel);
3883
+ }
3884
+ body.appendChild(tabs);
3885
+ body.appendChild(panelWrap);
3886
+ selectSettingsTab(settingsActiveTab, false);
3887
+ body.appendChild(queenSection);
3888
+ dialog.appendChild(body);
3767
3889
 
3768
3890
  overlay.appendChild(dialog);
3769
3891
  frame.appendChild(overlay);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-hive-panel",
3
- "version": "0.1.5",
3
+ "version": "0.1.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
@@ -130,7 +130,9 @@ const PANEL_STYLES = `.hive { position: relative; }
130
130
  align-items: center;
131
131
  justify-content: center;
132
132
  padding: 12px;
133
- background: rgb(0 0 0 / 45%);
133
+ background: transparent;
134
+ backdrop-filter: none;
135
+ -webkit-backdrop-filter: none;
134
136
  }
135
137
 
136
138
  .hive-help {
@@ -1255,15 +1257,59 @@ const PANEL_STYLES = `.hive { position: relative; }
1255
1257
  .hive-toast { right: 8px; bottom: 8px; width: calc(100% - 16px); }
1256
1258
  }
1257
1259
 
1258
- .hive-settings-actions {
1260
+
1261
+ .hive-settings-dialog { max-height: 80vh; }
1262
+
1263
+ .hive-settings-dialog .hive-dialog-body { overflow: auto; }
1264
+
1265
+ .hive-settings-tabs {
1266
+ display: flex;
1267
+ align-items: center;
1268
+ gap: 4px;
1269
+ border-bottom: 1px solid var(--hive-line, #232b38);
1270
+ }
1271
+
1272
+ .hive-settings-tab {
1273
+ flex: 0 0 auto;
1274
+ padding: 7px 10px 8px;
1275
+ border: 0;
1276
+ border-bottom: 2px solid transparent;
1277
+ background: transparent;
1278
+ color: var(--hive-fg-soft);
1279
+ font-size: 11.5px;
1280
+ line-height: 1.3;
1281
+ cursor: pointer;
1282
+ }
1283
+
1284
+ .hive-settings-tab:hover { color: var(--hive-fg, #e6edf3); }
1285
+
1286
+ .hive-settings-tab[aria-selected="true"] {
1287
+ border-bottom-color: var(--hive-accent, #58c4dc);
1288
+ color: var(--hive-fg, #e6edf3);
1289
+ }
1290
+
1291
+ .hive-settings-tab:focus-visible {
1292
+ outline: 2px solid var(--hive-accent, #58c4dc);
1293
+ outline-offset: -2px;
1294
+ }
1295
+
1296
+ .hive-settings-tabpanel[hidden] { display: none; }
1297
+
1298
+ .hive-settings-tabpanel .hive-settings-section {
1299
+ padding-top: 0;
1300
+ border-top: 0;
1301
+ }
1302
+
1303
+ .hive-settings-form-actions {
1259
1304
  display: flex;
1260
1305
  align-items: center;
1261
1306
  justify-content: flex-end;
1262
1307
  gap: 8px;
1263
1308
  width: 100%;
1309
+ margin-top: 2px;
1264
1310
  }
1265
1311
 
1266
- .hive-settings-actions .hive-btn {
1312
+ .hive-settings-form-actions .hive-btn {
1267
1313
  display: inline-flex;
1268
1314
  flex: 0 0 auto;
1269
1315
  align-items: center;
@@ -1276,6 +1322,11 @@ const PANEL_STYLES = `.hive { position: relative; }
1276
1322
  line-height: 1;
1277
1323
  }
1278
1324
 
1325
+ .hive-settings-form-actions .hive-btn:disabled {
1326
+ opacity: 0.55;
1327
+ cursor: not-allowed;
1328
+ }
1329
+
1279
1330
  .hive-settings-primary {
1280
1331
  border-color: color-mix(in srgb, var(--hive-accent, #58c4dc) 70%, var(--hive-line, #232b38));
1281
1332
  background: var(--hive-accent, #58c4dc);
@@ -1300,21 +1351,11 @@ const PANEL_STYLES = `.hive { position: relative; }
1300
1351
  color: var(--hive-fg, #e6edf3);
1301
1352
  }
1302
1353
 
1303
- .hive-settings-actions .hive-btn:disabled {
1354
+ .hive-settings-form-actions .hive-btn:disabled {
1304
1355
  opacity: 0.55;
1305
1356
  cursor: not-allowed;
1306
1357
  }
1307
1358
 
1308
- @media (max-width: 420px) {
1309
- .hive-settings-actions { justify-content: stretch; }
1310
- .hive-settings-actions .hive-btn { flex: 1 1 0; }
1311
- }
1312
-
1313
- @container hiveboard (max-width: 419px) {
1314
- .hive-settings-actions { justify-content: stretch; }
1315
- .hive-settings-actions .hive-btn { flex: 1 1 0; }
1316
- }
1317
-
1318
1359
  .hive-card-scrim { padding: 12px; }
1319
1360
 
1320
1361
  .hive-card-dialog {
@@ -1543,6 +1584,9 @@ export const messages = Object.freeze({
1543
1584
  "limits.closeAria": "Close agent concurrency settings",
1544
1585
  "settings.openAria": "Open settings for this repository",
1545
1586
  "settings.title": "Settings",
1587
+ "settings.tabLimits": "Concurrency limit",
1588
+ "settings.tabRole": "Add role",
1589
+ "settings.tabsAria": "Settings sections",
1546
1590
  "settings.aria": "Settings for this repository",
1547
1591
  "settings.addRole": "Add role",
1548
1592
  "settings.roleName": "Role name",
@@ -1617,9 +1661,9 @@ export const messages = Object.freeze({
1617
1661
  "init.queen": "This session's input now routes to the Queen (it splits tasks, it does not do the work).",
1618
1662
  "init.queenOutput": "Initialisation output",
1619
1663
  "queen.dismiss": "Dismiss",
1620
- "queen.dismissAria": "Dismiss the Queen notice for this repository",
1664
+ "queen.dismissAria": "Close this notice; it does not change Queen mode",
1621
1665
  "help.queen": "Queen mode",
1622
- "help.queenDesc": "Type /queen off to exit. After exiting, this session returns to normal coding mode. Hiding the notice does not change Queen mode.",
1666
+ "help.queenDesc": "Type /queen off to exit Queen mode; this session then returns to normal coding mode.",
1623
1667
  "queen.status.active": "Queen active",
1624
1668
  "queen.status.inactive": "Queen not active",
1625
1669
  "queen.source.auto": "auto",
@@ -1774,6 +1818,9 @@ export const messages = Object.freeze({
1774
1818
  "limits.closeAria": "关闭智能体的并发上限设置",
1775
1819
  "settings.openAria": "打开这个仓库的设置",
1776
1820
  "settings.title": "设置",
1821
+ "settings.tabLimits": "并发上限",
1822
+ "settings.tabRole": "添加角色",
1823
+ "settings.tabsAria": "设置分区",
1777
1824
  "settings.aria": "这个仓库的设置",
1778
1825
  "settings.addRole": "新增角色",
1779
1826
  "settings.roleName": "角色名",
@@ -1848,9 +1895,9 @@ export const messages = Object.freeze({
1848
1895
  "init.queen": "本会话输入框已接入女王模式(女王只拆解任务,不亲自干活)。",
1849
1896
  "init.queenOutput": "初始化输出",
1850
1897
  "queen.dismiss": "关闭提示",
1851
- "queen.dismissAria": "关闭这个仓库的女王提示",
1898
+ "queen.dismissAria": "关闭提示,不影响女王状态",
1852
1899
  "help.queen": "女王模式",
1853
- "help.queenDesc": "输入 /queen off 退出,退出后本会话恢复普通编码模式;关闭提示不影响女王状态。",
1900
+ "help.queenDesc": "输入 /queen off 退出女王模式,退出后本会话恢复普通编码模式。",
1854
1901
  "queen.status.active": "女王已接管",
1855
1902
  "queen.status.inactive": "女王未接管",
1856
1903
  "queen.source.auto": "自动",
@@ -2401,6 +2448,16 @@ function makeHiveIcon(doc, kind) {
2401
2448
  return svg;
2402
2449
  }
2403
2450
 
2451
+ function setHidden(node, hidden) {
2452
+ if (!node) return;
2453
+ if (hidden) {
2454
+ setAttr(node, "hidden", "");
2455
+ return;
2456
+ }
2457
+ if (typeof node.removeAttribute === "function") node.removeAttribute("hidden");
2458
+ else if (node.attributes) delete node.attributes.hidden;
2459
+ }
2460
+
2404
2461
  function setAttr(node, name, value) {
2405
2462
  if (node && typeof node.setAttribute === "function") {
2406
2463
  node.setAttribute(name, value === null || value === undefined ? "" : String(value));
@@ -2731,6 +2788,7 @@ export function mount(root, options = {}) {
2731
2788
  let limitsState = null;
2732
2789
  let limitsTriggerButton = null;
2733
2790
  let limitsFocusables = [];
2791
+ let settingsActiveTab = "limits";
2734
2792
 
2735
2793
  // --- shell ---------------------------------------------------------------
2736
2794
 
@@ -3568,7 +3626,7 @@ export function mount(root, options = {}) {
3568
3626
  if (!event || !event.target || event.target === overlay) closeLimitsDialog();
3569
3627
  });
3570
3628
 
3571
- const dialog = element(doc, "div", "hive-dialog");
3629
+ const dialog = element(doc, "div", "hive-dialog hive-settings-dialog");
3572
3630
  setAttr(dialog, "role", "dialog");
3573
3631
  setAttr(dialog, "aria-modal", "true");
3574
3632
  setAttr(dialog, "aria-label", translate("settings.aria"));
@@ -3588,18 +3646,11 @@ export function mount(root, options = {}) {
3588
3646
  dialog.appendChild(head);
3589
3647
 
3590
3648
  const body = element(doc, "div", "hive-dialog-body");
3591
- const repoLine = element(doc, "div", "hive-limits-repo");
3592
- repoLine.appendChild(element(doc, "span", "hive-limits-repo-label", translate("init.repo")));
3593
- const repoPath = element(doc, "code", "hive-limits-repo-path", repo);
3594
- setAttr(repoPath, "title", repo);
3595
- repoLine.appendChild(repoPath);
3596
- body.appendChild(repoLine);
3597
3649
  if (!writable) {
3598
3650
  body.appendChild(element(doc, "div", "hive-settings-note", translate("settings.readOnly")));
3599
3651
  }
3600
3652
 
3601
3653
  const roleSection = element(doc, "section", "hive-settings-section");
3602
- roleSection.appendChild(element(doc, "div", "hive-settings-section-title", translate("settings.addRole")));
3603
3654
  const roleForm = element(doc, "div", "hive-field-row hive-settings-role-form");
3604
3655
  const roleNameField = element(doc, "label", "hive-field");
3605
3656
  roleNameField.appendChild(element(doc, "span", "hive-field-label", translate("settings.roleName")));
@@ -3656,7 +3707,12 @@ export function mount(root, options = {}) {
3656
3707
 
3657
3708
  const roleErrorNode = element(doc, "div", "hive-limits-error is-hidden", "");
3658
3709
  roleSection.appendChild(roleErrorNode);
3659
- const addRoleButton = element(doc, "button", "hive-btn hive-settings-add-role", translate("settings.addRoleButton"));
3710
+ const addRoleButton = element(
3711
+ doc,
3712
+ "button",
3713
+ "hive-btn hive-settings-add-role hive-settings-secondary",
3714
+ translate("settings.addRoleButton"),
3715
+ );
3660
3716
  setAttr(addRoleButton, "type", "button");
3661
3717
  setAttr(addRoleButton, "title", translate("settings.addRoleAria"));
3662
3718
  setAttr(addRoleButton, "aria-label", translate("settings.addRoleAria"));
@@ -3664,16 +3720,16 @@ export function mount(root, options = {}) {
3664
3720
  addRoleButton.addEventListener("click", () => {
3665
3721
  void saveRole();
3666
3722
  });
3723
+ const roleActions = element(doc, "div", "hive-settings-form-actions hive-settings-role-actions");
3724
+ roleActions.appendChild(addRoleButton);
3725
+ roleSection.appendChild(roleActions);
3667
3726
  if (!writable) {
3668
3727
  roleNameInput.disabled = true;
3669
3728
  adapterInput.disabled = true;
3670
3729
  modelInput.disabled = true;
3671
3730
  roleDescriptionInput.disabled = true;
3672
3731
  }
3673
- body.appendChild(roleSection);
3674
-
3675
3732
  const limitsSection = element(doc, "section", "hive-settings-section");
3676
- limitsSection.appendChild(element(doc, "div", "hive-settings-section-title", translate("limits.title")));
3677
3733
  limitsSection.appendChild(element(doc, "div", "hive-limits-description", translate("limits.description")));
3678
3734
  const rowNodes = [];
3679
3735
  if (!supervisorAvailable) {
@@ -3714,18 +3770,12 @@ export function mount(root, options = {}) {
3714
3770
 
3715
3771
  const errorNode = element(doc, "div", "hive-limits-error is-hidden", "");
3716
3772
  limitsSection.appendChild(errorNode);
3717
- body.appendChild(limitsSection);
3718
-
3719
- const queenSection = element(doc, "section", "hive-settings-section");
3720
- queenSection.appendChild(element(doc, "div", "hive-settings-section-title", translate("help.queen")));
3721
- queenSection.appendChild(element(doc, "div", "hive-help-desc hive-help-queen", translate("help.queenDesc")));
3722
- body.appendChild(queenSection);
3723
- dialog.appendChild(body);
3724
-
3725
- const foot = element(doc, "div", "hive-dialog-foot");
3726
- const settingsActions = element(doc, "div", "hive-settings-actions");
3727
- addRoleButton.className = "hive-btn hive-settings-add-role hive-settings-secondary";
3728
- const saveButton = element(doc, "button", "hive-btn hive-settings-save hive-settings-primary", translate("settings.saveLimits"));
3773
+ const saveButton = element(
3774
+ doc,
3775
+ "button",
3776
+ "hive-btn hive-settings-save hive-settings-primary",
3777
+ translate("settings.saveLimits"),
3778
+ );
3729
3779
  setAttr(saveButton, "type", "button");
3730
3780
  setAttr(saveButton, "title", translate("limits.saveAria").replace("{repo}", repo));
3731
3781
  setAttr(saveButton, "aria-label", translate("limits.saveAria").replace("{repo}", repo));
@@ -3733,10 +3783,82 @@ export function mount(root, options = {}) {
3733
3783
  saveButton.addEventListener("click", () => {
3734
3784
  void saveBeeCounts();
3735
3785
  });
3736
- settingsActions.appendChild(addRoleButton);
3737
- settingsActions.appendChild(saveButton);
3738
- foot.appendChild(settingsActions);
3739
- dialog.appendChild(foot);
3786
+ const limitsActions = element(doc, "div", "hive-settings-form-actions hive-settings-limits-actions");
3787
+ limitsActions.appendChild(saveButton);
3788
+ limitsSection.appendChild(limitsActions);
3789
+
3790
+ const queenSection = element(doc, "section", "hive-settings-section");
3791
+ queenSection.appendChild(element(doc, "div", "hive-settings-section-title", translate("help.queen")));
3792
+ queenSection.appendChild(element(doc, "div", "hive-help-desc hive-help-queen", translate("help.queenDesc")));
3793
+ const tabs = element(doc, "div", "hive-settings-tabs");
3794
+ setAttr(tabs, "role", "tablist");
3795
+ setAttr(tabs, "aria-label", translate("settings.tabsAria"));
3796
+ const panelWrap = element(doc, "div", "hive-settings-panels");
3797
+ const tabEntries = [
3798
+ { id: "limits", labelKey: "settings.tabLimits", section: limitsSection },
3799
+ { id: "role", labelKey: "settings.tabRole", section: roleSection },
3800
+ ];
3801
+ const tabNodes = new Map();
3802
+ const panelNodes = new Map();
3803
+
3804
+ function selectSettingsTab(name, focusTab) {
3805
+ const active = name === "role" ? "role" : "limits";
3806
+ settingsActiveTab = active;
3807
+ for (const entry of tabEntries) {
3808
+ const selected = entry.id === active;
3809
+ const tab = tabNodes.get(entry.id);
3810
+ const panel = panelNodes.get(entry.id);
3811
+ setAttr(tab, "aria-selected", selected ? "true" : "false");
3812
+ setAttr(tab, "tabindex", selected ? "0" : "-1");
3813
+ setHidden(panel, !selected);
3814
+ }
3815
+ if (focusTab) focusNode(tabNodes.get(active));
3816
+ }
3817
+
3818
+ function onSettingsTabKeydown(event, current) {
3819
+ if (!event) return;
3820
+ if (event.key !== "ArrowLeft" && event.key !== "ArrowRight" && event.key !== "Home" && event.key !== "End") {
3821
+ return;
3822
+ }
3823
+ if (typeof event.preventDefault === "function") event.preventDefault();
3824
+ const index = tabEntries.findIndex((entry) => entry.id === current);
3825
+ let next = index;
3826
+ if (event.key === "ArrowLeft") next = index === 0 ? tabEntries.length - 1 : index - 1;
3827
+ else if (event.key === "ArrowRight") next = index === tabEntries.length - 1 ? 0 : index + 1;
3828
+ else if (event.key === "Home") next = 0;
3829
+ else if (event.key === "End") next = tabEntries.length - 1;
3830
+ selectSettingsTab(tabEntries[next].id, true);
3831
+ }
3832
+
3833
+ for (const entry of tabEntries) {
3834
+ const tabId = "hive-settings-tab-" + entry.id;
3835
+ const panelId = "hive-settings-panel-" + entry.id;
3836
+ const tab = element(doc, "button", "hive-settings-tab", translate(entry.labelKey));
3837
+ setAttr(tab, "type", "button");
3838
+ setAttr(tab, "role", "tab");
3839
+ setAttr(tab, "id", tabId);
3840
+ setAttr(tab, "aria-controls", panelId);
3841
+ setAttr(tab, "aria-selected", "false");
3842
+ setAttr(tab, "tabindex", "-1");
3843
+ tab.addEventListener("click", () => selectSettingsTab(entry.id, true));
3844
+ tab.addEventListener("keydown", (event) => onSettingsTabKeydown(event, entry.id));
3845
+ tabs.appendChild(tab);
3846
+ tabNodes.set(entry.id, tab);
3847
+
3848
+ const panel = element(doc, "div", "hive-settings-tabpanel");
3849
+ setAttr(panel, "role", "tabpanel");
3850
+ setAttr(panel, "id", panelId);
3851
+ setAttr(panel, "aria-labelledby", tabId);
3852
+ setHidden(panel, true);
3853
+ panel.appendChild(entry.section);
3854
+ panelWrap.appendChild(panel);
3855
+ panelNodes.set(entry.id, panel);
3856
+ }
3857
+ body.appendChild(tabs);
3858
+ body.appendChild(panelWrap);
3859
+ selectSettingsTab(settingsActiveTab, false);
3860
+ body.appendChild(queenSection);
3861
+ dialog.appendChild(body);
3740
3862
 
3741
3863
  overlay.appendChild(dialog);
3742
3864
  frame.appendChild(overlay);