@warren-dean/code-kit 0.31.1 → 0.33.0

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.
@@ -719,13 +719,9 @@ export function board(view, els, on) {
719
719
  ],
720
720
  });
721
721
 
722
- // --- Needs you (UI-3) ---
723
- const openAt = Math.min(
724
- Math.max(0, sel?.kind === 'need' ? Number(sel.id) : (ui.need ?? 0)),
725
- Math.max(0, needs.length - 1),
726
- );
727
- const buttonsOf = (line) =>
728
- line.actions.map((a) =>
722
+ // A need's own buttons, and a decision's Decide…, where a line has room for them (the inline layout).
723
+ const buttonsOf = (line) => [
724
+ ...line.actions.map((a) =>
729
725
  Button({
730
726
  key: `need-${a.id}`,
731
727
  label: a.hotkey ? `${a.hotkey} ${a.label}` : a.label,
@@ -733,7 +729,23 @@ export function board(view, els, on) {
733
729
  variant: isNote(line) ? undefined : 'primary',
734
730
  onPress: () => on.onNeed(a.id, line),
735
731
  }),
736
- );
732
+ ),
733
+ ...(isNote(line)
734
+ ? []
735
+ : [
736
+ Button({
737
+ key: 'need-decide',
738
+ label: 'Decide…',
739
+ hotkey: 'd',
740
+ plain: true,
741
+ onPress: () => on.onDecide(0, line),
742
+ }),
743
+ ]),
744
+ ];
745
+
746
+ // --- Needs you (UI-3, DECIDE-5) ---
747
+ // One line each, the same height whichever is chosen, so the list never jumps: a decision opens in the
748
+ // Decide pane, all of it; a note keeps its own buttons on its line.
737
749
  const needsPanel = needs.length
738
750
  ? Box({
739
751
  key: 'panel-needs',
@@ -748,54 +760,7 @@ export function board(view, els, on) {
748
760
  ),
749
761
  ...needs.map((line, i) => {
750
762
  const chosen = sel?.kind === 'need' && Number(sel.id) === i;
751
- if (i === openAt)
752
- return Box({
753
- key: `need-open`,
754
- flexDirection: 'column',
755
- borderStyle: 'round',
756
- borderColor: isNote(line) ? 'gray' : 'yellow',
757
- paddingX: 1,
758
- children: [
759
- Box({
760
- flexDirection: 'row',
761
- columnGap: 1,
762
- children: [
763
- text(needWord(line), {
764
- color: isNote(line) ? undefined : 'yellow',
765
- dimColor: isNote(line),
766
- }),
767
- Box({
768
- flexShrink: 1,
769
- children: [text(line.text, { bold: true, wrap: 'wrap' })],
770
- }),
771
- ],
772
- }),
773
- ...(line.context
774
- ? [text(line.context, { dimColor: true, wrap: 'truncate-end' })]
775
- : []),
776
- Box({
777
- key: 'need-buttons',
778
- flexDirection: 'row',
779
- columnGap: 1,
780
- flexWrap: 'wrap',
781
- children: [
782
- ...buttonsOf(line),
783
- ...(isNote(line)
784
- ? []
785
- : [
786
- Button({
787
- key: 'need-why',
788
- label: 'Why…',
789
- plain: true,
790
- ...(chosen ? { autoFocus: true } : {}),
791
- onPress: () => on.onDecide(i, line),
792
- }),
793
- ]),
794
- ],
795
- }),
796
- ],
797
- });
798
- // One line each: what it is (pressed to open it in its place), then its words, cut to fit.
763
+ const note = isNote(line);
799
764
  return Box({
800
765
  key: `need-row-${i}`,
801
766
  flexDirection: 'row',
@@ -805,18 +770,29 @@ export function board(view, els, on) {
805
770
  key: `need-line-${i}`,
806
771
  label: `${chosen ? '›' : ' '} ${needWord(line)}`,
807
772
  plain: true,
808
- ...(isNote(line) ? { dimColor: true } : {}),
809
- onPress: () => on.onSelect({ kind: 'need', id: String(i) }),
773
+ ...(note ? { dimColor: true } : { color: 'yellow' }),
774
+ onPress: () =>
775
+ note ? on.onSelect({ kind: 'need', id: String(i) }) : on.onDecide(i, line),
810
776
  }),
811
777
  Box({
812
778
  flexShrink: 1,
813
779
  children: [
814
780
  text(line.text, {
815
781
  wrap: 'truncate-end',
816
- ...(isNote(line) ? { dimColor: true } : {}),
782
+ ...(note ? { dimColor: true } : chosen ? { bold: true } : {}),
817
783
  }),
818
784
  ],
819
785
  }),
786
+ ...(note
787
+ ? line.actions.map((a) =>
788
+ Button({
789
+ key: `need-${i}-${a.id}`,
790
+ label: a.label,
791
+ plain: true,
792
+ onPress: () => on.onNeed(a.id, line),
793
+ }),
794
+ )
795
+ : []),
820
796
  ],
821
797
  });
822
798
  }),
@@ -1137,7 +1113,7 @@ export function board(view, els, on) {
1137
1113
  // The rows the cards have: the pane's, less what the other panels and the keys take, and the
1138
1114
  // gaps between them; in the wide layout, the Lanes column's, under Build.
1139
1115
  const buildRows = (progress ? 4 : 3) + (state.planGaps ? 1 : 0);
1140
- const needsRows = needs.length ? 1 + 4 + (needs[openAt]?.context ? 1 : 0) + needs.length - 1 : 0;
1116
+ const needsRows = needs.length ? 1 + needs.length : 0;
1141
1117
  const queueRows = open.length ? 1 + open.length + settled.length : 0;
1142
1118
  const logRows = 1 + log.length;
1143
1119
  const panels = 3 + (needs.length ? 1 : 0) + (open.length ? 1 : 0);
@@ -1434,6 +1410,7 @@ export function board(view, els, on) {
1434
1410
  key: 'inline-need',
1435
1411
  flexDirection: 'row',
1436
1412
  columnGap: 1,
1413
+ flexWrap: 'wrap',
1437
1414
  children: [
1438
1415
  Box({
1439
1416
  flexShrink: 1,
@@ -1561,7 +1538,7 @@ export function bandOf(view, els, onAction) {
1561
1538
  : [
1562
1539
  Button({
1563
1540
  key: 'band-decide',
1564
- label: columns < 60 ? 'Why…' : 'Why, and what each choice does',
1541
+ label: 'Decide…',
1565
1542
  hotkey: 'd',
1566
1543
  plain: true,
1567
1544
  onPress: () => onAction('decide', first),
@@ -290,6 +290,26 @@ function storyOf(line, state) {
290
290
  return null;
291
291
  }
292
292
 
293
+ /**
294
+ * DECIDE-5: what an answer typed in the person's own words answers, for the cards that take one: the
295
+ * lead's question, one open in the brief, or what the lead's last reply waits on. Null for the rest.
296
+ */
297
+ function typedOf(line, story) {
298
+ if (line.kind === 'question')
299
+ return { kind: 'question', ...line.question, story: line.question.story ?? story?.id ?? null };
300
+ if (line.kind === 'brief') return { kind: 'brief', ...line.brief };
301
+ if (line.kind === 'waiting' && line.waiting?.kind === 'person' && line.waiting.question)
302
+ return {
303
+ kind: 'lead',
304
+ question: line.waiting.question,
305
+ options: line.waiting.options ?? [],
306
+ };
307
+ return null;
308
+ }
309
+
310
+ /** DECIDE-5: the options a typed answer stands in for: Answer… and Something else…, which open no box now. */
311
+ export const TYPED_OPTIONS = new Set(['answer', 'answerBrief', 'answerLeadText']);
312
+
293
313
  /**
294
314
  * DECIDE-2: a card for each line that needs the person, in the band's order: { id, kind, title, asked,
295
315
  * story, requirements, doing, settled, why, options }. `context`: { state, status (for requirement
@@ -320,9 +340,14 @@ export function decisionCards(lines, context = {}) {
320
340
  const { headline, sub } = headlineOf(line, story);
321
341
  return {
322
342
  id: `${line.kind}-${i}`,
343
+ // DECIDE-5: what the card is about, the same across refreshes, so the one in view stays in view.
344
+ key: `${line.kind}|${String(headline).replace(/\s+/g, ' ').trim()}`,
323
345
  kind: line.kind,
324
346
  tag: TAG[line.kind] ?? 'decision',
325
347
  headline: clip(headline, 100),
348
+ // DECIDE-5: the whole of it, never cut, for the Decide pane.
349
+ full: String(headline).replace(/\s+/g, ' ').trim(),
350
+ typed: typedOf(line, story),
326
351
  sub,
327
352
  line,
328
353
  // The band line it came from: one line can stand for several decisions (CARD-8).
@@ -391,56 +416,8 @@ export function contextOf(card) {
391
416
  return `for ${card.story.id} ${card.story.title}${reqs ? ` (${reqs})` : ''}`;
392
417
  }
393
418
 
394
- /** DECIDE-4: the kinds of decision settled with a choice, asked in Claude Code's own question dialog. */
395
- export const NATIVE_KINDS = new Set(['proposal', 'teamStale', 'question', 'waiting']);
396
-
397
- /** One sentence ended as a question asks. */
398
- const asked = (text, question) => `${String(text).replace(/[.\s]+$/, '')}. ${question}`;
399
-
400
- /**
401
- * DECIDE-4: a decision card as Claude Code's question dialog asks it: { key, question, header, options:
402
- * [{ label, act, line }], typed }, or null for one that needs the pane (a reason to give, an answer to
403
- * type with no choices offered). An option without `act` leaves the decision where it is; `typed` names
404
- * the act that takes the person's own words, typed under the dialog's Other.
405
- */
406
- export function nativeChoice(card) {
407
- if (!NATIVE_KINDS.has(card.kind)) return null;
408
- const line = card.line;
409
- const w = line.waiting;
410
- // What the person stopped, or a reply waiting on them with no question in it, is theirs to pick up
411
- // in the chat: no dialog over what they're about to type.
412
- if (card.kind === 'waiting' && !(w?.kind === 'person' && w.question) && w?.kind !== 'blocked')
413
- return null;
414
- const options = card.options
415
- .filter((o) => !o.label.endsWith('…'))
416
- .slice(0, 4)
417
- .map((o) => ({ label: o.label, act: o.act ?? o.id, line: o.line ?? line }));
418
- if (!options.length) return null;
419
- if (options.length === 1) options.push({ label: 'Not now', act: null, line });
420
- const question =
421
- card.kind === 'proposal' && line.proposal?.first
422
- ? asked(line.text, 'How much should it do on its own?')
423
- : card.kind === 'proposal' && line.proposal?.repeated
424
- ? `${card.why} ${line.text}`
425
- : card.kind === 'stalled'
426
- ? asked(`${line.text}. ${card.why}`, 'Restart it?')
427
- : card.kind === 'teamStale'
428
- ? asked(line.text, 'Keep your claim?')
429
- : card.kind === 'waiting' && w.kind === 'blocked'
430
- ? asked(line.text, 'Ask the lead again?')
431
- : card.headline;
432
- return {
433
- key: `${card.kind}:${card.headline}:${options.map((o) => o.label).join('|')}`,
434
- question: /\?$/.test(question) ? question : `${question}?`,
435
- header: card.tag.slice(0, 12),
436
- options,
437
- typed:
438
- card.kind === 'question' ? 'answerTyped' : card.kind === 'waiting' ? 'answerLeadTyped' : null,
439
- };
440
- }
441
-
442
419
  /** NOTIFY-1: a decision's identity across refreshes: its kind and what it asks. */
443
- export const decisionKey = (card) => `${card.kind}|${card.headline}`;
420
+ export const decisionKey = (card) => card.key ?? `${card.kind}|${card.headline}`;
444
421
 
445
422
  /**
446
423
  * NOTIFY-1: the decisions that weren't waiting at the last look, each as a system notification: what it
@@ -13,7 +13,8 @@ import {
13
13
  mapSvg,
14
14
  neighboursOf,
15
15
  } from './codemap.mjs';
16
- import { ago, shownState, tokens } from './view.mjs';
16
+ import { ago, asideNodes, shownState, tokens } from './view.mjs';
17
+ import { TYPED_OPTIONS } from './decisions.mjs';
17
18
 
18
19
  /** A lane's stories in plan order. */
19
20
  export const laneStories = (lane, state) =>
@@ -942,192 +943,178 @@ export function codeTab(view, { Box, Text, Button, Svg }, on) {
942
943
  return [picker, drawing, legend, detail, keys];
943
944
  }
944
945
 
945
- /** CARD-9: how many decision cards the list shows at once, around the selected one. */
946
- const CARDS_SHOWN = 5;
946
+ /** DECIDE-5: the card the Decide pane shows: the one it was opened on, else the one now in its place. */
947
+ export function cardToDecide(cards, { key = null, at = 0 } = {}) {
948
+ if (!cards.length) return null;
949
+ const i = cards.findIndex((c) => c.key === key);
950
+ return i >= 0 ? i : Math.min(Math.max(0, at), cards.length - 1);
951
+ }
947
952
 
948
953
  /**
949
- * DECIDE-3, CARD-9: the Decisions tab: how many decisions need the person, by kind; then each as a short
950
- * card (its kind, a one-line headline, and who or what it's for), a few at a time around the selected
951
- * one, with j and k to move; then the selected one in full, with its lineage (what they asked for, the
952
- * story and requirements, what was happening, what's settled, why it needs them) and its options, each
953
- * saying what it does. `on`: onDecision(i), onNeed(id, line).
954
+ * DECIDE-5: the Decide pane: one decision at a time, all of it: what it asks, never cut; why it's the
955
+ * person's; the story and requirements it's for, what was happening and what's settled; each option with
956
+ * what it does, on its number; the person's own words, where it takes them, and a question about it
957
+ * first (ASK-5); n and p to the next and previous. `ui`: { key, at, typing: { text, error, aside } }.
958
+ * `on`: onOption(option, card), onMove(key), onTypedInput, onTyped, onAskInput, onAsk, onClose.
954
959
  */
955
- export function decisionsTab(cards, ui, { Box, Text, Button }, on) {
956
- const text = (value, style = {}) => Text({ ...style, children: [value] });
957
- if (!cards.length) return [];
958
- const at = Math.min(ui.decision ?? 0, cards.length - 1);
960
+ export function decidePane(cards, ui, els, on) {
961
+ const { Box, Text, Button, Input, Markdown } = els;
962
+ const text = (value, style = {}) => Text({ ...style, children: [String(value)] });
963
+ const at = cardToDecide(cards, ui);
964
+ if (at === null)
965
+ return Box({
966
+ flexDirection: 'column',
967
+ rowGap: 1,
968
+ children: [
969
+ text('Nothing needs you now.', { bold: true }),
970
+ text("Everything else is the lead's.", { dimColor: true }),
971
+ Button({ key: 'decide-close', label: 'Close', onPress: () => on.onClose() }),
972
+ ],
973
+ });
959
974
  const card = cards[at];
960
975
  const row = (label, value, style = {}) =>
961
976
  Box({
962
- key: `decision-${label}`,
977
+ key: `decide-${label}`,
963
978
  flexDirection: 'row',
964
979
  columnGap: 1,
965
980
  children: [
966
- text(label.padEnd(15), { dimColor: true }),
967
- text(value, { wrap: 'wrap', ...style }),
981
+ Box({ width: 10, flexShrink: 0, children: [text(label, { dimColor: true })] }),
982
+ Box({ flexShrink: 1, children: [text(value, { wrap: 'wrap', ...style })] }),
968
983
  ],
969
984
  });
970
- const kinds = new Map();
971
- for (const c of cards) kinds.set(c.tag, (kinds.get(c.tag) ?? 0) + 1);
972
- const from = Math.max(0, Math.min(at - Math.floor(CARDS_SHOWN / 2), cards.length - CARDS_SHOWN));
973
- const shown = cards.slice(from, from + CARDS_SHOWN);
974
- const list = Box({
975
- key: 'decision-list',
985
+ const story = card.story
986
+ ? `${card.story.id} ${card.story.title}`.trim() +
987
+ (card.requirements.length
988
+ ? ` (${card.requirements.map((r) => `${r.id}${r.title ? ` ${r.title}` : ''}`).join('; ')})`
989
+ : '')
990
+ : null;
991
+ const choices = card.options.filter((o) => !(card.typed && TYPED_OPTIONS.has(o.act ?? o.id)));
992
+ const typing = ui.typing ?? { text: '', error: null, aside: { thread: [], draft: '' } };
993
+ const move = (step) => {
994
+ const next = cards[(at + step + cards.length) % cards.length];
995
+ on.onMove(next.key, (at + step + cards.length) % cards.length);
996
+ };
997
+ return Box({
976
998
  flexDirection: 'column',
999
+ rowGap: 1,
977
1000
  children: [
978
- ...(from > 0 ? [text(` ↑ ${from} more`, { key: 'decision-above', dimColor: true })] : []),
979
- ...shown.map((c, n) => {
980
- const i = from + n;
981
- return Box({
982
- key: `decision-item-${i}`,
983
- flexDirection: 'column',
984
- borderStyle: 'round',
985
- borderColor: i === at ? 'yellow' : 'gray',
986
- paddingX: 1,
987
- children: [
988
- // UI-7: its kind in sentence case, pressed to choose it; then the headline, cut to fit.
989
- Box({
990
- key: `decision-head-${i}`,
991
- flexDirection: 'row',
992
- columnGap: 1,
993
- children: [
994
- Button({
995
- key: `decision-pick-${i}`,
996
- label: c.tag,
997
- plain: true,
998
- ...(i === at ? {} : { dimColor: true }),
999
- onPress: () => on.onDecision(i),
1000
- }),
1001
- Box({
1002
- flexShrink: 1,
1003
- children: [text(c.headline, { bold: i === at, wrap: 'truncate-end' })],
1004
- }),
1005
- ],
1006
- }),
1007
- ...(c.sub ? [text(c.sub, { dimColor: true, wrap: 'truncate-end' })] : []),
1008
- ],
1009
- });
1001
+ Box({
1002
+ key: 'decide-head',
1003
+ flexDirection: 'row',
1004
+ columnGap: 1,
1005
+ children: [
1006
+ text(cards.length > 1 ? `${at + 1} of ${cards.length}` : 'Decision', { dimColor: true }),
1007
+ text(card.tag, { color: 'yellow' }),
1008
+ ...(card.story
1009
+ ? [Box({ flexShrink: 1, children: [text(card.story.id, { dimColor: true })] })]
1010
+ : []),
1011
+ ],
1010
1012
  }),
1011
- ...(from + CARDS_SHOWN < cards.length
1012
- ? [
1013
- text(` ↓ ${cards.length - from - CARDS_SHOWN} more`, {
1014
- key: 'decision-below',
1015
- dimColor: true,
1016
- }),
1017
- ]
1018
- : []),
1019
- ],
1020
- });
1021
- const keys = Box({
1022
- key: 'decision-keys',
1023
- flexDirection: 'row',
1024
- columnGap: 2,
1025
- children: [
1026
- Button({
1027
- key: 'decision-next',
1028
- label: 'Next',
1029
- hotkey: 'j',
1030
- plain: true,
1031
- onPress: () => on.onDecision(Math.min(at + 1, cards.length - 1)),
1013
+ Box({
1014
+ key: 'decide-question',
1015
+ children: [text(card.full ?? card.headline, { bold: true, wrap: 'wrap' })],
1032
1016
  }),
1033
- Button({
1034
- key: 'decision-prev',
1035
- label: 'Previous',
1036
- hotkey: 'k',
1037
- plain: true,
1038
- onPress: () => on.onDecision(Math.max(at - 1, 0)),
1017
+ Box({
1018
+ key: 'decide-lineage',
1019
+ flexDirection: 'column',
1020
+ children: [
1021
+ ...(card.why ? [row('Why yours', card.why)] : []),
1022
+ ...(card.details ?? [])
1023
+ .filter((d) => d.label !== 'Question')
1024
+ .map((d) => row(d.label, d.value)),
1025
+ ...(story ? [row('For', story)] : []),
1026
+ ...(card.asked ? [row('You asked', card.asked, { dimColor: true })] : []),
1027
+ ...(card.doing ? [row('Happening', card.doing, { dimColor: true })] : []),
1028
+ ...(card.settled.length
1029
+ ? [row('Settled', card.settled.join('\n'), { dimColor: true })]
1030
+ : []),
1031
+ ],
1039
1032
  }),
1040
- text(`${at + 1} of ${cards.length}`, { dimColor: true }),
1041
- ],
1042
- });
1043
- const detail = Box({
1044
- key: 'decision-card',
1045
- flexDirection: 'column',
1046
- borderStyle: 'double',
1047
- borderColor: 'yellow',
1048
- paddingX: 1,
1049
- rowGap: 0,
1050
- children: [
1051
- text(
1052
- card.kind === 'brief'
1053
- ? 'An open question in your brief'
1054
- : card.kind === 'question'
1055
- ? 'A question from the lead'
1056
- : card.headline,
1057
- { bold: true, wrap: 'wrap' },
1058
- ),
1059
- ...(card.details ?? []).map((d) =>
1060
- row(d.label, d.value, d.label === 'Question' ? { bold: true } : {}),
1061
- ),
1062
- ...(card.asked ? [row('You asked for', card.asked)] : []),
1063
- ...(card.story
1064
- ? [
1065
- row(
1066
- 'Story',
1067
- `${card.story.id} ${card.story.title}${card.story.branch ? ` · ${card.story.branch}` : ''}`,
1068
- ),
1069
- ]
1070
- : []),
1071
- ...(card.requirements.length
1072
- ? [
1073
- row(
1074
- 'Requirements',
1075
- card.requirements.map((r) => `${r.id}${r.title ? ` ${r.title}` : ''}`).join('; '),
1076
- ),
1077
- ]
1078
- : []),
1079
- ...(card.doing ? [row('Happening', card.doing)] : []),
1080
- ...(card.settled.length
1081
- ? [
1082
- text('Already settled', { dimColor: true }),
1083
- ...card.settled.map((line, i) =>
1033
+ Box({
1034
+ key: 'decide-options',
1035
+ flexDirection: 'column',
1036
+ children: choices.map((o, i) =>
1037
+ Box({
1038
+ key: `decide-option-${o.id}`,
1039
+ flexDirection: 'row',
1040
+ columnGap: 2,
1041
+ children: [
1084
1042
  Box({
1085
- key: `decision-settled-${i}`,
1086
- children: [text(` · ${line}`, { wrap: 'wrap' })],
1043
+ flexShrink: 0,
1044
+ children: [
1045
+ Button({
1046
+ key: `decide-${o.id}`,
1047
+ label: o.label,
1048
+ ...(i < 9 ? { hotkey: String(i + 1) } : {}),
1049
+ plain: true,
1050
+ ...(i === 0 && !card.typed ? { autoFocus: true } : {}),
1051
+ onPress: () => on.onOption(o, card),
1052
+ }),
1053
+ ],
1087
1054
  }),
1055
+ ...(o.effect
1056
+ ? [
1057
+ Box({
1058
+ flexShrink: 1,
1059
+ children: [text(o.effect, { dimColor: true, wrap: 'wrap' })],
1060
+ }),
1061
+ ]
1062
+ : []),
1063
+ ],
1064
+ }),
1065
+ ),
1066
+ }),
1067
+ ...(card.typed
1068
+ ? [
1069
+ Input({
1070
+ key: 'decide-typed',
1071
+ label: choices.length ? 'Or in your own words' : 'Your answer',
1072
+ value: typing.text,
1073
+ submitLabel: 'Answer',
1074
+ autoFocus: true,
1075
+ onInput: (value) => on.onTypedInput(value),
1076
+ onSubmit: (value) => on.onTyped(card, value),
1077
+ }),
1078
+ ...(typing.error ? [text(typing.error, { color: 'red', wrap: 'wrap' })] : []),
1079
+ ...asideNodes(
1080
+ typing.aside ?? { thread: [], draft: '' },
1081
+ { Text, Input, Markdown },
1082
+ { onAskInput: on.onAskInput, onAsk: (q) => on.onAsk(card, q) },
1083
+ 'What does it mean, and what would you suggest?',
1088
1084
  ),
1089
1085
  ]
1090
1086
  : []),
1091
- ...(card.why ? [row('Why it is yours', card.why, { color: 'yellow' })] : []),
1092
- text('Your options', { dimColor: true }),
1093
- ...card.options.map((o) =>
1094
- Box({
1095
- key: `decision-option-${o.id}`,
1096
- flexDirection: 'row',
1097
- columnGap: 2,
1098
- children: [
1099
- Button({
1100
- key: `decide-${o.id}`,
1101
- label: o.label,
1102
- ...(o.hotkey ? { hotkey: o.hotkey } : {}),
1103
- variant: 'primary',
1104
- onPress: () => on.onNeed(o.act ?? o.id, o.line ?? card.line),
1105
- }),
1106
- ...(o.effect ? [text(o.effect, { dimColor: true, wrap: 'wrap' })] : []),
1107
- ],
1108
- }),
1109
- ),
1087
+ Box({
1088
+ key: 'decide-keys',
1089
+ flexDirection: 'row',
1090
+ columnGap: 2,
1091
+ children: [
1092
+ ...(cards.length > 1
1093
+ ? [
1094
+ Button({
1095
+ key: 'decide-next',
1096
+ label: 'Next',
1097
+ hotkey: 'n',
1098
+ plain: true,
1099
+ onPress: () => move(1),
1100
+ }),
1101
+ Button({
1102
+ key: 'decide-prev',
1103
+ label: 'Previous',
1104
+ hotkey: 'p',
1105
+ plain: true,
1106
+ onPress: () => move(-1),
1107
+ }),
1108
+ ]
1109
+ : []),
1110
+ Box({
1111
+ flexShrink: 1,
1112
+ children: [text('esc closes; it waits in Needs you', { dimColor: true, wrap: 'wrap' })],
1113
+ }),
1114
+ ],
1115
+ }),
1110
1116
  ],
1111
1117
  });
1112
- return [
1113
- text(
1114
- `${cards.length} decision${cards.length === 1 ? '' : 's'} need${cards.length === 1 ? 's' : ''} you. Everything else is the lead's.`,
1115
- { bold: true, wrap: 'wrap' },
1116
- ),
1117
- Box({
1118
- key: 'decision-kinds',
1119
- children: [
1120
- text(
1121
- [...kinds]
1122
- .map(([tag, n]) => `${n} ${tag}${n === 1 || tag.endsWith('brief') ? '' : 's'}`)
1123
- .join(' · '),
1124
- { dimColor: true, wrap: 'wrap' },
1125
- ),
1126
- ],
1127
- }),
1128
- ...(cards.length > 1 ? [list, keys] : []),
1129
- detail,
1130
- ];
1131
1118
  }
1132
1119
 
1133
1120
  const JOURNAL_GLYPH = {