@kud/jira-cli 0.5.0 → 0.5.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.
package/README.md CHANGED
@@ -51,7 +51,7 @@ jira
51
51
 
52
52
  Your issues as a board: three tabs — **To do**, **In progress**, **Done** — filed by Jira's status *category*, so it works on any instance without knowing what your board calls its columns. Rows hang under their epic, carry a type pill, a priority glyph (`▲` high, `▼` low) and how long since they last moved. Closed work from the last fortnight is on the Done tab; `a` loads everything.
53
53
 
54
- `↑↓` to move, `⇥` to switch tab, `enter` to open, `?` for the legend, `r` to refresh, `q` to quit.
54
+ `↑↓` to move, `←→` (or `⇥`) to switch tab, `enter` to open, `?` for the legend, `r` to refresh, `q` to quit.
55
55
 
56
56
  `/` searches. Plain words narrow the list as you type and, on `enter`, run as `text ~ "…"` within your issues — so a match in a comment counts too. Anything shaped like JQL (`status = Done`, `labels in (a, b)`, `ORDER BY …`) is sent as-is and replaces the scope; the tag at the end of the line says which reading it took, and `⇥` flips it. A query Jira rejects shows Jira's own message under the box and keeps your text for editing. `esc` clears the search.
57
57
 
package/dist/index.js CHANGED
@@ -888,7 +888,7 @@ var interactiveArgs = (argv) => {
888
888
  var main = async () => {
889
889
  const { screen, mock, isBare } = interactiveArgs(process.argv);
890
890
  if (screen === "list" && isBare) {
891
- const { SCREENS } = await import("./tui-TWKZI63D.js");
891
+ const { SCREENS } = await import("./tui-XQKRS4AW.js");
892
892
  process.stdout.write(`${SCREENS.join("\n")}
893
893
  `);
894
894
  return;
@@ -898,7 +898,7 @@ var main = async () => {
898
898
  program.outputHelp();
899
899
  return;
900
900
  }
901
- const { runTui } = await import("./tui-TWKZI63D.js");
901
+ const { runTui } = await import("./tui-XQKRS4AW.js");
902
902
  const [, key] = (screen ?? "").split(":");
903
903
  await runTui({
904
904
  screen: screen?.startsWith("detail") ? "detail" : "issues",
@@ -45,26 +45,46 @@ var countsFor = (rows) => rows.reduce(
45
45
  }),
46
46
  { todo: 0, doing: 0, done: 0 }
47
47
  );
48
+ var isEpic = (row) => row.type.toLowerCase() === "epic";
48
49
  var blocksFor = (rows) => {
49
- if (!rows.some((r) => r.parent))
50
- return rows.map((row) => ({ kind: "issue", row }));
51
- const groups = /* @__PURE__ */ new Map();
50
+ const hasStructure = rows.some((r) => r.parent || isEpic(r));
51
+ if (!hasStructure)
52
+ return rows.map((row) => ({ kind: "issue", row, depth: 0 }));
53
+ const heads = new Map(rows.filter(isEpic).map((r) => [r.key, r]));
54
+ const children = /* @__PURE__ */ new Map();
55
+ const orphans = [];
52
56
  for (const row of rows) {
53
- const key = row.parent?.key ?? null;
54
- const group = groups.get(key) ?? {
55
- summary: row.parent?.summary ?? "",
56
- rows: []
57
- };
58
- group.rows.push(row);
59
- groups.set(key, group);
57
+ if (isEpic(row)) continue;
58
+ const key = row.parent?.key;
59
+ if (!key) {
60
+ orphans.push(row);
61
+ continue;
62
+ }
63
+ children.set(key, [...children.get(key) ?? [], row]);
64
+ }
65
+ const groups = [];
66
+ for (const [key, head] of heads)
67
+ groups.push([
68
+ { kind: "issue", row: head, depth: 0 },
69
+ ...(children.get(key) ?? []).map(
70
+ (row) => ({ kind: "issue", row, depth: 1 })
71
+ )
72
+ ]);
73
+ for (const [key, kids] of children) {
74
+ if (heads.has(key)) continue;
75
+ groups.push([
76
+ { kind: "fence", key, summary: kids[0].parent?.summary ?? "" },
77
+ ...kids.map((row) => ({ kind: "issue", row, depth: 1 }))
78
+ ]);
60
79
  }
61
- const ordered = [...groups.entries()].sort(
62
- ([a], [b]) => a === null ? 1 : b === null ? -1 : 0
80
+ if (orphans.length)
81
+ groups.push([
82
+ ...groups.length ? [{ kind: "fence", key: null, summary: "No epic" }] : [],
83
+ ...orphans.map((row) => ({ kind: "issue", row, depth: 0 }))
84
+ ]);
85
+ return groups.flatMap(
86
+ (group, i) => i === 0 ? group : [{ kind: "gap" }, ...group]
63
87
  );
64
- return ordered.flatMap(([key, group]) => [
65
- { kind: "header", key, summary: key ? group.summary : "No epic" },
66
- ...group.rows.map((row) => ({ kind: "issue", row }))
67
- ]);
68
88
  };
69
89
  var blockIndexOfIssue = (blocks, issueIndex) => {
70
90
  let seen = -1;
@@ -107,7 +127,7 @@ var pillVariantFor = (type) => {
107
127
 
108
128
  // src/tui/list.tsx
109
129
  import { jsx, jsxs } from "react/jsx-runtime";
110
- var CHROME = 9;
130
+ var CHROME = 10;
111
131
  var LEGEND = [
112
132
  ["\u25B2", "high priority"],
113
133
  ["\u25BC", "low priority"],
@@ -163,7 +183,7 @@ var IssueList = ({
163
183
  const counts = countsFor(narrowed);
164
184
  const tabItems = TABS.map((t) => ({ ...t, count: counts[t.value] }));
165
185
  const listFocused = !search.open && !legend;
166
- const { active } = useTabs(tabItems, {
186
+ const { active, setActive } = useTabs(tabItems, {
167
187
  initial: "doing",
168
188
  isActive: listFocused
169
189
  });
@@ -195,6 +215,11 @@ var IssueList = ({
195
215
  return;
196
216
  }
197
217
  if (key.return && issues[cursor]) onOpen(issues[cursor].row.key);
218
+ if (key.leftArrow || key.rightArrow) {
219
+ const at = TABS.findIndex((t) => t.value === tab);
220
+ const next = (at + (key.leftArrow ? -1 : 1) + TABS.length) % TABS.length;
221
+ setActive(TABS[next].value);
222
+ }
198
223
  if (input === "/")
199
224
  setSearch((s) => ({
200
225
  ...s,
@@ -224,7 +249,7 @@ var IssueList = ({
224
249
  ["esc", "cancel"]
225
250
  ] : legend ? [["?", "close"]] : [
226
251
  ["\u2191\u2193", "move"],
227
- ["\u21E5", "tab"],
252
+ ["\u2190\u2192", "tab"],
228
253
  ["enter", "open"],
229
254
  ["/", scope.kind === "search" ? "edit" : "search"],
230
255
  ...scope.kind === "search" ? [["esc", "clear"]] : [["a", showingAll ? "recent only" : "everything"]],
@@ -271,7 +296,7 @@ var IssueList = ({
271
296
  " \u2717 ",
272
297
  searchError
273
298
  ] }) : null,
274
- /* @__PURE__ */ jsx(Box, { paddingLeft: 2, children: /* @__PURE__ */ jsx(Tabs, { active: tab, items: tabItems }) }),
299
+ /* @__PURE__ */ jsx(Box, { paddingLeft: 2, marginTop: 1, children: /* @__PURE__ */ jsx(Tabs, { active: tab, items: tabItems }) }),
275
300
  /* @__PURE__ */ jsx(
276
301
  Box,
277
302
  {
@@ -283,10 +308,11 @@ var IssueList = ({
283
308
  /* @__PURE__ */ jsx(Box, { width: 28, flexShrink: 0, children: /* @__PURE__ */ jsx(Text, { color: colors.accent, children: glyph }) }),
284
309
  /* @__PURE__ */ jsx(Text, { dimColor: true, children: meaning })
285
310
  ] }, glyph)) : issues.length === 0 ? /* @__PURE__ */ jsx(Box, { paddingLeft: 4, children: /* @__PURE__ */ jsx(Text, { dimColor: true, children: emptyHint(tab, counts, showingAll, scope) }) }) : blocks.slice(start, end).map(
286
- (block, i) => block.kind === "header" ? /* @__PURE__ */ jsx(Box, { paddingLeft: 4, children: /* @__PURE__ */ jsx(Text, { dimColor: true, children: rule(
311
+ (block, i) => block.kind === "gap" ? /* @__PURE__ */ jsx(Text, { children: " " }, `gap:${start + i}`) : block.kind === "fence" ? /* @__PURE__ */ jsx(Box, { paddingLeft: 4, children: /* @__PURE__ */ jsx(Text, { dimColor: true, children: rule(
287
312
  block.key ? `${block.summary} \xB7 ${block.key}` : block.summary,
288
313
  width - 7
289
- ) }) }, `h:${block.key ?? "none"}`) : /* @__PURE__ */ jsxs(SelectableRow, { active: start + i === focus, children: [
314
+ ) }) }, `f:${block.key ?? "none"}`) : /* @__PURE__ */ jsxs(SelectableRow, { active: start + i === focus, children: [
315
+ block.depth === 1 ? /* @__PURE__ */ jsx(Box, { flexShrink: 0, width: 3, children: /* @__PURE__ */ jsx(Text, { dimColor: true, children: "\u2514\u2500 " }) }) : null,
290
316
  /* @__PURE__ */ jsx(Box, { flexShrink: 0, width: 2, children: /* @__PURE__ */ jsx(
291
317
  Text,
292
318
  {
@@ -637,6 +663,16 @@ var liveData = (ctx = context()) => ({
637
663
  var CHECKOUT = { key: "SHOP-300", summary: "Basket and checkout correctness" };
638
664
  var STOREFRONT = { key: "SHOP-350", summary: "Storefront refresh" };
639
665
  var ROWS = [
666
+ {
667
+ key: "SHOP-300",
668
+ status: "To Do",
669
+ category: "new",
670
+ summary: "Basket and checkout correctness",
671
+ type: "Epic",
672
+ priority: "Medium",
673
+ assignee: "Ada Okafor",
674
+ updated: "2026-08-14T10:00:00.000Z"
675
+ },
640
676
  {
641
677
  key: "SHOP-412",
642
678
  status: "In Progress",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kud/jira-cli",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "type": "module",
5
5
  "description": "Jira on the command line — read issues, comments and attachments as plain text",
6
6
  "keywords": [