dsh-hive-panel 0.1.5 → 0.1.6

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,13 @@
1
+ ## [0.1.6] - 2026-12-04
2
+
3
+ ### Changed
4
+
5
+ - Settings open as two independent tabs, "Concurrency" (并发上限) and "Add role"
6
+ (新增角色), each with its own bottom-right actions; the forms stay right-aligned on
7
+ narrow screens.
8
+ - Modal backdrops are transparent so the board stays visible behind card and task
9
+ dialogs; browser bundle rebuilt.
10
+
1
11
  ## [0.1.5] - 2026-12-04
2
12
 
3
13
  ### Added
@@ -25,6 +35,10 @@
25
35
  `ok:false, code:2` plus that stderr. The shared renderer's drawer exposes the action
26
36
  as a red button with a second confirmation. `lib/client.js` rebuilt.
27
37
 
38
+ ### Published
39
+
40
+ - npm: `dsh-hive-panel@0.1.5` on 2026-12-04.
41
+
28
42
  ## [0.1.4] - 2026-12-04
29
43
 
30
44
  ### 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",
@@ -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": "角色名",
@@ -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"));
@@ -3626,7 +3684,6 @@ function mount(root, options = {}) {
3626
3684
  }
3627
3685
 
3628
3686
  const roleSection = element(doc, "section", "hive-settings-section");
3629
- roleSection.appendChild(element(doc, "div", "hive-settings-section-title", translate("settings.addRole")));
3630
3687
  const roleForm = element(doc, "div", "hive-field-row hive-settings-role-form");
3631
3688
  const roleNameField = element(doc, "label", "hive-field");
3632
3689
  roleNameField.appendChild(element(doc, "span", "hive-field-label", translate("settings.roleName")));
