opencode-worktree 0.3.2 → 0.3.3
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/bin/opencode-worktree +0 -0
- package/package.json +1 -1
- package/src/ui.ts +62 -38
package/bin/opencode-worktree
CHANGED
|
File without changes
|
package/package.json
CHANGED
package/src/ui.ts
CHANGED
|
@@ -1063,7 +1063,7 @@ class WorktreeSelector {
|
|
|
1063
1063
|
const branchDisplay = worktree.branch || basename(worktree.path);
|
|
1064
1064
|
|
|
1065
1065
|
// Build dialog title
|
|
1066
|
-
const title =
|
|
1066
|
+
const title = "DELETE WORKTREE";
|
|
1067
1067
|
|
|
1068
1068
|
this.confirmContainer = new BoxRenderable(this.renderer, {
|
|
1069
1069
|
id: "confirm-container",
|
|
@@ -1071,18 +1071,30 @@ class WorktreeSelector {
|
|
|
1071
1071
|
left: 2,
|
|
1072
1072
|
top: 3,
|
|
1073
1073
|
width: 76,
|
|
1074
|
-
height: isDirty ?
|
|
1074
|
+
height: isDirty ? 12 : 10,
|
|
1075
1075
|
borderStyle: "single",
|
|
1076
|
-
borderColor: "#
|
|
1076
|
+
borderColor: "#EF4444",
|
|
1077
1077
|
title,
|
|
1078
1078
|
titleAlignment: "center",
|
|
1079
|
-
backgroundColor: "#
|
|
1079
|
+
backgroundColor: "#1C1917",
|
|
1080
1080
|
border: true,
|
|
1081
1081
|
});
|
|
1082
1082
|
this.renderer.root.add(this.confirmContainer);
|
|
1083
1083
|
|
|
1084
|
-
//
|
|
1084
|
+
// Branch name prominently displayed
|
|
1085
1085
|
let yOffset = 1;
|
|
1086
|
+
const branchHeader = new TextRenderable(this.renderer, {
|
|
1087
|
+
id: "confirm-branch",
|
|
1088
|
+
position: "absolute",
|
|
1089
|
+
left: 1,
|
|
1090
|
+
top: yOffset,
|
|
1091
|
+
content: `Branch: ${branchDisplay}`,
|
|
1092
|
+
fg: "#FBBF24",
|
|
1093
|
+
});
|
|
1094
|
+
this.confirmContainer.add(branchHeader);
|
|
1095
|
+
yOffset += 2;
|
|
1096
|
+
|
|
1097
|
+
// Warning for dirty worktree
|
|
1086
1098
|
if (isDirty) {
|
|
1087
1099
|
const warningText = new TextRenderable(this.renderer, {
|
|
1088
1100
|
id: "confirm-warning",
|
|
@@ -1090,7 +1102,7 @@ class WorktreeSelector {
|
|
|
1090
1102
|
left: 1,
|
|
1091
1103
|
top: yOffset,
|
|
1092
1104
|
content: "⚠ This worktree has uncommitted changes!",
|
|
1093
|
-
fg: "#
|
|
1105
|
+
fg: "#EF4444",
|
|
1094
1106
|
});
|
|
1095
1107
|
this.confirmContainer.add(warningText);
|
|
1096
1108
|
yOffset += 2;
|
|
@@ -1102,7 +1114,7 @@ class WorktreeSelector {
|
|
|
1102
1114
|
left: 1,
|
|
1103
1115
|
top: yOffset,
|
|
1104
1116
|
content: `Path: ${worktree.path}`,
|
|
1105
|
-
fg: "#
|
|
1117
|
+
fg: "#A8A29E",
|
|
1106
1118
|
});
|
|
1107
1119
|
this.confirmContainer.add(pathText);
|
|
1108
1120
|
yOffset += 2;
|
|
@@ -1134,13 +1146,13 @@ class WorktreeSelector {
|
|
|
1134
1146
|
width: 72,
|
|
1135
1147
|
height: 4,
|
|
1136
1148
|
options,
|
|
1137
|
-
backgroundColor: "#
|
|
1138
|
-
focusedBackgroundColor: "#
|
|
1139
|
-
selectedBackgroundColor: "#
|
|
1140
|
-
textColor: "#
|
|
1141
|
-
selectedTextColor: "#
|
|
1142
|
-
descriptionColor: "#
|
|
1143
|
-
selectedDescriptionColor: "#
|
|
1149
|
+
backgroundColor: "#1C1917",
|
|
1150
|
+
focusedBackgroundColor: "#292524",
|
|
1151
|
+
selectedBackgroundColor: "#44403C",
|
|
1152
|
+
textColor: "#E7E5E4",
|
|
1153
|
+
selectedTextColor: "#F87171",
|
|
1154
|
+
descriptionColor: "#A8A29E",
|
|
1155
|
+
selectedDescriptionColor: "#E7E5E4",
|
|
1144
1156
|
showDescription: true,
|
|
1145
1157
|
wrapSelection: true,
|
|
1146
1158
|
});
|
|
@@ -1357,7 +1369,7 @@ class WorktreeSelector {
|
|
|
1357
1369
|
const hasDirty = dirtyWorktrees.length > 0;
|
|
1358
1370
|
|
|
1359
1371
|
const count = worktrees.length;
|
|
1360
|
-
const title = `
|
|
1372
|
+
const title = `DELETE ${count} WORKTREE${count === 1 ? "" : "S"}`;
|
|
1361
1373
|
|
|
1362
1374
|
this.confirmContainer = new BoxRenderable(this.renderer, {
|
|
1363
1375
|
id: "confirm-container",
|
|
@@ -1365,18 +1377,36 @@ class WorktreeSelector {
|
|
|
1365
1377
|
left: 2,
|
|
1366
1378
|
top: 3,
|
|
1367
1379
|
width: 76,
|
|
1368
|
-
height: hasDirty ?
|
|
1380
|
+
height: hasDirty ? 14 : 12,
|
|
1369
1381
|
borderStyle: "single",
|
|
1370
|
-
borderColor: "#
|
|
1382
|
+
borderColor: "#EF4444",
|
|
1371
1383
|
title,
|
|
1372
1384
|
titleAlignment: "center",
|
|
1373
|
-
backgroundColor: "#
|
|
1385
|
+
backgroundColor: "#1C1917",
|
|
1374
1386
|
border: true,
|
|
1375
1387
|
});
|
|
1376
1388
|
this.renderer.root.add(this.confirmContainer);
|
|
1377
1389
|
|
|
1378
1390
|
let yOffset = 1;
|
|
1379
1391
|
|
|
1392
|
+
// List branches to be deleted prominently
|
|
1393
|
+
const branchNames = worktrees
|
|
1394
|
+
.map((wt) => wt.branch || basename(wt.path))
|
|
1395
|
+
.slice(0, 3);
|
|
1396
|
+
const displayList =
|
|
1397
|
+
branchNames.join(", ") + (worktrees.length > 3 ? `, +${worktrees.length - 3} more` : "");
|
|
1398
|
+
|
|
1399
|
+
const branchHeader = new TextRenderable(this.renderer, {
|
|
1400
|
+
id: "confirm-branches",
|
|
1401
|
+
position: "absolute",
|
|
1402
|
+
left: 1,
|
|
1403
|
+
top: yOffset,
|
|
1404
|
+
content: `Branches: ${displayList}`,
|
|
1405
|
+
fg: "#FBBF24",
|
|
1406
|
+
});
|
|
1407
|
+
this.confirmContainer.add(branchHeader);
|
|
1408
|
+
yOffset += 2;
|
|
1409
|
+
|
|
1380
1410
|
// Warning for dirty worktrees
|
|
1381
1411
|
if (hasDirty) {
|
|
1382
1412
|
const warningText = new TextRenderable(this.renderer, {
|
|
@@ -1385,28 +1415,22 @@ class WorktreeSelector {
|
|
|
1385
1415
|
left: 1,
|
|
1386
1416
|
top: yOffset,
|
|
1387
1417
|
content: `⚠ ${dirtyWorktrees.length} worktree${dirtyWorktrees.length === 1 ? " has" : "s have"} uncommitted changes!`,
|
|
1388
|
-
fg: "#
|
|
1418
|
+
fg: "#EF4444",
|
|
1389
1419
|
});
|
|
1390
1420
|
this.confirmContainer.add(warningText);
|
|
1391
1421
|
yOffset += 2;
|
|
1392
1422
|
}
|
|
1393
1423
|
|
|
1394
|
-
//
|
|
1395
|
-
const
|
|
1396
|
-
|
|
1397
|
-
.slice(0, 3);
|
|
1398
|
-
const displayList =
|
|
1399
|
-
branchNames.join(", ") + (worktrees.length > 3 ? `, +${worktrees.length - 3} more` : "");
|
|
1400
|
-
|
|
1401
|
-
const listText = new TextRenderable(this.renderer, {
|
|
1402
|
-
id: "confirm-list",
|
|
1424
|
+
// Info text
|
|
1425
|
+
const infoText = new TextRenderable(this.renderer, {
|
|
1426
|
+
id: "confirm-info",
|
|
1403
1427
|
position: "absolute",
|
|
1404
1428
|
left: 1,
|
|
1405
1429
|
top: yOffset,
|
|
1406
|
-
content:
|
|
1407
|
-
fg: "#
|
|
1430
|
+
content: "This will remove worktree directories from disk.",
|
|
1431
|
+
fg: "#A8A29E",
|
|
1408
1432
|
});
|
|
1409
|
-
this.confirmContainer.add(
|
|
1433
|
+
this.confirmContainer.add(infoText);
|
|
1410
1434
|
yOffset += 2;
|
|
1411
1435
|
|
|
1412
1436
|
// Build options
|
|
@@ -1436,13 +1460,13 @@ class WorktreeSelector {
|
|
|
1436
1460
|
width: 72,
|
|
1437
1461
|
height: 4,
|
|
1438
1462
|
options,
|
|
1439
|
-
backgroundColor: "#
|
|
1440
|
-
focusedBackgroundColor: "#
|
|
1441
|
-
selectedBackgroundColor: "#
|
|
1442
|
-
textColor: "#
|
|
1443
|
-
selectedTextColor: "#
|
|
1444
|
-
descriptionColor: "#
|
|
1445
|
-
selectedDescriptionColor: "#
|
|
1463
|
+
backgroundColor: "#1C1917",
|
|
1464
|
+
focusedBackgroundColor: "#292524",
|
|
1465
|
+
selectedBackgroundColor: "#44403C",
|
|
1466
|
+
textColor: "#E7E5E4",
|
|
1467
|
+
selectedTextColor: "#F87171",
|
|
1468
|
+
descriptionColor: "#A8A29E",
|
|
1469
|
+
selectedDescriptionColor: "#E7E5E4",
|
|
1446
1470
|
showDescription: true,
|
|
1447
1471
|
wrapSelection: true,
|
|
1448
1472
|
});
|