@kud/jira-cli 0.5.1 → 0.5.3

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-K7CKDM5F.js");
891
+ const { SCREENS } = await import("./tui-ZP4S2UZS.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-K7CKDM5F.js");
901
+ const { runTui } = await import("./tui-ZP4S2UZS.js");
902
902
  const [, key] = (screen ?? "").split(":");
903
903
  await runTui({
904
904
  screen: screen?.startsWith("detail") ? "detail" : "issues",
@@ -9,17 +9,39 @@ import { render } from "ink";
9
9
 
10
10
  // src/tui/app.tsx
11
11
  import { execFile } from "child_process";
12
- import { Alert, ConfirmInput, Select, Spinner, TextInput as TextInput2 } from "@kud/ink-ui";
13
- import { Box as Box2, Text as Text2, useApp, useInput as useInput2, useStdout } from "ink";
12
+ import {
13
+ Alert,
14
+ ConfirmInput,
15
+ Select,
16
+ Spinner,
17
+ TextInput as TextInput2
18
+ } from "@kud/ink-ui";
19
+ import { Box as Box3, Text as Text3, useApp, useInput as useInput2, useStdout } from "ink";
14
20
  import { useCallback, useEffect as useEffect2, useState as useState2 } from "react";
15
21
  import { isJiraApiError } from "@kud/jira";
16
22
  import { IssueDetailView } from "@kud/jira-ink";
17
23
 
24
+ // src/tui/frame.tsx
25
+ import { FooterHints, Panel } from "@kud/ink-ui";
26
+ import { Box, Text } from "ink";
27
+ import { jsx, jsxs } from "react/jsx-runtime";
28
+ var Frame = ({ width, height, facts, hints, children }) => /* @__PURE__ */ jsxs(Panel, { width, height, children: [
29
+ /* @__PURE__ */ jsxs(Box, { paddingLeft: 1, children: [
30
+ /* @__PURE__ */ jsx(Text, { bold: true, children: "\u{1F3AB} Jira" }),
31
+ /* @__PURE__ */ jsxs(Text, { dimColor: true, children: [
32
+ " ",
33
+ facts
34
+ ] })
35
+ ] }),
36
+ /* @__PURE__ */ jsx(Box, { flexDirection: "column", flexGrow: 1, children }),
37
+ hints ? /* @__PURE__ */ jsx(Box, { paddingLeft: 2, children: /* @__PURE__ */ jsx(FooterHints, { hints }) }) : null
38
+ ] });
39
+ var FRAME_CHROME = 3;
40
+
18
41
  // src/tui/list.tsx
19
42
  import {
20
43
  colors,
21
- FooterHints,
22
- Panel,
44
+ FooterHints as FooterHints2,
23
45
  Pill,
24
46
  pillWidth,
25
47
  SelectableRow,
@@ -28,7 +50,7 @@ import {
28
50
  useListCursor,
29
51
  useTabs
30
52
  } from "@kud/ink-ui";
31
- import { Box, Text, useInput } from "ink";
53
+ import { Box as Box2, Text as Text2, useInput } from "ink";
32
54
  import { useEffect, useMemo, useState } from "react";
33
55
 
34
56
  // src/tui/board.ts
@@ -126,7 +148,7 @@ var pillVariantFor = (type) => {
126
148
  };
127
149
 
128
150
  // src/tui/list.tsx
129
- import { jsx, jsxs } from "react/jsx-runtime";
151
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
130
152
  var CHROME = 10;
131
153
  var LEGEND = [
132
154
  ["\u25B2", "high priority"],
@@ -183,7 +205,7 @@ var IssueList = ({
183
205
  const counts = countsFor(narrowed);
184
206
  const tabItems = TABS.map((t) => ({ ...t, count: counts[t.value] }));
185
207
  const listFocused = !search.open && !legend;
186
- const { active } = useTabs(tabItems, {
208
+ const { active, setActive } = useTabs(tabItems, {
187
209
  initial: "doing",
188
210
  isActive: listFocused
189
211
  });
@@ -215,6 +237,11 @@ var IssueList = ({
215
237
  return;
216
238
  }
217
239
  if (key.return && issues[cursor]) onOpen(issues[cursor].row.key);
240
+ if (key.leftArrow || key.rightArrow) {
241
+ const at = TABS.findIndex((t) => t.value === tab);
242
+ const next = (at + (key.leftArrow ? -1 : 1) + TABS.length) % TABS.length;
243
+ setActive(TABS[next].value);
244
+ }
218
245
  if (input === "/")
219
246
  setSearch((s) => ({
220
247
  ...s,
@@ -244,7 +271,7 @@ var IssueList = ({
244
271
  ["esc", "cancel"]
245
272
  ] : legend ? [["?", "close"]] : [
246
273
  ["\u2191\u2193", "move"],
247
- ["\u21E5", "tab"],
274
+ ["\u2190\u2192", "tab"],
248
275
  ["enter", "open"],
249
276
  ["/", scope.kind === "search" ? "edit" : "search"],
250
277
  ...scope.kind === "search" ? [["esc", "clear"]] : [["a", showingAll ? "recent only" : "everything"]],
@@ -252,82 +279,77 @@ var IssueList = ({
252
279
  ["?", "legend"],
253
280
  ["q", "quit"]
254
281
  ];
255
- return /* @__PURE__ */ jsxs(Panel, { width, height, children: [
256
- /* @__PURE__ */ jsxs(Box, { paddingLeft: 1, children: [
257
- /* @__PURE__ */ jsx(Text, { bold: true, children: "\u{1F3AB} Jira" }),
258
- /* @__PURE__ */ jsxs(Text, { dimColor: true, children: [
259
- " ",
260
- countLabel,
261
- " \xB7 ",
262
- scopeLabel,
263
- " \xB7 updated",
264
- " ",
265
- relativeAge(new Date(loadedAt).toISOString(), now),
266
- " ago"
267
- ] })
268
- ] }),
269
- search.open ? /* @__PURE__ */ jsxs(Box, { paddingRight: 1, children: [
270
- /* @__PURE__ */ jsx(Box, { flexShrink: 0, children: /* @__PURE__ */ jsx(Text, { color: colors.accent, children: " / " }) }),
271
- /* @__PURE__ */ jsx(Box, { flexGrow: 1, children: /* @__PURE__ */ jsx(
272
- TextInput,
273
- {
274
- defaultValue: search.draft,
275
- placeholder: "words, or JQL",
276
- onChange: (draft) => setSearch((s) => ({ ...s, draft })),
277
- onSubmit: (query) => {
278
- setSearch((s) => ({ ...s, open: false, draft: query }));
279
- if (query.trim()) onSearch(query, search.mode);
280
- else onClearSearch();
281
- }
282
- }
283
- ) }),
284
- /* @__PURE__ */ jsx(Box, { flexShrink: 0, children: /* @__PURE__ */ jsx(Text, { dimColor: true, children: modeOf(search) === "jql" ? "JQL" : "plain" }) })
285
- ] }) : scope.kind === "search" ? /* @__PURE__ */ jsxs(Box, { paddingRight: 1, children: [
286
- /* @__PURE__ */ jsx(Box, { flexShrink: 0, children: /* @__PURE__ */ jsx(Text, { color: colors.accent, children: " / " }) }),
287
- /* @__PURE__ */ jsx(Box, { flexGrow: 1, children: /* @__PURE__ */ jsx(Text, { wrap: "truncate-end", children: scope.query }) }),
288
- /* @__PURE__ */ jsx(Box, { flexShrink: 0, children: /* @__PURE__ */ jsx(Text, { dimColor: true, children: scope.mode === "jql" ? "JQL" : "plain" }) })
289
- ] }) : null,
290
- searchError ? /* @__PURE__ */ jsxs(Text, { color: colors.error, children: [
291
- " \u2717 ",
292
- searchError
293
- ] }) : null,
294
- /* @__PURE__ */ jsx(Box, { paddingLeft: 2, marginTop: 1, children: /* @__PURE__ */ jsx(Tabs, { active: tab, items: tabItems }) }),
295
- /* @__PURE__ */ jsx(
296
- Box,
297
- {
298
- flexDirection: "column",
299
- marginTop: 1,
300
- height: size,
301
- paddingRight: 1,
302
- children: legend ? LEGEND.map(([glyph, meaning]) => /* @__PURE__ */ jsxs(Box, { paddingLeft: 4, children: [
303
- /* @__PURE__ */ jsx(Box, { width: 28, flexShrink: 0, children: /* @__PURE__ */ jsx(Text, { color: colors.accent, children: glyph }) }),
304
- /* @__PURE__ */ jsx(Text, { dimColor: true, children: meaning })
305
- ] }, 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(
306
- (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(
307
- block.key ? `${block.summary} \xB7 ${block.key}` : block.summary,
308
- width - 7
309
- ) }) }, `f:${block.key ?? "none"}`) : /* @__PURE__ */ jsxs(SelectableRow, { active: start + i === focus, children: [
310
- block.depth === 1 ? /* @__PURE__ */ jsx(Box, { flexShrink: 0, width: 3, children: /* @__PURE__ */ jsx(Text, { dimColor: true, children: "\u2514\u2500 " }) }) : null,
311
- /* @__PURE__ */ jsx(Box, { flexShrink: 0, width: 2, children: /* @__PURE__ */ jsx(
312
- Text,
313
- {
314
- color: priorityGlyph(block.row.priority) === "\u25B2" ? colors.warning : colors.muted,
315
- children: priorityGlyph(block.row.priority)
282
+ return /* @__PURE__ */ jsxs2(
283
+ Frame,
284
+ {
285
+ width,
286
+ height,
287
+ facts: `${countLabel} \xB7 ${scopeLabel} \xB7 updated ${relativeAge(new Date(loadedAt).toISOString(), now)} ago`,
288
+ children: [
289
+ search.open ? /* @__PURE__ */ jsxs2(Box2, { paddingRight: 1, children: [
290
+ /* @__PURE__ */ jsx2(Box2, { flexShrink: 0, children: /* @__PURE__ */ jsx2(Text2, { color: colors.accent, children: " / " }) }),
291
+ /* @__PURE__ */ jsx2(Box2, { flexGrow: 1, children: /* @__PURE__ */ jsx2(
292
+ TextInput,
293
+ {
294
+ defaultValue: search.draft,
295
+ placeholder: "words, or JQL",
296
+ onChange: (draft) => setSearch((s) => ({ ...s, draft })),
297
+ onSubmit: (query) => {
298
+ setSearch((s) => ({ ...s, open: false, draft: query }));
299
+ if (query.trim()) onSearch(query, search.mode);
300
+ else onClearSearch();
316
301
  }
317
- ) }),
318
- /* @__PURE__ */ jsx(Box, { flexShrink: 0, width: keyWidth + 2, children: /* @__PURE__ */ jsx(Text, { color: colors.accent, bold: start + i === focus, children: block.row.key }) }),
319
- /* @__PURE__ */ jsx(Box, { flexShrink: 0, width: typeWidth + 2, children: /* @__PURE__ */ jsx(Pill, { tone: "soft", variant: pillVariantFor(block.row.type), children: block.row.type.toLowerCase() }) }),
320
- /* @__PURE__ */ jsx(Box, { flexGrow: 1, children: /* @__PURE__ */ jsx(Text, { wrap: "truncate-end", bold: start + i === focus, children: block.row.summary }) }),
321
- /* @__PURE__ */ jsx(Box, { flexShrink: 0, width: 5, justifyContent: "flex-end", children: /* @__PURE__ */ jsx(Text, { dimColor: true, children: relativeAge(block.row.updated, now) }) })
322
- ] }, block.row.key)
323
- )
324
- }
325
- ),
326
- /* @__PURE__ */ jsxs(Box, { marginTop: 1, paddingLeft: 2, flexDirection: "column", children: [
327
- /* @__PURE__ */ jsx(Text, { dimColor: true, children: issues.length ? `${cursor + 1}/${issues.length}` : " " }),
328
- /* @__PURE__ */ jsx(FooterHints, { hints })
329
- ] })
330
- ] });
302
+ }
303
+ ) }),
304
+ /* @__PURE__ */ jsx2(Box2, { flexShrink: 0, children: /* @__PURE__ */ jsx2(Text2, { dimColor: true, children: modeOf(search) === "jql" ? "JQL" : "plain" }) })
305
+ ] }) : scope.kind === "search" ? /* @__PURE__ */ jsxs2(Box2, { paddingRight: 1, children: [
306
+ /* @__PURE__ */ jsx2(Box2, { flexShrink: 0, children: /* @__PURE__ */ jsx2(Text2, { color: colors.accent, children: " / " }) }),
307
+ /* @__PURE__ */ jsx2(Box2, { flexGrow: 1, children: /* @__PURE__ */ jsx2(Text2, { wrap: "truncate-end", children: scope.query }) }),
308
+ /* @__PURE__ */ jsx2(Box2, { flexShrink: 0, children: /* @__PURE__ */ jsx2(Text2, { dimColor: true, children: scope.mode === "jql" ? "JQL" : "plain" }) })
309
+ ] }) : null,
310
+ searchError ? /* @__PURE__ */ jsxs2(Text2, { color: colors.error, children: [
311
+ " \u2717 ",
312
+ searchError
313
+ ] }) : null,
314
+ /* @__PURE__ */ jsx2(Box2, { paddingLeft: 2, marginTop: 1, children: /* @__PURE__ */ jsx2(Tabs, { active: tab, items: tabItems }) }),
315
+ /* @__PURE__ */ jsx2(
316
+ Box2,
317
+ {
318
+ flexDirection: "column",
319
+ marginTop: 1,
320
+ height: size,
321
+ paddingRight: 1,
322
+ children: legend ? LEGEND.map(([glyph, meaning]) => /* @__PURE__ */ jsxs2(Box2, { paddingLeft: 4, children: [
323
+ /* @__PURE__ */ jsx2(Box2, { width: 28, flexShrink: 0, children: /* @__PURE__ */ jsx2(Text2, { color: colors.accent, children: glyph }) }),
324
+ /* @__PURE__ */ jsx2(Text2, { dimColor: true, children: meaning })
325
+ ] }, glyph)) : issues.length === 0 ? /* @__PURE__ */ jsx2(Box2, { paddingLeft: 4, children: /* @__PURE__ */ jsx2(Text2, { dimColor: true, children: emptyHint(tab, counts, showingAll, scope) }) }) : blocks.slice(start, end).map(
326
+ (block, i) => block.kind === "gap" ? /* @__PURE__ */ jsx2(Text2, { children: " " }, `gap:${start + i}`) : block.kind === "fence" ? /* @__PURE__ */ jsx2(Box2, { paddingLeft: 4, children: /* @__PURE__ */ jsx2(Text2, { dimColor: true, children: rule(
327
+ block.key ? `${block.summary} \xB7 ${block.key}` : block.summary,
328
+ width - 7
329
+ ) }) }, `f:${block.key ?? "none"}`) : /* @__PURE__ */ jsxs2(SelectableRow, { active: start + i === focus, children: [
330
+ block.depth === 1 ? /* @__PURE__ */ jsx2(Box2, { flexShrink: 0, width: 3, children: /* @__PURE__ */ jsx2(Text2, { dimColor: true, children: "\u2514\u2500 " }) }) : null,
331
+ /* @__PURE__ */ jsx2(Box2, { flexShrink: 0, width: 2, children: /* @__PURE__ */ jsx2(
332
+ Text2,
333
+ {
334
+ color: priorityGlyph(block.row.priority) === "\u25B2" ? colors.warning : colors.muted,
335
+ children: priorityGlyph(block.row.priority)
336
+ }
337
+ ) }),
338
+ /* @__PURE__ */ jsx2(Box2, { flexShrink: 0, width: keyWidth + 2, children: /* @__PURE__ */ jsx2(Text2, { color: colors.accent, bold: start + i === focus, children: block.row.key }) }),
339
+ /* @__PURE__ */ jsx2(Box2, { flexShrink: 0, width: typeWidth + 2, children: /* @__PURE__ */ jsx2(Pill, { tone: "soft", variant: pillVariantFor(block.row.type), children: block.row.type.toLowerCase() }) }),
340
+ /* @__PURE__ */ jsx2(Box2, { flexGrow: 1, children: /* @__PURE__ */ jsx2(Text2, { wrap: "truncate-end", bold: start + i === focus, children: block.row.summary }) }),
341
+ /* @__PURE__ */ jsx2(Box2, { flexShrink: 0, width: 5, justifyContent: "flex-end", children: /* @__PURE__ */ jsx2(Text2, { dimColor: true, children: relativeAge(block.row.updated, now) }) })
342
+ ] }, block.row.key)
343
+ )
344
+ }
345
+ ),
346
+ /* @__PURE__ */ jsxs2(Box2, { marginTop: 1, paddingLeft: 2, flexDirection: "column", children: [
347
+ /* @__PURE__ */ jsx2(Text2, { dimColor: true, children: issues.length ? `${cursor + 1}/${issues.length}` : " " }),
348
+ /* @__PURE__ */ jsx2(FooterHints2, { hints })
349
+ ] })
350
+ ]
351
+ }
352
+ );
331
353
  };
332
354
  var modeOf = (s) => s.mode === "auto" ? looksLikeJql(s.draft) ? "jql" : "text" : s.mode;
333
355
  var rule = (label, width) => {
@@ -347,7 +369,8 @@ var emptyHint = (tab, counts, showingAll, scope) => {
347
369
  };
348
370
 
349
371
  // src/tui/app.tsx
350
- import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
372
+ import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
373
+ var DETAIL_CHROME = 5;
351
374
  var MIN_WIDTH = 60;
352
375
  var MIN_HEIGHT = 12;
353
376
  var App = ({ data, initialScreen, initialKey }) => {
@@ -425,7 +448,7 @@ var App = ({ data, initialScreen, initialKey }) => {
425
448
  }
426
449
  });
427
450
  if (width < MIN_WIDTH || height < MIN_HEIGHT) {
428
- return /* @__PURE__ */ jsxs2(Text2, { children: [
451
+ return /* @__PURE__ */ jsxs3(Text3, { children: [
429
452
  "Terminal too small \u2014 needs at least ",
430
453
  MIN_WIDTH,
431
454
  "\xD7",
@@ -438,112 +461,134 @@ var App = ({ data, initialScreen, initialKey }) => {
438
461
  "."
439
462
  ] });
440
463
  }
441
- if (error) {
442
- return /* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", gap: 1, children: [
443
- /* @__PURE__ */ jsx2(Alert, { variant: "error", children: error }),
444
- /* @__PURE__ */ jsx2(Text2, { dimColor: true, children: "r retry \xB7 q quit" })
445
- ] });
446
- }
447
- if (busy) return /* @__PURE__ */ jsx2(Spinner, { label: busy });
464
+ const framed = (facts, body, hints) => /* @__PURE__ */ jsx3(Frame, { width, height, facts, hints, children: /* @__PURE__ */ jsx3(Box3, { flexDirection: "column", marginTop: 1, paddingLeft: 2, flexGrow: 1, children: body }) });
465
+ if (error)
466
+ return framed("error", /* @__PURE__ */ jsx3(Alert, { variant: "error", children: error }), [
467
+ ["r", "retry"],
468
+ ["q", "quit"]
469
+ ]);
470
+ if (busy) return framed("working\u2026", /* @__PURE__ */ jsx3(Spinner, { label: busy }));
448
471
  if (overlay.kind === "transition") {
449
- return /* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", gap: 1, children: [
450
- /* @__PURE__ */ jsxs2(Text2, { bold: true, children: [
451
- "Move ",
452
- issue?.key,
453
- " to\u2026"
454
- ] }),
455
- /* @__PURE__ */ jsx2(
456
- Select,
457
- {
458
- options: overlay.options.map((t) => ({
459
- label: `${t.name} \u2192 ${t.to}`,
460
- value: t.id
461
- })),
462
- onSubmit: (id) => {
463
- setOverlay({ kind: "none" });
464
- void (async () => {
465
- setBusy("Transitioning\u2026");
466
- try {
467
- await data.transition(issue.key, id);
468
- await loadIssue(issue.key);
469
- } catch (e) {
470
- setError(e instanceof Error ? e.message : String(e));
471
- } finally {
472
- setBusy(null);
473
- }
474
- })();
472
+ return framed(
473
+ issue?.key ?? "",
474
+ /* @__PURE__ */ jsxs3(Box3, { flexDirection: "column", gap: 1, children: [
475
+ /* @__PURE__ */ jsxs3(Text3, { bold: true, children: [
476
+ "Move ",
477
+ issue?.key,
478
+ " to\u2026"
479
+ ] }),
480
+ /* @__PURE__ */ jsx3(
481
+ Select,
482
+ {
483
+ options: overlay.options.map((t) => ({
484
+ label: `${t.name} \u2192 ${t.to}`,
485
+ value: t.id
486
+ })),
487
+ onSubmit: (id) => {
488
+ setOverlay({ kind: "none" });
489
+ void (async () => {
490
+ setBusy("Transitioning\u2026");
491
+ try {
492
+ await data.transition(issue.key, id);
493
+ await loadIssue(issue.key);
494
+ } catch (e) {
495
+ setError(e instanceof Error ? e.message : String(e));
496
+ } finally {
497
+ setBusy(null);
498
+ }
499
+ })();
500
+ }
475
501
  }
476
- }
477
- ),
478
- /* @__PURE__ */ jsx2(Text2, { dimColor: true, children: "esc cancel" })
479
- ] });
502
+ ),
503
+ /* @__PURE__ */ jsx3(Text3, { dimColor: true, children: "esc cancel" })
504
+ ] })
505
+ );
480
506
  }
481
507
  if (overlay.kind === "comment") {
482
- return /* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", gap: 1, children: [
483
- /* @__PURE__ */ jsxs2(Text2, { bold: true, children: [
484
- "Comment on ",
485
- issue?.key
486
- ] }),
487
- /* @__PURE__ */ jsx2(
488
- TextInput2,
489
- {
490
- placeholder: "Markdown is supported\u2026",
491
- onSubmit: (body) => {
492
- setOverlay({ kind: "none" });
493
- if (!body.trim()) return;
494
- void (async () => {
495
- setBusy("Posting\u2026");
496
- try {
497
- await data.comment(issue.key, body);
498
- await loadIssue(issue.key);
499
- } catch (e) {
500
- setError(e instanceof Error ? e.message : String(e));
501
- } finally {
502
- setBusy(null);
503
- }
504
- })();
508
+ return framed(
509
+ issue?.key ?? "",
510
+ /* @__PURE__ */ jsxs3(Box3, { flexDirection: "column", gap: 1, children: [
511
+ /* @__PURE__ */ jsxs3(Text3, { bold: true, children: [
512
+ "Comment on ",
513
+ issue?.key
514
+ ] }),
515
+ /* @__PURE__ */ jsx3(
516
+ TextInput2,
517
+ {
518
+ placeholder: "Markdown is supported\u2026",
519
+ onSubmit: (body) => {
520
+ setOverlay({ kind: "none" });
521
+ if (!body.trim()) return;
522
+ void (async () => {
523
+ setBusy("Posting\u2026");
524
+ try {
525
+ await data.comment(issue.key, body);
526
+ await loadIssue(issue.key);
527
+ } catch (e) {
528
+ setError(e instanceof Error ? e.message : String(e));
529
+ } finally {
530
+ setBusy(null);
531
+ }
532
+ })();
533
+ }
505
534
  }
506
- }
507
- )
508
- ] });
535
+ )
536
+ ] })
537
+ );
509
538
  }
510
539
  if (overlay.kind === "assign") {
511
- return /* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", gap: 1, children: [
512
- /* @__PURE__ */ jsxs2(Text2, { children: [
513
- "Assign ",
514
- issue?.key,
515
- " to yourself?"
516
- ] }),
517
- /* @__PURE__ */ jsx2(
518
- ConfirmInput,
519
- {
520
- onCancel: () => setOverlay({ kind: "none" }),
521
- onConfirm: () => {
522
- setOverlay({ kind: "none" });
523
- void (async () => {
524
- setBusy("Assigning\u2026");
525
- try {
526
- await data.assignToMe(issue.key);
527
- await loadIssue(issue.key);
528
- } catch (e) {
529
- setError(e instanceof Error ? e.message : String(e));
530
- } finally {
531
- setBusy(null);
532
- }
533
- })();
540
+ return framed(
541
+ issue?.key ?? "",
542
+ /* @__PURE__ */ jsxs3(Box3, { flexDirection: "column", gap: 1, children: [
543
+ /* @__PURE__ */ jsxs3(Text3, { children: [
544
+ "Assign ",
545
+ issue?.key,
546
+ " to yourself?"
547
+ ] }),
548
+ /* @__PURE__ */ jsx3(
549
+ ConfirmInput,
550
+ {
551
+ onCancel: () => setOverlay({ kind: "none" }),
552
+ onConfirm: () => {
553
+ setOverlay({ kind: "none" });
554
+ void (async () => {
555
+ setBusy("Assigning\u2026");
556
+ try {
557
+ await data.assignToMe(issue.key);
558
+ await loadIssue(issue.key);
559
+ } catch (e) {
560
+ setError(e instanceof Error ? e.message : String(e));
561
+ } finally {
562
+ setBusy(null);
563
+ }
564
+ })();
565
+ }
534
566
  }
535
- }
536
- )
537
- ] });
567
+ )
568
+ ] })
569
+ );
538
570
  }
539
571
  if (screen === "detail") {
540
- if (!issue) return /* @__PURE__ */ jsx2(Spinner, { label: "Loading issue\u2026" });
541
- return /* @__PURE__ */ jsx2(
572
+ if (!issue) return framed("loading\u2026", /* @__PURE__ */ jsx3(Spinner, { label: "Loading issue\u2026" }));
573
+ return /* @__PURE__ */ jsx3(
542
574
  IssueDetailView,
543
575
  {
544
576
  issue,
545
577
  width,
546
- height,
578
+ height: height - FRAME_CHROME - DETAIL_CHROME,
579
+ frame: ({ title, subtitle, hints, body }) => /* @__PURE__ */ jsxs3(Frame, { width, height, facts: title, hints, children: [
580
+ /* @__PURE__ */ jsx3(Box3, { paddingLeft: 2, marginTop: 1, children: /* @__PURE__ */ jsx3(Text3, { dimColor: true, children: subtitle }) }),
581
+ /* @__PURE__ */ jsx3(
582
+ Box3,
583
+ {
584
+ flexDirection: "column",
585
+ marginTop: 1,
586
+ paddingLeft: 2,
587
+ flexGrow: 1,
588
+ children: body
589
+ }
590
+ )
591
+ ] }),
547
592
  onBack: () => setScreen("issues"),
548
593
  onOpenBrowser: () => execFile(opener(), [issue.url]),
549
594
  onAssign: () => setOverlay({ kind: "assign" }),
@@ -564,8 +609,8 @@ var App = ({ data, initialScreen, initialKey }) => {
564
609
  }
565
610
  );
566
611
  }
567
- if (!rows) return /* @__PURE__ */ jsx2(Spinner, { label: "Loading issues\u2026" });
568
- return /* @__PURE__ */ jsx2(
612
+ if (!rows) return framed("loading\u2026", /* @__PURE__ */ jsx3(Spinner, { label: "Loading issues\u2026" }));
613
+ return /* @__PURE__ */ jsx3(
569
614
  IssueList,
570
615
  {
571
616
  rows,
@@ -836,7 +881,7 @@ var mockData = () => ({
836
881
  });
837
882
 
838
883
  // src/tui/index.tsx
839
- import { jsx as jsx3 } from "react/jsx-runtime";
884
+ import { jsx as jsx4 } from "react/jsx-runtime";
840
885
  var SCREENS = ["issues", "detail"];
841
886
  var runTui = async ({
842
887
  screen,
@@ -846,7 +891,7 @@ var runTui = async ({
846
891
  const data = mock ? mockData() : liveData();
847
892
  const key = issueKey ?? (mock ? "SHOP-412" : void 0);
848
893
  const { waitUntilExit } = render(
849
- /* @__PURE__ */ jsx3(App, { data, initialScreen: screen, initialKey: key })
894
+ /* @__PURE__ */ jsx4(App, { data, initialScreen: screen, initialKey: key })
850
895
  );
851
896
  await waitUntilExit();
852
897
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kud/jira-cli",
3
- "version": "0.5.1",
3
+ "version": "0.5.3",
4
4
  "type": "module",
5
5
  "description": "Jira on the command line — read issues, comments and attachments as plain text",
6
6
  "keywords": [