ework-web 0.10.47 → 0.10.48

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ework-web",
3
- "version": "0.10.47",
3
+ "version": "0.10.48",
4
4
  "type": "module",
5
5
  "description": "ework-web — standalone multi-project issue tracker. Local SQLite-backed, no external API dependency. Bun + TypeScript + SSR HTML.",
6
6
  "license": "MIT",
@@ -250,6 +250,18 @@ export function escapeHtml(s: string): string {
250
250
  .replace(/'/g, "'");
251
251
  }
252
252
 
253
+ export function aiStatusBadge(status: string | undefined): string {
254
+ const s = status ?? "";
255
+ if (!s) return "";
256
+ const map: Record<string, string> = {
257
+ processing: '<span class="ai-status-list" style="color:var(--accent)">⚙️ 处理中</span>',
258
+ halted: '<span class="ai-status-list" style="color:#bf8700">⏸️ 已暂停</span>',
259
+ completed: '<span class="ai-status-list" style="color:var(--green)">✓ 已完成</span>',
260
+ failed: '<span class="ai-status-list" style="color:#cf222e">✗ 失败</span>',
261
+ };
262
+ return map[s] ?? "";
263
+ }
264
+
253
265
  export function escapeAttr(s: string): string {
254
266
  return escapeHtml(s);
255
267
  }
@@ -1,4 +1,4 @@
1
- import { THEME_CSS, escapeHtml, escapeAttr, containsCI, highlightAll, tabNavHTML } from "../render/layout";
1
+ import { THEME_CSS, escapeHtml, escapeAttr, containsCI, highlightAll, tabNavHTML, aiStatusBadge } from "../render/layout";
2
2
  import { getProject, listIssues, listLabelsForIssues, type IssueWithMeta, type LabelRow } from "../store";
3
3
  import { relTime } from "../render/components";
4
4
 
@@ -22,9 +22,10 @@ function issueRow(
22
22
  const chips = labels.length
23
23
  ? `<span class="row-labels">${labels.map((l) => labelChip(l, owner, repo, state)).join("")}</span>`
24
24
  : "";
25
+ const aiBadge = aiStatusBadge(it.ai_status);
25
26
  return `<a class="row" href="${escapeAttr(href)}">
26
27
  <div class="row-title">${title}${chips}</div>
27
- <div class="row-meta">#${it.number} · 💬 ${it.comment_count} · ${relTime(it.updated_at)}</div>
28
+ <div class="row-meta">#${it.number} · 💬 ${it.comment_count} · ${relTime(it.updated_at)}${aiBadge ? ` · ${aiBadge}` : ""}</div>
28
29
  </a>`;
29
30
  }
30
31
 
@@ -1,4 +1,4 @@
1
- import { THEME_CSS, escapeHtml, escapeAttr, containsCI, highlightAll, tabNavHTML } from "../render/layout";
1
+ import { THEME_CSS, escapeHtml, escapeAttr, containsCI, highlightAll, tabNavHTML, aiStatusBadge } from "../render/layout";
2
2
  import { listAllIssues, listLabelsForIssues, type IssueWithMeta, type LabelRow } from "../store";
3
3
  import { relTime } from "../render/components";
4
4
 
@@ -16,9 +16,10 @@ function issueRow(it: IssueWithMeta, q: string, state: string, labels: LabelRow[
16
16
  const chips = labels.length
17
17
  ? `<span class="row-labels">${labels.map((l) => labelChip(l, it.project_owner, it.project_name, state)).join("")}</span>`
18
18
  : "";
19
+ const aiBadge = aiStatusBadge(it.ai_status);
19
20
  return `<a class="row" href="${escapeAttr(href)}">
20
21
  <div class="row-title">${title}${chips}</div>
21
- <div class="row-meta">${projectStr} · #${it.number} · 💬 ${it.comment_count} · ${relTime(it.updated_at)}</div>
22
+ <div class="row-meta">${projectStr} · #${it.number} · 💬 ${it.comment_count} · ${relTime(it.updated_at)}${aiBadge ? ` · ${aiBadge}` : ""}</div>
22
23
  </a>`;
23
24
  }
24
25