bdtui 0.7.1 → 0.8.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.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,30 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.8.0] - 2026-07-02
8
+
9
+ ### Added
10
+
11
+ - The detail pane now shows a **Close Reason** section for closed beads. When a bead is closed with `c`, `bd` stores the text in its `close_reason` field; that resolution (with the close date) was already fetched but never displayed. It now renders above the dependencies, so you can see why/how a bead was closed without leaving the TUI.
12
+ - `m` toggles mouse capture so you can **select and copy detail-pane text**. blessed grabs the terminal mouse process-wide the moment any pane enables it, which blocks the terminal's own click-drag selection. Pressing `m` releases the mouse (drag to select, then copy with your terminal's copy); pressing it again restores wheel scrolling and click-to-select. The status bar shows the current mode.
13
+ - A **Deferred** status tab, added to the left of **Blocked** in the tab bar. It lists every bead whose stored status is `deferred` (`bd list --status deferred`) — beads you've explicitly parked — so they're reachable without scrolling the **All** tab. Like the other status tabs it builds the epic→child tree (a deferred bead nests under its parent epic) and cycles with `Tab` / `Shift+Tab`. The deferred status glyph/color and the `s` status picker already supported `deferred`; this surfaces it as a first-class view.
14
+
15
+ ## [0.7.2] - 2026-06-29
16
+
17
+ ### Added
18
+
19
+ - `w` now works on epics. Previously the workflow-command picker was disabled for epics ("workflow skills apply to tasks only"); pressing `w` on an epic now opens a picker offering `/executor-epic-sequential` and `/executor-epic-sequential-worktree` (which run every ready child of the epic on a single branch / isolated worktree). Tasks, chores, and bugs keep their existing per-bead executors.
20
+
21
+ ### Fixed
22
+
23
+ - `bd` errors now render as readable text in the status bar. When a `bd` command failed, bdtui threw the entire structured JSON error body (`{"error": "…", "schema_version": 1}`) verbatim — a multi-line blob whose leading `{` corrupted the one-line status bar markup (the "error with `{`" seen when a tab failed to load). bdtui now parses that body and surfaces just the human-readable `error` field, collapsing newlines and escaping tag markup so the status bar stays a clean single line.
24
+ - Tag-escaping no longer mangles text containing a literal `}`. The two-step escape (`replace('{')` then `replace('}')`) re-processed the `}` it had just inserted into `{open}`, turning any `}` in a bead description (e.g. JSON/code snippets) or in a `/` search query into a stray `{open}` token. Escaping is now a single pass in both the detail pane and the status bar.
25
+
26
+ ### Changed
27
+
28
+ - npm package metadata: expanded `description` and added `keywords` for discoverability; normalized the repository URL to the `git+https://` form.
29
+ - Removed internal agent-workflow tooling (`.beads/`, `.claude/` agents and skills, `CLAUDE.md`, `BEADS_WORKFLOW.md`, `docs/TROUBLESHOOTING.md`) from the repository.
30
+
7
31
  ## [0.7.1] - 2026-06-21
8
32
 
