@tomkapa/tayto 0.3.0 → 0.3.2

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.
@@ -7,7 +7,7 @@ import {
7
7
  UIDependencyType,
8
8
  isTerminalStatus,
9
9
  logger
10
- } from "./chunk-FUNYPBWJ.js";
10
+ } from "./chunk-STYT4TGJ.js";
11
11
 
12
12
  // src/tui/index.tsx
13
13
  import { render } from "ink";
@@ -1520,6 +1520,8 @@ var SECTIONS = [
1520
1520
  keys: [
1521
1521
  ["\u2190", "Enter reorder"],
1522
1522
  ["\u2191\u2193", "Move task"],
1523
+ ["t", "Jump to top"],
1524
+ ["b", "Jump to bottom"],
1523
1525
  ["\u2192", "Save position"],
1524
1526
  ["esc/\u2190", "Cancel"]
1525
1527
  ]
@@ -2131,6 +2133,37 @@ function App({ container, initialProject }) {
2131
2133
  });
2132
2134
  loadEpics();
2133
2135
  }, [container, state.epics, state.epicSelectedIndex, loadEpics]);
2136
+ const rerankSelectedToEdge = useCallback2(
2137
+ (kind, edge) => {
2138
+ const isEpic = kind === "epic";
2139
+ const item = isEpic ? state.epics[state.epicSelectedIndex] : state.tasks[state.selectedIndex];
2140
+ if (!item) return;
2141
+ const result = container.taskService.rerankTask({
2142
+ taskId: item.id,
2143
+ ...edge === "top" ? { top: true } : { bottom: true }
2144
+ });
2145
+ dispatch({
2146
+ type: isEpic ? "EXIT_EPIC_REORDER" : "EXIT_REORDER",
2147
+ save: result.ok
2148
+ });
2149
+ dispatch({
2150
+ type: "FLASH",
2151
+ message: result.ok ? `${isEpic ? "Epic moved" : "Moved"} to ${edge}` : result.error.message,
2152
+ level: result.ok ? "info" : "error"
2153
+ });
2154
+ if (isEpic) loadEpics();
2155
+ else loadTasks();
2156
+ },
2157
+ [
2158
+ container,
2159
+ state.tasks,
2160
+ state.selectedIndex,
2161
+ state.epics,
2162
+ state.epicSelectedIndex,
2163
+ loadTasks,
2164
+ loadEpics
2165
+ ]
2166
+ );
2134
2167
  const refetchAll = useCallback2(() => {
2135
2168
  loadProjects();
2136
2169
  loadTasks();
@@ -2279,6 +2312,14 @@ function App({ container, initialProject }) {
2279
2312
  dispatch({ type: "EPIC_REORDER_MOVE", direction: "down" });
2280
2313
  return;
2281
2314
  }
2315
+ if (input === "t") {
2316
+ rerankSelectedToEdge("epic", "top");
2317
+ return;
2318
+ }
2319
+ if (input === "b") {
2320
+ rerankSelectedToEdge("epic", "bottom");
2321
+ return;
2322
+ }
2282
2323
  if (key.rightArrow) {
2283
2324
  saveEpicReorder();
2284
2325
  return;
@@ -2299,6 +2340,14 @@ function App({ container, initialProject }) {
2299
2340
  dispatch({ type: "REORDER_MOVE", direction: "down" });
2300
2341
  return;
2301
2342
  }
2343
+ if (input === "t") {
2344
+ rerankSelectedToEdge("task", "top");
2345
+ return;
2346
+ }
2347
+ if (input === "b") {
2348
+ rerankSelectedToEdge("task", "bottom");
2349
+ return;
2350
+ }
2302
2351
  if (key.rightArrow) {
2303
2352
  saveReorder();
2304
2353
  return;
@@ -2358,7 +2407,7 @@ function App({ container, initialProject }) {
2358
2407
  dispatch({ type: "ENTER_EPIC_REORDER" });
2359
2408
  dispatch({
2360
2409
  type: "FLASH",
2361
- message: "Reorder: \u2191\u2193 move, \u2192 save, \u2190 cancel",
2410
+ message: "Reorder: \u2191\u2193 move, t top, b bottom, \u2192 save, \u2190 cancel",
2362
2411
  level: "info"
2363
2412
  });
2364
2413
  }
@@ -2482,7 +2531,11 @@ function App({ container, initialProject }) {
2482
2531
  }
2483
2532
  if (state.tasks.length > 0) {
2484
2533
  dispatch({ type: "ENTER_REORDER" });
2485
- dispatch({ type: "FLASH", message: "Reorder: \u2191\u2193 move, \u2192 save, \u2190 cancel", level: "info" });
2534
+ dispatch({
2535
+ type: "FLASH",
2536
+ message: "Reorder: \u2191\u2193 move, t top, b bottom, \u2192 save, \u2190 cancel",
2537
+ level: "info"
2538
+ });
2486
2539
  }
2487
2540
  return;
2488
2541
  }
@@ -2943,4 +2996,4 @@ async function launchTUI(container, initialProject) {
2943
2996
  export {
2944
2997
  launchTUI
2945
2998
  };
2946
- //# sourceMappingURL=tui-5JJH67YY.js.map
2999
+ //# sourceMappingURL=tui-JEP3F4JS.js.map