@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 +1 -1
- package/dist/index.js +2 -2
- package/dist/{tui-K7CKDM5F.js → tui-ZP4S2UZS.js} +226 -181
- package/package.json +1 -1
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-
|
|
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-
|
|
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 {
|
|
13
|
-
|
|
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
|
-
["\
|
|
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__ */
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
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
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
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
|
|
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__ */
|
|
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
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
if (busy) return /* @__PURE__ */
|
|
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
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
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
|
-
|
|
479
|
-
|
|
502
|
+
),
|
|
503
|
+
/* @__PURE__ */ jsx3(Text3, { dimColor: true, children: "esc cancel" })
|
|
504
|
+
] })
|
|
505
|
+
);
|
|
480
506
|
}
|
|
481
507
|
if (overlay.kind === "comment") {
|
|
482
|
-
return
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
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
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
setOverlay({ kind: "none" })
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
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__ */
|
|
541
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
568
|
-
return /* @__PURE__ */
|
|
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
|
|
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__ */
|
|
894
|
+
/* @__PURE__ */ jsx4(App, { data, initialScreen: screen, initialKey: key })
|
|
850
895
|
);
|
|
851
896
|
await waitUntilExit();
|
|
852
897
|
};
|