9
33
  ### Fixed
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Fast blessed-based terminal UI for the [`bd`](https://github.com/gastownhall/beads) beads issue tracker.
4
4
 
5
- ![bdtui screenshot](https://raw.githubusercontent.com/jsiovn/bdtui/master/docs/images/bdtui.png)
5
+ ![bdtui screenshot](https://raw.githubusercontent.com/jsiovn/bdtui/master/docs/images/bdtui-jul-03.png)
6
6
 
7
7
  ## Requirements
8
8
 
@@ -40,51 +40,70 @@ bdtui ~/www/myapp # explicit project path
40
40
 
41
41
  ## Layout
42
42
 
43
+ A top tab bar (the active status filter is highlighted — shown here as `[ready]` — followed by the live `type:` / `epic:` / `search:` and bead-count indicators), a two-pane body with the **Beads** list on the left and the **Detail** view on the right, and a bottom status bar:
44
+
43
45
  ```
44
- ┌─[ready open in_progress all]────────────────────────────┐
45
- │ list (40%) │ detail (60%) │
46
- │ > be-12 P1 in_prog … │ be-12 — Some bead title │
47
- │ be-13 P2 open … │ Status: in_progress Priority: P1 │
48
- │ │ Type: feature Owner: — │
49
- │ │ … │
50
- ├───────────────────────┴─────────────────────────────────────┤
51
- │ ● Ready │ ? help · q quit │
52
- └─────────────────────────────────────────────────────────────┘
46
+ ┌──────────────────────────────────────────────────────────────────────────────────
47
+ │ deferred │ blocked │ [ready] │ in_progress │ closed │ all type: all · 27 beads
48
+ ├──────────────────────────────────────────────────────────────────────────────────
49
+ │ Beads (27) │ Detail
50
+ │ be-12 P1 in_prog T Fix login │ be-12 — Fix login bug
51
+ │ be-13 P2 open T Retry │ ══════════════════════════════
52
+ │ be-10 P1 open E Auth epic │ Status: in_progress │ Priority: P1 High
53
+ │ be-11 P2 open T ├ OAuth │ Type: bug │ Owner: alice
54
+ │ be-14 P2 closed B └ CSRF │ Created: 2026-06-01 │ Updated: 2026-06-14
55
+ │ │
56
+ │ list · 40% │ detail · 60%
57
+ ├───────────────────────────────────────────────────────────────────────────────────
58
+ │ ● Ready ? help · q quit
59
+ └───────────────────────────────────────────────────────────────────────────────────
53
60
  ```
54
61
 
55
- Beads with parent–child dependencies are shown as a tree inside the active filter:
62
+ Each list row reads `id · priority · status · type-badge · title`. The detail pane shows the selected bead's fields, its close reason (for closed beads), dependencies, and rendered description.
63
+
64
+ Beads with parent–child dependencies are shown as a tree inside the active filter — child rows nest under their epic with `├` / `└`:
56
65
 
57
66
  ```
58
- be-10 P1 open E Epic title
59
- be-11 P2 open T ├ Child task
60
- be-12 P2 ready T └ Another child
67
+ be-10 P1 open E Auth epic
68
+ be-11 P2 open T ├ Add OAuth login
69
+ be-12 P2 open T └ Refresh tokens
61
70
  ```
62
71
 
63
72
  ## Keybindings
64
73
 
65
- | Key | Action |
66
- |-----|--------|
67
- | `j` / `↓` | Move down |
68
- | `k` / `↑` | Move up |
69
- | `g` / `Shift+g` | Jump to top / bottom |
70
- | `Enter` / `l` | Focus detail pane |
71
- | `h` / `Esc` | Back to list (from detail) |
72
- | `Tab` / `Shift+Tab` | Next / previous status filter (blocked/ready/in_progress/closed/all) |
73
- | `t` | Cycle type filter (all/epic/task/chore/bug) |
74
- | `e` | Filter by epic (modal picker; `x` clears) |
75
- | `/` | In-memory title filter (empty submit clears it) |
76
- | `r` | Reload (keeps active filters) |
77
- | `Shift+r` | Reset all filters (title / epic / type) and reload |
78
- | `s` | Change status |
79
- | `c` | Close with reason |
80
- | `Shift+c` | Claim (in_progress + assign self) |
81
- | `o` | Reopen |
82
- | `p` | Change priority |
83
- | `h` | Change parent (epic / standalone) |
84
- | `y` | Yank bead ID to clipboard |
85
- | `w` | Pick a workflow skill (`/executor-task`, `/executor-task-worktree`, `/executor-epic-task`, `/executor-epic-task-worktree`) and copy it with the selected task's ID. Disabled for epics. See [workflow-template](https://github.com/jsiovn/workflow-template). |
86
- | `?` | Help overlay |
87
- | `q` / `Ctrl-C` | Quit |
74
+ | Key | Action |
75
+ | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
76
+ | `j` / `↓` | Move down |
77
+ | `k` / `↑` | Move up |
78
+ | `g` / `Shift+g` | Jump to top / bottom |
79
+ | `Enter` / `l` | Focus detail pane |
80
+ | `h` / `Esc` | Back to list (from detail) |
81
+ | `Tab` / `Shift+Tab` | Next / previous status filter (deferred/blocked/ready/in_progress/closed/all) |
82
+ | `t` | Cycle type filter (all/epic/task/chore/bug) |
83
+ | `e` | Filter by epic (modal picker; `x` clears) |
84
+ | `/` | In-memory title filter (empty submit clears it) |
85
+ | `r` | Reload (keeps active filters) |
86
+ | `Shift+r` | Reset all filters (title / epic / type) and reload |
87
+ | `s` | Change status |
88
+ | `c` | Close with reason |
89
+ | `Shift+c` | Claim (in_progress + assign self) |
90
+ | `o` | Reopen |
91
+ | `p` | Change priority |
92
+ | `h` | Change parent (epic / standalone) |
93
+ | `y` | Yank bead ID to clipboard |
94
+ | `w` | Pick a workflow command and copy it with the selected bead's ID. Tasks list the per-bead executors (`/executor-task`, `/executor-task-worktree`, `/executor-epic-task`, `/executor-epic-task-worktree`, `/executor-rework-in-place`); epics list `/executor-epic-sequential` and `/executor-epic-sequential-worktree`. See [Agent workflow](#agent-workflow). |
95
+ | `m` | Release mouse capture so you can drag-select & copy detail text with your terminal (toggle) |
96
+ | `?` | Help overlay |
97
+ | `q` / `Ctrl-C` | Quit |
98
+
99
+ ## Agent workflow
100
+
101
+ Pressing `w` copies a slash-command for the selected bead, e.g. `/executor-task be-12`. Those `/executor-*` commands are [Claude Code](https://claude.com/claude-code) / Codex skills scaffolded by [`agent-workflow-beads`](https://www.npmjs.com/package/agent-workflow-beads) — a planner → executor workflow backed by the same beads database. Install it globally, then bootstrap your repo so the copied commands resolve:
102
+
103
+ ```bash
104
+ npm install -g agent-workflow-beads
105
+ agent-workflow-beads bootstrap /path/to/your-repo myprefix
106
+ ```
88
107
 
89
108
  ## Author
90
109
 
package/package.json CHANGED
@@ -1,7 +1,24 @@
1
1
  {
2
2
  "name": "bdtui",
3
- "version": "0.7.1",
4
- "description": "Terminal UI for the bd beads issue tracker",
3
+ "version": "0.8.0",
4
+ "description": "Terminal UI (TUI) for the bd beads issue tracker - browse, filter, and update beads from the CLI with vim keybindings",
5
+ "keywords": [
6
+ "bd",
7
+ "beads",
8
+ "bdtui",
9
+ "issue-tracker",
10
+ "tui",
11
+ "terminal-ui",
12
+ "terminal",
13
+ "cli",
14
+ "bug-tracker",
15
+ "project-management",
16
+ "blessed",
17
+ "vim",
18
+ "dependency-aware",
19
+ "developer-tools",
20
+ "nodejs"
21
+ ],
5
22
  "type": "module",
6
23
  "bin": {
7
24
  "bdtui": "bin/bdtui.js"
@@ -14,7 +31,7 @@
14
31
  ],
15
32
  "repository": {
16
33
  "type": "git",
17
- "url": "https://github.com/jsiovn/bdtui.git"
34
+ "url": "git+https://github.com/jsiovn/bdtui.git"
18
35
  },
19
36
  "homepage": "https://github.com/jsiovn/bdtui#readme",
20
37
  "bugs": {
package/src/app.js CHANGED
@@ -7,13 +7,16 @@ import { statusPicker, priorityPicker, textPrompt, parentPicker, skillPicker, ep
7
7
  import { showHelp } from './keys.js';
8
8
  import { bdUpdate, bdClose, bdClaim, bdReopen, bdDepAdd, bdDepRemove, bdDepListDown, bdEpics } from './bd.js';
9
9
 
10
- const FILTERS = ['blocked', 'ready', 'in_progress', 'closed', 'all'];
10
+ const FILTERS = ['deferred', 'blocked', 'ready', 'in_progress', 'closed', 'all'];
11
11
  const TYPE_FILTERS = ['all', 'epic', 'task', 'chore', 'bug'];
12
12
 
13
13
  // Neutralize blessed tag markup in free text before it lands in a tags:true
14
14
  // box (mirrors esc() in views/detail.js). The title search is user-typed, so a
15
15
  // query like "{bold}" would otherwise corrupt the status line.
16
- const escTags = (s) => String(s ?? '').replace(/\{/g, '{open}').replace(/\}/g, '{close}');
16
+ // Single pass: a two-step .replace(/\{/).replace(/\}/) would re-process the "}"
17
+ // it just inserted into "{open}", corrupting any text that contains a literal
18
+ // "}" (e.g. a bd JSON error blob) into a stray "{open}" token.
19
+ const escTags = (s) => String(s ?? '').replace(/[{}]/g, (c) => (c === '{' ? '{open}' : '{close}'));
17
20
 
18
21
  export async function run(cwd) {
19
22
  state.cwd = cwd;
@@ -48,7 +51,9 @@ export async function run(cwd) {
48
51
  // active so the caller can fall back to a plain "Ready".
49
52
  function filterSummary() {
50
53
  const parts = [];
51
- if (state.textFilter) parts.push(`"${escTags(state.textFilter)}"`);
54
+ // Plain text only — setStatus() escapes the whole summary, so pre-escaping
55
+ // textFilter here would double-escape any braces in the search query.
56
+ if (state.textFilter) parts.push(`"${state.textFilter}"`);
52
57
  if (state.epicFilter) parts.push(`epic: ${state.epicFilter}`);
53
58
  if (state.typeFilter !== 'all') parts.push(`type: ${state.typeFilter}`);
54
59
  if (parts.length === 0) return null;
@@ -59,8 +64,13 @@ export async function run(cwd) {
59
64
  }
60
65
  function setStatus(msg, isError = false, transient = false) {
61
66
  if (statusTimer) { clearTimeout(statusTimer); statusTimer = null; }
67
+ // The status bar is a single tags:true row. Neutralize blessed tag markup
68
+ // and collapse newlines so dynamic text — bd error messages especially,
69
+ // which can be multi-line and contain "{" — renders as plain text instead
70
+ // of corrupting the markup or overflowing the one-line height.
71
+ const safe = escTags(String(msg ?? '').replace(/\s*\n\s*/g, ' ').trim());
62
72
  const icon = isError ? '{red-fg}✗{/}' : '{green-fg}●{/}';
63
- const text = isError ? `{red-fg}${msg}{/}` : msg;
73
+ const text = isError ? `{red-fg}${safe}{/}` : safe;
64
74
  statusBar.setContent(` ${icon} ${text} {gray-fg}? help · q quit{/}`);
65
75
  screen.render();
66
76
  if (transient) {
@@ -544,12 +554,8 @@ export async function run(cwd) {
544
554
  if (screen.focused !== list || !state.selectedId) return;
545
555
  const id = state.selectedId;
546
556
  const bead = state.beadsById.get(id);
547
- if (bead?.issue_type === 'epic') {
548
- setStatus(`${id} is an epic — workflow skills apply to tasks only`, true, true);
549
- return;
550
- }
551
557
  try {
552
- const line = await skillPicker(screen, id);
558
+ const line = await skillPicker(screen, id, bead?.issue_type);
553
559
  list.focus();
554
560
  await copyToClipboard(line, {
555
561
  busyMsg: `Copying ${line}…`,
@@ -561,6 +567,24 @@ export async function run(cwd) {
561
567
  }
562
568
  });
563
569
 
570
+ // Release blessed's mouse capture so the terminal can do native click-drag
571
+ // text selection (then copy with the terminal's own copy). blessed grabs the
572
+ // mouse process-wide the moment any element sets mouse:true, which blocks
573
+ // native selection; toggling it off hands the mouse back to the terminal.
574
+ // Re-enable via program.enableMouse() directly — screen.enableMouse() is a
575
+ // no-op here because blessed's _listenedMouse latch is already set.
576
+ let mouseCaptured = true;
577
+ key(['m'], () => {
578
+ mouseCaptured = !mouseCaptured;
579
+ if (mouseCaptured) {
580
+ screen.program.enableMouse();
581
+ setStatus('Mouse restored — wheel scroll & click active', false, true);
582
+ } else {
583
+ screen.program.disableMouse();
584
+ setStatus('Mouse released — drag to select text, copy with your terminal · press m to restore');
585
+ }
586
+ });
587
+
564
588
  // ── Boot ───────────────────────────────────────────────────────────────────
565
589
 
566
590
  setFocusBorder('list');
package/src/bd.js CHANGED
@@ -7,12 +7,32 @@ const execFileP = promisify(execFile);
7
7
  // closed beads) can exceed that and throw "stdout maxBuffer length exceeded".
8
8
  const MAX_BUFFER = 64 * 1024 * 1024; // 64MB
9
9
 
10
+ // bd reports failures with a non-zero exit and a structured JSON body
11
+ // ({"error": "…", "schema_version": 1}) — usually on stderr, occasionally on
12
+ // stdout. Surface the human-readable `error` field; fall back to the raw text,
13
+ // then execFile's own message. Without this the whole multi-line JSON blob —
14
+ // leading "{" and all — gets thrown verbatim and dumped into the one-line
15
+ // status bar, which is the "error with {" users see when a tab fails to load.
16
+ function bdErrorMessage(err) {
17
+ const raw = (err.stderr?.trim() || err.stdout?.trim() || '');
18
+ if (raw) {
19
+ try {
20
+ const parsed = JSON.parse(raw);
21
+ if (parsed && typeof parsed.error === 'string' && parsed.error.trim()) {
22
+ return parsed.error.trim();
23
+ }
24
+ } catch {}
25
+ return raw;
26
+ }
27
+ return err.message;
28
+ }
29
+
10
30
  async function runBd(args, cwd) {
11
31
  try {
12
32
  const { stdout } = await execFileP('bd', args, { cwd, maxBuffer: MAX_BUFFER });
13
33
  return JSON.parse(stdout);
14
34
  } catch (err) {
15
- throw new Error(err.stderr?.trim() || err.message);
35
+ throw new Error(bdErrorMessage(err));
16
36
  }
17
37
  }
18
38
 
@@ -24,7 +44,7 @@ async function runBdVoid(args, cwd) {
24
44
  try {
25
45
  await execFileP('bd', args, { cwd, maxBuffer: MAX_BUFFER });
26
46
  } catch (err) {
27
- throw new Error(err.stderr?.trim() || err.message);
47
+ throw new Error(bdErrorMessage(err));
28
48
  }
29
49
  }
30
50
 
package/src/keys.js CHANGED
@@ -13,7 +13,7 @@ export const HELP_TEXT = [
13
13
  '',
14
14
  ' Filters & refresh',
15
15
  ' ──────────────────────────────────────',
16
- ' Tab Next status filter (blocked/ready/in_progress/closed/all)',
16
+ ' Tab Next status filter (deferred/blocked/ready/in_progress/closed/all)',
17
17
  ' Shift+Tab Previous status filter',
18
18
  ' t Cycle type filter (all/epic/task/chore/bug)',
19
19
  ' e Filter by epic (modal picker; x clears; switches status to all)',
@@ -34,7 +34,8 @@ export const HELP_TEXT = [
34
34
  ' Other',
35
35
  ' ──────────────────────────────────────',
36
36
  ' y Yank bead ID to clipboard',
37
- ' w Copy workflow skill command for selected task',
37
+ ' w Copy workflow command (tasks: executors; epics: epic-sequential)',
38
+ ' m Release mouse to select/copy detail text (toggle)',
38
39
  ' ? Toggle this help',
39
40
  ' q / Ctrl-C Quit',
40
41
  '',
@@ -24,7 +24,10 @@ const STATUS_ICON = {
24
24
  const PRIORITY_COLOR = ['red', 'yellow', 'green', 'cyan', 'gray'];
25
25
  const PRIORITY_LABEL = ['Critical', 'High', 'Normal', 'Low', 'Trivial'];
26
26
 
27
- function esc(s) { return String(s ?? '').replace(/\{/g, '{open}').replace(/\}/g, '{close}'); }
27
+ // Single pass: a two-step .replace(/\{/).replace(/\}/) would re-process the "}"
28
+ // it just inserted into "{open}", corrupting any text containing a literal "}"
29
+ // (e.g. a JSON/code snippet in a description) into a stray "{open}" token.
30
+ function esc(s) { return String(s ?? '').replace(/[{}]/g, (c) => (c === '{' ? '{open}' : '{close}')); }
28
31
  function t(color, text) { return `{${color}-fg}${text}{/}`; }
29
32
  function bold(text) { return `{bold}${text}{/bold}`; }
30
33
  function fmtDate(iso) { return iso ? iso.slice(0, 10) : '—'; }
@@ -181,6 +184,18 @@ export function renderDetail(box) {
181
184
  lines.push(field('Labels', b.labels.map((l) => t('blue', esc(l))).join(' ')));
182
185
  }
183
186
 
187
+ // ── Close reason (closed beads) ─────────────────────────────────────────────
188
+ // bd stores the text from `bd close --reason` in `close_reason`; loadDetail
189
+ // already spreads the full `bd show` object onto the bead, so it's available
190
+ // here. Rendered high in the pane (before deps) so a closed bead's resolution
191
+ // is visible without scrolling. Truthy guard → open beads show nothing.
192
+ if (b.close_reason) {
193
+ const when = b.closed_at ? ` · ${fmtDate(b.closed_at)}` : '';
194
+ lines.push(sectionHeader(`Close Reason${when}`));
195
+ lines.push('');
196
+ renderDescription(lines, b.close_reason);
197
+ }
198
+
184
199
  // ── Dependencies ───────────────────────────────────────────────────────────
185
200
  if (b.depsDown?.length > 0) {
186
201
  lines.push(sectionHeader(`Depends on (${b.depsDown.length})`));
@@ -175,14 +175,21 @@ export function epicPicker(screen, epics, currentEpicId = null) {
175
175
  });
176
176
  }
177
177
 
178
- export function skillPicker(screen, beadId) {
179
- const items = [
180
- `/executor-task ${beadId}`,
181
- `/executor-task-worktree ${beadId}`,
182
- `/executor-epic-task ${beadId}`,
183
- `/executor-epic-task-worktree ${beadId}`,
184
- `/executor-rework-in-place ${beadId}`,
185
- ];
178
+ export function skillPicker(screen, beadId, issueType) {
179
+ // Epics get the epic-level executor (runs every ready child sequentially on a
180
+ // single branch); tasks/chores/bugs get the per-bead executors.
181
+ const items = issueType === 'epic'
182
+ ? [
183
+ `/executor-epic-sequential ${beadId}`,
184
+ `/executor-epic-sequential-worktree ${beadId}`,
185
+ ]
186
+ : [
187
+ `/executor-task ${beadId}`,
188
+ `/executor-task-worktree ${beadId}`,
189
+ `/executor-epic-task ${beadId}`,
190
+ `/executor-epic-task-worktree ${beadId}`,
191
+ `/executor-rework-in-place ${beadId}`,
192
+ ];
186
193
  return listPicker(screen, 'Copy workflow command', items, 'magenta', 56, 1);
187
194
  }
188
195