Skip to content

Commit 87cc2bc

Browse files
Merge pull request #12 from Darknode-Official/fix/toggle-colors-cheap
Slash menu toggle colors: cover /cheap and more, color the selected row
2 parents 7c59ec9 + 1dee94c commit 87cc2bc

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎darknode.js‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3965,12 +3965,18 @@ function nexusTui(engine, cwd, nexusMd, autoResume, launch) {
39653965
case "/tight": return tightEdits;
39663966
case "/title": return autoTitle;
39673967
case "/redact": return redact;
3968+
case "/cheap": return !!(cacheOn && tightEdits && cheapSide);
3969+
case "/hack": return hack;
3970+
case "/cowork": return !!cowork.on;
3971+
case "/fallback": return !!fallback;
3972+
case "/autocompact": return autoCompact;
3973+
case "/guard": return guard !== "off";
39683974
default: return null;
39693975
}
39703976
};
39713977
for (let i = 0; i < menuReserve; i++) {
39723978
if (i >= menuRows) { frame.push(""); continue; }
3973-
const idx = menuStart + i; const [nm, ds] = combined[idx]; const sel = idx === menuSel; const pos = (sel && combined.length > menuRows) ? gray(" (" + (menuSel + 1) + "/" + combined.length + ")") : ""; const nmW = Math.min(18, Math.max(10, Math.floor(C / 4))); const incompat = menu.length && nm[0] === "/" && !cmdOkFor(nm); const tstate = incompat ? null : (menu.length && nm[0] === "/") ? toggleState(nm) : null; const _nmPad = padRightV(nm, nmW); const nmShown = sel ? bold(cyan(_nmPad)) : incompat ? dim(_nmPad) : tstate === true ? green(_nmPad) : tstate === false ? red(_nmPad) : _nmPad; const stateTag = tstate == null ? "" : (tstate ? green(" on") : red(" off")); const tail = incompat ? red(" not compatible with " + _curM) : gray(" " + (ds || "")); const head = (sel ? cyan(" › ") : " ") + nmShown + stateTag, room = C - 2 - strWidth(stripA(head)) - strWidth(stripA(pos)); frame.push(clip(head + (strWidth(stripA(tail)) > room ? clip(tail, Math.max(0, room - 1)) + (useColor ? "\x1b[0m" : "") + gray("…") : tail) + pos, C - 2)); /* a long description ends in … (and the n/N position stays visible) */
3979+
const idx = menuStart + i; const [nm, ds] = combined[idx]; const sel = idx === menuSel; const pos = (sel && combined.length > menuRows) ? gray(" (" + (menuSel + 1) + "/" + combined.length + ")") : ""; const nmW = Math.min(18, Math.max(10, Math.floor(C / 4))); const incompat = menu.length && nm[0] === "/" && !cmdOkFor(nm); const tstate = incompat ? null : (menu.length && nm[0] === "/") ? toggleState(nm) : null; const _nmPad = padRightV(nm, nmW); const nmShown = sel ? bold(tstate === true ? green(_nmPad) : tstate === false ? red(_nmPad) : cyan(_nmPad)) : incompat ? dim(_nmPad) : tstate === true ? green(_nmPad) : tstate === false ? red(_nmPad) : _nmPad; const stateTag = tstate == null ? "" : (tstate ? green(" on") : red(" off")); const tail = incompat ? red(" not compatible with " + _curM) : gray(" " + (ds || "")); const head = (sel ? cyan(" › ") : " ") + nmShown + stateTag, room = C - 2 - strWidth(stripA(head)) - strWidth(stripA(pos)); frame.push(clip(head + (strWidth(stripA(tail)) > room ? clip(tail, Math.max(0, room - 1)) + (useColor ? "\x1b[0m" : "") + gray("…") : tail) + pos, C - 2)); /* a long description ends in … (and the n/N position stays visible) */
39743980
}
39753981
}
39763982
for (const r of agentPanelRows) frame.push(clip(r, C)); // the Agents panel, under the prompt bar

0 commit comments

Comments
 (0)