@kud/jira-cli 0.5.2 → 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/dist/index.js +2 -2
- package/dist/{tui-XQKRS4AW.js → tui-ZP4S2UZS.js} +219 -179
- package/package.json +1 -1
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"],
|
|
@@ -257,82 +279,77 @@ var IssueList = ({
|
|
|
257
279
|
["?", "legend"],
|
|
258
280
|
["q", "quit"]
|
|
259
281
|
];
|
|
260
|
-
return /* @__PURE__ */
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
defaultValue: search.draft,
|
|
280
|
-
placeholder: "words, or JQL",
|
|
281
|
-
onChange: (draft) => setSearch((s) => ({ ...s, draft })),
|
|
282
|
-
onSubmit: (query) => {
|
|
283
|
-
setSearch((s) => ({ ...s, open: false, draft: query }));
|
|
284
|
-
if (query.trim()) onSearch(query, search.mode);
|
|
285
|
-
else onClearSearch();
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
) }),
|
|
289
|
-
/* @__PURE__ */ jsx(Box, { flexShrink: 0, children: /* @__PURE__ */ jsx(Text, { dimColor: true, children: modeOf(search) === "jql" ? "JQL" : "plain" }) })
|
|
290
|
-
] }) : scope.kind === "search" ? /* @__PURE__ */ jsxs(Box, { paddingRight: 1, children: [
|
|
291
|
-
/* @__PURE__ */ jsx(Box, { flexShrink: 0, children: /* @__PURE__ */ jsx(Text, { color: colors.accent, children: " / " }) }),
|
|
292
|
-
/* @__PURE__ */ jsx(Box, { flexGrow: 1, children: /* @__PURE__ */ jsx(Text, { wrap: "truncate-end", children: scope.query }) }),
|
|
293
|
-
/* @__PURE__ */ jsx(Box, { flexShrink: 0, children: /* @__PURE__ */ jsx(Text, { dimColor: true, children: scope.mode === "jql" ? "JQL" : "plain" }) })
|
|
294
|
-
] }) : null,
|
|
295
|
-
searchError ? /* @__PURE__ */ jsxs(Text, { color: colors.error, children: [
|
|
296
|
-
" \u2717 ",
|
|
297
|
-
searchError
|
|
298
|
-
] }) : null,
|
|
299
|
-
/* @__PURE__ */ jsx(Box, { paddingLeft: 2, marginTop: 1, children: /* @__PURE__ */ jsx(Tabs, { active: tab, items: tabItems }) }),
|
|
300
|
-
/* @__PURE__ */ jsx(
|
|
301
|
-
Box,
|
|
302
|
-
{
|
|
303
|
-
flexDirection: "column",
|
|
304
|
-
marginTop: 1,
|
|
305
|
-
height: size,
|
|
306
|
-
paddingRight: 1,
|
|
307
|
-
children: legend ? LEGEND.map(([glyph, meaning]) => /* @__PURE__ */ jsxs(Box, { paddingLeft: 4, children: [
|
|
308
|
-
/* @__PURE__ */ jsx(Box, { width: 28, flexShrink: 0, children: /* @__PURE__ */ jsx(Text, { color: colors.accent, children: glyph }) }),
|
|
309
|
-
/* @__PURE__ */ jsx(Text, { dimColor: true, children: meaning })
|
|
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(
|
|
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(
|
|
312
|
-
block.key ? `${block.summary} \xB7 ${block.key}` : block.summary,
|
|
313
|
-
width - 7
|
|
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,
|
|
316
|
-
/* @__PURE__ */ jsx(Box, { flexShrink: 0, width: 2, children: /* @__PURE__ */ jsx(
|
|
317
|
-
Text,
|
|
318
|
-
{
|
|
319
|
-
color: priorityGlyph(block.row.priority) === "\u25B2" ? colors.warning : colors.muted,
|
|
320
|
-
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();
|
|
321
301
|
}
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
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
|
+
);
|
|
336
353
|
};
|
|
337
354
|
var modeOf = (s) => s.mode === "auto" ? looksLikeJql(s.draft) ? "jql" : "text" : s.mode;
|
|
338
355
|
var rule = (label, width) => {
|
|
@@ -352,7 +369,8 @@ var emptyHint = (tab, counts, showingAll, scope) => {
|
|
|
352
369
|
};
|
|
353
370
|
|
|
354
371
|
// src/tui/app.tsx
|
|
355
|
-
import { jsx as
|
|
372
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
373
|
+
var DETAIL_CHROME = 5;
|
|
356
374
|
var MIN_WIDTH = 60;
|
|
357
375
|
var MIN_HEIGHT = 12;
|
|
358
376
|
var App = ({ data, initialScreen, initialKey }) => {
|
|
@@ -430,7 +448,7 @@ var App = ({ data, initialScreen, initialKey }) => {
|
|
|
430
448
|
}
|
|
431
449
|
});
|
|
432
450
|
if (width < MIN_WIDTH || height < MIN_HEIGHT) {
|
|
433
|
-
return /* @__PURE__ */
|
|
451
|
+
return /* @__PURE__ */ jsxs3(Text3, { children: [
|
|
434
452
|
"Terminal too small \u2014 needs at least ",
|
|
435
453
|
MIN_WIDTH,
|
|
436
454
|
"\xD7",
|
|
@@ -443,112 +461,134 @@ var App = ({ data, initialScreen, initialKey }) => {
|
|
|
443
461
|
"."
|
|
444
462
|
] });
|
|
445
463
|
}
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
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 }));
|
|
453
471
|
if (overlay.kind === "transition") {
|
|
454
|
-
return
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
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
|
+
}
|
|
480
501
|
}
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
502
|
+
),
|
|
503
|
+
/* @__PURE__ */ jsx3(Text3, { dimColor: true, children: "esc cancel" })
|
|
504
|
+
] })
|
|
505
|
+
);
|
|
485
506
|
}
|
|
486
507
|
if (overlay.kind === "comment") {
|
|
487
|
-
return
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
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
|
+
}
|
|
510
534
|
}
|
|
511
|
-
|
|
512
|
-
)
|
|
513
|
-
|
|
535
|
+
)
|
|
536
|
+
] })
|
|
537
|
+
);
|
|
514
538
|
}
|
|
515
539
|
if (overlay.kind === "assign") {
|
|
516
|
-
return
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
setOverlay({ kind: "none" })
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
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
|
+
}
|
|
539
566
|
}
|
|
540
|
-
|
|
541
|
-
)
|
|
542
|
-
|
|
567
|
+
)
|
|
568
|
+
] })
|
|
569
|
+
);
|
|
543
570
|
}
|
|
544
571
|
if (screen === "detail") {
|
|
545
|
-
if (!issue) return /* @__PURE__ */
|
|
546
|
-
return /* @__PURE__ */
|
|
572
|
+
if (!issue) return framed("loading\u2026", /* @__PURE__ */ jsx3(Spinner, { label: "Loading issue\u2026" }));
|
|
573
|
+
return /* @__PURE__ */ jsx3(
|
|
547
574
|
IssueDetailView,
|
|
548
575
|
{
|
|
549
576
|
issue,
|
|
550
577
|
width,
|
|
551
|
-
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
|
+
] }),
|
|
552
592
|
onBack: () => setScreen("issues"),
|
|
553
593
|
onOpenBrowser: () => execFile(opener(), [issue.url]),
|
|
554
594
|
onAssign: () => setOverlay({ kind: "assign" }),
|
|
@@ -569,8 +609,8 @@ var App = ({ data, initialScreen, initialKey }) => {
|
|
|
569
609
|
}
|
|
570
610
|
);
|
|
571
611
|
}
|
|
572
|
-
if (!rows) return /* @__PURE__ */
|
|
573
|
-
return /* @__PURE__ */
|
|
612
|
+
if (!rows) return framed("loading\u2026", /* @__PURE__ */ jsx3(Spinner, { label: "Loading issues\u2026" }));
|
|
613
|
+
return /* @__PURE__ */ jsx3(
|
|
574
614
|
IssueList,
|
|
575
615
|
{
|
|
576
616
|
rows,
|
|
@@ -841,7 +881,7 @@ var mockData = () => ({
|
|
|
841
881
|
});
|
|
842
882
|
|
|
843
883
|
// src/tui/index.tsx
|
|
844
|
-
import { jsx as
|
|
884
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
845
885
|
var SCREENS = ["issues", "detail"];
|
|
846
886
|
var runTui = async ({
|
|
847
887
|
screen,
|
|
@@ -851,7 +891,7 @@ var runTui = async ({
|
|
|
851
891
|
const data = mock ? mockData() : liveData();
|
|
852
892
|
const key = issueKey ?? (mock ? "SHOP-412" : void 0);
|
|
853
893
|
const { waitUntilExit } = render(
|
|
854
|
-
/* @__PURE__ */
|
|
894
|
+
/* @__PURE__ */ jsx4(App, { data, initialScreen: screen, initialKey: key })
|
|
855
895
|
);
|
|
856
896
|
await waitUntilExit();
|
|
857
897
|
};
|