kandown 0.7.3 → 0.7.5
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/tui.js +193 -48
- package/dist/index.html +23 -23
- package/package.json +1 -1
package/bin/tui.js
CHANGED
|
@@ -27895,7 +27895,7 @@ var require_backend = __commonJS({
|
|
|
27895
27895
|
});
|
|
27896
27896
|
return value;
|
|
27897
27897
|
},
|
|
27898
|
-
useEffect: function
|
|
27898
|
+
useEffect: function useEffect11(create3) {
|
|
27899
27899
|
nextHook();
|
|
27900
27900
|
hookLog.push({
|
|
27901
27901
|
displayName: null,
|
|
@@ -27983,7 +27983,7 @@ var require_backend = __commonJS({
|
|
|
27983
27983
|
});
|
|
27984
27984
|
return initialValue;
|
|
27985
27985
|
},
|
|
27986
|
-
useState: function
|
|
27986
|
+
useState: function useState10(initialState) {
|
|
27987
27987
|
var hook = nextHook();
|
|
27988
27988
|
initialState = null !== hook ? hook.memoizedState : "function" === typeof initialState ? initialState() : initialState;
|
|
27989
27989
|
hookLog.push({
|
|
@@ -53951,6 +53951,8 @@ var use_app_default = useApp;
|
|
|
53951
53951
|
|
|
53952
53952
|
// node_modules/.pnpm/ink@7.0.1_@types+react@19.2.14_react-devtools-core@7.0.1_react@19.2.5/node_modules/ink/build/hooks/use-stdout.js
|
|
53953
53953
|
var import_react25 = __toESM(require_react(), 1);
|
|
53954
|
+
var useStdout = () => (0, import_react25.useContext)(StdoutContext_default);
|
|
53955
|
+
var use_stdout_default = useStdout;
|
|
53954
53956
|
|
|
53955
53957
|
// node_modules/.pnpm/ink@7.0.1_@types+react@19.2.14_react-devtools-core@7.0.1_react@19.2.5/node_modules/ink/build/hooks/use-stderr.js
|
|
53956
53958
|
var import_react26 = __toESM(require_react(), 1);
|
|
@@ -53976,6 +53978,9 @@ var import_react32 = __toESM(require_react(), 1);
|
|
|
53976
53978
|
// node_modules/.pnpm/ink@7.0.1_@types+react@19.2.14_react-devtools-core@7.0.1_react@19.2.5/node_modules/ink/build/hooks/use-box-metrics.js
|
|
53977
53979
|
var import_react33 = __toESM(require_react(), 1);
|
|
53978
53980
|
|
|
53981
|
+
// src/cli/app.tsx
|
|
53982
|
+
var import_react38 = __toESM(require_react(), 1);
|
|
53983
|
+
|
|
53979
53984
|
// src/cli/screens/settings.tsx
|
|
53980
53985
|
var import_react34 = __toESM(require_react(), 1);
|
|
53981
53986
|
|
|
@@ -56757,8 +56762,8 @@ function AgentPicker({ agents, taskId, onSelect, onCancel }) {
|
|
|
56757
56762
|
|
|
56758
56763
|
// src/cli/hooks/use-mouse.ts
|
|
56759
56764
|
var import_react36 = __toESM(require_react(), 1);
|
|
56760
|
-
var MOUSE_ENABLE = "\x1B[?1000h\x1B[?1006h";
|
|
56761
|
-
var MOUSE_DISABLE = "\x1B[?1006l\x1B[?1000l";
|
|
56765
|
+
var MOUSE_ENABLE = "\x1B[?1000h\x1B[?1002h\x1B[?1006h";
|
|
56766
|
+
var MOUSE_DISABLE = "\x1B[?1006l\x1B[?1002l\x1B[?1000l";
|
|
56762
56767
|
var RE_SGR_MOUSE = /^\[<(\d+);(\d+);(\d+)([Mm])/;
|
|
56763
56768
|
function parseMouseInput(input) {
|
|
56764
56769
|
const match = input.match(RE_SGR_MOUSE);
|
|
@@ -56766,31 +56771,44 @@ function parseMouseInput(input) {
|
|
|
56766
56771
|
const cb = parseInt(match[1], 10);
|
|
56767
56772
|
const cx = parseInt(match[2], 10);
|
|
56768
56773
|
const cy = parseInt(match[3], 10);
|
|
56769
|
-
const
|
|
56774
|
+
const final = match[4];
|
|
56775
|
+
const buttonNumber = cb & 3 | (cb & 192) >> 4;
|
|
56776
|
+
const dragging = (cb & 32) === 32;
|
|
56777
|
+
let action;
|
|
56778
|
+
if (final === "m") action = "release";
|
|
56779
|
+
else if (dragging && buttonNumber <= 2) action = "drag";
|
|
56780
|
+
else if (dragging) action = "move";
|
|
56781
|
+
else if (buttonNumber >= 4 && buttonNumber <= 7) action = "scroll";
|
|
56782
|
+
else action = "press";
|
|
56770
56783
|
return {
|
|
56771
56784
|
x: cx,
|
|
56772
56785
|
y: cy,
|
|
56773
|
-
button:
|
|
56774
|
-
action
|
|
56786
|
+
button: buttonNumber <= 2 ? buttonNumber : 0,
|
|
56787
|
+
action
|
|
56775
56788
|
};
|
|
56776
56789
|
}
|
|
56777
56790
|
function isMouseInput(input) {
|
|
56778
56791
|
return input.startsWith("[<") || input.startsWith("[M");
|
|
56779
56792
|
}
|
|
56793
|
+
function safeWrite(write, data) {
|
|
56794
|
+
try {
|
|
56795
|
+
write(data);
|
|
56796
|
+
} catch {
|
|
56797
|
+
}
|
|
56798
|
+
}
|
|
56780
56799
|
function useMouseMode(enabled = true) {
|
|
56800
|
+
const { write } = use_stdout_default();
|
|
56781
56801
|
(0, import_react36.useEffect)(() => {
|
|
56782
56802
|
if (!enabled) return;
|
|
56783
56803
|
if (!process.stdin.isTTY) return;
|
|
56784
|
-
|
|
56785
|
-
const cleanup = () =>
|
|
56786
|
-
process.stdout.write(MOUSE_DISABLE);
|
|
56787
|
-
};
|
|
56804
|
+
safeWrite(write, MOUSE_ENABLE);
|
|
56805
|
+
const cleanup = () => safeWrite(write, MOUSE_DISABLE);
|
|
56788
56806
|
process.on("exit", cleanup);
|
|
56789
56807
|
return () => {
|
|
56790
56808
|
process.removeListener("exit", cleanup);
|
|
56791
|
-
|
|
56809
|
+
safeWrite(write, MOUSE_DISABLE);
|
|
56792
56810
|
};
|
|
56793
|
-
}, [enabled]);
|
|
56811
|
+
}, [enabled, write]);
|
|
56794
56812
|
}
|
|
56795
56813
|
|
|
56796
56814
|
// src/cli/components/task-context-menu.tsx
|
|
@@ -56846,8 +56864,8 @@ var RE_HEADER = /^#{1,3}\s/;
|
|
|
56846
56864
|
var RE_SUBTASK = /^\s*-\s+\[([ xX])\]/;
|
|
56847
56865
|
var RE_DONE = /^\s*-\s+\[x\]/i;
|
|
56848
56866
|
var RE_BRACKET_TAG = /^\[([^\]]+)\]\s*/;
|
|
56849
|
-
function TaskRow({ task, focused, colWidth }) {
|
|
56850
|
-
const cursor = focused ? "\u25B8" : " ";
|
|
56867
|
+
function TaskRow({ task, focused, dragging, colWidth }) {
|
|
56868
|
+
const cursor = dragging ? "\u2195" : focused ? "\u25B8" : " ";
|
|
56851
56869
|
const check2 = task.checked ? "\u2713" : "\u25CB";
|
|
56852
56870
|
const idStr = task.id;
|
|
56853
56871
|
const tagMatch = task.title.match(RE_BRACKET_TAG);
|
|
@@ -56857,15 +56875,15 @@ function TaskRow({ task, focused, colWidth }) {
|
|
|
56857
56875
|
const tagChars = tag ? tag.length + 1 : 0;
|
|
56858
56876
|
const titleStr = truncate(titleClean, Math.max(4, colWidth - fixedChars - tagChars));
|
|
56859
56877
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Box_default, { children: [
|
|
56860
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Text, { color: focused ? "cyan" : void 0, bold: focused, children: [
|
|
56878
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Text, { color: dragging ? "yellow" : focused ? "cyan" : void 0, bold: focused || dragging, children: [
|
|
56861
56879
|
cursor,
|
|
56862
56880
|
" "
|
|
56863
56881
|
] }),
|
|
56864
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Text, { color: task.checked ? "green" : focused ? "white" : "gray", children: [
|
|
56882
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Text, { color: dragging ? "yellow" : task.checked ? "green" : focused ? "white" : "gray", children: [
|
|
56865
56883
|
check2,
|
|
56866
56884
|
" "
|
|
56867
56885
|
] }),
|
|
56868
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { color: focused ? "cyan" : "yellow", bold: focused, children: idStr }),
|
|
56886
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { color: dragging ? "yellow" : focused ? "cyan" : "yellow", bold: focused || dragging, children: idStr }),
|
|
56869
56887
|
tag && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Text, { color: focused ? "white" : "magenta", bold: true, children: [
|
|
56870
56888
|
" ",
|
|
56871
56889
|
tag
|
|
@@ -56899,7 +56917,8 @@ function KanbanColumn({
|
|
|
56899
56917
|
contextMenuRow,
|
|
56900
56918
|
contextMenuCursor,
|
|
56901
56919
|
showMoveTarget,
|
|
56902
|
-
isMoveFocused
|
|
56920
|
+
isMoveFocused,
|
|
56921
|
+
draggedTaskId
|
|
56903
56922
|
}) {
|
|
56904
56923
|
const headerBg = isFocused ? "cyan" : void 0;
|
|
56905
56924
|
const headerColor = isFocused ? "black" : "cyan";
|
|
@@ -56912,6 +56931,7 @@ function KanbanColumn({
|
|
|
56912
56931
|
{
|
|
56913
56932
|
task,
|
|
56914
56933
|
focused: isFocused && idx === focusedRow,
|
|
56934
|
+
dragging: task.id === draggedTaskId,
|
|
56915
56935
|
colWidth
|
|
56916
56936
|
},
|
|
56917
56937
|
task.id
|
|
@@ -56944,16 +56964,14 @@ function BoardHeader({ title, inTmux, modeHint, version }) {
|
|
|
56944
56964
|
const tmuxHint = inTmux ? " tmux" : "";
|
|
56945
56965
|
const versionTag = version ? ` v${version}` : "";
|
|
56946
56966
|
const hint = modeHint || "h/l cols \xB7 j/k tasks \xB7 Enter detail \xB7 m menu \xB7 a agent \xB7 r reload \xB7 q quit";
|
|
56947
|
-
|
|
56948
|
-
|
|
56949
|
-
|
|
56950
|
-
|
|
56951
|
-
|
|
56952
|
-
|
|
56953
|
-
|
|
56954
|
-
|
|
56955
|
-
] }),
|
|
56956
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { color: "gray", dimColor: true, children: hint })
|
|
56967
|
+
const width = termWidth();
|
|
56968
|
+
const leftWidth = Math.min(Math.max(28, Math.floor(width * 0.42)), width);
|
|
56969
|
+
const rightWidth = Math.max(0, width - leftWidth);
|
|
56970
|
+
const left = pad(` KANDOWN${tmuxHint}${versionTag} ${title}`, leftWidth);
|
|
56971
|
+
const right = truncate(hint, rightWidth).padStart(rightWidth, " ");
|
|
56972
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Box_default, { marginBottom: 1, children: [
|
|
56973
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { bold: true, color: "cyan", children: left }),
|
|
56974
|
+
rightWidth > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { color: "gray", dimColor: true, children: right })
|
|
56957
56975
|
] });
|
|
56958
56976
|
}
|
|
56959
56977
|
function StatusBar({ message, task }) {
|
|
@@ -57029,6 +57047,8 @@ function Board({ kandownDir, version }) {
|
|
|
57029
57047
|
const [ctxMenuCursor, setCtxMenuCursor] = (0, import_react37.useState)(0);
|
|
57030
57048
|
const [moveTaskId, setMoveTaskId] = (0, import_react37.useState)(null);
|
|
57031
57049
|
const [moveTargetCol, setMoveTargetCol] = (0, import_react37.useState)(0);
|
|
57050
|
+
const [mousePress, setMousePress] = (0, import_react37.useState)(null);
|
|
57051
|
+
const [taskDrag, setTaskDrag] = (0, import_react37.useState)(null);
|
|
57032
57052
|
const [installedAgents, setInstalledAgents] = (0, import_react37.useState)([]);
|
|
57033
57053
|
const inTmux = isInTmux();
|
|
57034
57054
|
const layoutRef = (0, import_react37.useRef)({
|
|
@@ -57046,6 +57066,25 @@ function Board({ kandownDir, version }) {
|
|
|
57046
57066
|
}
|
|
57047
57067
|
layoutRef.current = { colStarts: starts, colWidth: cw };
|
|
57048
57068
|
}, []);
|
|
57069
|
+
const columnAtX = (0, import_react37.useCallback)((x) => {
|
|
57070
|
+
const layout = layoutRef.current;
|
|
57071
|
+
for (let c = 0; c < layout.colStarts.length; c++) {
|
|
57072
|
+
const start = layout.colStarts[c];
|
|
57073
|
+
if (x >= start && x < start + layout.colWidth) return c;
|
|
57074
|
+
}
|
|
57075
|
+
return -1;
|
|
57076
|
+
}, []);
|
|
57077
|
+
const taskHitAt = (0, import_react37.useCallback)((x, y) => {
|
|
57078
|
+
if (!board) return null;
|
|
57079
|
+
const clickedCol = columnAtX(x);
|
|
57080
|
+
if (clickedCol < 0) return null;
|
|
57081
|
+
const col = board.columns[clickedCol];
|
|
57082
|
+
if (!col) return null;
|
|
57083
|
+
const taskIdx = y - TASKS_START_Y;
|
|
57084
|
+
const task = taskIdx >= 0 ? col.tasks[taskIdx] : void 0;
|
|
57085
|
+
if (!task) return null;
|
|
57086
|
+
return { taskId: task.id, colIndex: clickedCol, rowIndex: taskIdx, startX: x, startY: y };
|
|
57087
|
+
}, [board, columnAtX]);
|
|
57049
57088
|
(0, import_react37.useEffect)(() => {
|
|
57050
57089
|
const loaded = readBoard(kandownDir);
|
|
57051
57090
|
setBoard(loaded);
|
|
@@ -57239,12 +57278,87 @@ function Board({ kandownDir, version }) {
|
|
|
57239
57278
|
return;
|
|
57240
57279
|
}
|
|
57241
57280
|
}, [board, mode, colIndex, rowIndex, ctxMenuRow, moveTaskId, kandownDir, updateLayout, openDetail, closeContextMenu]);
|
|
57281
|
+
const handleMouseEvent = (0, import_react37.useCallback)((mouse) => {
|
|
57282
|
+
if (!board) return;
|
|
57283
|
+
if (mode === "browse") {
|
|
57284
|
+
if (mouse.action === "press" && mouse.button === 0) {
|
|
57285
|
+
const hit = taskHitAt(mouse.x, mouse.y);
|
|
57286
|
+
if (hit) {
|
|
57287
|
+
setMousePress(hit);
|
|
57288
|
+
setColIndex(hit.colIndex);
|
|
57289
|
+
setRowIndex(hit.rowIndex);
|
|
57290
|
+
}
|
|
57291
|
+
return;
|
|
57292
|
+
}
|
|
57293
|
+
if (mouse.action === "drag" && mousePress) {
|
|
57294
|
+
const delta = Math.max(Math.abs(mouse.x - mousePress.startX), Math.abs(mouse.y - mousePress.startY));
|
|
57295
|
+
if (delta < 1) return;
|
|
57296
|
+
const hoverCol = columnAtX(mouse.x);
|
|
57297
|
+
setTaskDrag({ taskId: mousePress.taskId, sourceCol: mousePress.colIndex, hoverCol });
|
|
57298
|
+
setMoveTargetCol(hoverCol >= 0 ? hoverCol : mousePress.colIndex);
|
|
57299
|
+
setMoveTaskId(mousePress.taskId);
|
|
57300
|
+
setMode("dragging");
|
|
57301
|
+
closeContextMenu();
|
|
57302
|
+
return;
|
|
57303
|
+
}
|
|
57304
|
+
if (mouse.action === "release" && mousePress) {
|
|
57305
|
+
const hit = taskHitAt(mouse.x, mouse.y);
|
|
57306
|
+
if (hit && hit.taskId === mousePress.taskId) {
|
|
57307
|
+
setCtxMenuRow(mousePress.rowIndex);
|
|
57308
|
+
setCtxMenuCursor(0);
|
|
57309
|
+
setMode("context-menu");
|
|
57310
|
+
}
|
|
57311
|
+
setMousePress(null);
|
|
57312
|
+
return;
|
|
57313
|
+
}
|
|
57314
|
+
if (mouse.action === "press") handleMouseClick(mouse.x, mouse.y);
|
|
57315
|
+
return;
|
|
57316
|
+
}
|
|
57317
|
+
if (mode === "dragging") {
|
|
57318
|
+
if (!taskDrag) {
|
|
57319
|
+
setMode("browse");
|
|
57320
|
+
setMoveTaskId(null);
|
|
57321
|
+
setMousePress(null);
|
|
57322
|
+
return;
|
|
57323
|
+
}
|
|
57324
|
+
if (mouse.action === "drag") {
|
|
57325
|
+
const hoverCol = columnAtX(mouse.x);
|
|
57326
|
+
setTaskDrag((current) => current ? { ...current, hoverCol } : current);
|
|
57327
|
+
setMoveTargetCol(hoverCol >= 0 ? hoverCol : taskDrag.sourceCol);
|
|
57328
|
+
return;
|
|
57329
|
+
}
|
|
57330
|
+
if (mouse.action === "release") {
|
|
57331
|
+
const targetCol = columnAtX(mouse.x);
|
|
57332
|
+
if (targetCol >= 0 && targetCol !== taskDrag.sourceCol) {
|
|
57333
|
+
const targetColName = board.columns[targetCol]?.name;
|
|
57334
|
+
if (targetColName) {
|
|
57335
|
+
moveTaskToColumn(kandownDir, taskDrag.taskId, targetColName);
|
|
57336
|
+
const loaded = readBoard(kandownDir);
|
|
57337
|
+
setBoard(loaded);
|
|
57338
|
+
updateLayout(loaded);
|
|
57339
|
+
setColIndex(targetCol);
|
|
57340
|
+
const movedRow = loaded.columns[targetCol]?.tasks.findIndex((task) => task.id === taskDrag.taskId) ?? 0;
|
|
57341
|
+
setRowIndex(Math.max(0, movedRow));
|
|
57342
|
+
setStatusMsg(`Dragged ${taskDrag.taskId} \u2192 ${targetColName}`);
|
|
57343
|
+
setTimeout(() => setStatusMsg(""), 2e3);
|
|
57344
|
+
}
|
|
57345
|
+
}
|
|
57346
|
+
setTaskDrag(null);
|
|
57347
|
+
setMousePress(null);
|
|
57348
|
+
setMoveTaskId(null);
|
|
57349
|
+
setMode("browse");
|
|
57350
|
+
return;
|
|
57351
|
+
}
|
|
57352
|
+
return;
|
|
57353
|
+
}
|
|
57354
|
+
if (mouse.action === "press" && mouse.button === 0) {
|
|
57355
|
+
handleMouseClick(mouse.x, mouse.y);
|
|
57356
|
+
}
|
|
57357
|
+
}, [board, mode, mousePress, taskDrag, taskHitAt, columnAtX, closeContextMenu, handleMouseClick, kandownDir, updateLayout]);
|
|
57242
57358
|
use_input_default((input, key) => {
|
|
57243
57359
|
if (isMouseInput(input)) {
|
|
57244
57360
|
const mouse = parseMouseInput(input);
|
|
57245
|
-
if (mouse
|
|
57246
|
-
handleMouseClick(mouse.x, mouse.y);
|
|
57247
|
-
}
|
|
57361
|
+
if (mouse) handleMouseEvent(mouse);
|
|
57248
57362
|
return;
|
|
57249
57363
|
}
|
|
57250
57364
|
if (mode === "browse") {
|
|
@@ -57335,6 +57449,16 @@ function Board({ kandownDir, version }) {
|
|
|
57335
57449
|
return;
|
|
57336
57450
|
}
|
|
57337
57451
|
}
|
|
57452
|
+
if (mode === "dragging") {
|
|
57453
|
+
if (key.escape || input === "q") {
|
|
57454
|
+
setTaskDrag(null);
|
|
57455
|
+
setMousePress(null);
|
|
57456
|
+
setMoveTaskId(null);
|
|
57457
|
+
setMode("browse");
|
|
57458
|
+
return;
|
|
57459
|
+
}
|
|
57460
|
+
return;
|
|
57461
|
+
}
|
|
57338
57462
|
if (mode === "move-target") {
|
|
57339
57463
|
if (key.escape || input === "q") {
|
|
57340
57464
|
setMoveTaskId(null);
|
|
@@ -57418,6 +57542,8 @@ function Board({ kandownDir, version }) {
|
|
|
57418
57542
|
modeHint = "j/k choose \xB7 Enter confirm \xB7 Esc cancel \xB7 or click";
|
|
57419
57543
|
} else if (mode === "move-target") {
|
|
57420
57544
|
modeHint = "\u2190/\u2192 pick column \xB7 Enter confirm \xB7 Esc cancel \xB7 or click \u2193";
|
|
57545
|
+
} else if (mode === "dragging") {
|
|
57546
|
+
modeHint = "drag over target column \xB7 release to drop \xB7 Esc cancel";
|
|
57421
57547
|
}
|
|
57422
57548
|
if (mode === "agent-picker") {
|
|
57423
57549
|
const taskId = detailTaskId || focusedTask?.id || "";
|
|
@@ -57459,17 +57585,18 @@ function Board({ kandownDir, version }) {
|
|
|
57459
57585
|
colWidth,
|
|
57460
57586
|
contextMenuRow: mode === "context-menu" && cIdx === colIndex ? ctxMenuRow : -1,
|
|
57461
57587
|
contextMenuCursor: ctxMenuCursor,
|
|
57462
|
-
showMoveTarget: mode === "move-target" && cIdx !== colIndex,
|
|
57463
|
-
isMoveFocused: mode === "move-target" && cIdx === moveTargetCol
|
|
57588
|
+
showMoveTarget: mode === "move-target" && cIdx !== colIndex || mode === "dragging" && cIdx !== taskDrag?.sourceCol,
|
|
57589
|
+
isMoveFocused: (mode === "move-target" || mode === "dragging") && cIdx === moveTargetCol,
|
|
57590
|
+
draggedTaskId: taskDrag?.taskId ?? null
|
|
57464
57591
|
},
|
|
57465
57592
|
col.name
|
|
57466
57593
|
)) }),
|
|
57467
|
-
mode === "move-target" && moveTaskId && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Text, { color: "yellow", bold: true, children: [
|
|
57594
|
+
(mode === "move-target" || mode === "dragging") && moveTaskId && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Text, { color: "yellow", bold: true, children: [
|
|
57468
57595
|
"Moving ",
|
|
57469
57596
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { color: "cyan", children: moveTaskId }),
|
|
57470
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { color: "gray", children: " \u2014
|
|
57471
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { color: "yellow", bold: true, children: "\u2193" }),
|
|
57472
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { color: "gray", children: " or \u2190/\u2192 + Enter" })
|
|
57597
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { color: "gray", children: " \u2014 " }),
|
|
57598
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { color: "yellow", bold: true, children: mode === "dragging" ? "release over a column" : "click \u2193" }),
|
|
57599
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Text, { color: "gray", children: mode === "dragging" ? " \xB7 Esc cancel" : " or \u2190/\u2192 + Enter" })
|
|
57473
57600
|
] }) }),
|
|
57474
57601
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(StatusBar, { message: statusMsg, task: focusedTask })
|
|
57475
57602
|
] });
|
|
@@ -57477,18 +57604,38 @@ function Board({ kandownDir, version }) {
|
|
|
57477
57604
|
|
|
57478
57605
|
// src/cli/app.tsx
|
|
57479
57606
|
var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
|
|
57607
|
+
function getTerminalRows() {
|
|
57608
|
+
const rows = process.stdout.rows;
|
|
57609
|
+
return typeof rows === "number" && Number.isFinite(rows) && rows > 0 ? rows : 24;
|
|
57610
|
+
}
|
|
57611
|
+
function useTerminalRows() {
|
|
57612
|
+
const [rows, setRows] = (0, import_react38.useState)(getTerminalRows);
|
|
57613
|
+
(0, import_react38.useEffect)(() => {
|
|
57614
|
+
const handleResize = () => setRows(getTerminalRows());
|
|
57615
|
+
process.stdout.on("resize", handleResize);
|
|
57616
|
+
return () => {
|
|
57617
|
+
process.stdout.off("resize", handleResize);
|
|
57618
|
+
};
|
|
57619
|
+
}, []);
|
|
57620
|
+
return rows;
|
|
57621
|
+
}
|
|
57480
57622
|
function App2({ screen, kandownDir, version }) {
|
|
57623
|
+
const rows = useTerminalRows();
|
|
57624
|
+
let content;
|
|
57481
57625
|
switch (screen) {
|
|
57482
57626
|
case "settings":
|
|
57483
|
-
|
|
57627
|
+
content = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Settings, { kandownDir, version });
|
|
57628
|
+
break;
|
|
57484
57629
|
case "board":
|
|
57485
|
-
|
|
57630
|
+
content = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Board, { kandownDir, version });
|
|
57631
|
+
break;
|
|
57486
57632
|
default:
|
|
57487
|
-
|
|
57633
|
+
content = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Box_default, { padding: 2, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { color: "red", bold: true, children: [
|
|
57488
57634
|
"Unknown screen: ",
|
|
57489
57635
|
screen
|
|
57490
57636
|
] }) });
|
|
57491
57637
|
}
|
|
57638
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Box_default, { flexDirection: "column", height: rows, overflow: "hidden", children: content });
|
|
57492
57639
|
}
|
|
57493
57640
|
|
|
57494
57641
|
// src/cli/tui.tsx
|
|
@@ -57499,15 +57646,13 @@ async function run(screen, kandownDir, version) {
|
|
|
57499
57646
|
"kandown TUI requires an interactive terminal. Run this command directly in your terminal."
|
|
57500
57647
|
);
|
|
57501
57648
|
}
|
|
57502
|
-
process.stdout.write("\x1B[?1049h\x1B[H");
|
|
57503
57649
|
const instance = render_default(/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(App2, { screen, kandownDir, version }), {
|
|
57504
|
-
exitOnCtrlC: true
|
|
57650
|
+
exitOnCtrlC: true,
|
|
57651
|
+
interactive: true,
|
|
57652
|
+
alternateScreen: true,
|
|
57653
|
+
maxFps: 30
|
|
57505
57654
|
});
|
|
57506
|
-
|
|
57507
|
-
await instance.waitUntilExit();
|
|
57508
|
-
} finally {
|
|
57509
|
-
process.stdout.write("\x1B[?1049l");
|
|
57510
|
-
}
|
|
57655
|
+
await instance.waitUntilExit();
|
|
57511
57656
|
}
|
|
57512
57657
|
export {
|
|
57513
57658
|
run
|