@rsktash/beads-ui 0.1.47 → 0.1.49

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.html CHANGED
@@ -4,8 +4,8 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>Beads UI</title>
7
- <script type="module" crossorigin src="/assets/index-CgAVMbmt.js"></script>
8
- <link rel="stylesheet" crossorigin href="/assets/index-EyqiRiRs.css">
7
+ <script type="module" crossorigin src="/assets/index-DRZKHtZN.js"></script>
8
+ <link rel="stylesheet" crossorigin href="/assets/index-BuQ1xTdM.css">
9
9
  </head>
10
10
  <body style="background: #FDFBF7; color: #1A1A1A;">
11
11
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsktash/beads-ui",
3
- "version": "0.1.47",
3
+ "version": "0.1.49",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/rsktash/beads-ui.git"
@@ -512,11 +512,14 @@ export async function queryIssueDetail(id) {
512
512
  issue.closed_children = children.filter((c) => c.status === 'closed').length;
513
513
  }
514
514
 
515
- // Fetch comment count
515
+ // Fetch comments
516
516
  const [commentRows] = await pool.query(
517
- `SELECT COUNT(*) as cnt FROM comments WHERE issue_id = ?`, [id]
517
+ `SELECT id, issue_id, author, text, created_at FROM comments
518
+ WHERE issue_id = ? ORDER BY created_at ASC`, [id]
518
519
  );
519
- issue.comment_count = /** @type {any[]} */ (commentRows)[0]?.cnt || 0;
520
+ const comments = /** @type {any[]} */ (commentRows).map(normalizeRow);
521
+ issue.comments = comments;
522
+ issue.comment_count = comments.length;
520
523
 
521
524
  return { ok: true, item: issue };
522
525
  } catch (err) {
@@ -344,7 +344,15 @@ async function fetchViaBdCli(spec, options) {
344
344
  let items = normalizeIssueList(raw);
345
345
  if (String(spec.type) === 'issue-detail') {
346
346
  items = await Promise.all(
347
- items.map((item) => enrichIssueDetailParentContext(item, options))
347
+ items.map(async (item) => {
348
+ const enriched = await enrichIssueDetailParentContext(item, options);
349
+ const cRes = await runBdJson(['comments', String(item.id), '--json'], { cwd: options.cwd });
350
+ if (cRes && cRes.code === 0 && Array.isArray(cRes.stdoutJson)) {
351
+ enriched.comments = cRes.stdoutJson;
352
+ enriched.comment_count = cRes.stdoutJson.length;
353
+ }
354
+ return enriched;
355
+ })
348
356
  );
349
357
  }
350
358
  return { ok: true, items };
package/server/ws.js CHANGED
@@ -1178,6 +1178,7 @@ export async function handleMessage(ws, data) {
1178
1178
  return;
1179
1179
  }
1180
1180
  ws.send(JSON.stringify(makeOk(req, res.items)));
1181
+ try { triggerMutationRefreshOnce(); } catch { /* ignore */ }
1181
1182
  } else {
1182
1183
  const args = ['comment', id, text.trim()];
1183
1184
  if (author) {
@@ -1196,6 +1197,7 @@ export async function handleMessage(ws, data) {
1196
1197
  return;
1197
1198
  }
1198
1199
  ws.send(JSON.stringify(makeOk(req, comments.stdoutJson || [])));
1200
+ try { triggerMutationRefreshOnce(); } catch { /* ignore */ }
1199
1201
  }
1200
1202
  return;
1201
1203
  }