@rotorsoft/gent 1.16.0 → 1.17.0
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/dist/index.js +29 -24
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2221,7 +2221,7 @@ import { homedir } from "os";
|
|
|
2221
2221
|
// package.json
|
|
2222
2222
|
var package_default = {
|
|
2223
2223
|
name: "@rotorsoft/gent",
|
|
2224
|
-
version: "1.
|
|
2224
|
+
version: "1.17.0",
|
|
2225
2225
|
description: "AI-powered GitHub workflow CLI - leverage AI (Claude, Gemini, or Codex) to create tickets, implement features, and manage PRs",
|
|
2226
2226
|
keywords: [
|
|
2227
2227
|
"cli",
|
|
@@ -3138,7 +3138,7 @@ function buildModalFrame(title, contentLines, footerText, width) {
|
|
|
3138
3138
|
function isSeparator(entry) {
|
|
3139
3139
|
return "separator" in entry;
|
|
3140
3140
|
}
|
|
3141
|
-
function buildSelectContent(items, selectedIndex, maxWidth) {
|
|
3141
|
+
function buildSelectContent(items, selectedIndex, maxWidth, currentIndex) {
|
|
3142
3142
|
const lines = [];
|
|
3143
3143
|
let selectableIdx = 0;
|
|
3144
3144
|
for (const item of items) {
|
|
@@ -3146,12 +3146,12 @@ function buildSelectContent(items, selectedIndex, maxWidth) {
|
|
|
3146
3146
|
lines.push(chalk4.dim(item.separator));
|
|
3147
3147
|
} else {
|
|
3148
3148
|
const isSelected = selectableIdx === selectedIndex;
|
|
3149
|
+
const isCurrent = currentIndex != null && selectableIdx === currentIndex;
|
|
3149
3150
|
const prefix = isSelected ? chalk4.cyan.bold("> ") : " ";
|
|
3150
3151
|
const bullet = chalk4.dim("\xB7 ");
|
|
3151
3152
|
const label = truncateAnsi(item.name, maxWidth - 4);
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
);
|
|
3153
|
+
const styledLabel = isSelected ? chalk4.bold(label) : isCurrent ? chalk4.cyan(label) : label;
|
|
3154
|
+
lines.push(prefix + bullet + styledLabel);
|
|
3155
3155
|
selectableIdx++;
|
|
3156
3156
|
}
|
|
3157
3157
|
}
|
|
@@ -3320,9 +3320,9 @@ async function showSelect(opts) {
|
|
|
3320
3320
|
const w = modalWidth();
|
|
3321
3321
|
const maxItems = selectableCount(opts.items);
|
|
3322
3322
|
if (maxItems === 0) return null;
|
|
3323
|
-
let selectedIndex = 0;
|
|
3323
|
+
let selectedIndex = opts.initialIndex ?? 0;
|
|
3324
3324
|
const render = () => {
|
|
3325
|
-
const content = buildSelectContent(opts.items, selectedIndex, w - 6);
|
|
3325
|
+
const content = buildSelectContent(opts.items, selectedIndex, w - 6, opts.currentIndex);
|
|
3326
3326
|
const footer = "\u2191\u2193 Navigate Enter Select Esc Cancel";
|
|
3327
3327
|
const lines = buildModalFrame(opts.title, content, footer, w);
|
|
3328
3328
|
renderOverlay(opts.dashboardLines, lines, w);
|
|
@@ -3725,6 +3725,8 @@ async function handleList(dashboardLines) {
|
|
|
3725
3725
|
const currentBranch = await getCurrentBranch();
|
|
3726
3726
|
const defaultBranch = await getDefaultBranch();
|
|
3727
3727
|
const items = [];
|
|
3728
|
+
let initialIndex = 0;
|
|
3729
|
+
let selectableIdx = 0;
|
|
3728
3730
|
const isMain = currentBranch === defaultBranch;
|
|
3729
3731
|
const mainLabel = defaultBranch + (isMain ? " (current)" : "");
|
|
3730
3732
|
if (dirty && !isMain) {
|
|
@@ -3735,42 +3737,42 @@ async function handleList(dashboardLines) {
|
|
|
3735
3737
|
} else {
|
|
3736
3738
|
items.push({ name: mainLabel, value: "__main__" });
|
|
3737
3739
|
}
|
|
3740
|
+
if (isMain) initialIndex = selectableIdx;
|
|
3741
|
+
selectableIdx++;
|
|
3738
3742
|
const inProgressChoices = choices.filter(
|
|
3739
3743
|
(c) => c.category === "in-progress"
|
|
3740
3744
|
);
|
|
3741
3745
|
const openPrChoices = choices.filter((c) => c.category === "open-pr");
|
|
3742
3746
|
const readyChoices = choices.filter((c) => c.category === "ready");
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3747
|
+
const addChoices = (list) => {
|
|
3748
|
+
for (const c of list) {
|
|
3749
|
+
const isCurrent = c.branch === currentBranch;
|
|
3746
3750
|
items.push({
|
|
3747
3751
|
name: `#${c.issueNumber} ${c.title}`,
|
|
3748
3752
|
value: String(c.issueNumber)
|
|
3749
3753
|
});
|
|
3754
|
+
if (isCurrent) initialIndex = selectableIdx;
|
|
3755
|
+
selectableIdx++;
|
|
3750
3756
|
}
|
|
3757
|
+
};
|
|
3758
|
+
if (inProgressChoices.length > 0) {
|
|
3759
|
+
items.push({ separator: "\u2500\u2500 In Progress \u2500\u2500" });
|
|
3760
|
+
addChoices(inProgressChoices);
|
|
3751
3761
|
}
|
|
3752
3762
|
if (openPrChoices.length > 0) {
|
|
3753
3763
|
items.push({ separator: "\u2500\u2500 Open PRs \u2500\u2500" });
|
|
3754
|
-
|
|
3755
|
-
items.push({
|
|
3756
|
-
name: `#${c.issueNumber} ${c.title}`,
|
|
3757
|
-
value: String(c.issueNumber)
|
|
3758
|
-
});
|
|
3759
|
-
}
|
|
3764
|
+
addChoices(openPrChoices);
|
|
3760
3765
|
}
|
|
3761
3766
|
if (readyChoices.length > 0) {
|
|
3762
3767
|
items.push({ separator: "\u2500\u2500 Ready \u2500\u2500" });
|
|
3763
|
-
|
|
3764
|
-
items.push({
|
|
3765
|
-
name: `#${c.issueNumber} ${c.title}`,
|
|
3766
|
-
value: String(c.issueNumber)
|
|
3767
|
-
});
|
|
3768
|
-
}
|
|
3768
|
+
addChoices(readyChoices);
|
|
3769
3769
|
}
|
|
3770
3770
|
const selected = await showSelect({
|
|
3771
3771
|
title: "Switch Ticket",
|
|
3772
3772
|
items,
|
|
3773
|
-
dashboardLines
|
|
3773
|
+
dashboardLines,
|
|
3774
|
+
initialIndex,
|
|
3775
|
+
currentIndex: initialIndex
|
|
3774
3776
|
});
|
|
3775
3777
|
if (!selected) return false;
|
|
3776
3778
|
if (selected === "__main_disabled__") {
|
|
@@ -3877,13 +3879,16 @@ async function tuiCommand() {
|
|
|
3877
3879
|
isPlaywrightAvailable: false
|
|
3878
3880
|
};
|
|
3879
3881
|
let needsRefresh = true;
|
|
3882
|
+
let isFirstLoad = true;
|
|
3880
3883
|
while (running) {
|
|
3881
3884
|
if (needsRefresh) {
|
|
3882
3885
|
clearScreen();
|
|
3883
3886
|
renderDashboard(lastState, lastActions, void 0, true, versionCheck);
|
|
3887
|
+
const checkInterval = isFirstLoad ? 0 : VERSION_CHECK_INTERVAL_MS;
|
|
3888
|
+
isFirstLoad = false;
|
|
3884
3889
|
const [state, versionResult] = await Promise.all([
|
|
3885
3890
|
aggregateState(),
|
|
3886
|
-
checkForUpdates(
|
|
3891
|
+
checkForUpdates(checkInterval).catch(() => null)
|
|
3887
3892
|
]);
|
|
3888
3893
|
const actions = getAvailableActions(state);
|
|
3889
3894
|
lastState = state;
|