@d86e/hive-panel 0.3.7 → 0.3.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/README.md +3 -2
- package/README.zh-CN.md +1 -1
- package/SPEC.md +2 -1
- package/package.json +1 -1
- package/public/panel.js +1193 -299
- package/src/actions.js +2 -0
package/public/panel.js
CHANGED
|
@@ -14,23 +14,26 @@ const QUEEN_DISMISS_KEY = "hive.queenNoticeDismissed";
|
|
|
14
14
|
const DEFAULT_INTERVAL_MS = 3000;
|
|
15
15
|
|
|
16
16
|
const CARD_ACTIONS = Object.freeze({
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
// remove is available in every stored state; the drawer renders it as a
|
|
18
|
+
// danger button, disabled with an explanation while the card is claimed
|
|
19
|
+
// (the panel never sends --force, so the CLI would refuse).
|
|
20
|
+
pending: Object.freeze(["claim", "remove"]),
|
|
21
|
+
claimed: Object.freeze(["done", "fail", "remove"]),
|
|
22
|
+
done: Object.freeze(["remove"]),
|
|
23
|
+
blocked: Object.freeze(["retry", "remove"]),
|
|
24
|
+
failed: Object.freeze(["retry", "remove"]),
|
|
22
25
|
});
|
|
23
26
|
|
|
24
27
|
const ACTION_META = Object.freeze({
|
|
25
|
-
freeze: { labelKey: "action.freeze", helpKey: "help.action.freeze"
|
|
26
|
-
unfreeze: { labelKey: "action.unfreeze", helpKey: "help.action.unfreeze"
|
|
27
|
-
add: { labelKey: "action.add", helpKey: "help.action.add"
|
|
28
|
-
plan: { labelKey: "action.plan", helpKey: "help.action.plan"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
freeze: { labelKey: "action.freeze", helpKey: "help.action.freeze" },
|
|
29
|
+
unfreeze: { labelKey: "action.unfreeze", helpKey: "help.action.unfreeze" },
|
|
30
|
+
add: { labelKey: "action.add", helpKey: "help.action.add" },
|
|
31
|
+
plan: { labelKey: "action.plan", helpKey: "help.action.plan" },
|
|
32
|
+
claim: { labelKey: "action.claim", helpKey: "help.action.claim" },
|
|
33
|
+
done: { labelKey: "action.done", helpKey: "help.action.done" },
|
|
34
|
+
fail: { labelKey: "action.fail", helpKey: "help.action.fail" },
|
|
35
|
+
retry: { labelKey: "action.retry", helpKey: "help.action.retry" },
|
|
36
|
+
remove: { labelKey: "action.remove", helpKey: "help.action.remove" },
|
|
34
37
|
});
|
|
35
38
|
|
|
36
39
|
const MIN_PLAN_CARDS = 1;
|
|
@@ -103,6 +106,23 @@ const PANEL_STYLES = `.hive { position: relative; }
|
|
|
103
106
|
font-weight: 700;
|
|
104
107
|
}
|
|
105
108
|
|
|
109
|
+
/* Destructive card action: the drawer's delete control. */
|
|
110
|
+
.hive-btn-danger {
|
|
111
|
+
border-color: color-mix(in srgb, var(--hive-danger) 55%, var(--hive-line, #232b38));
|
|
112
|
+
background: color-mix(in srgb, var(--hive-danger) 12%, transparent);
|
|
113
|
+
color: color-mix(in srgb, var(--hive-danger) 88%, var(--hive-fg, #e6edf3));
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.hive-btn-danger:hover:not(:disabled) {
|
|
117
|
+
border-color: color-mix(in srgb, var(--hive-danger) 75%, var(--hive-line, #232b38));
|
|
118
|
+
background: color-mix(in srgb, var(--hive-danger) 22%, transparent);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.hive-btn-danger:disabled {
|
|
122
|
+
opacity: 0.5;
|
|
123
|
+
cursor: not-allowed;
|
|
124
|
+
}
|
|
125
|
+
|
|
106
126
|
.hive-overlay { position: absolute; inset: 0; z-index: 2147483000; }
|
|
107
127
|
.hive-help-scrim { background: transparent; }
|
|
108
128
|
.hive-dialog-scrim {
|
|
@@ -911,7 +931,7 @@ const PANEL_STYLES = `.hive { position: relative; }
|
|
|
911
931
|
|
|
912
932
|
.hive-limits-row {
|
|
913
933
|
display: grid;
|
|
914
|
-
grid-template-columns: minmax(0, 1fr)
|
|
934
|
+
grid-template-columns: minmax(0, 1fr) 96px 48px 48px;
|
|
915
935
|
align-items: center;
|
|
916
936
|
gap: 6px;
|
|
917
937
|
min-width: 0;
|
|
@@ -1007,6 +1027,95 @@ const PANEL_STYLES = `.hive { position: relative; }
|
|
|
1007
1027
|
overflow-wrap: anywhere;
|
|
1008
1028
|
}
|
|
1009
1029
|
|
|
1030
|
+
.hive-supervisor-inline {
|
|
1031
|
+
display: inline-flex;
|
|
1032
|
+
flex-wrap: wrap;
|
|
1033
|
+
align-items: center;
|
|
1034
|
+
gap: 5px;
|
|
1035
|
+
min-width: 0;
|
|
1036
|
+
padding: 1px 8px;
|
|
1037
|
+
border: 1px solid var(--hive-line, #232b38);
|
|
1038
|
+
border-radius: 999px;
|
|
1039
|
+
background: var(--hive-surface);
|
|
1040
|
+
color: var(--hive-fg-soft);
|
|
1041
|
+
font-size: 10px;
|
|
1042
|
+
line-height: 1.6;
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
.hive-supervisor-inline.is-hidden { display: none; }
|
|
1046
|
+
|
|
1047
|
+
.hive-supervisor-inline-label {
|
|
1048
|
+
color: var(--hive-fg-faint);
|
|
1049
|
+
font-size: 9.5px;
|
|
1050
|
+
font-weight: 650;
|
|
1051
|
+
letter-spacing: 0.1em;
|
|
1052
|
+
text-transform: uppercase;
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
.hive-supervisor-inline-state {
|
|
1056
|
+
color: var(--hive-fg-soft);
|
|
1057
|
+
font-weight: 600;
|
|
1058
|
+
white-space: nowrap;
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
.hive-supervisor-inline-state.is-running { color: var(--hive-ok); }
|
|
1062
|
+
.hive-supervisor-inline-state.is-idle { color: var(--hive-fg-soft); }
|
|
1063
|
+
.hive-supervisor-inline-state.is-backoff { color: var(--hive-warn); }
|
|
1064
|
+
.hive-supervisor-inline-state.is-paused { color: var(--hive-danger); }
|
|
1065
|
+
|
|
1066
|
+
.hive-supervisor-inline-resume {
|
|
1067
|
+
padding: 1px 6px;
|
|
1068
|
+
font-size: 9.5px;
|
|
1069
|
+
line-height: 1.3;
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
.hive-supervisor-inline-resume.is-hidden { display: none; }
|
|
1073
|
+
|
|
1074
|
+
.hive-settings-trigger {
|
|
1075
|
+
flex: 0 0 auto;
|
|
1076
|
+
min-width: 28px;
|
|
1077
|
+
padding-inline: 8px;
|
|
1078
|
+
font-size: 14px;
|
|
1079
|
+
line-height: 1.2;
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
.hive-settings-section {
|
|
1083
|
+
display: flex;
|
|
1084
|
+
flex-direction: column;
|
|
1085
|
+
gap: 8px;
|
|
1086
|
+
min-width: 0;
|
|
1087
|
+
padding-top: 12px;
|
|
1088
|
+
border-top: 1px solid color-mix(in srgb, var(--hive-line, #232b38) 70%, transparent);
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
.hive-settings-section:first-of-type { padding-top: 0; border-top: 0; }
|
|
1092
|
+
|
|
1093
|
+
.hive-settings-section-title {
|
|
1094
|
+
color: var(--hive-fg, #e6edf3);
|
|
1095
|
+
font-size: 11px;
|
|
1096
|
+
font-weight: 650;
|
|
1097
|
+
letter-spacing: 0.08em;
|
|
1098
|
+
text-transform: uppercase;
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
.hive-settings-role-form { align-items: flex-end; }
|
|
1102
|
+
|
|
1103
|
+
.hive-settings-role-description { width: 100%; }
|
|
1104
|
+
|
|
1105
|
+
.hive-settings-role-description .hive-textarea { width: 100%; }
|
|
1106
|
+
|
|
1107
|
+
.hive-settings-role-form .hive-field:first-child { flex: 1 1 200px; }
|
|
1108
|
+
|
|
1109
|
+
.hive-settings-note {
|
|
1110
|
+
padding: 8px 10px;
|
|
1111
|
+
border: 1px solid color-mix(in srgb, var(--hive-warn) 38%, var(--hive-line, #232b38));
|
|
1112
|
+
border-radius: 6px;
|
|
1113
|
+
background: color-mix(in srgb, var(--hive-warn) 9%, transparent);
|
|
1114
|
+
color: var(--hive-warn);
|
|
1115
|
+
font-size: 10.5px;
|
|
1116
|
+
line-height: 1.55;
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1010
1119
|
/* -------------------------------------------------------------------- spacing */
|
|
1011
1120
|
.hive {
|
|
1012
1121
|
gap: 8px;
|
|
@@ -1080,6 +1189,46 @@ const PANEL_STYLES = `.hive { position: relative; }
|
|
|
1080
1189
|
line-height: 1.55;
|
|
1081
1190
|
}
|
|
1082
1191
|
|
|
1192
|
+
.hive-icon-button {
|
|
1193
|
+
display: inline-flex;
|
|
1194
|
+
flex: 0 0 28px;
|
|
1195
|
+
align-items: center;
|
|
1196
|
+
justify-content: center;
|
|
1197
|
+
width: 28px;
|
|
1198
|
+
min-width: 28px;
|
|
1199
|
+
height: 28px;
|
|
1200
|
+
padding: 0;
|
|
1201
|
+
border: 0;
|
|
1202
|
+
border-color: transparent;
|
|
1203
|
+
background: transparent;
|
|
1204
|
+
color: color-mix(in srgb, var(--hive-fg, #e6edf3) 80%, transparent);
|
|
1205
|
+
font-size: 0;
|
|
1206
|
+
line-height: 1;
|
|
1207
|
+
box-shadow: none;
|
|
1208
|
+
cursor: pointer;
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
.hive-icon-button:hover {
|
|
1212
|
+
border: 0;
|
|
1213
|
+
border-color: transparent;
|
|
1214
|
+
background: transparent;
|
|
1215
|
+
color: var(--hive-fg, #e6edf3);
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
.hive-icon-button:active { transform: none; }
|
|
1219
|
+
|
|
1220
|
+
.hive-icon-button:focus-visible {
|
|
1221
|
+
outline: 2px solid var(--hive-accent, #58c4dc);
|
|
1222
|
+
outline-offset: 1px;
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
.hive-icon-button svg {
|
|
1226
|
+
display: block;
|
|
1227
|
+
width: 16px;
|
|
1228
|
+
height: 16px;
|
|
1229
|
+
pointer-events: none;
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1083
1232
|
@media (max-width: 520px) {
|
|
1084
1233
|
.hive { gap: 6px; padding: 12px; }
|
|
1085
1234
|
.hive-bar,
|
|
@@ -1104,7 +1253,183 @@ const PANEL_STYLES = `.hive { position: relative; }
|
|
|
1104
1253
|
.hive-dialog-foot .hive-btn { flex: 1 1 auto; }
|
|
1105
1254
|
.hive-help { right: 8px; width: calc(100% - 16px); max-height: 66vh; }
|
|
1106
1255
|
.hive-toast { right: 8px; bottom: 8px; width: calc(100% - 16px); }
|
|
1107
|
-
}
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
.hive-settings-actions {
|
|
1259
|
+
display: flex;
|
|
1260
|
+
align-items: center;
|
|
1261
|
+
justify-content: flex-end;
|
|
1262
|
+
gap: 8px;
|
|
1263
|
+
width: 100%;
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
.hive-settings-actions .hive-btn {
|
|
1267
|
+
display: inline-flex;
|
|
1268
|
+
flex: 0 0 auto;
|
|
1269
|
+
align-items: center;
|
|
1270
|
+
justify-content: center;
|
|
1271
|
+
height: 28px;
|
|
1272
|
+
min-height: 28px;
|
|
1273
|
+
padding: 0 14px;
|
|
1274
|
+
border-radius: 7px;
|
|
1275
|
+
font-size: 11.5px;
|
|
1276
|
+
line-height: 1;
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
.hive-settings-primary {
|
|
1280
|
+
border-color: color-mix(in srgb, var(--hive-accent, #58c4dc) 70%, var(--hive-line, #232b38));
|
|
1281
|
+
background: var(--hive-accent, #58c4dc);
|
|
1282
|
+
color: var(--hive-bg, #0b0f17);
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
.hive-settings-primary:hover {
|
|
1286
|
+
border-color: var(--hive-accent, #58c4dc);
|
|
1287
|
+
background: color-mix(in srgb, var(--hive-accent, #58c4dc) 86%, white);
|
|
1288
|
+
color: var(--hive-bg, #0b0f17);
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
.hive-settings-secondary {
|
|
1292
|
+
border-color: var(--hive-line, #232b38);
|
|
1293
|
+
background: var(--hive-surface-strong);
|
|
1294
|
+
color: var(--hive-fg, #e6edf3);
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
.hive-settings-secondary:hover {
|
|
1298
|
+
border-color: color-mix(in srgb, var(--hive-accent, #58c4dc) 40%, var(--hive-line, #232b38));
|
|
1299
|
+
background: var(--hive-surface-hover);
|
|
1300
|
+
color: var(--hive-fg, #e6edf3);
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1303
|
+
.hive-settings-actions .hive-btn:disabled {
|
|
1304
|
+
opacity: 0.55;
|
|
1305
|
+
cursor: not-allowed;
|
|
1306
|
+
}
|
|
1307
|
+
|
|
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
|
+
.hive-card-scrim { padding: 12px; }
|
|
1319
|
+
|
|
1320
|
+
.hive-card-dialog {
|
|
1321
|
+
position: relative;
|
|
1322
|
+
inset: auto;
|
|
1323
|
+
width: min(720px, 92vw);
|
|
1324
|
+
max-width: 92vw;
|
|
1325
|
+
height: auto;
|
|
1326
|
+
max-height: 80vh;
|
|
1327
|
+
border: 1px solid var(--hive-line, #232b38);
|
|
1328
|
+
border-radius: 12px;
|
|
1329
|
+
background: color-mix(in srgb, var(--hive-bg, #0b0f17) 97%, var(--hive-fg, #e6edf3) 3%);
|
|
1330
|
+
box-shadow: 0 24px 70px rgb(0 0 0 / 52%);
|
|
1331
|
+
overflow: hidden;
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1334
|
+
.hive-card-dialog .hive-dialog-head { align-items: flex-start; }
|
|
1335
|
+
|
|
1336
|
+
.hive-card-subline {
|
|
1337
|
+
margin-top: 3px;
|
|
1338
|
+
overflow-wrap: anywhere;
|
|
1339
|
+
color: var(--hive-fg-soft);
|
|
1340
|
+
font-family: var(--hive-mono);
|
|
1341
|
+
font-size: 10.5px;
|
|
1342
|
+
line-height: 1.5;
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
.hive-card-close {
|
|
1346
|
+
min-width: 28px;
|
|
1347
|
+
height: 28px;
|
|
1348
|
+
padding: 0 6px;
|
|
1349
|
+
color: var(--hive-fg-soft);
|
|
1350
|
+
font-size: 18px;
|
|
1351
|
+
line-height: 1;
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1354
|
+
.hive-card-body {
|
|
1355
|
+
display: flex;
|
|
1356
|
+
flex-direction: column;
|
|
1357
|
+
gap: 12px;
|
|
1358
|
+
min-height: 0;
|
|
1359
|
+
overflow: auto;
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
.hive-card-json {
|
|
1363
|
+
border: 1px solid var(--hive-line, #232b38);
|
|
1364
|
+
border-radius: 8px;
|
|
1365
|
+
background: var(--hive-surface);
|
|
1366
|
+
overflow: hidden;
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1369
|
+
.hive-card-json-summary {
|
|
1370
|
+
padding: 8px 10px;
|
|
1371
|
+
color: var(--hive-fg-soft);
|
|
1372
|
+
font-size: 10px;
|
|
1373
|
+
font-weight: 650;
|
|
1374
|
+
letter-spacing: 0.08em;
|
|
1375
|
+
line-height: 1.5;
|
|
1376
|
+
text-transform: uppercase;
|
|
1377
|
+
cursor: pointer;
|
|
1378
|
+
user-select: none;
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
.hive-card-json .hive-json {
|
|
1382
|
+
max-height: 300px;
|
|
1383
|
+
margin: 0;
|
|
1384
|
+
padding: 10px;
|
|
1385
|
+
overflow: auto;
|
|
1386
|
+
border-top: 1px solid var(--hive-line, #232b38);
|
|
1387
|
+
font-family: var(--hive-mono);
|
|
1388
|
+
font-size: 10.5px;
|
|
1389
|
+
line-height: 1.5;
|
|
1390
|
+
white-space: pre-wrap;
|
|
1391
|
+
}
|
|
1392
|
+
|
|
1393
|
+
.hive-card-actions {
|
|
1394
|
+
justify-content: flex-end;
|
|
1395
|
+
gap: 8px;
|
|
1396
|
+
flex-wrap: wrap;
|
|
1397
|
+
}
|
|
1398
|
+
|
|
1399
|
+
.hive-add-dialog {
|
|
1400
|
+
width: min(560px, 92vw);
|
|
1401
|
+
max-width: 92vw;
|
|
1402
|
+
max-height: 80vh;
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1405
|
+
.hive-add-body {
|
|
1406
|
+
display: flex;
|
|
1407
|
+
flex-direction: column;
|
|
1408
|
+
gap: 10px;
|
|
1409
|
+
min-height: 0;
|
|
1410
|
+
overflow: auto;
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
.hive-add-body .hive-field { width: 100%; }
|
|
1414
|
+
|
|
1415
|
+
.hive-add-body .hive-input,
|
|
1416
|
+
.hive-add-body .hive-textarea { width: 100%; }
|
|
1417
|
+
|
|
1418
|
+
.hive-add-acceptance { min-height: 70px; }
|
|
1419
|
+
|
|
1420
|
+
.hive-add-submit {
|
|
1421
|
+
border-color: color-mix(in srgb, var(--hive-accent, #58c4dc) 70%, var(--hive-line, #232b38));
|
|
1422
|
+
background: var(--hive-accent, #58c4dc);
|
|
1423
|
+
color: var(--hive-bg, #0b0f17);
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1426
|
+
.hive-add-submit:hover:not(:disabled) {
|
|
1427
|
+
border-color: var(--hive-accent, #58c4dc);
|
|
1428
|
+
background: color-mix(in srgb, var(--hive-accent, #58c4dc) 86%, white);
|
|
1429
|
+
color: var(--hive-bg, #0b0f17);
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1432
|
+
`;
|
|
1108
1433
|
|
|
1109
1434
|
const LANE_LABEL_KEYS = Object.freeze({
|
|
1110
1435
|
pending: "lane.pending",
|
|
@@ -1125,13 +1450,13 @@ export const messages = Object.freeze({
|
|
|
1125
1450
|
"actions.aria": "board actions",
|
|
1126
1451
|
"action.add": "New task",
|
|
1127
1452
|
"action.claim": "claim",
|
|
1128
|
-
"action.commit": "commit",
|
|
1129
1453
|
"action.done": "done",
|
|
1130
1454
|
"action.fail": "fail",
|
|
1131
|
-
"action.freeze": "
|
|
1455
|
+
"action.freeze": "Pause",
|
|
1132
1456
|
"action.modeTitle": "Toggle board mode",
|
|
1457
|
+
"action.remove": "Delete task",
|
|
1133
1458
|
"action.retry": "retry",
|
|
1134
|
-
"action.unfreeze": "
|
|
1459
|
+
"action.unfreeze": "Resume",
|
|
1135
1460
|
"pane.agents": "agents",
|
|
1136
1461
|
"pane.board": "board",
|
|
1137
1462
|
"pane.events": "events",
|
|
@@ -1150,7 +1475,7 @@ export const messages = Object.freeze({
|
|
|
1150
1475
|
"mode.freeze": "freeze",
|
|
1151
1476
|
"mode.free.help": "Free: anyone can claim tasks.",
|
|
1152
1477
|
"mode.freeze.help": "Freeze: only tasks tagged fix can be claimed; use this while the pipeline is red.",
|
|
1153
|
-
"mode.freeze.banner": "
|
|
1478
|
+
"mode.freeze.banner": "Paused: only tasks tagged fix can be claimed.",
|
|
1154
1479
|
"mode.title": "mode:",
|
|
1155
1480
|
"stats.cards": "tasks",
|
|
1156
1481
|
"stats.oldest": "oldest",
|
|
@@ -1181,6 +1506,7 @@ export const messages = Object.freeze({
|
|
|
1181
1506
|
"drawer.cardActions": "task actions",
|
|
1182
1507
|
"drawer.noActions": "No actions for this state.",
|
|
1183
1508
|
"drawer.readOnly": "Read-only: writable=false.",
|
|
1509
|
+
"drawer.removeClaimed": "A claimed task must be released or reopened before it can be deleted.",
|
|
1184
1510
|
"drawer.rawJson": "raw json",
|
|
1185
1511
|
"events.empty": "No events yet.",
|
|
1186
1512
|
"events.showAll": "Show all events",
|
|
@@ -1196,45 +1522,85 @@ export const messages = Object.freeze({
|
|
|
1196
1522
|
"supervisor.resumeAria": "Resume the supervisor for {repo}",
|
|
1197
1523
|
"supervisor.resumeFailed": "Could not resume the supervisor",
|
|
1198
1524
|
"limits.open": "Settings",
|
|
1199
|
-
"limits.openAria": "
|
|
1200
|
-
"limits.title": "
|
|
1201
|
-
"limits.aria": "
|
|
1202
|
-
"limits.description": "
|
|
1525
|
+
"limits.openAria": "Open agent concurrency settings",
|
|
1526
|
+
"limits.title": "Agent concurrency",
|
|
1527
|
+
"limits.aria": "Agent concurrency for this repository",
|
|
1528
|
+
"limits.description": "Max agents working at the same time, per role; 0 pauses the role",
|
|
1203
1529
|
"limits.role": "Role",
|
|
1204
|
-
"limits.limit": "
|
|
1530
|
+
"limits.limit": "Concurrency limit",
|
|
1205
1531
|
"limits.inFlight": "In flight",
|
|
1206
1532
|
"limits.queued": "Queued",
|
|
1207
1533
|
"limits.defaultHint": "0-999, default 5",
|
|
1208
1534
|
"limits.limitAria": "Concurrency limit for {role}",
|
|
1209
1535
|
"limits.save": "Save",
|
|
1210
|
-
"limits.saveAria": "Save
|
|
1536
|
+
"limits.saveAria": "Save agent concurrency for {repo}",
|
|
1211
1537
|
"limits.saving": "Saving...",
|
|
1212
|
-
"limits.saved": "
|
|
1213
|
-
"limits.failed": "Could not save
|
|
1538
|
+
"limits.saved": "Agent concurrency saved.",
|
|
1539
|
+
"limits.failed": "Could not save agent concurrency",
|
|
1214
1540
|
"limits.invalid": "Every limit must be an integer from 0 to 999.",
|
|
1215
1541
|
"limits.none": "No role data for this repository.",
|
|
1216
1542
|
"limits.close": "Close",
|
|
1217
|
-
"limits.closeAria": "Close
|
|
1543
|
+
"limits.closeAria": "Close agent concurrency settings",
|
|
1544
|
+
"settings.openAria": "Open settings for this repository",
|
|
1545
|
+
"settings.title": "Settings",
|
|
1546
|
+
"settings.aria": "Settings for this repository",
|
|
1547
|
+
"settings.addRole": "Add role",
|
|
1548
|
+
"settings.roleName": "Role name",
|
|
1549
|
+
"settings.roleNameHint": "start with a lowercase letter; 2-32 characters; lowercase letters, digits and hyphens only",
|
|
1550
|
+
"settings.roleNameAria": "New role name",
|
|
1551
|
+
"settings.roleNameExample": "e.g. reviewer",
|
|
1552
|
+
"settings.roleDescription": "Responsibilities",
|
|
1553
|
+
"settings.roleDescriptionAria": "Responsibilities for the new role (optional)",
|
|
1554
|
+
"settings.roleDescriptionHint": "Written to .hive/roles/<name>.md; the agent reads it when it starts.",
|
|
1555
|
+
"settings.roleDescriptionMax": "optional, up to 2000 characters",
|
|
1556
|
+
"settings.descriptionTooLong": "Responsibilities must be at most 2000 characters.",
|
|
1557
|
+
"settings.adapter": "Adapter",
|
|
1558
|
+
"settings.adapterAria": "Adapter for the new role",
|
|
1559
|
+
"settings.model": "Model",
|
|
1560
|
+
"settings.modelOptional": "optional",
|
|
1561
|
+
"settings.modelAria": "Optional model for the new role",
|
|
1562
|
+
"settings.addRoleButton": "Add role",
|
|
1563
|
+
"settings.addRoleAria": "Add this role",
|
|
1564
|
+
"settings.addingRole": "Adding...",
|
|
1565
|
+
"settings.roleInvalid": "Role name must start with a lowercase letter, be 2-32 characters, and use lowercase letters, digits and hyphens only.",
|
|
1566
|
+
"settings.modelInvalid": "Model may use letters, digits, dot, underscore, colon and hyphen (max 64).",
|
|
1567
|
+
"settings.roleExists": "Role already exists.",
|
|
1568
|
+
"settings.roleAdded": "Role added.",
|
|
1569
|
+
"settings.roleFailed": "Could not add role",
|
|
1570
|
+
"settings.readOnly": "Read-only: roles and limits cannot be changed.",
|
|
1571
|
+
"settings.supervisorUnavailable": "Supervisor unavailable; role limits cannot load.",
|
|
1572
|
+
"settings.saveLimits": "Save limits",
|
|
1573
|
+
"settings.close": "Close",
|
|
1574
|
+
"settings.closeAria": "Close settings",
|
|
1218
1575
|
"event.unknown": "event",
|
|
1576
|
+
"add.dialogTitle": "New task",
|
|
1577
|
+
"add.title": "Title",
|
|
1578
|
+
"add.titleAria": "New task title",
|
|
1579
|
+
"add.role": "Role",
|
|
1580
|
+
"add.roleAria": "Role for the new task",
|
|
1581
|
+
"add.scope": "Scope (comma separated, optional)",
|
|
1582
|
+
"add.scopeAria": "File scope for the new task",
|
|
1583
|
+
"add.after": "After task ids (comma separated, optional)",
|
|
1584
|
+
"add.afterAria": "Tasks that must finish first",
|
|
1585
|
+
"add.acceptance": "Acceptance criteria (optional)",
|
|
1586
|
+
"add.acceptanceAria": "Acceptance criteria for the new task",
|
|
1587
|
+
"add.cancel": "Cancel",
|
|
1588
|
+
"add.submit": "Add task",
|
|
1589
|
+
"add.submitting": "Adding…",
|
|
1590
|
+
"add.required": "A title is required.",
|
|
1219
1591
|
"prompt.newTitle": "New task title",
|
|
1220
1592
|
"prompt.role": "Role",
|
|
1221
1593
|
"prompt.scope": "Scope (comma separated, optional)",
|
|
1222
1594
|
"prompt.after": "After task ids (comma separated, optional)",
|
|
1223
|
-
"prompt.commitMessage": "Commit message",
|
|
1224
|
-
"prompt.paths": "Paths (comma separated, optional)",
|
|
1225
1595
|
"prompt.claimAgent": "Claim as agent",
|
|
1226
1596
|
"prompt.commitSha": "Commit sha (optional)",
|
|
1227
1597
|
"prompt.failReason": "Failure reason",
|
|
1228
|
-
"action.plan": "
|
|
1229
|
-
"help.open": "What these buttons do",
|
|
1598
|
+
"action.plan": "Set the Queen a goal",
|
|
1230
1599
|
"menu.open": "More actions and help",
|
|
1231
|
-
"help.title": "
|
|
1232
|
-
"help.aria": "
|
|
1600
|
+
"help.title": "Menu",
|
|
1601
|
+
"help.aria": "Menu",
|
|
1233
1602
|
"help.close": "close",
|
|
1234
|
-
"help.closeAria": "Close the
|
|
1235
|
-
"help.board": "board actions",
|
|
1236
|
-
"help.tasks": "task actions",
|
|
1237
|
-
"help.params": "Parameters: ",
|
|
1603
|
+
"help.closeAria": "Close the menu",
|
|
1238
1604
|
"help.readOnly": "The panel started read-only; add --write to show the write-action buttons.",
|
|
1239
1605
|
"help.uninitialised": "Initialise Hive with the button in the main area before using board actions.",
|
|
1240
1606
|
"init.repo": "repository",
|
|
@@ -1264,29 +1630,20 @@ export const messages = Object.freeze({
|
|
|
1264
1630
|
"queen.takeover": "Let the Queen take over",
|
|
1265
1631
|
"queen.takeoverAria": "Let the Queen take over this session",
|
|
1266
1632
|
"queen.takeoverBusy": "Taking over...",
|
|
1267
|
-
"help.
|
|
1268
|
-
"help.action.
|
|
1269
|
-
"help.action.unfreeze": "Unfreeze: agents can claim pending tasks again.",
|
|
1633
|
+
"help.action.freeze": "Pause: only tasks tagged fix can be claimed.",
|
|
1634
|
+
"help.action.unfreeze": "Resume: agents can claim pending tasks again.",
|
|
1270
1635
|
"help.action.add": "New task: create a pending task with a role and file scope.",
|
|
1271
|
-
"help.action.plan": "
|
|
1272
|
-
"help.action.commit": "Commit: commit the selected paths with a message.",
|
|
1636
|
+
"help.action.plan": "Set the Queen a goal: split a goal into tasks, preview the plan, then write it to the board.",
|
|
1273
1637
|
"help.action.claim": "Claim: lease a pending task for an agent.",
|
|
1274
1638
|
"help.action.done": "Done: mark a claimed task complete, optionally with a commit sha.",
|
|
1275
1639
|
"help.action.fail": "Fail: mark a claimed task failed and record the reason.",
|
|
1276
1640
|
"help.action.retry": "Retry: put a failed or blocked task back in the queue.",
|
|
1277
|
-
"help.
|
|
1278
|
-
"
|
|
1279
|
-
"help.params.plan": "goal, maxCards",
|
|
1280
|
-
"help.params.commit": "message, set[]",
|
|
1281
|
-
"help.params.claim": "id, agent",
|
|
1282
|
-
"help.params.done": "id, sha?",
|
|
1283
|
-
"help.params.fail": "id, reason",
|
|
1284
|
-
"help.params.retry": "id",
|
|
1285
|
-
"plan.dialogTitle": "Give the Queen a goal",
|
|
1641
|
+
"help.action.remove": "Delete this task card permanently. A claimed task has to be released or reopened first.",
|
|
1642
|
+
"plan.dialogTitle": "Set the Queen a goal",
|
|
1286
1643
|
"plan.dialogAria": "Plan tasks from a goal",
|
|
1287
1644
|
"plan.goal": "Goal",
|
|
1288
1645
|
"plan.goalHint": "Describe the outcome; the Queen will split it into tasks.",
|
|
1289
|
-
"plan.maxCards": "Max
|
|
1646
|
+
"plan.maxCards": "Max tasks",
|
|
1290
1647
|
"plan.maxCardsHint": "1+",
|
|
1291
1648
|
"plan.preview": "Preview plan",
|
|
1292
1649
|
"plan.previewAria": "Ask the Queen to draft a task plan without writing it",
|
|
@@ -1307,14 +1664,16 @@ export const messages = Object.freeze({
|
|
|
1307
1664
|
"plan.deps": "deps",
|
|
1308
1665
|
"plan.none": "—",
|
|
1309
1666
|
"plan.goalRequired": "Enter a goal first.",
|
|
1310
|
-
"plan.maxInvalid": "Max
|
|
1667
|
+
"plan.maxInvalid": "Max tasks must be a positive whole number.",
|
|
1311
1668
|
"plan.previewFirst": "Preview the plan before writing tasks.",
|
|
1312
1669
|
"plan.previewFailed": "Could not read the plan.",
|
|
1313
1670
|
"plan.applyHint": "The preview is read-only; writing calls plan again with apply=true.",
|
|
1314
|
-
"plan.stale": "The goal or max
|
|
1671
|
+
"plan.stale": "The goal or max tasks changed; preview the plan again.",
|
|
1315
1672
|
"plan.error": "Plan failed",
|
|
1673
|
+
"confirm.remove": "Delete task \"{title}\" permanently? This cannot be undone.",
|
|
1316
1674
|
"toast.dismiss": "Dismiss",
|
|
1317
1675
|
"toast.planWritten": "Tasks written",
|
|
1676
|
+
"toast.taskRemoved": "Task deleted",
|
|
1318
1677
|
"toast.pickupHint": "The supervisor will pick them up automatically.",
|
|
1319
1678
|
}),
|
|
1320
1679
|
zh: Object.freeze({
|
|
@@ -1322,13 +1681,13 @@ export const messages = Object.freeze({
|
|
|
1322
1681
|
"actions.aria": "看板操作",
|
|
1323
1682
|
"action.add": "新建任务",
|
|
1324
1683
|
"action.claim": "认领",
|
|
1325
|
-
"action.commit": "提交",
|
|
1326
1684
|
"action.done": "完成",
|
|
1327
1685
|
"action.fail": "标记失败",
|
|
1328
|
-
"action.freeze": "
|
|
1686
|
+
"action.freeze": "暂停",
|
|
1329
1687
|
"action.modeTitle": "切换看板模式",
|
|
1688
|
+
"action.remove": "删除任务",
|
|
1330
1689
|
"action.retry": "重试",
|
|
1331
|
-
"action.unfreeze": "
|
|
1690
|
+
"action.unfreeze": "恢复",
|
|
1332
1691
|
"pane.agents": "智能体",
|
|
1333
1692
|
"pane.board": "任务",
|
|
1334
1693
|
"pane.events": "事件",
|
|
@@ -1347,7 +1706,7 @@ export const messages = Object.freeze({
|
|
|
1347
1706
|
"mode.freeze": "冻结",
|
|
1348
1707
|
"mode.free.help": "正常:任何人都可以认领任务。",
|
|
1349
1708
|
"mode.freeze.help": "冻结:只有带 fix 标签的任务能被认领;流水线红时使用。",
|
|
1350
|
-
"mode.freeze.banner": "
|
|
1709
|
+
"mode.freeze.banner": "已暂停:只有带 fix 标签的任务能被认领",
|
|
1351
1710
|
"mode.title": "模式:",
|
|
1352
1711
|
"stats.cards": "个任务",
|
|
1353
1712
|
"stats.oldest": "最久待办",
|
|
@@ -1378,6 +1737,7 @@ export const messages = Object.freeze({
|
|
|
1378
1737
|
"drawer.cardActions": "任务操作",
|
|
1379
1738
|
"drawer.noActions": "该状态没有可用操作。",
|
|
1380
1739
|
"drawer.readOnly": "只读:writable=false。",
|
|
1740
|
+
"drawer.removeClaimed": "已认领的任务必须先释放或重开才能删除。",
|
|
1381
1741
|
"drawer.rawJson": "原始 JSON",
|
|
1382
1742
|
"events.empty": "暂无事件。",
|
|
1383
1743
|
"events.showAll": "展开全部事件",
|
|
@@ -1393,45 +1753,85 @@ export const messages = Object.freeze({
|
|
|
1393
1753
|
"supervisor.resumeAria": "恢复 {repo} 的 supervisor",
|
|
1394
1754
|
"supervisor.resumeFailed": "恢复 supervisor 失败",
|
|
1395
1755
|
"limits.open": "设置",
|
|
1396
|
-
"limits.openAria": "
|
|
1397
|
-
"limits.title": "
|
|
1398
|
-
"limits.aria": "
|
|
1399
|
-
"limits.description": "
|
|
1756
|
+
"limits.openAria": "打开智能体并发上限设置",
|
|
1757
|
+
"limits.title": "智能体的并发上限",
|
|
1758
|
+
"limits.aria": "这个仓库的智能体并发上限",
|
|
1759
|
+
"limits.description": "同时干活的智能体数量上限,按角色分别设置;0 表示暂停该角色",
|
|
1400
1760
|
"limits.role": "角色",
|
|
1401
|
-
"limits.limit": "
|
|
1761
|
+
"limits.limit": "并发上限",
|
|
1402
1762
|
"limits.inFlight": "在飞",
|
|
1403
1763
|
"limits.queued": "排队",
|
|
1404
1764
|
"limits.defaultHint": "0–999,默认 5",
|
|
1405
1765
|
"limits.limitAria": "{role} 的并发上限",
|
|
1406
1766
|
"limits.save": "保存",
|
|
1407
|
-
"limits.saveAria": "保存 {repo}
|
|
1767
|
+
"limits.saveAria": "保存 {repo} 的智能体并发上限",
|
|
1408
1768
|
"limits.saving": "正在保存…",
|
|
1409
|
-
"limits.saved": "
|
|
1410
|
-
"limits.failed": "
|
|
1769
|
+
"limits.saved": "智能体的并发上限已保存。",
|
|
1770
|
+
"limits.failed": "保存智能体的并发上限失败",
|
|
1411
1771
|
"limits.invalid": "每个上限都必须是 0–999 的整数。",
|
|
1412
1772
|
"limits.none": "这个仓库没有角色数据。",
|
|
1413
1773
|
"limits.close": "关闭",
|
|
1414
|
-
"limits.closeAria": "
|
|
1774
|
+
"limits.closeAria": "关闭智能体的并发上限设置",
|
|
1775
|
+
"settings.openAria": "打开这个仓库的设置",
|
|
1776
|
+
"settings.title": "设置",
|
|
1777
|
+
"settings.aria": "这个仓库的设置",
|
|
1778
|
+
"settings.addRole": "新增角色",
|
|
1779
|
+
"settings.roleName": "角色名",
|
|
1780
|
+
"settings.roleNameHint": "以小写字母开头,2–32 个字符,只能包含小写字母、数字和连字符",
|
|
1781
|
+
"settings.roleNameAria": "新角色名",
|
|
1782
|
+
"settings.roleNameExample": "例如 reviewer",
|
|
1783
|
+
"settings.roleDescription": "职责描述",
|
|
1784
|
+
"settings.roleDescriptionAria": "新角色的职责描述(可空)",
|
|
1785
|
+
"settings.roleDescriptionHint": "会写进 .hive/roles/<name>.md,agent 开工时读它",
|
|
1786
|
+
"settings.roleDescriptionMax": "可空,最多 2000 字",
|
|
1787
|
+
"settings.descriptionTooLong": "职责描述不能超过 2000 字。",
|
|
1788
|
+
"settings.adapter": "适配器",
|
|
1789
|
+
"settings.adapterAria": "新角色的适配器",
|
|
1790
|
+
"settings.model": "模型",
|
|
1791
|
+
"settings.modelOptional": "可空",
|
|
1792
|
+
"settings.modelAria": "新角色的可选模型",
|
|
1793
|
+
"settings.addRoleButton": "新增角色",
|
|
1794
|
+
"settings.addRoleAria": "新增这个角色",
|
|
1795
|
+
"settings.addingRole": "正在新增…",
|
|
1796
|
+
"settings.roleInvalid": "角色名必须以小写字母开头,2–32 个字符,只能包含小写字母、数字和连字符。",
|
|
1797
|
+
"settings.modelInvalid": "模型只能包含字母、数字、点、下划线、冒号和连字符,最长 64 位。",
|
|
1798
|
+
"settings.roleExists": "角色已存在。",
|
|
1799
|
+
"settings.roleAdded": "角色已新增。",
|
|
1800
|
+
"settings.roleFailed": "新增角色失败",
|
|
1801
|
+
"settings.readOnly": "只读模式:无法修改角色和限额。",
|
|
1802
|
+
"settings.supervisorUnavailable": "取不到 supervisor,无法读取角色限额。",
|
|
1803
|
+
"settings.saveLimits": "保存限额",
|
|
1804
|
+
"settings.close": "关闭",
|
|
1805
|
+
"settings.closeAria": "关闭设置",
|
|
1415
1806
|
"event.unknown": "事件",
|
|
1807
|
+
"add.dialogTitle": "新建任务",
|
|
1808
|
+
"add.title": "标题",
|
|
1809
|
+
"add.titleAria": "新任务标题",
|
|
1810
|
+
"add.role": "角色",
|
|
1811
|
+
"add.roleAria": "新任务角色",
|
|
1812
|
+
"add.scope": "范围(逗号分隔,可选)",
|
|
1813
|
+
"add.scopeAria": "新任务的文件范围",
|
|
1814
|
+
"add.after": "依赖任务(任务 ID,逗号分隔,可选)",
|
|
1815
|
+
"add.afterAria": "需要先完成的任务",
|
|
1816
|
+
"add.acceptance": "验收标准(可选)",
|
|
1817
|
+
"add.acceptanceAria": "新任务的验收标准",
|
|
1818
|
+
"add.cancel": "取消",
|
|
1819
|
+
"add.submit": "新建任务",
|
|
1820
|
+
"add.submitting": "正在新建…",
|
|
1821
|
+
"add.required": "标题不能为空。",
|
|
1416
1822
|
"prompt.newTitle": "新任务标题",
|
|
1417
1823
|
"prompt.role": "角色",
|
|
1418
1824
|
"prompt.scope": "范围(逗号分隔,可选)",
|
|
1419
1825
|
"prompt.after": "排在哪些任务之后(任务 ID,逗号分隔,可选)",
|
|
1420
|
-
"prompt.commitMessage": "提交信息",
|
|
1421
|
-
"prompt.paths": "路径(逗号分隔,可选)",
|
|
1422
1826
|
"prompt.claimAgent": "以哪个智能体认领",
|
|
1423
1827
|
"prompt.commitSha": "提交 SHA(可选)",
|
|
1424
1828
|
"prompt.failReason": "失败原因",
|
|
1425
|
-
"action.plan": "
|
|
1426
|
-
"help.open": "这些按钮是做什么的",
|
|
1829
|
+
"action.plan": "给女王设目标",
|
|
1427
1830
|
"menu.open": "更多操作与说明",
|
|
1428
|
-
"help.title": "
|
|
1429
|
-
"help.aria": "
|
|
1831
|
+
"help.title": "菜单",
|
|
1832
|
+
"help.aria": "菜单",
|
|
1430
1833
|
"help.close": "关闭",
|
|
1431
|
-
"help.closeAria": "
|
|
1432
|
-
"help.board": "看板操作",
|
|
1433
|
-
"help.tasks": "任务操作",
|
|
1434
|
-
"help.params": "参数:",
|
|
1834
|
+
"help.closeAria": "关闭菜单",
|
|
1435
1835
|
"help.readOnly": "面板以只读启动,加 --write 才有写操作按钮。",
|
|
1436
1836
|
"help.uninitialised": "请先用主区的按钮初始化 Hive,再使用看板操作。",
|
|
1437
1837
|
"init.repo": "仓库",
|
|
@@ -1461,29 +1861,20 @@ export const messages = Object.freeze({
|
|
|
1461
1861
|
"queen.takeover": "让女王接管",
|
|
1462
1862
|
"queen.takeoverAria": "让女王接管本会话",
|
|
1463
1863
|
"queen.takeoverBusy": "正在接管…",
|
|
1464
|
-
"help.
|
|
1465
|
-
"help.action.
|
|
1466
|
-
"help.action.unfreeze": "解冻:恢复认领,智能体可以继续接取待办任务。",
|
|
1864
|
+
"help.action.freeze": "暂停:只有带 fix 标签的任务能被认领。",
|
|
1865
|
+
"help.action.unfreeze": "恢复:恢复认领,智能体可以继续接取待办任务。",
|
|
1467
1866
|
"help.action.add": "新建任务:添加一条带角色和文件范围的待办任务。",
|
|
1468
|
-
"help.action.plan": "
|
|
1469
|
-
"help.action.commit": "提交:按提交信息提交选中的路径。",
|
|
1867
|
+
"help.action.plan": "给女王设目标:让女王把目标拆成任务计划,预览后再写入看板。",
|
|
1470
1868
|
"help.action.claim": "认领:以某个智能体的名义短期租下这条待办任务。",
|
|
1471
1869
|
"help.action.done": "完成:把已认领的任务标为完成,可选填写提交 SHA。",
|
|
1472
1870
|
"help.action.fail": "标记失败:把已认领的任务标为失败,并写明原因。",
|
|
1473
1871
|
"help.action.retry": "重试:把失败或受阻的任务放回队列。",
|
|
1474
|
-
"help.
|
|
1475
|
-
"
|
|
1476
|
-
"help.params.plan": "goal、maxCards",
|
|
1477
|
-
"help.params.commit": "message、set[]",
|
|
1478
|
-
"help.params.claim": "id、智能体",
|
|
1479
|
-
"help.params.done": "id、sha?",
|
|
1480
|
-
"help.params.fail": "id、reason",
|
|
1481
|
-
"help.params.retry": "id",
|
|
1482
|
-
"plan.dialogTitle": "给女王下目标",
|
|
1872
|
+
"help.action.remove": "永久删除这张任务卡;已认领的任务需要先释放或重开。",
|
|
1873
|
+
"plan.dialogTitle": "给女王设目标",
|
|
1483
1874
|
"plan.dialogAria": "按目标规划任务",
|
|
1484
1875
|
"plan.goal": "目标",
|
|
1485
1876
|
"plan.goalHint": "描述想达成的结果,女王会把它拆成任务。",
|
|
1486
|
-
"plan.maxCards": "
|
|
1877
|
+
"plan.maxCards": "最大任务数",
|
|
1487
1878
|
"plan.maxCardsHint": "至少 1",
|
|
1488
1879
|
"plan.preview": "预览计划",
|
|
1489
1880
|
"plan.previewAria": "让女王先给出任务计划,不写入看板",
|
|
@@ -1504,14 +1895,16 @@ export const messages = Object.freeze({
|
|
|
1504
1895
|
"plan.deps": "依赖",
|
|
1505
1896
|
"plan.none": "—",
|
|
1506
1897
|
"plan.goalRequired": "请先填写目标。",
|
|
1507
|
-
"plan.maxInvalid": "
|
|
1898
|
+
"plan.maxInvalid": "最大任务数必须是正整数。",
|
|
1508
1899
|
"plan.previewFirst": "请先预览计划,再写入任务。",
|
|
1509
1900
|
"plan.previewFailed": "无法解析计划。",
|
|
1510
1901
|
"plan.applyHint": "预览不会写入;写入时会带 apply=true 再调用一次 plan。",
|
|
1511
|
-
"plan.stale": "
|
|
1902
|
+
"plan.stale": "目标或最大任务数已修改,请重新预览计划。",
|
|
1512
1903
|
"plan.error": "计划失败",
|
|
1904
|
+
"confirm.remove": "确定永久删除任务「{title}」?此操作不可撤销。",
|
|
1513
1905
|
"toast.dismiss": "关闭",
|
|
1514
1906
|
"toast.planWritten": "任务已写入",
|
|
1907
|
+
"toast.taskRemoved": "任务已删除",
|
|
1515
1908
|
"toast.pickupHint": "supervisor 会自动接卡。",
|
|
1516
1909
|
}),
|
|
1517
1910
|
});
|
|
@@ -1680,22 +2073,12 @@ function modeAction(mode) {
|
|
|
1680
2073
|
return { name: "mode", ...meta, body: { mode: nextMode, reason: "panel" } };
|
|
1681
2074
|
}
|
|
1682
2075
|
|
|
1683
|
-
function toolbarActions(writable) {
|
|
2076
|
+
function toolbarActions(writable, mode) {
|
|
1684
2077
|
if (!writable) return [];
|
|
1685
2078
|
return [
|
|
1686
2079
|
{ name: "add", ...ACTION_META.add },
|
|
1687
2080
|
{ name: "plan", ...ACTION_META.plan },
|
|
1688
|
-
|
|
1689
|
-
];
|
|
1690
|
-
}
|
|
1691
|
-
|
|
1692
|
-
function helpGroups(mode) {
|
|
1693
|
-
return [
|
|
1694
|
-
{ titleKey: "help.board", actions: [modeAction(mode), ...toolbarActions(true)] },
|
|
1695
|
-
{
|
|
1696
|
-
titleKey: "help.tasks",
|
|
1697
|
-
actions: ["claim", "done", "fail", "retry"].map((name) => ({ name, ...ACTION_META[name] })),
|
|
1698
|
-
},
|
|
2081
|
+
modeAction(mode),
|
|
1699
2082
|
];
|
|
1700
2083
|
}
|
|
1701
2084
|
|
|
@@ -1706,6 +2089,7 @@ function helpGroups(mode) {
|
|
|
1706
2089
|
* @returns {{
|
|
1707
2090
|
* at: string, repo: string, mode: string, initialised: boolean, writable: boolean,
|
|
1708
2091
|
* queen: {active:boolean, source:"auto"|"manual"|null, repo:string}|null,
|
|
2092
|
+
* roles: {list:Array<{name:string,adapter:string|null,model:string|null,prompt:string|null,promptExists:boolean,limit:number|null}>, limits:Record<string,number>, error:string|null},
|
|
1709
2093
|
* lanes: Record<string, Array<{id:string,title:string,role:string,owner:string,scope:string[],reason:string}>>,
|
|
1710
2094
|
* laneOrder: string[],
|
|
1711
2095
|
* stats: {total:number, byState:Record<string,number>, byRole:Record<string,number>, oldestPending:{id:string,createdAt:string}|null},
|
|
@@ -1749,6 +2133,32 @@ export function renderModel(snapshot) {
|
|
|
1749
2133
|
: null,
|
|
1750
2134
|
repo: typeof rawQueen.repo === "string" ? rawQueen.repo : "",
|
|
1751
2135
|
};
|
|
2136
|
+
const rawRoles = isRecord(source.roles) ? source.roles : null;
|
|
2137
|
+
const rolesLimits = {};
|
|
2138
|
+
if (rawRoles && isRecord(rawRoles.limits)) {
|
|
2139
|
+
for (const [name, value] of Object.entries(rawRoles.limits)) {
|
|
2140
|
+
const number = Number(value);
|
|
2141
|
+
if (name && Number.isFinite(number)) rolesLimits[name] = number;
|
|
2142
|
+
}
|
|
2143
|
+
}
|
|
2144
|
+
const roles = {
|
|
2145
|
+
list:
|
|
2146
|
+
rawRoles && Array.isArray(rawRoles.list)
|
|
2147
|
+
? rawRoles.list
|
|
2148
|
+
.filter(isRecord)
|
|
2149
|
+
.map((entry) => ({
|
|
2150
|
+
name: asString(entry.name),
|
|
2151
|
+
adapter: typeof entry.adapter === "string" ? entry.adapter : null,
|
|
2152
|
+
model: typeof entry.model === "string" ? entry.model : null,
|
|
2153
|
+
prompt: typeof entry.prompt === "string" ? entry.prompt : null,
|
|
2154
|
+
promptExists: entry.promptExists === true,
|
|
2155
|
+
limit: typeof entry.limit === "number" && Number.isFinite(entry.limit) ? entry.limit : null,
|
|
2156
|
+
}))
|
|
2157
|
+
.filter((entry) => entry.name)
|
|
2158
|
+
: [],
|
|
2159
|
+
limits: rolesLimits,
|
|
2160
|
+
error: rawRoles ? asString(rawRoles.error) || null : null,
|
|
2161
|
+
};
|
|
1752
2162
|
|
|
1753
2163
|
return {
|
|
1754
2164
|
at: asString(source.at),
|
|
@@ -1756,13 +2166,14 @@ export function renderModel(snapshot) {
|
|
|
1756
2166
|
mode,
|
|
1757
2167
|
initialised,
|
|
1758
2168
|
queen,
|
|
2169
|
+
roles,
|
|
1759
2170
|
writable,
|
|
1760
2171
|
lanes,
|
|
1761
2172
|
laneOrder: [...LANE_ORDER],
|
|
1762
2173
|
stats: normalizeStats(source.stats, tasks),
|
|
1763
2174
|
agents: normalizeAgents(source.board),
|
|
1764
2175
|
events: normalizeEvents(source.events),
|
|
1765
|
-
actions: initialised ? toolbarActions(writable) : [],
|
|
2176
|
+
actions: initialised ? toolbarActions(writable, mode) : [],
|
|
1766
2177
|
};
|
|
1767
2178
|
}
|
|
1768
2179
|
|
|
@@ -1944,6 +2355,52 @@ function element(doc, tag, className, text) {
|
|
|
1944
2355
|
return node;
|
|
1945
2356
|
}
|
|
1946
2357
|
|
|
2358
|
+
function svgNode(doc, tag) {
|
|
2359
|
+
const node =
|
|
2360
|
+
typeof doc.createElementNS === "function"
|
|
2361
|
+
? doc.createElementNS("http://www.w3.org/2000/svg", tag)
|
|
2362
|
+
: doc.createElement(tag);
|
|
2363
|
+
return node;
|
|
2364
|
+
}
|
|
2365
|
+
|
|
2366
|
+
function makeHiveIcon(doc, kind) {
|
|
2367
|
+
const svg = svgNode(doc, "svg");
|
|
2368
|
+
setAttr(svg, "viewBox", "0 0 24 24");
|
|
2369
|
+
setAttr(svg, "width", "16");
|
|
2370
|
+
setAttr(svg, "height", "16");
|
|
2371
|
+
setAttr(svg, "aria-hidden", "true");
|
|
2372
|
+
setAttr(svg, "focusable", "false");
|
|
2373
|
+
if (kind === "menu") {
|
|
2374
|
+
for (const cx of [5, 12, 19]) {
|
|
2375
|
+
const dot = svgNode(doc, "circle");
|
|
2376
|
+
setAttr(dot, "cx", String(cx));
|
|
2377
|
+
setAttr(dot, "cy", "12");
|
|
2378
|
+
setAttr(dot, "r", "1.25");
|
|
2379
|
+
setAttr(dot, "fill", "currentColor");
|
|
2380
|
+
svg.appendChild(dot);
|
|
2381
|
+
}
|
|
2382
|
+
return svg;
|
|
2383
|
+
}
|
|
2384
|
+
setAttr(svg, "fill", "none");
|
|
2385
|
+
setAttr(svg, "stroke", "currentColor");
|
|
2386
|
+
setAttr(svg, "stroke-width", "1.75");
|
|
2387
|
+
setAttr(svg, "stroke-linecap", "round");
|
|
2388
|
+
setAttr(svg, "stroke-linejoin", "round");
|
|
2389
|
+
const center = svgNode(doc, "circle");
|
|
2390
|
+
setAttr(center, "cx", "12");
|
|
2391
|
+
setAttr(center, "cy", "12");
|
|
2392
|
+
setAttr(center, "r", "3");
|
|
2393
|
+
svg.appendChild(center);
|
|
2394
|
+
const path = svgNode(doc, "path");
|
|
2395
|
+
setAttr(
|
|
2396
|
+
path,
|
|
2397
|
+
"d",
|
|
2398
|
+
"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z",
|
|
2399
|
+
);
|
|
2400
|
+
svg.appendChild(path);
|
|
2401
|
+
return svg;
|
|
2402
|
+
}
|
|
2403
|
+
|
|
1947
2404
|
function setAttr(node, name, value) {
|
|
1948
2405
|
if (node && typeof node.setAttribute === "function") {
|
|
1949
2406
|
node.setAttribute(name, value === null || value === undefined ? "" : String(value));
|
|
@@ -2022,22 +2479,6 @@ function formatTime(value) {
|
|
|
2022
2479
|
}
|
|
2023
2480
|
}
|
|
2024
2481
|
|
|
2025
|
-
function formatStamp(value) {
|
|
2026
|
-
const date = parseDate(value);
|
|
2027
|
-
if (!date) return asString(value);
|
|
2028
|
-
try {
|
|
2029
|
-
return date.toLocaleString([], {
|
|
2030
|
-
month: "short",
|
|
2031
|
-
day: "2-digit",
|
|
2032
|
-
hour: "2-digit",
|
|
2033
|
-
minute: "2-digit",
|
|
2034
|
-
second: "2-digit",
|
|
2035
|
-
});
|
|
2036
|
-
} catch {
|
|
2037
|
-
return date.toISOString();
|
|
2038
|
-
}
|
|
2039
|
-
}
|
|
2040
|
-
|
|
2041
2482
|
function safeClassToken(value) {
|
|
2042
2483
|
const token = asString(value).toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
2043
2484
|
return token || "unknown";
|
|
@@ -2150,6 +2591,7 @@ function extractPlan(payload) {
|
|
|
2150
2591
|
* intervalMs?: number,
|
|
2151
2592
|
* onError?: (error: Error) => void,
|
|
2152
2593
|
* fetch?: typeof fetch,
|
|
2594
|
+
* confirm?: (message: string) => boolean,
|
|
2153
2595
|
* t?: (key: string) => string,
|
|
2154
2596
|
* subscribeLocale?: (listener: () => void) => (() => void)
|
|
2155
2597
|
* }} [options]
|
|
@@ -2203,6 +2645,18 @@ export function mount(root, options = {}) {
|
|
|
2203
2645
|
? globalThis.prompt.bind(globalThis)
|
|
2204
2646
|
: null;
|
|
2205
2647
|
|
|
2648
|
+
// Destructive actions ask through the host's confirm when it provides one
|
|
2649
|
+
// (tests, embedded hosts), then the global confirm. Without either, a
|
|
2650
|
+
// destructive action is refused rather than run unconfirmed.
|
|
2651
|
+
const confirmImpl =
|
|
2652
|
+
typeof opts.confirm === "function"
|
|
2653
|
+
? opts.confirm
|
|
2654
|
+
: typeof view.confirm === "function"
|
|
2655
|
+
? view.confirm.bind(view)
|
|
2656
|
+
: typeof globalThis.confirm === "function"
|
|
2657
|
+
? globalThis.confirm.bind(globalThis)
|
|
2658
|
+
: null;
|
|
2659
|
+
|
|
2206
2660
|
const schedule =
|
|
2207
2661
|
typeof view.setInterval === "function" ? view.setInterval.bind(view) : globalThis.setInterval.bind(globalThis);
|
|
2208
2662
|
const unschedule =
|
|
@@ -2240,6 +2694,7 @@ export function mount(root, options = {}) {
|
|
|
2240
2694
|
let lastModel = null;
|
|
2241
2695
|
let drawerNode = null;
|
|
2242
2696
|
let drawerState = null;
|
|
2697
|
+
let drawerTrigger = null;
|
|
2243
2698
|
let unsubscribeLocale = null;
|
|
2244
2699
|
let statusKey = null;
|
|
2245
2700
|
let statusKind = "info";
|
|
@@ -2252,6 +2707,11 @@ export function mount(root, options = {}) {
|
|
|
2252
2707
|
let planState = null;
|
|
2253
2708
|
let planTriggerButton = null;
|
|
2254
2709
|
let planFocusables = [];
|
|
2710
|
+
let addOverlay = null;
|
|
2711
|
+
let addDialogNode = null;
|
|
2712
|
+
let addState = null;
|
|
2713
|
+
let addTriggerButton = null;
|
|
2714
|
+
let addFocusables = [];
|
|
2255
2715
|
let toastNode = null;
|
|
2256
2716
|
let stageFilter = "all";
|
|
2257
2717
|
let stageChipEntries = [];
|
|
@@ -2265,6 +2725,7 @@ export function mount(root, options = {}) {
|
|
|
2265
2725
|
const queenDismissedFallback = new Set();
|
|
2266
2726
|
let supervisorData = [];
|
|
2267
2727
|
let supervisorRequest = null;
|
|
2728
|
+
let supervisorInlineRow = null;
|
|
2268
2729
|
let limitsOverlay = null;
|
|
2269
2730
|
let limitsDialogNode = null;
|
|
2270
2731
|
let limitsState = null;
|
|
@@ -2282,8 +2743,19 @@ export function mount(root, options = {}) {
|
|
|
2282
2743
|
ident.appendChild(repoNode);
|
|
2283
2744
|
bar.appendChild(ident);
|
|
2284
2745
|
|
|
2285
|
-
const
|
|
2286
|
-
|
|
2746
|
+
const supervisorInline = element(doc, "span", "hive-supervisor-inline is-hidden");
|
|
2747
|
+
setAttr(supervisorInline, "aria-label", translate("supervisor.aria"));
|
|
2748
|
+
const supervisorInlineLabel = element(doc, "span", "hive-supervisor-inline-label", translate("supervisor.label"));
|
|
2749
|
+
const supervisorInlineState = element(doc, "span", "hive-supervisor-inline-state", "");
|
|
2750
|
+
const supervisorInlineResume = element(doc, "button", "hive-btn hive-supervisor-inline-resume is-hidden", translate("supervisor.resume"));
|
|
2751
|
+
setAttr(supervisorInlineResume, "type", "button");
|
|
2752
|
+
supervisorInlineResume.addEventListener("click", () => {
|
|
2753
|
+
if (supervisorInlineRow) void resumeSupervisor(supervisorInlineRow, supervisorInlineResume);
|
|
2754
|
+
});
|
|
2755
|
+
supervisorInline.appendChild(supervisorInlineLabel);
|
|
2756
|
+
supervisorInline.appendChild(supervisorInlineState);
|
|
2757
|
+
supervisorInline.appendChild(supervisorInlineResume);
|
|
2758
|
+
bar.appendChild(supervisorInline);
|
|
2287
2759
|
|
|
2288
2760
|
const statsNode = element(doc, "div", "hive-stats");
|
|
2289
2761
|
bar.appendChild(statsNode);
|
|
@@ -2298,8 +2770,9 @@ export function mount(root, options = {}) {
|
|
|
2298
2770
|
const actionsNode = element(doc, "div", "hive-actions");
|
|
2299
2771
|
actionGroup.appendChild(actionsNode);
|
|
2300
2772
|
|
|
2301
|
-
const helpButton = element(doc, "button", "hive-btn hive-help-trigger hive-menu-trigger"
|
|
2773
|
+
const helpButton = element(doc, "button", "hive-btn hive-btn-ghost hive-icon-button hive-help-trigger hive-menu-trigger");
|
|
2302
2774
|
setAttr(helpButton, "type", "button");
|
|
2775
|
+
helpButton.appendChild(makeHiveIcon(doc, "menu"));
|
|
2303
2776
|
setAttr(helpButton, "aria-haspopup", "dialog");
|
|
2304
2777
|
setAttr(helpButton, "aria-expanded", "false");
|
|
2305
2778
|
setAttr(helpButton, "title", translate("menu.open"));
|
|
@@ -2307,23 +2780,17 @@ export function mount(root, options = {}) {
|
|
|
2307
2780
|
helpButton.addEventListener("click", () => {
|
|
2308
2781
|
toggleHelp();
|
|
2309
2782
|
});
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
setAttr(
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
setAttr(supervisorLimitsButton, "type", "button");
|
|
2319
|
-
setAttr(supervisorLimitsButton, "title", translate("limits.openAria"));
|
|
2320
|
-
setAttr(supervisorLimitsButton, "aria-label", translate("limits.openAria"));
|
|
2321
|
-
supervisorLimitsButton.addEventListener("click", () => {
|
|
2322
|
-
openLimitsDialog(supervisorLimitsButton);
|
|
2783
|
+
// The previous "⋯" action menu has no entries left; settings carries the Queen section.
|
|
2784
|
+
const settingsButton = element(doc, "button", "hive-btn hive-btn-ghost hive-icon-button hive-settings-trigger");
|
|
2785
|
+
setAttr(settingsButton, "type", "button");
|
|
2786
|
+
settingsButton.appendChild(makeHiveIcon(doc, "gear"));
|
|
2787
|
+
setAttr(settingsButton, "title", translate("settings.openAria"));
|
|
2788
|
+
setAttr(settingsButton, "aria-label", translate("settings.openAria"));
|
|
2789
|
+
settingsButton.addEventListener("click", () => {
|
|
2790
|
+
openLimitsDialog(settingsButton);
|
|
2323
2791
|
});
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
supervisorBar.appendChild(supervisorLimitsButton);
|
|
2792
|
+
actionGroup.appendChild(settingsButton);
|
|
2793
|
+
bar.appendChild(actionGroup);
|
|
2327
2794
|
|
|
2328
2795
|
const freezeSlot = element(doc, "div", "hive-freeze-slot");
|
|
2329
2796
|
|
|
@@ -2452,7 +2919,6 @@ export function mount(root, options = {}) {
|
|
|
2452
2919
|
});
|
|
2453
2920
|
|
|
2454
2921
|
frame.appendChild(bar);
|
|
2455
|
-
frame.appendChild(supervisorBar);
|
|
2456
2922
|
frame.appendChild(freezeSlot);
|
|
2457
2923
|
frame.appendChild(queenHint);
|
|
2458
2924
|
frame.appendChild(agentsStrip);
|
|
@@ -2509,6 +2975,15 @@ export function mount(root, options = {}) {
|
|
|
2509
2975
|
return answer === null || answer === undefined ? null : String(answer);
|
|
2510
2976
|
}
|
|
2511
2977
|
|
|
2978
|
+
function askConfirm(message) {
|
|
2979
|
+
if (!confirmImpl) return false;
|
|
2980
|
+
try {
|
|
2981
|
+
return confirmImpl(message) === true;
|
|
2982
|
+
} catch {
|
|
2983
|
+
return false;
|
|
2984
|
+
}
|
|
2985
|
+
}
|
|
2986
|
+
|
|
2512
2987
|
function emptyState(text) {
|
|
2513
2988
|
return element(doc, "div", "hive-empty", text);
|
|
2514
2989
|
}
|
|
@@ -2576,36 +3051,22 @@ export function mount(root, options = {}) {
|
|
|
2576
3051
|
if (!model || !model.writable) {
|
|
2577
3052
|
body.appendChild(element(doc, "div", "hive-help-note", translate("help.readOnly")));
|
|
2578
3053
|
}
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
const button = element(doc, "button", "hive-btn hive-help-mode-action", translate(action.labelKey));
|
|
2593
|
-
setAttr(button, "type", "button");
|
|
2594
|
-
setAttr(button, "title", translate(action.helpKey));
|
|
2595
|
-
setAttr(button, "aria-label", translate(action.helpKey));
|
|
2596
|
-
button.addEventListener("click", () => {
|
|
2597
|
-
closeHelp();
|
|
2598
|
-
void postAction("mode", action.body || { mode: "freeze", reason: "panel" });
|
|
2599
|
-
});
|
|
2600
|
-
row.appendChild(button);
|
|
2601
|
-
item.appendChild(row);
|
|
2602
|
-
}
|
|
2603
|
-
body.appendChild(item);
|
|
2604
|
-
}
|
|
3054
|
+
if (model && model.writable && model.initialised !== false) {
|
|
3055
|
+
const action = modeAction(model.mode);
|
|
3056
|
+
const row = element(doc, "div", "hive-help-actionrow");
|
|
3057
|
+
const button = element(doc, "button", "hive-btn hive-help-mode-action", translate(action.labelKey));
|
|
3058
|
+
setAttr(button, "type", "button");
|
|
3059
|
+
setAttr(button, "title", translate(action.helpKey));
|
|
3060
|
+
setAttr(button, "aria-label", translate(action.helpKey));
|
|
3061
|
+
button.addEventListener("click", () => {
|
|
3062
|
+
closeHelp();
|
|
3063
|
+
void postAction("mode", action.body || { mode: "freeze", reason: "panel" });
|
|
3064
|
+
});
|
|
3065
|
+
row.appendChild(button);
|
|
3066
|
+
body.appendChild(row);
|
|
2605
3067
|
}
|
|
2606
3068
|
body.appendChild(element(doc, "div", "hive-help-section", translate("help.queen")));
|
|
2607
3069
|
body.appendChild(element(doc, "div", "hive-help-desc hive-help-queen", translate("help.queenDesc")));
|
|
2608
|
-
body.appendChild(element(doc, "div", "hive-help-hint", translate("help.hint")));
|
|
2609
3070
|
}
|
|
2610
3071
|
|
|
2611
3072
|
function positionHelp(panel) {
|
|
@@ -2852,6 +3313,7 @@ export function mount(root, options = {}) {
|
|
|
2852
3313
|
function openPlanDialog(trigger) {
|
|
2853
3314
|
if (destroyed || !lastModel || !lastModel.writable) return;
|
|
2854
3315
|
closeHelp(false);
|
|
3316
|
+
closeAddDialog(false);
|
|
2855
3317
|
closeDrawer();
|
|
2856
3318
|
planTriggerButton = trigger || planTriggerButton || null;
|
|
2857
3319
|
|
|
@@ -2978,7 +3440,7 @@ export function mount(root, options = {}) {
|
|
|
2978
3440
|
focusNode(goalInput);
|
|
2979
3441
|
}
|
|
2980
3442
|
|
|
2981
|
-
// ---
|
|
3443
|
+
// --- agent concurrency settings -----------------------------------------
|
|
2982
3444
|
|
|
2983
3445
|
function currentSupervisorRow() {
|
|
2984
3446
|
if (!lastModel) return null;
|
|
@@ -2986,14 +3448,42 @@ export function mount(root, options = {}) {
|
|
|
2986
3448
|
}
|
|
2987
3449
|
|
|
2988
3450
|
function roleRowsForCurrentRepo(row) {
|
|
2989
|
-
const
|
|
3451
|
+
const supervisorRoles = new Map();
|
|
2990
3452
|
if (row && Array.isArray(row.roles)) {
|
|
2991
3453
|
for (const role of row.roles) {
|
|
2992
3454
|
if (!isRecord(role)) continue;
|
|
2993
3455
|
const name = asString(role.role);
|
|
2994
|
-
if (name)
|
|
3456
|
+
if (name) supervisorRoles.set(name, role);
|
|
2995
3457
|
}
|
|
2996
3458
|
}
|
|
3459
|
+
const modelRoles = lastModel && lastModel.roles && Array.isArray(lastModel.roles.list) ? lastModel.roles.list : [];
|
|
3460
|
+
if (modelRoles.length > 0) {
|
|
3461
|
+
return modelRoles
|
|
3462
|
+
.map((entry) => {
|
|
3463
|
+
const name = asString(entry.name);
|
|
3464
|
+
if (!name) return null;
|
|
3465
|
+
const savedLimit = lastModel.roles.limits[name];
|
|
3466
|
+
const limit = Number.isFinite(savedLimit)
|
|
3467
|
+
? savedLimit
|
|
3468
|
+
: Number.isFinite(entry.limit)
|
|
3469
|
+
? entry.limit
|
|
3470
|
+
: null;
|
|
3471
|
+
const effective = supervisorRoles.get(name);
|
|
3472
|
+
return {
|
|
3473
|
+
role: name,
|
|
3474
|
+
adapter: entry.adapter,
|
|
3475
|
+
model: entry.model,
|
|
3476
|
+
limit,
|
|
3477
|
+
inFlight: effective ? effective.inFlight : null,
|
|
3478
|
+
queued: effective ? effective.queued : null,
|
|
3479
|
+
};
|
|
3480
|
+
})
|
|
3481
|
+
.filter(Boolean)
|
|
3482
|
+
.sort((left, right) => left.role.localeCompare(right.role));
|
|
3483
|
+
}
|
|
3484
|
+
|
|
3485
|
+
const roles = new Map();
|
|
3486
|
+
for (const [name, role] of supervisorRoles) roles.set(name, { ...role, role: name });
|
|
2997
3487
|
if (roles.size === 0 && lastModel) {
|
|
2998
3488
|
for (const cards of Object.values(lastModel.lanes)) {
|
|
2999
3489
|
for (const card of cards) {
|
|
@@ -3060,15 +3550,18 @@ export function mount(root, options = {}) {
|
|
|
3060
3550
|
}
|
|
3061
3551
|
|
|
3062
3552
|
function openLimitsDialog(trigger) {
|
|
3063
|
-
if (destroyed || !lastModel
|
|
3553
|
+
if (destroyed || !lastModel) return;
|
|
3064
3554
|
closeHelp(false);
|
|
3065
3555
|
closePlanDialog(false);
|
|
3556
|
+
closeAddDialog(false);
|
|
3066
3557
|
closeDrawer();
|
|
3067
3558
|
closeToast();
|
|
3068
3559
|
if (limitsDialogNode) closeLimitsDialog(false);
|
|
3069
|
-
limitsTriggerButton = trigger ||
|
|
3560
|
+
limitsTriggerButton = trigger || settingsButton;
|
|
3070
3561
|
|
|
3071
3562
|
const repo = lastModel.repo || "";
|
|
3563
|
+
const writable = Boolean(lastModel.writable);
|
|
3564
|
+
const supervisorAvailable = supervisorData.length > 0;
|
|
3072
3565
|
const rows = roleRowsForCurrentRepo(currentSupervisorRow());
|
|
3073
3566
|
const overlay = element(doc, "div", "hive-overlay hive-dialog-scrim");
|
|
3074
3567
|
overlay.addEventListener("click", (event) => {
|
|
@@ -3078,16 +3571,16 @@ export function mount(root, options = {}) {
|
|
|
3078
3571
|
const dialog = element(doc, "div", "hive-dialog");
|
|
3079
3572
|
setAttr(dialog, "role", "dialog");
|
|
3080
3573
|
setAttr(dialog, "aria-modal", "true");
|
|
3081
|
-
setAttr(dialog, "aria-label", translate("
|
|
3574
|
+
setAttr(dialog, "aria-label", translate("settings.aria"));
|
|
3082
3575
|
|
|
3083
3576
|
const head = element(doc, "div", "hive-dialog-head");
|
|
3084
3577
|
const titleBox = element(doc, "div", "hive-dialog-head-title");
|
|
3085
|
-
titleBox.appendChild(element(doc, "h2", "hive-dialog-title", translate("
|
|
3578
|
+
titleBox.appendChild(element(doc, "h2", "hive-dialog-title", translate("settings.title")));
|
|
3086
3579
|
head.appendChild(titleBox);
|
|
3087
|
-
const closeButton = element(doc, "button", "hive-btn hive-btn-ghost", translate("
|
|
3580
|
+
const closeButton = element(doc, "button", "hive-btn hive-btn-ghost", translate("settings.close"));
|
|
3088
3581
|
setAttr(closeButton, "type", "button");
|
|
3089
|
-
setAttr(closeButton, "title", translate("
|
|
3090
|
-
setAttr(closeButton, "aria-label", translate("
|
|
3582
|
+
setAttr(closeButton, "title", translate("settings.closeAria"));
|
|
3583
|
+
setAttr(closeButton, "aria-label", translate("settings.closeAria"));
|
|
3091
3584
|
closeButton.addEventListener("click", () => {
|
|
3092
3585
|
closeLimitsDialog();
|
|
3093
3586
|
});
|
|
@@ -3101,11 +3594,93 @@ export function mount(root, options = {}) {
|
|
|
3101
3594
|
setAttr(repoPath, "title", repo);
|
|
3102
3595
|
repoLine.appendChild(repoPath);
|
|
3103
3596
|
body.appendChild(repoLine);
|
|
3104
|
-
|
|
3597
|
+
if (!writable) {
|
|
3598
|
+
body.appendChild(element(doc, "div", "hive-settings-note", translate("settings.readOnly")));
|
|
3599
|
+
}
|
|
3105
3600
|
|
|
3601
|
+
const roleSection = element(doc, "section", "hive-settings-section");
|
|
3602
|
+
roleSection.appendChild(element(doc, "div", "hive-settings-section-title", translate("settings.addRole")));
|
|
3603
|
+
const roleForm = element(doc, "div", "hive-field-row hive-settings-role-form");
|
|
3604
|
+
const roleNameField = element(doc, "label", "hive-field");
|
|
3605
|
+
roleNameField.appendChild(element(doc, "span", "hive-field-label", translate("settings.roleName")));
|
|
3606
|
+
const roleNameInput = element(doc, "input", "hive-input hive-settings-role-name");
|
|
3607
|
+
setAttr(roleNameInput, "type", "text");
|
|
3608
|
+
setAttr(roleNameInput, "autocomplete", "off");
|
|
3609
|
+
setAttr(roleNameInput, "placeholder", translate("settings.roleNameExample"));
|
|
3610
|
+
setAttr(roleNameInput, "aria-label", translate("settings.roleNameAria"));
|
|
3611
|
+
setAttr(roleNameInput, "pattern", "[a-z0-9]+(?:-[a-z0-9]+)*");
|
|
3612
|
+
roleNameField.appendChild(roleNameInput);
|
|
3613
|
+
roleNameField.appendChild(element(doc, "span", "hive-field-hint", translate("settings.roleNameHint")));
|
|
3614
|
+
roleForm.appendChild(roleNameField);
|
|
3615
|
+
|
|
3616
|
+
const adapterField = element(doc, "label", "hive-field is-narrow");
|
|
3617
|
+
adapterField.appendChild(element(doc, "span", "hive-field-label", translate("settings.adapter")));
|
|
3618
|
+
const adapterInput = element(doc, "select", "hive-input hive-settings-role-adapter");
|
|
3619
|
+
setAttr(adapterInput, "aria-label", translate("settings.adapterAria"));
|
|
3620
|
+
for (const adapter of ["dsh", "claude", "codex"]) {
|
|
3621
|
+
const option = element(doc, "option", null, adapter);
|
|
3622
|
+
setAttr(option, "value", adapter);
|
|
3623
|
+
adapterInput.appendChild(option);
|
|
3624
|
+
}
|
|
3625
|
+
adapterInput.value = "dsh";
|
|
3626
|
+
adapterField.appendChild(adapterInput);
|
|
3627
|
+
roleForm.appendChild(adapterField);
|
|
3628
|
+
|
|
3629
|
+
const modelField = element(doc, "label", "hive-field is-narrow");
|
|
3630
|
+
modelField.appendChild(element(doc, "span", "hive-field-label", translate("settings.model")));
|
|
3631
|
+
const modelInput = element(doc, "input", "hive-input hive-settings-role-model");
|
|
3632
|
+
setAttr(modelInput, "type", "text");
|
|
3633
|
+
setAttr(modelInput, "autocomplete", "off");
|
|
3634
|
+
setAttr(modelInput, "placeholder", translate("settings.modelOptional"));
|
|
3635
|
+
setAttr(modelInput, "aria-label", translate("settings.modelAria"));
|
|
3636
|
+
modelField.appendChild(modelInput);
|
|
3637
|
+
roleForm.appendChild(modelField);
|
|
3638
|
+
roleSection.appendChild(roleForm);
|
|
3639
|
+
|
|
3640
|
+
const roleDescriptionField = element(doc, "label", "hive-field hive-settings-role-description");
|
|
3641
|
+
roleDescriptionField.appendChild(element(doc, "span", "hive-field-label", translate("settings.roleDescription")));
|
|
3642
|
+
const roleDescriptionInput = element(doc, "textarea", "hive-textarea hive-settings-role-description-input");
|
|
3643
|
+
setAttr(roleDescriptionInput, "maxlength", "2000");
|
|
3644
|
+
setAttr(roleDescriptionInput, "rows", "3");
|
|
3645
|
+
setAttr(roleDescriptionInput, "aria-label", translate("settings.roleDescriptionAria"));
|
|
3646
|
+
roleDescriptionField.appendChild(roleDescriptionInput);
|
|
3647
|
+
roleDescriptionField.appendChild(
|
|
3648
|
+
element(
|
|
3649
|
+
doc,
|
|
3650
|
+
"span",
|
|
3651
|
+
"hive-field-hint",
|
|
3652
|
+
translate("settings.roleDescriptionHint") + " · " + translate("settings.roleDescriptionMax"),
|
|
3653
|
+
),
|
|
3654
|
+
);
|
|
3655
|
+
roleSection.appendChild(roleDescriptionField);
|
|
3656
|
+
|
|
3657
|
+
const roleErrorNode = element(doc, "div", "hive-limits-error is-hidden", "");
|
|
3658
|
+
roleSection.appendChild(roleErrorNode);
|
|
3659
|
+
const addRoleButton = element(doc, "button", "hive-btn hive-settings-add-role", translate("settings.addRoleButton"));
|
|
3660
|
+
setAttr(addRoleButton, "type", "button");
|
|
3661
|
+
setAttr(addRoleButton, "title", translate("settings.addRoleAria"));
|
|
3662
|
+
setAttr(addRoleButton, "aria-label", translate("settings.addRoleAria"));
|
|
3663
|
+
addRoleButton.disabled = !writable;
|
|
3664
|
+
addRoleButton.addEventListener("click", () => {
|
|
3665
|
+
void saveRole();
|
|
3666
|
+
});
|
|
3667
|
+
if (!writable) {
|
|
3668
|
+
roleNameInput.disabled = true;
|
|
3669
|
+
adapterInput.disabled = true;
|
|
3670
|
+
modelInput.disabled = true;
|
|
3671
|
+
roleDescriptionInput.disabled = true;
|
|
3672
|
+
}
|
|
3673
|
+
body.appendChild(roleSection);
|
|
3674
|
+
|
|
3675
|
+
const limitsSection = element(doc, "section", "hive-settings-section");
|
|
3676
|
+
limitsSection.appendChild(element(doc, "div", "hive-settings-section-title", translate("limits.title")));
|
|
3677
|
+
limitsSection.appendChild(element(doc, "div", "hive-limits-description", translate("limits.description")));
|
|
3106
3678
|
const rowNodes = [];
|
|
3679
|
+
if (!supervisorAvailable) {
|
|
3680
|
+
limitsSection.appendChild(element(doc, "div", "hive-settings-note", translate("settings.supervisorUnavailable")));
|
|
3681
|
+
}
|
|
3107
3682
|
if (rows.length === 0) {
|
|
3108
|
-
|
|
3683
|
+
limitsSection.appendChild(element(doc, "div", "hive-limits-empty", translate("limits.none")));
|
|
3109
3684
|
} else {
|
|
3110
3685
|
const table = element(doc, "div", "hive-limits-table");
|
|
3111
3686
|
const header = element(doc, "div", "hive-limits-row is-head");
|
|
@@ -3126,30 +3701,41 @@ export function mount(root, options = {}) {
|
|
|
3126
3701
|
setAttr(input, "inputmode", "numeric");
|
|
3127
3702
|
setAttr(input, "aria-label", translate("limits.limitAria").replace("{role}", role.role));
|
|
3128
3703
|
input.value = supervisorNumber(role.limit) === null ? "5" : String(supervisorNumber(role.limit));
|
|
3704
|
+
input.disabled = !writable || !supervisorAvailable;
|
|
3129
3705
|
roleRow.appendChild(input);
|
|
3130
3706
|
roleRow.appendChild(element(doc, "span", "hive-limits-cell is-number", limitsNumberText(role.inFlight)));
|
|
3131
3707
|
roleRow.appendChild(element(doc, "span", "hive-limits-cell is-number", limitsNumberText(role.queued)));
|
|
3132
3708
|
table.appendChild(roleRow);
|
|
3133
3709
|
rowNodes.push({ role: role.role, input });
|
|
3134
3710
|
}
|
|
3135
|
-
|
|
3136
|
-
|
|
3711
|
+
limitsSection.appendChild(table);
|
|
3712
|
+
limitsSection.appendChild(element(doc, "div", "hive-limits-hint", translate("limits.defaultHint")));
|
|
3137
3713
|
}
|
|
3138
3714
|
|
|
3139
3715
|
const errorNode = element(doc, "div", "hive-limits-error is-hidden", "");
|
|
3140
|
-
|
|
3716
|
+
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);
|
|
3141
3723
|
dialog.appendChild(body);
|
|
3142
3724
|
|
|
3143
3725
|
const foot = element(doc, "div", "hive-dialog-foot");
|
|
3144
|
-
const
|
|
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"));
|
|
3145
3729
|
setAttr(saveButton, "type", "button");
|
|
3146
3730
|
setAttr(saveButton, "title", translate("limits.saveAria").replace("{repo}", repo));
|
|
3147
3731
|
setAttr(saveButton, "aria-label", translate("limits.saveAria").replace("{repo}", repo));
|
|
3148
|
-
saveButton.disabled = rows.length === 0;
|
|
3732
|
+
saveButton.disabled = !writable || !supervisorAvailable || rows.length === 0;
|
|
3149
3733
|
saveButton.addEventListener("click", () => {
|
|
3150
3734
|
void saveBeeCounts();
|
|
3151
3735
|
});
|
|
3152
|
-
|
|
3736
|
+
settingsActions.appendChild(addRoleButton);
|
|
3737
|
+
settingsActions.appendChild(saveButton);
|
|
3738
|
+
foot.appendChild(settingsActions);
|
|
3153
3739
|
dialog.appendChild(foot);
|
|
3154
3740
|
|
|
3155
3741
|
overlay.appendChild(dialog);
|
|
@@ -3162,17 +3748,105 @@ export function mount(root, options = {}) {
|
|
|
3162
3748
|
errorNode,
|
|
3163
3749
|
saveButton,
|
|
3164
3750
|
busy: false,
|
|
3751
|
+
writable,
|
|
3752
|
+
supervisorAvailable,
|
|
3753
|
+
roleName: roleNameInput,
|
|
3754
|
+
roleAdapter: adapterInput,
|
|
3755
|
+
roleModel: modelInput,
|
|
3756
|
+
roleDescription: roleDescriptionInput,
|
|
3757
|
+
roleButton: addRoleButton,
|
|
3758
|
+
roleErrorNode,
|
|
3759
|
+
roleBusy: false,
|
|
3165
3760
|
};
|
|
3166
|
-
limitsFocusables = [
|
|
3761
|
+
limitsFocusables = [
|
|
3762
|
+
closeButton,
|
|
3763
|
+
roleNameInput,
|
|
3764
|
+
adapterInput,
|
|
3765
|
+
modelInput,
|
|
3766
|
+
roleDescriptionInput,
|
|
3767
|
+
addRoleButton,
|
|
3768
|
+
...rowNodes.map((entry) => entry.input),
|
|
3769
|
+
saveButton,
|
|
3770
|
+
];
|
|
3167
3771
|
if (typeof doc.addEventListener === "function") {
|
|
3168
3772
|
doc.addEventListener("keydown", onLimitsKeydown);
|
|
3169
3773
|
}
|
|
3170
|
-
focusNode(
|
|
3774
|
+
focusNode(writable ? roleNameInput : closeButton);
|
|
3775
|
+
}
|
|
3776
|
+
|
|
3777
|
+
function setRoleError(message) {
|
|
3778
|
+
if (!limitsState) return;
|
|
3779
|
+
limitsState.roleErrorNode.textContent = message || "";
|
|
3780
|
+
limitsState.roleErrorNode.className = "hive-limits-error" + (message ? "" : " is-hidden");
|
|
3781
|
+
}
|
|
3782
|
+
|
|
3783
|
+
async function saveRole() {
|
|
3784
|
+
const state = limitsState;
|
|
3785
|
+
if (!state || state.roleBusy || !state.writable) return;
|
|
3786
|
+
const name = String(state.roleName.value === null || state.roleName.value === undefined ? "" : state.roleName.value).trim();
|
|
3787
|
+
if (!/^[a-z][a-z0-9-]{1,31}$/.test(name)) {
|
|
3788
|
+
setRoleError(translate("settings.roleInvalid"));
|
|
3789
|
+
focusNode(state.roleName);
|
|
3790
|
+
return;
|
|
3791
|
+
}
|
|
3792
|
+
const adapter = ["dsh", "claude", "codex"].includes(String(state.roleAdapter.value || "dsh"))
|
|
3793
|
+
? String(state.roleAdapter.value || "dsh")
|
|
3794
|
+
: "dsh";
|
|
3795
|
+
const model = String(state.roleModel.value === null || state.roleModel.value === undefined ? "" : state.roleModel.value).trim();
|
|
3796
|
+
if (model && !/^[A-Za-z0-9._:-]{1,64}$/.test(model)) {
|
|
3797
|
+
setRoleError(translate("settings.modelInvalid"));
|
|
3798
|
+
focusNode(state.roleModel);
|
|
3799
|
+
return;
|
|
3800
|
+
}
|
|
3801
|
+
const description = String(
|
|
3802
|
+
state.roleDescription.value === null || state.roleDescription.value === undefined ? "" : state.roleDescription.value,
|
|
3803
|
+
).trim();
|
|
3804
|
+
if (description.length > 2000) {
|
|
3805
|
+
setRoleError(translate("settings.descriptionTooLong"));
|
|
3806
|
+
focusNode(state.roleDescription);
|
|
3807
|
+
return;
|
|
3808
|
+
}
|
|
3809
|
+
|
|
3810
|
+
state.roleBusy = true;
|
|
3811
|
+
state.roleName.disabled = true;
|
|
3812
|
+
state.roleAdapter.disabled = true;
|
|
3813
|
+
state.roleModel.disabled = true;
|
|
3814
|
+
state.roleDescription.disabled = true;
|
|
3815
|
+
state.roleButton.disabled = true;
|
|
3816
|
+
state.roleButton.textContent = translate("settings.addingRole");
|
|
3817
|
+
setRoleError("");
|
|
3818
|
+
try {
|
|
3819
|
+
const body = { name, adapter, description };
|
|
3820
|
+
if (model) body.model = model;
|
|
3821
|
+
const result = await requestAction("roles-add", body);
|
|
3822
|
+
if (!result.ok) {
|
|
3823
|
+
const detail = actionErrorDetail(result.error) || translate("settings.roleFailed");
|
|
3824
|
+
setRoleError(/already exists/i.test(detail) ? translate("settings.roleExists") : detail);
|
|
3825
|
+
return;
|
|
3826
|
+
}
|
|
3827
|
+
await refresh();
|
|
3828
|
+
await refreshSupervisor(true);
|
|
3829
|
+
if (destroyed) return;
|
|
3830
|
+
const trigger = limitsTriggerButton;
|
|
3831
|
+
closeLimitsDialog(false);
|
|
3832
|
+
openLimitsDialog(trigger);
|
|
3833
|
+
showToast("success", translate("settings.roleAdded"), name);
|
|
3834
|
+
} finally {
|
|
3835
|
+
if (!destroyed && limitsState === state) {
|
|
3836
|
+
state.roleBusy = false;
|
|
3837
|
+
state.roleName.disabled = false;
|
|
3838
|
+
state.roleAdapter.disabled = false;
|
|
3839
|
+
state.roleModel.disabled = false;
|
|
3840
|
+
state.roleDescription.disabled = false;
|
|
3841
|
+
state.roleButton.disabled = false;
|
|
3842
|
+
state.roleButton.textContent = translate("settings.addRoleButton");
|
|
3843
|
+
}
|
|
3844
|
+
}
|
|
3171
3845
|
}
|
|
3172
3846
|
|
|
3173
3847
|
async function saveBeeCounts() {
|
|
3174
3848
|
const state = limitsState;
|
|
3175
|
-
if (!state || state.busy) return;
|
|
3849
|
+
if (!state || state.busy || !state.writable || !state.supervisorAvailable) return;
|
|
3176
3850
|
const roleLimits = {};
|
|
3177
3851
|
let invalid = false;
|
|
3178
3852
|
for (const entry of state.rows) {
|
|
@@ -3319,25 +3993,212 @@ export function mount(root, options = {}) {
|
|
|
3319
3993
|
if (!destroyed) showToast("success", translate("toast.planWritten"), translate("toast.pickupHint"));
|
|
3320
3994
|
}
|
|
3321
3995
|
|
|
3996
|
+
|
|
3997
|
+
// --- new task dialog -----------------------------------------------------
|
|
3998
|
+
|
|
3999
|
+
function onAddKeydown(event) {
|
|
4000
|
+
if (event && (event.key === "Escape" || event.key === "Esc")) closeAddDialog();
|
|
4001
|
+
}
|
|
4002
|
+
|
|
4003
|
+
function closeAddDialog(restoreFocus = true) {
|
|
4004
|
+
if (addOverlay && addOverlay.parentNode) addOverlay.parentNode.removeChild(addOverlay);
|
|
4005
|
+
addOverlay = null;
|
|
4006
|
+
addDialogNode = null;
|
|
4007
|
+
addState = null;
|
|
4008
|
+
addFocusables = [];
|
|
4009
|
+
if (typeof doc.removeEventListener === "function") {
|
|
4010
|
+
doc.removeEventListener("keydown", onAddKeydown);
|
|
4011
|
+
}
|
|
4012
|
+
if (restoreFocus && !destroyed) focusNode(addTriggerButton);
|
|
4013
|
+
addTriggerButton = null;
|
|
4014
|
+
}
|
|
4015
|
+
|
|
4016
|
+
function setAddError(message) {
|
|
4017
|
+
if (!addState) return;
|
|
4018
|
+
addState.error.textContent = message || "";
|
|
4019
|
+
addState.error.className = message ? "hive-limits-error" : "hive-limits-error is-hidden";
|
|
4020
|
+
}
|
|
4021
|
+
|
|
4022
|
+
function addField(labelKey, input, hintKey) {
|
|
4023
|
+
const field = element(doc, "label", "hive-field");
|
|
4024
|
+
field.appendChild(element(doc, "span", "hive-field-label", translate(labelKey)));
|
|
4025
|
+
field.appendChild(input);
|
|
4026
|
+
if (hintKey) field.appendChild(element(doc, "span", "hive-field-hint", translate(hintKey)));
|
|
4027
|
+
return field;
|
|
4028
|
+
}
|
|
4029
|
+
|
|
4030
|
+
function openAddDialog(trigger) {
|
|
4031
|
+
if (destroyed || !lastModel || !lastModel.writable) return;
|
|
4032
|
+
closeHelp(false);
|
|
4033
|
+
closePlanDialog(false);
|
|
4034
|
+
closeLimitsDialog(false);
|
|
4035
|
+
closeDrawer(false);
|
|
4036
|
+
closeAddDialog(false);
|
|
4037
|
+
addTriggerButton = trigger || null;
|
|
4038
|
+
|
|
4039
|
+
const overlay = element(doc, "div", "hive-overlay hive-dialog-scrim");
|
|
4040
|
+
overlay.addEventListener("click", (event) => {
|
|
4041
|
+
if (!event || !event.target || event.target === overlay) closeAddDialog();
|
|
4042
|
+
});
|
|
4043
|
+
|
|
4044
|
+
const dialog = element(doc, "div", "hive-dialog hive-add-dialog");
|
|
4045
|
+
setAttr(dialog, "role", "dialog");
|
|
4046
|
+
setAttr(dialog, "aria-modal", "true");
|
|
4047
|
+
setAttr(dialog, "aria-label", translate("add.dialogTitle"));
|
|
4048
|
+
|
|
4049
|
+
const head = element(doc, "div", "hive-dialog-head");
|
|
4050
|
+
const titleBox = element(doc, "div", "hive-dialog-head-title");
|
|
4051
|
+
titleBox.appendChild(element(doc, "h2", "hive-dialog-title", translate("add.dialogTitle")));
|
|
4052
|
+
head.appendChild(titleBox);
|
|
4053
|
+
const closeButton = element(doc, "button", "hive-btn hive-btn-ghost hive-add-close", "×");
|
|
4054
|
+
setAttr(closeButton, "type", "button");
|
|
4055
|
+
setAttr(closeButton, "title", translate("settings.closeAria"));
|
|
4056
|
+
setAttr(closeButton, "aria-label", translate("settings.closeAria"));
|
|
4057
|
+
closeButton.addEventListener("click", () => {
|
|
4058
|
+
closeAddDialog();
|
|
4059
|
+
});
|
|
4060
|
+
head.appendChild(closeButton);
|
|
4061
|
+
dialog.appendChild(head);
|
|
4062
|
+
|
|
4063
|
+
const body = element(doc, "div", "hive-dialog-body hive-add-body");
|
|
4064
|
+
const titleInput = element(doc, "input", "hive-input hive-add-title");
|
|
4065
|
+
setAttr(titleInput, "type", "text");
|
|
4066
|
+
setAttr(titleInput, "maxlength", "2000");
|
|
4067
|
+
setAttr(titleInput, "autocomplete", "off");
|
|
4068
|
+
setAttr(titleInput, "aria-label", translate("add.titleAria"));
|
|
4069
|
+
body.appendChild(addField("add.title", titleInput));
|
|
4070
|
+
|
|
4071
|
+
const roleInput = element(doc, "input", "hive-input hive-add-role");
|
|
4072
|
+
setAttr(roleInput, "type", "text");
|
|
4073
|
+
setAttr(roleInput, "autocomplete", "off");
|
|
4074
|
+
setAttr(roleInput, "aria-label", translate("add.roleAria"));
|
|
4075
|
+
roleInput.value = "coder";
|
|
4076
|
+
body.appendChild(addField("add.role", roleInput));
|
|
4077
|
+
|
|
4078
|
+
const scopeInput = element(doc, "input", "hive-input hive-add-scope");
|
|
4079
|
+
setAttr(scopeInput, "type", "text");
|
|
4080
|
+
setAttr(scopeInput, "autocomplete", "off");
|
|
4081
|
+
setAttr(scopeInput, "aria-label", translate("add.scopeAria"));
|
|
4082
|
+
body.appendChild(addField("add.scope", scopeInput));
|
|
4083
|
+
|
|
4084
|
+
const afterInput = element(doc, "input", "hive-input hive-add-after");
|
|
4085
|
+
setAttr(afterInput, "type", "text");
|
|
4086
|
+
setAttr(afterInput, "autocomplete", "off");
|
|
4087
|
+
setAttr(afterInput, "aria-label", translate("add.afterAria"));
|
|
4088
|
+
body.appendChild(addField("add.after", afterInput));
|
|
4089
|
+
|
|
4090
|
+
const acceptanceInput = element(doc, "textarea", "hive-textarea hive-add-acceptance");
|
|
4091
|
+
setAttr(acceptanceInput, "maxlength", "2000");
|
|
4092
|
+
setAttr(acceptanceInput, "rows", "3");
|
|
4093
|
+
setAttr(acceptanceInput, "aria-label", translate("add.acceptanceAria"));
|
|
4094
|
+
body.appendChild(addField("add.acceptance", acceptanceInput));
|
|
4095
|
+
|
|
4096
|
+
const errorNode = element(doc, "div", "hive-limits-error is-hidden", "");
|
|
4097
|
+
body.appendChild(errorNode);
|
|
4098
|
+
dialog.appendChild(body);
|
|
4099
|
+
|
|
4100
|
+
const foot = element(doc, "div", "hive-dialog-foot");
|
|
4101
|
+
const cancelButton = element(doc, "button", "hive-btn hive-btn-ghost", translate("add.cancel"));
|
|
4102
|
+
setAttr(cancelButton, "type", "button");
|
|
4103
|
+
cancelButton.addEventListener("click", () => {
|
|
4104
|
+
closeAddDialog();
|
|
4105
|
+
});
|
|
4106
|
+
const submitButton = element(doc, "button", "hive-btn hive-add-submit", translate("add.submit"));
|
|
4107
|
+
setAttr(submitButton, "type", "button");
|
|
4108
|
+
submitButton.addEventListener("click", () => {
|
|
4109
|
+
void submitAdd();
|
|
4110
|
+
});
|
|
4111
|
+
foot.appendChild(cancelButton);
|
|
4112
|
+
foot.appendChild(submitButton);
|
|
4113
|
+
dialog.appendChild(foot);
|
|
4114
|
+
|
|
4115
|
+
overlay.appendChild(dialog);
|
|
4116
|
+
frame.appendChild(overlay);
|
|
4117
|
+
addOverlay = overlay;
|
|
4118
|
+
addDialogNode = dialog;
|
|
4119
|
+
addState = {
|
|
4120
|
+
overlay,
|
|
4121
|
+
dialog,
|
|
4122
|
+
title: titleInput,
|
|
4123
|
+
role: roleInput,
|
|
4124
|
+
scope: scopeInput,
|
|
4125
|
+
after: afterInput,
|
|
4126
|
+
acceptance: acceptanceInput,
|
|
4127
|
+
error: errorNode,
|
|
4128
|
+
submit: submitButton,
|
|
4129
|
+
cancel: cancelButton,
|
|
4130
|
+
busy: false,
|
|
4131
|
+
};
|
|
4132
|
+
addFocusables = [closeButton, titleInput, roleInput, scopeInput, afterInput, acceptanceInput, cancelButton, submitButton];
|
|
4133
|
+
if (typeof doc.addEventListener === "function") {
|
|
4134
|
+
doc.addEventListener("keydown", onAddKeydown);
|
|
4135
|
+
}
|
|
4136
|
+
focusNode(titleInput);
|
|
4137
|
+
}
|
|
4138
|
+
|
|
4139
|
+
function setAddBusy(busy) {
|
|
4140
|
+
if (!addState) return;
|
|
4141
|
+
addState.busy = busy;
|
|
4142
|
+
addState.title.disabled = busy;
|
|
4143
|
+
addState.role.disabled = busy;
|
|
4144
|
+
addState.scope.disabled = busy;
|
|
4145
|
+
addState.after.disabled = busy;
|
|
4146
|
+
addState.acceptance.disabled = busy;
|
|
4147
|
+
addState.cancel.disabled = busy;
|
|
4148
|
+
addState.submit.disabled = busy;
|
|
4149
|
+
addState.submit.textContent = busy ? translate("add.submitting") : translate("add.submit");
|
|
4150
|
+
}
|
|
4151
|
+
|
|
4152
|
+
async function submitAdd() {
|
|
4153
|
+
if (!addState || addState.busy) return;
|
|
4154
|
+
const title = String(addState.title.value || "").trim();
|
|
4155
|
+
if (!title) {
|
|
4156
|
+
setAddError(translate("add.required"));
|
|
4157
|
+
focusNode(addState.title);
|
|
4158
|
+
return;
|
|
4159
|
+
}
|
|
4160
|
+
const role = String(addState.role.value || "").trim() || "coder";
|
|
4161
|
+
const body = {
|
|
4162
|
+
title,
|
|
4163
|
+
role,
|
|
4164
|
+
scope: splitList(String(addState.scope.value || "")),
|
|
4165
|
+
after: splitList(String(addState.after.value || "")),
|
|
4166
|
+
acceptance: String(addState.acceptance.value || "").trim(),
|
|
4167
|
+
};
|
|
4168
|
+
setAddError("");
|
|
4169
|
+
setAddBusy(true);
|
|
4170
|
+
const result = await postAction("add", body);
|
|
4171
|
+
if (destroyed || !addState) return;
|
|
4172
|
+
if (result) {
|
|
4173
|
+
closeAddDialog();
|
|
4174
|
+
return;
|
|
4175
|
+
}
|
|
4176
|
+
setAddBusy(false);
|
|
4177
|
+
setAddError(translate("status.actionFailed"));
|
|
4178
|
+
}
|
|
4179
|
+
|
|
3322
4180
|
// --- drawer --------------------------------------------------------------
|
|
3323
4181
|
|
|
3324
4182
|
function onDrawerKeydown(event) {
|
|
3325
4183
|
if (event && (event.key === "Escape" || event.key === "Esc")) closeDrawer();
|
|
3326
4184
|
}
|
|
3327
4185
|
|
|
3328
|
-
function closeDrawer() {
|
|
4186
|
+
function closeDrawer(restoreFocus = true) {
|
|
3329
4187
|
if (drawerNode && drawerNode.parentNode) drawerNode.parentNode.removeChild(drawerNode);
|
|
3330
4188
|
drawerNode = null;
|
|
3331
4189
|
drawerState = null;
|
|
3332
4190
|
if (typeof doc.removeEventListener === "function") {
|
|
3333
4191
|
doc.removeEventListener("keydown", onDrawerKeydown);
|
|
3334
4192
|
}
|
|
4193
|
+
if (restoreFocus && !destroyed) focusNode(drawerTrigger);
|
|
4194
|
+
drawerTrigger = null;
|
|
3335
4195
|
}
|
|
3336
4196
|
|
|
3337
4197
|
function mountDrawer(eyebrow, title, ariaLabel) {
|
|
3338
4198
|
closeHelp(false);
|
|
3339
4199
|
closePlanDialog(false);
|
|
3340
|
-
|
|
4200
|
+
closeAddDialog(false);
|
|
4201
|
+
closeDrawer(false);
|
|
3341
4202
|
|
|
3342
4203
|
const panel = element(doc, "aside", "hive-drawer");
|
|
3343
4204
|
setAttr(panel, "role", "dialog");
|
|
@@ -3382,45 +4243,108 @@ export function mount(root, options = {}) {
|
|
|
3382
4243
|
body.appendChild(element(doc, "pre", "hive-json", JSON.stringify(raw, null, 2)));
|
|
3383
4244
|
}
|
|
3384
4245
|
|
|
3385
|
-
function openDrawer(card, lane) {
|
|
4246
|
+
function openDrawer(card, lane, trigger) {
|
|
4247
|
+
closeHelp(false);
|
|
4248
|
+
closePlanDialog(false);
|
|
4249
|
+
closeAddDialog(false);
|
|
4250
|
+
closeDrawer(false);
|
|
4251
|
+
drawerTrigger = trigger || null;
|
|
4252
|
+
|
|
3386
4253
|
const raw = findRawTask(card) || { ...card, state: lane };
|
|
3387
4254
|
const title = card.title || translate("card.untitled");
|
|
3388
|
-
const
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
);
|
|
3393
|
-
|
|
3394
|
-
const
|
|
4255
|
+
const id = card.id || translate("card.noId");
|
|
4256
|
+
const role = asString(card.role) || "—";
|
|
4257
|
+
const status = laneLabel(lane);
|
|
4258
|
+
const repo = lastModel ? lastModel.repo : "";
|
|
4259
|
+
const ariaLabel = translate("drawer.cardAria") + " " + (card.title || card.id || translate("card.untitled"));
|
|
4260
|
+
|
|
4261
|
+
const overlay = element(doc, "div", "hive-overlay hive-dialog-scrim hive-card-scrim");
|
|
4262
|
+
overlay.addEventListener("click", (event) => {
|
|
4263
|
+
if (!event || !event.target || event.target === overlay) closeDrawer();
|
|
4264
|
+
});
|
|
3395
4265
|
|
|
4266
|
+
const dialog = element(doc, "div", "hive-dialog hive-card-dialog hive-drawer");
|
|
4267
|
+
setAttr(dialog, "role", "dialog");
|
|
4268
|
+
setAttr(dialog, "aria-modal", "true");
|
|
4269
|
+
setAttr(dialog, "aria-label", ariaLabel);
|
|
4270
|
+
|
|
4271
|
+
const head = element(doc, "div", "hive-dialog-head");
|
|
4272
|
+
const titleBox = element(doc, "div", "hive-dialog-head-title");
|
|
4273
|
+
titleBox.appendChild(element(doc, "h2", "hive-dialog-title", title));
|
|
4274
|
+
const subline = element(doc, "div", "hive-card-subline");
|
|
4275
|
+
const sublineText = [id, role, status, repo].filter(Boolean).join(" · ");
|
|
4276
|
+
subline.textContent = sublineText;
|
|
4277
|
+
setAttr(subline, "title", sublineText);
|
|
4278
|
+
titleBox.appendChild(subline);
|
|
4279
|
+
head.appendChild(titleBox);
|
|
4280
|
+
const closeButton = element(doc, "button", "hive-btn hive-btn-ghost hive-card-close", "×");
|
|
4281
|
+
setAttr(closeButton, "type", "button");
|
|
4282
|
+
setAttr(closeButton, "title", translate("drawer.closeAria"));
|
|
4283
|
+
setAttr(closeButton, "aria-label", translate("drawer.closeAria"));
|
|
4284
|
+
closeButton.addEventListener("click", () => {
|
|
4285
|
+
closeDrawer();
|
|
4286
|
+
});
|
|
4287
|
+
head.appendChild(closeButton);
|
|
4288
|
+
dialog.appendChild(head);
|
|
4289
|
+
|
|
4290
|
+
const body = element(doc, "div", "hive-dialog-body hive-card-body");
|
|
4291
|
+
const details = element(doc, "details", "hive-card-json");
|
|
4292
|
+
const summary = element(doc, "summary", "hive-card-json-summary", translate("drawer.rawJson"));
|
|
4293
|
+
const pre = element(doc, "pre", "hive-json", JSON.stringify(raw, null, 2));
|
|
4294
|
+
details.appendChild(summary);
|
|
4295
|
+
details.appendChild(pre);
|
|
4296
|
+
body.appendChild(details);
|
|
4297
|
+
dialog.appendChild(body);
|
|
4298
|
+
|
|
4299
|
+
const actions = actionsForState(lane, lastModel ? lastModel.writable : false);
|
|
4300
|
+
if (actions.length === 0) {
|
|
4301
|
+
body.appendChild(
|
|
4302
|
+
element(
|
|
4303
|
+
doc,
|
|
4304
|
+
"div",
|
|
4305
|
+
"hive-note",
|
|
4306
|
+
lastModel && lastModel.writable ? translate("drawer.noActions") : translate("drawer.readOnly"),
|
|
4307
|
+
),
|
|
4308
|
+
);
|
|
4309
|
+
}
|
|
3396
4310
|
if (actions.length > 0) {
|
|
3397
|
-
const
|
|
3398
|
-
setAttr(
|
|
4311
|
+
const foot = element(doc, "div", "hive-dialog-foot hive-card-actions");
|
|
4312
|
+
setAttr(foot, "aria-label", translate("drawer.cardActions"));
|
|
4313
|
+
const claimed = asString(card.state || lane) === "claimed";
|
|
3399
4314
|
for (const action of actions) {
|
|
3400
|
-
const
|
|
4315
|
+
const destructive = action.name === "remove";
|
|
4316
|
+
const button = element(
|
|
4317
|
+
doc,
|
|
4318
|
+
"button",
|
|
4319
|
+
"hive-btn" + (destructive ? " hive-btn-danger" : ""),
|
|
4320
|
+
translate(action.labelKey),
|
|
4321
|
+
);
|
|
3401
4322
|
setAttr(button, "type", "button");
|
|
3402
|
-
|
|
3403
|
-
|
|
4323
|
+
// The panel never sends --force, so a claimed card's delete control is
|
|
4324
|
+
// rendered but disabled, with the release/reopen reason in its title.
|
|
4325
|
+
const hint = destructive && claimed ? translate("drawer.removeClaimed") : translate(action.helpKey);
|
|
4326
|
+
setAttr(button, "title", hint);
|
|
4327
|
+
setAttr(button, "aria-label", hint);
|
|
4328
|
+
if (destructive && claimed) {
|
|
4329
|
+
button.disabled = true;
|
|
4330
|
+
setAttr(button, "aria-disabled", "true");
|
|
4331
|
+
}
|
|
3404
4332
|
button.addEventListener("click", () => {
|
|
3405
4333
|
void runCardAction(action.name, card, lane);
|
|
3406
4334
|
});
|
|
3407
|
-
|
|
4335
|
+
foot.appendChild(button);
|
|
3408
4336
|
}
|
|
3409
|
-
|
|
3410
|
-
} else {
|
|
3411
|
-
const note = element(
|
|
3412
|
-
doc,
|
|
3413
|
-
"div",
|
|
3414
|
-
"hive-note",
|
|
3415
|
-
lastModel && lastModel.writable ? translate("drawer.noActions") : translate("drawer.readOnly"),
|
|
3416
|
-
);
|
|
3417
|
-
body.appendChild(note);
|
|
4337
|
+
dialog.appendChild(foot);
|
|
3418
4338
|
}
|
|
3419
4339
|
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
4340
|
+
overlay.appendChild(dialog);
|
|
4341
|
+
frame.appendChild(overlay);
|
|
4342
|
+
drawerNode = overlay;
|
|
4343
|
+
drawerState = { kind: "card", card, lane };
|
|
4344
|
+
if (typeof doc.addEventListener === "function") {
|
|
4345
|
+
doc.addEventListener("keydown", onDrawerKeydown);
|
|
4346
|
+
}
|
|
4347
|
+
focusNode(closeButton);
|
|
3424
4348
|
}
|
|
3425
4349
|
|
|
3426
4350
|
// --- actions -------------------------------------------------------------
|
|
@@ -3569,34 +4493,12 @@ export function mount(root, options = {}) {
|
|
|
3569
4493
|
case "mode":
|
|
3570
4494
|
await postAction("mode", action.body || { mode: "free", reason: "panel" });
|
|
3571
4495
|
break;
|
|
3572
|
-
case "add":
|
|
3573
|
-
|
|
3574
|
-
if (title === null || !title.trim()) return;
|
|
3575
|
-
const role = ask(translate("prompt.role"), "coder");
|
|
3576
|
-
if (role === null) return;
|
|
3577
|
-
const scope = ask(translate("prompt.scope"), "");
|
|
3578
|
-
if (scope === null) return;
|
|
3579
|
-
const after = ask(translate("prompt.after"), "");
|
|
3580
|
-
if (after === null) return;
|
|
3581
|
-
await postAction("add", {
|
|
3582
|
-
title: title.trim(),
|
|
3583
|
-
role: role.trim() || "coder",
|
|
3584
|
-
scope: splitList(scope),
|
|
3585
|
-
after: splitList(after),
|
|
3586
|
-
});
|
|
4496
|
+
case "add":
|
|
4497
|
+
openAddDialog(triggerButton);
|
|
3587
4498
|
break;
|
|
3588
|
-
}
|
|
3589
4499
|
case "plan":
|
|
3590
4500
|
openPlanDialog(triggerButton);
|
|
3591
4501
|
break;
|
|
3592
|
-
case "commit": {
|
|
3593
|
-
const message = ask(translate("prompt.commitMessage"), "panel commit");
|
|
3594
|
-
if (message === null) return;
|
|
3595
|
-
const paths = ask(translate("prompt.paths"), "");
|
|
3596
|
-
if (paths === null) return;
|
|
3597
|
-
await postAction("commit", { message: message.trim() || "panel commit", set: splitList(paths) });
|
|
3598
|
-
break;
|
|
3599
|
-
}
|
|
3600
4502
|
default:
|
|
3601
4503
|
break;
|
|
3602
4504
|
}
|
|
@@ -3629,10 +4531,18 @@ export function mount(root, options = {}) {
|
|
|
3629
4531
|
case "retry":
|
|
3630
4532
|
ok = await postAction("retry", { id: card.id });
|
|
3631
4533
|
break;
|
|
4534
|
+
case "remove": {
|
|
4535
|
+
const name = card.title || card.id || translate("card.untitled");
|
|
4536
|
+
const message = translate("confirm.remove").replace("{title}", name);
|
|
4537
|
+
if (!askConfirm(message)) return;
|
|
4538
|
+
ok = await postAction("remove", { id: card.id });
|
|
4539
|
+
break;
|
|
4540
|
+
}
|
|
3632
4541
|
default:
|
|
3633
4542
|
break;
|
|
3634
4543
|
}
|
|
3635
4544
|
if (ok && !destroyed) {
|
|
4545
|
+
if (name === "remove") showToast("success", translate("toast.taskRemoved"), "");
|
|
3636
4546
|
closeDrawer();
|
|
3637
4547
|
void refresh();
|
|
3638
4548
|
}
|
|
@@ -3781,10 +4691,9 @@ export function mount(root, options = {}) {
|
|
|
3781
4691
|
renderSupervisorContent();
|
|
3782
4692
|
} catch {
|
|
3783
4693
|
supervisorData = [];
|
|
4694
|
+
supervisorInlineRow = null;
|
|
3784
4695
|
try {
|
|
3785
|
-
|
|
3786
|
-
supervisorLimitsButton.className = "hive-btn hive-btn-ghost hive-supervisor-limits is-hidden";
|
|
3787
|
-
if (limitsDialogNode) closeLimitsDialog(false);
|
|
4696
|
+
supervisorInline.className = "hive-supervisor-inline is-hidden";
|
|
3788
4697
|
} catch {
|
|
3789
4698
|
// Supervisor rendering is optional; never let it break the panel.
|
|
3790
4699
|
}
|
|
@@ -3792,53 +4701,38 @@ export function mount(root, options = {}) {
|
|
|
3792
4701
|
}
|
|
3793
4702
|
|
|
3794
4703
|
function renderSupervisorContent() {
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
const canConfigure = Boolean(lastModel && lastModel.writable);
|
|
3806
|
-
supervisorLimitsButton.className = "hive-btn hive-btn-ghost hive-supervisor-limits" + (canConfigure ? "" : " is-hidden");
|
|
3807
|
-
supervisorLimitsButton.textContent = translate("limits.open");
|
|
3808
|
-
setAttr(supervisorLimitsButton, "title", translate("limits.openAria"));
|
|
3809
|
-
setAttr(supervisorLimitsButton, "aria-label", translate("limits.openAria"));
|
|
3810
|
-
if (!canConfigure && limitsDialogNode) closeLimitsDialog(false);
|
|
3811
|
-
for (const row of supervisorData) {
|
|
3812
|
-
const item = element(doc, "span", "hive-supervisor-item");
|
|
3813
|
-
const path = element(doc, "code", "hive-supervisor-path", row.repo);
|
|
3814
|
-
setAttr(path, "title", row.repo);
|
|
3815
|
-
item.appendChild(path);
|
|
3816
|
-
|
|
3817
|
-
let stateLabel = translate("supervisor.idle");
|
|
3818
|
-
if (row.state === "running") {
|
|
3819
|
-
stateLabel =
|
|
3820
|
-
row.running === null || row.running === undefined
|
|
3821
|
-
? translate("supervisor.running")
|
|
3822
|
-
: translate("supervisor.runningCount").replace("{count}", String(row.running));
|
|
3823
|
-
} else if (row.state === "backoff") {
|
|
3824
|
-
stateLabel = translate("supervisor.backoff");
|
|
3825
|
-
} else if (row.state === "paused") {
|
|
3826
|
-
stateLabel = translate("supervisor.paused");
|
|
3827
|
-
}
|
|
3828
|
-
item.appendChild(element(doc, "span", "hive-supervisor-state is-" + row.state, stateLabel));
|
|
4704
|
+
supervisorInlineRow = null;
|
|
4705
|
+
supervisorInline.className = "hive-supervisor-inline is-hidden";
|
|
4706
|
+
supervisorInlineState.className = "hive-supervisor-inline-state";
|
|
4707
|
+
supervisorInlineState.textContent = "";
|
|
4708
|
+
supervisorInlineResume.className = "hive-btn hive-supervisor-inline-resume is-hidden";
|
|
4709
|
+
setAttr(supervisorInline, "aria-label", translate("supervisor.aria"));
|
|
4710
|
+
supervisorInlineLabel.textContent = translate("supervisor.label");
|
|
4711
|
+
if (!lastModel || !Array.isArray(supervisorData) || supervisorData.length === 0) return;
|
|
4712
|
+
const row = supervisorData.find((entry) => entry.repo === lastModel.repo);
|
|
4713
|
+
if (!row) return;
|
|
3829
4714
|
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
4715
|
+
supervisorInlineRow = row;
|
|
4716
|
+
supervisorInline.className = "hive-supervisor-inline";
|
|
4717
|
+
let stateLabel = translate("supervisor.idle");
|
|
4718
|
+
if (row.state === "running") {
|
|
4719
|
+
stateLabel =
|
|
4720
|
+
row.running === null || row.running === undefined
|
|
4721
|
+
? translate("supervisor.running")
|
|
4722
|
+
: translate("supervisor.runningCount").replace("{count}", String(row.running));
|
|
4723
|
+
} else if (row.state === "backoff") {
|
|
4724
|
+
stateLabel = translate("supervisor.backoff");
|
|
4725
|
+
} else if (row.state === "paused") {
|
|
4726
|
+
stateLabel = translate("supervisor.paused");
|
|
4727
|
+
}
|
|
4728
|
+
supervisorInlineState.className = "hive-supervisor-inline-state is-" + row.state;
|
|
4729
|
+
supervisorInlineState.textContent = stateLabel;
|
|
4730
|
+
|
|
4731
|
+
if (row.state === "paused") {
|
|
4732
|
+
const aria = translate("supervisor.resumeAria").replace("{repo}", row.repo);
|
|
4733
|
+
supervisorInlineResume.className = "hive-btn hive-supervisor-inline-resume";
|
|
4734
|
+
setAttr(supervisorInlineResume, "title", aria);
|
|
4735
|
+
setAttr(supervisorInlineResume, "aria-label", aria);
|
|
3842
4736
|
}
|
|
3843
4737
|
}
|
|
3844
4738
|
|
|
@@ -4076,11 +4970,11 @@ export function mount(root, options = {}) {
|
|
|
4076
4970
|
foot.appendChild(element(doc, "span", "hive-card-state", laneLabel(lane)));
|
|
4077
4971
|
node.appendChild(foot);
|
|
4078
4972
|
|
|
4079
|
-
node.addEventListener("click", () => openDrawer(card, lane));
|
|
4973
|
+
node.addEventListener("click", () => openDrawer(card, lane, node));
|
|
4080
4974
|
node.addEventListener("keydown", (event) => {
|
|
4081
4975
|
if (!event || (event.key !== "Enter" && event.key !== " ")) return;
|
|
4082
4976
|
if (typeof event.preventDefault === "function") event.preventDefault();
|
|
4083
|
-
openDrawer(card, lane);
|
|
4977
|
+
openDrawer(card, lane, node);
|
|
4084
4978
|
});
|
|
4085
4979
|
return node;
|
|
4086
4980
|
}
|
|
@@ -4206,8 +5100,6 @@ export function mount(root, options = {}) {
|
|
|
4206
5100
|
function render(model) {
|
|
4207
5101
|
repoNode.textContent = model.repo || "—";
|
|
4208
5102
|
setAttr(repoNode, "title", model.repo);
|
|
4209
|
-
timeNode.textContent = model.at ? formatStamp(model.at) : "—";
|
|
4210
|
-
setAttr(timeNode, "datetime", model.at);
|
|
4211
5103
|
|
|
4212
5104
|
renderInit(model);
|
|
4213
5105
|
renderQueenHint(model);
|
|
@@ -4230,6 +5122,7 @@ export function mount(root, options = {}) {
|
|
|
4230
5122
|
if (helpWasOpen) closeHelp(false);
|
|
4231
5123
|
if (planDialogNode) closePlanDialog(false);
|
|
4232
5124
|
if (limitsDialogNode) closeLimitsDialog(false);
|
|
5125
|
+
if (addDialogNode) closeAddDialog(false);
|
|
4233
5126
|
try {
|
|
4234
5127
|
applyChrome();
|
|
4235
5128
|
if (lastModel) render(lastModel);
|
|
@@ -4354,6 +5247,7 @@ export function mount(root, options = {}) {
|
|
|
4354
5247
|
closeHelp(false);
|
|
4355
5248
|
closePlanDialog(false);
|
|
4356
5249
|
closeLimitsDialog(false);
|
|
5250
|
+
closeAddDialog(false);
|
|
4357
5251
|
closeToast();
|
|
4358
5252
|
closeDrawer();
|
|
4359
5253
|
if (frame.parentNode) frame.parentNode.removeChild(frame);
|