@@ -3683,7 +3740,12 @@ function mount(root, options = {}) {
3683
3740
 
3684
3741
  const roleErrorNode = element(doc, "div", "hive-limits-error is-hidden", "");
3685
3742
  roleSection.appendChild(roleErrorNode);
3686
- const addRoleButton = element(doc, "button", "hive-btn hive-settings-add-role", translate("settings.addRoleButton"));
3743
+ const addRoleButton = element(
3744
+ doc,
3745
+ "button",
3746
+ "hive-btn hive-settings-add-role hive-settings-secondary",
3747
+ translate("settings.addRoleButton"),
3748
+ );
3687
3749
  setAttr(addRoleButton, "type", "button");
3688
3750
  setAttr(addRoleButton, "title", translate("settings.addRoleAria"));
3689
3751
  setAttr(addRoleButton, "aria-label", translate("settings.addRoleAria"));
@@ -3691,16 +3753,16 @@ function mount(root, options = {}) {
3691
3753
  addRoleButton.addEventListener("click", () => {
3692
3754
  void saveRole();
3693
3755
  });
3756
+ const roleActions = element(doc, "div", "hive-settings-form-actions hive-settings-role-actions");
3757
+ roleActions.appendChild(addRoleButton);
3758
+ roleSection.appendChild(roleActions);
3694
3759
  if (!writable) {
3695
3760
  roleNameInput.disabled = true;
3696
3761
  adapterInput.disabled = true;
3697
3762
  modelInput.disabled = true;
3698
3763
  roleDescriptionInput.disabled = true;
3699
3764
  }
3700
- body.appendChild(roleSection);
3701
-
3702
3765
  const limitsSection = element(doc, "section", "hive-settings-section");
3703
- limitsSection.appendChild(element(doc, "div", "hive-settings-section-title", translate("limits.title")));
3704
3766
  limitsSection.appendChild(element(doc, "div", "hive-limits-description", translate("limits.description")));
3705
3767
  const rowNodes = [];
3706
3768
  if (!supervisorAvailable) {
@@ -3741,18 +3803,12 @@ function mount(root, options = {}) {
3741
3803
 
3742
3804
  const errorNode = element(doc, "div", "hive-limits-error is-hidden", "");
3743
3805
  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"));
3806
+ const saveButton = element(
3807
+ doc,
3808
+ "button",
3809
+ "hive-btn hive-settings-save hive-settings-primary",
3810
+ translate("settings.saveLimits"),
3811
+ );
3756
3812
  setAttr(saveButton, "type", "button");
3757
3813
  setAttr(saveButton, "title", translate("limits.saveAria").replace("{repo}", repo));
3758
3814
  setAttr(saveButton, "aria-label", translate("limits.saveAria").replace("{repo}", repo));
@@ -3760,10 +3816,82 @@ function mount(root, options = {}) {
3760
3816
  saveButton.addEventListener("click", () => {
3761
3817
  void saveBeeCounts();
3762
3818
  });
3763
- settingsActions.appendChild(addRoleButton);
3764
- settingsActions.appendChild(saveButton);
3765
- foot.appendChild(settingsActions);
3766
- dialog.appendChild(foot);
3819
+ const limitsActions = element(doc, "div", "hive-settings-form-actions hive-settings-limits-actions");
3820
+ limitsActions.appendChild(saveButton);
3821
+ limitsSection.appendChild(limitsActions);
3822
+
3823
+ const queenSection = element(doc, "section", "hive-settings-section");
3824
+ queenSection.appendChild(element(doc, "div", "hive-settings-section-title", translate("help.queen")));
3825
+ queenSection.appendChild(element(doc, "div", "hive-help-desc hive-help-queen", translate("help.queenDesc")));
3826
+ const tabs = element(doc, "div", "hive-settings-tabs");
3827
+ setAttr(tabs, "role", "tablist");
3828
+ setAttr(tabs, "aria-label", translate("settings.tabsAria"));
3829
+ const panelWrap = element(doc, "div", "hive-settings-panels");
3830
+ const tabEntries = [
3831
+ { id: "limits", labelKey: "settings.tabLimits", section: limitsSection },
3832
+ { id: "role", labelKey: "settings.tabRole", section: roleSection },
3833
+ ];
3834
+ const tabNodes = new Map();
3835
+ const panelNodes = new Map();
3836
+
3837
+ function selectSettingsTab(name, focusTab) {
3838
+ const active = name === "role" ? "role" : "limits";
3839
+ settingsActiveTab = active;
3840
+ for (const entry of tabEntries) {
3841
+ const selected = entry.id === active;
3842
+ const tab = tabNodes.get(entry.id);
3843
+ const panel = panelNodes.get(entry.id);
3844
+ setAttr(tab, "aria-selected", selected ? "true" : "false");
3845
+ setAttr(tab, "tabindex", selected ? "0" : "-1");
3846
+ setHidden(panel, !selected);
3847
+ }
3848
+ if (focusTab) focusNode(tabNodes.get(active));
3849
+ }
3850
+
3851
+ function onSettingsTabKeydown(event, current) {
3852
+ if (!event) return;
3853
+ if (event.key !== "ArrowLeft" && event.key !== "ArrowRight" && event.key !== "Home" && event.key !== "End") {
3854
+ return;
3855
+ }
3856
+ if (typeof event.preventDefault === "function") event.preventDefault();
3857
+ const index = tabEntries.findIndex((entry) => entry.id === current);
3858
+ let next = index;
3859
+ if (event.key === "ArrowLeft") next = index === 0 ? tabEntries.length - 1 : index - 1;
3860
+ else if (event.key === "ArrowRight") next = index === tabEntries.length - 1 ? 0 : index + 1;
3861
+ else if (event.key === "Home") next = 0;
3862
+ else if (event.key === "End") next = tabEntries.length - 1;
3863
+ selectSettingsTab(tabEntries[next].id, true);
3864
+ }
3865
+
3866
+ for (const entry of tabEntries) {
3867
+ const tabId = "hive-settings-tab-" + entry.id;
3868
+ const panelId = "hive-settings-panel-" + entry.id;
3869
+ const tab = element(doc, "button", "hive-settings-tab", translate(entry.labelKey));
3870
+ setAttr(tab, "type", "button");
3871
+ setAttr(tab, "role", "tab");
3872
+ setAttr(tab, "id", tabId);
3873
+ setAttr(tab, "aria-controls", panelId);
3874
+ setAttr(tab, "aria-selected", "false");
3875
+ setAttr(tab, "tabindex", "-1");
3876
+ tab.addEventListener("click", () => selectSettingsTab(entry.id, true));
3877
+ tab.addEventListener("keydown", (event) => onSettingsTabKeydown(event, entry.id));
3878
+ tabs.appendChild(tab);
3879
+ tabNodes.set(entry.id, tab);
3880
+
3881
+ const panel = element(doc, "div", "hive-settings-tabpanel");
3882
+ setAttr(panel, "role", "tabpanel");
3883
+ setAttr(panel, "id", panelId);
3884
+ setAttr(panel, "aria-labelledby", tabId);
3885
+ setHidden(panel, true);
3886
+ panel.appendChild(entry.section);
3887
+ panelWrap.appendChild(panel);
3888
+ panelNodes.set(entry.id, panel);
3889
+ }
3890
+ body.appendChild(tabs);
3891
+ body.appendChild(panelWrap);
3892
+ selectSettingsTab(settingsActiveTab, false);
3893
+ body.appendChild(queenSection);
3894
+ dialog.appendChild(body);
3767
3895
 
3768
3896
  overlay.appendChild(dialog);
3769
3897
  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.6",
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",
@@ -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": "角色名",
@@ -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"));
@@ -3599,7 +3657,6 @@ export function mount(root, options = {}) {
3599
3657
  }
3600
3658
 
3601
3659
  const roleSection = element(doc, "section", "hive-settings-section");
3602
- roleSection.appendChild(element(doc, "div", "hive-settings-section-title", translate("settings.addRole")));
3603
3660
  const roleForm = element(doc, "div", "hive-field-row hive-settings-role-form");
3604
3661
  const roleNameField = element(doc, "label", "hive-field");
3605
3662
  roleNameField.appendChild(element(doc, "span", "hive-field-label", translate("settings.roleName")));
@@ -3656,7 +3713,12 @@ export function mount(root, options = {}) {
3656
3713
 
3657
3714
  const roleErrorNode = element(doc, "div", "hive-limits-error is-hidden", "");
3658
3715
  roleSection.appendChild(roleErrorNode);
3659
- const addRoleButton = element(doc, "button", "hive-btn hive-settings-add-role", translate("settings.addRoleButton"));
3716
+ const addRoleButton = element(
3717
+ doc,
3718
+ "button",
3719
+ "hive-btn hive-settings-add-role hive-settings-secondary",
3720
+ translate("settings.addRoleButton"),
3721
+ );
3660
3722
  setAttr(addRoleButton, "type", "button");
3661
3723
  setAttr(addRoleButton, "title", translate("settings.addRoleAria"));
3662
3724
  setAttr(addRoleButton, "aria-label", translate("settings.addRoleAria"));
@@ -3664,16 +3726,16 @@ export function mount(root, options = {}) {
3664
3726
  addRoleButton.addEventListener("click", () => {
3665
3727
  void saveRole();
3666
3728
  });
3729
+ const roleActions = element(doc, "div", "hive-settings-form-actions hive-settings-role-actions");
3730
+ roleActions.appendChild(addRoleButton);
3731
+ roleSection.appendChild(roleActions);
3667
3732
  if (!writable) {
3668
3733
  roleNameInput.disabled = true;
3669
3734
  adapterInput.disabled = true;
3670
3735
  modelInput.disabled = true;
3671
3736
  roleDescriptionInput.disabled = true;
3672
3737
  }
3673
- body.appendChild(roleSection);
3674
-
3675
3738
  const limitsSection = element(doc, "section", "hive-settings-section");
3676
- limitsSection.appendChild(element(doc, "div", "hive-settings-section-title", translate("limits.title")));
3677
3739
  limitsSection.appendChild(element(doc, "div", "hive-limits-description", translate("limits.description")));
3678
3740
  const rowNodes = [];
3679
3741
  if (!supervisorAvailable) {
@@ -3714,18 +3776,12 @@ export function mount(root, options = {}) {
3714
3776
 
3715
3777
  const errorNode = element(doc, "div", "hive-limits-error is-hidden", "");
3716
3778
  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"));
3779
+ const saveButton = element(
3780
+ doc,
3781
+ "button",
3782
+ "hive-btn hive-settings-save hive-settings-primary",
3783
+ translate("settings.saveLimits"),
3784
+ );
3729
3785
  setAttr(saveButton, "type", "button");
3730
3786
  setAttr(saveButton, "title", translate("limits.saveAria").replace("{repo}", repo));
3731
3787
  setAttr(saveButton, "aria-label", translate("limits.saveAria").replace("{repo}", repo));
@@ -3733,10 +3789,82 @@ export function mount(root, options = {}) {
3733
3789
  saveButton.addEventListener("click", () => {
3734
3790
  void saveBeeCounts();
3735
3791
  });
3736
- settingsActions.appendChild(addRoleButton);
3737
- settingsActions.appendChild(saveButton);
3738
- foot.appendChild(settingsActions);
3739
- dialog.appendChild(foot);
3792
+ const limitsActions = element(doc, "div", "hive-settings-form-actions hive-settings-limits-actions");
3793
+ limitsActions.appendChild(saveButton);
3794
+ limitsSection.appendChild(limitsActions);
3795
+
3796
+ const queenSection = element(doc, "section", "hive-settings-section");
3797
+ queenSection.appendChild(element(doc, "div", "hive-settings-section-title", translate("help.queen")));
3798
+ queenSection.appendChild(element(doc, "div", "hive-help-desc hive-help-queen", translate("help.queenDesc")));
3799
+ const tabs = element(doc, "div", "hive-settings-tabs");
3800
+ setAttr(tabs, "role", "tablist");
3801
+ setAttr(tabs, "aria-label", translate("settings.tabsAria"));
3802
+ const panelWrap = element(doc, "div", "hive-settings-panels");
3803
+ const tabEntries = [
3804
+ { id: "limits", labelKey: "settings.tabLimits", section: limitsSection },
3805
+ { id: "role", labelKey: "settings.tabRole", section: roleSection },
3806
+ ];
3807
+ const tabNodes = new Map();
3808
+ const panelNodes = new Map();
3809
+
3810
+ function selectSettingsTab(name, focusTab) {
3811
+ const active = name === "role" ? "role" : "limits";
3812
+ settingsActiveTab = active;
3813
+ for (const entry of tabEntries) {
3814
+ const selected = entry.id === active;
3815
+ const tab = tabNodes.get(entry.id);
3816
+ const panel = panelNodes.get(entry.id);
3817
+ setAttr(tab, "aria-selected", selected ? "true" : "false");
3818
+ setAttr(tab, "tabindex", selected ? "0" : "-1");
3819
+ setHidden(panel, !selected);
3820
+ }
3821
+ if (focusTab) focusNode(tabNodes.get(active));
3822
+ }
3823
+
3824
+ function onSettingsTabKeydown(event, current) {
3825
+ if (!event) return;
3826
+ if (event.key !== "ArrowLeft" && event.key !== "ArrowRight" && event.key !== "Home" && event.key !== "End") {
3827
+ return;
3828
+ }
3829
+ if (typeof event.preventDefault === "function") event.preventDefault();
3830
+ const index = tabEntries.findIndex((entry) => entry.id === current);
3831
+ let next = index;
3832
+ if (event.key === "ArrowLeft") next = index === 0 ? tabEntries.length - 1 : index - 1;
3833
+ else if (event.key === "ArrowRight") next = index === tabEntries.length - 1 ? 0 : index + 1;
3834
+ else if (event.key === "Home") next = 0;
3835
+ else if (event.key === "End") next = tabEntries.length - 1;
3836
+ selectSettingsTab(tabEntries[next].id, true);
3837
+ }
3838
+
3839
+ for (const entry of tabEntries) {
3840
+ const tabId = "hive-settings-tab-" + entry.id;
3841
+ const panelId = "hive-settings-panel-" + entry.id;
3842
+ const tab = element(doc, "button", "hive-settings-tab", translate(entry.labelKey));
3843
+ setAttr(tab, "type", "button");
3844
+ setAttr(tab, "role", "tab");
3845
+ setAttr(tab, "id", tabId);
3846
+ setAttr(tab, "aria-controls", panelId);
3847
+ setAttr(tab, "aria-selected", "false");
3848
+ setAttr(tab, "tabindex", "-1");
3849
+ tab.addEventListener("click", () => selectSettingsTab(entry.id, true));
3850
+ tab.addEventListener("keydown", (event) => onSettingsTabKeydown(event, entry.id));
3851
+ tabs.appendChild(tab);
3852
+ tabNodes.set(entry.id, tab);
3853
+
3854
+ const panel = element(doc, "div", "hive-settings-tabpanel");
3855
+ setAttr(panel, "role", "tabpanel");
3856
+ setAttr(panel, "id", panelId);
3857
+ setAttr(panel, "aria-labelledby", tabId);
3858
+ setHidden(panel, true);
3859
+ panel.appendChild(entry.section);
3860
+ panelWrap.appendChild(panel);
3861
+ panelNodes.set(entry.id, panel);
3862
+ }
3863
+ body.appendChild(tabs);
3864
+ body.appendChild(panelWrap);
3865
+ selectSettingsTab(settingsActiveTab, false);
3866
+ body.appendChild(queenSection);
3867
+ dialog.appendChild(body);
3740
3868
 
3741
3869
  overlay.appendChild(dialog);
3742
3870
  frame.appendChild(overlay);