@cnzgray/dsh-mattpocock-workflow 0.5.0 → 0.6.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/README.md CHANGED
@@ -25,6 +25,13 @@
25
25
  默认只看未关闭工单,并按“可接 → 阻塞 → 其他开放 → 已关闭”排序;筛选、人员开关、排序键、布局与方向按工作区记住,
26
26
  重新打开面板或切回该工作区时恢复。偏好只存在浏览器本地存储里,不随工作区删除而清理,最多保留 50 个工作区条目;
27
27
  存储不可用时静默退回默认视图;
28
+ 工具栏右侧有一个「行内显示」图标(滑杆),点开浮层后是四个开关:创建人、创建时间、更新时间与分配人;
29
+ 创建人与创建时间默认打开(与加入开关前的行内信息一致),更新时间与分配人默认关闭,四个开关都按工作区记住。
30
+ 创建时间不再依附创建人:没有创建人的行(本地 Markdown)也显示「创建 X」,关掉创建人时时间照常显示;
31
+ 只在创建人与创建时间同排时保留裸露的相对创建时间。
32
+ 打开「更新时间」后,时间区追加「更新 Y」,与创建时间并排时两段都带前缀;
33
+ 打开「分配人」后,标签之后显示远端登录名(与详情里的写法一致,最多两个,其余折成 `+N`,悬停可看完整名单),
34
+ 没有分配人的行不渲染图标或占位;本地 Markdown 后端不提供分配人开关;
28
35
  列表支持**平铺**与**父子**两种布局,默认平铺:父子布局用已加载且通过当前筛选的票建树,子票逐层缩进,
29
36
  父行可收起整棵子树并显示可见子票数;父票被筛掉、还没加载、在别的仓库或是 GitLab epic 时,子票升到顶层并显示父级引用徽标,
30
37
  不伪造父行。GitHub 用原生子工单,GitLab 用工作项层级(列表返回后按每批最多 100 张票用一次 GraphQL 补齐,失败时只禁用父子布局、列表照常),
package/lib/client.js CHANGED
@@ -39,7 +39,7 @@ __export(index_exports, {
39
39
  inject: () => inject
40
40
  });
41
41
  module.exports = __toCommonJS(index_exports);
42
- var React45 = __toESM(require("react"), 1);
42
+ var React46 = __toESM(require("react"), 1);
43
43
 
44
44
  // src/client/agent-activity.ts
45
45
  var React = __toESM(require("react"), 1);
@@ -191,6 +191,19 @@ var zh = {
191
191
  "tickets.emptyFilter": "\u6CA1\u6709\u7B26\u5408\u7B5B\u9009\u6761\u4EF6\u7684\u5DE5\u5355\u3002",
192
192
  "tickets.a11y.open": "\u6253\u5F00 {ref}\uFF1A{title}",
193
193
  "tickets.age.title": "\u521B\u5EFA\uFF1A{created}\uFF1B\u66F4\u65B0\uFF1A{updated}",
194
+ "row.displayGroup": "\u884C\u5185\u663E\u793A",
195
+ "row.displayGroupHint": "\u9009\u62E9\u5217\u8868\u884C\u663E\u793A\u54EA\u4E9B\u4FE1\u606F",
196
+ "row.showAuthor": "\u521B\u5EFA\u4EBA",
197
+ "row.showCreatedAt": "\u521B\u5EFA\u65F6\u95F4",
198
+ "row.showUpdatedAt": "\u66F4\u65B0\u65F6\u95F4",
199
+ "row.showAssignees": "\u5206\u914D\u4EBA",
200
+ "row.time.created": "\u521B\u5EFA {age}",
201
+ "row.time.updated": "\u66F4\u65B0 {age}",
202
+ "row.time.separator": " \xB7 ",
203
+ "row.assigneesA11y": "\u5206\u914D\u4EBA\uFF1A{names}",
204
+ "row.assigneesTitle": "\u5206\u914D\u4EBA\uFF1A{names}",
205
+ "row.assigneesSeparator": ", ",
206
+ "row.assigneesMoreTitle": "\u8FD8\u6709 {count} \u4E2A\u5206\u914D\u4EBA\uFF1A{names}",
194
207
  "tickets.more.loading": "\u6B63\u5728\u52A0\u8F7D\u66F4\u591A\u2026",
195
208
  "tickets.more.scroll": "\u7EE7\u7EED\u5411\u4E0B\u6EDA\u52A8\u52A0\u8F7D\u66F4\u591A",
196
209
  "tickets.more.failed": "\u52A0\u8F7D\u66F4\u591A\u5931\u8D25\uFF1A{message}",
@@ -665,6 +678,19 @@ var en = {
665
678
  "tickets.emptyFilter": "No tickets match the filter.",
666
679
  "tickets.a11y.open": "Open {ref}: {title}",
667
680
  "tickets.age.title": "Created: {created}; updated: {updated}",
681
+ "row.displayGroup": "Row details",
682
+ "row.displayGroupHint": "Choose which fields each row shows",
683
+ "row.showAuthor": "Author",
684
+ "row.showCreatedAt": "Created time",
685
+ "row.showUpdatedAt": "Updated time",
686
+ "row.showAssignees": "Assignees",
687
+ "row.time.created": "Created {age}",
688
+ "row.time.updated": "Updated {age}",
689
+ "row.time.separator": " \xB7 ",
690
+ "row.assigneesA11y": "Assignees: {names}",
691
+ "row.assigneesTitle": "Assignees: {names}",
692
+ "row.assigneesSeparator": ", ",
693
+ "row.assigneesMoreTitle": "{count} more assignees: {names}",
668
694
  "tickets.more.loading": "Loading more\u2026",
669
695
  "tickets.more.scroll": "Scroll down to load more",
670
696
  "tickets.more.failed": "Failed to load more: {message}",
@@ -1370,11 +1396,11 @@ function createPanelClient(t2, fetchImpl = defaultFetch) {
1370
1396
  },
1371
1397
  resolveBlockers: (workspaceRoot) => call(fetchImpl, t2, RPC_METHODS.snapshotResolveBlockers, { workspaceRoot }, isSnapshotResult),
1372
1398
  envCheck: (workspaceRoot) => call(fetchImpl, t2, RPC_METHODS.envCheck, { workspaceRoot }, isEnvCheckResult),
1373
- getDetail: (workspaceRoot, ref, number) => call(
1399
+ getDetail: (workspaceRoot, ref, number, repository) => call(
1374
1400
  fetchImpl,
1375
1401
  t2,
1376
1402
  RPC_METHODS.ticketGet,
1377
- { workspaceRoot, ref, number },
1403
+ { workspaceRoot, ref, number, ...repository === void 0 ? {} : { repository } },
1378
1404
  isTicketDetailResult
1379
1405
  ),
1380
1406
  updateTicket: (workspaceRoot, ref, number, patch) => call(
@@ -1776,7 +1802,7 @@ function disposerOf(handle) {
1776
1802
  }
1777
1803
 
1778
1804
  // src/client/task-panel.tsx
1779
- var React44 = __toESM(require("react"), 1);
1805
+ var React45 = __toESM(require("react"), 1);
1780
1806
 
1781
1807
  // src/client/action-bar.tsx
1782
1808
  var React5 = __toESM(require("react"), 1);
@@ -1972,6 +1998,17 @@ function TrashIcon() {
1972
1998
  }
1973
1999
  ));
1974
2000
  }
2001
+ function DisplaySettingsIcon() {
2002
+ return /* @__PURE__ */ React3.createElement("svg", { width: "13", height: "13", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true" }, /* @__PURE__ */ React3.createElement(
2003
+ "path",
2004
+ {
2005
+ d: "M2.5 5h2M7.5 5h6M2.5 11h6M11.5 11h2",
2006
+ stroke: "currentColor",
2007
+ strokeWidth: "1.2",
2008
+ strokeLinecap: "round"
2009
+ }
2010
+ ), /* @__PURE__ */ React3.createElement("circle", { cx: "6", cy: "5", r: "1.6", stroke: "currentColor", strokeWidth: "1.2" }), /* @__PURE__ */ React3.createElement("circle", { cx: "10", cy: "11", r: "1.6", stroke: "currentColor", strokeWidth: "1.2" }));
2011
+ }
1975
2012
  function FlatListIcon() {
1976
2013
  return /* @__PURE__ */ React3.createElement("svg", { width: "12", height: "12", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true" }, /* @__PURE__ */ React3.createElement(
1977
2014
  "path",
@@ -3044,11 +3081,19 @@ function blockerItems(ticket, tickets) {
3044
3081
  }
3045
3082
  return items;
3046
3083
  }
3047
- function blockerNumber(ref) {
3048
- const match = /^#(\d+)$/.exec(ref);
3084
+ var BLOCKER_REF = /^(?:([A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+))?#(\d+)$/;
3085
+ function parseBlockerRef(ref) {
3086
+ const match = BLOCKER_REF.exec(ref);
3049
3087
  if (match === null) return null;
3050
- const number = Number.parseInt(match[1] ?? "", 10);
3051
- return Number.isSafeInteger(number) ? number : null;
3088
+ const number = Number.parseInt(match[2] ?? "", 10);
3089
+ if (!Number.isSafeInteger(number)) return null;
3090
+ return { repository: match[1] ?? null, number };
3091
+ }
3092
+ function blockerNumber(ref) {
3093
+ return parseBlockerRef(ref)?.number ?? null;
3094
+ }
3095
+ function blockerRepository(ref) {
3096
+ return parseBlockerRef(ref)?.repository ?? null;
3052
3097
  }
3053
3098
  function findSnapshotTicket(tickets, ref) {
3054
3099
  return tickets?.find((ticket) => ticket.ref === ref) ?? null;
@@ -3146,7 +3191,7 @@ function useDetailNavigation(workspaceRoot) {
3146
3191
  setNavigation({
3147
3192
  open: {
3148
3193
  workspaceRoot,
3149
- target: { ref: ticket.ref, number: ticket.number, ticket }
3194
+ target: { ref: ticket.ref, number: ticket.number, ticket, repository: null }
3150
3195
  },
3151
3196
  stack: []
3152
3197
  });
@@ -3163,7 +3208,8 @@ function useDetailNavigation(workspaceRoot) {
3163
3208
  target: {
3164
3209
  ref,
3165
3210
  number: row?.number ?? blockerNumber(ref),
3166
- ticket: row
3211
+ ticket: row,
3212
+ repository: blockerRepository(ref)
3167
3213
  }
3168
3214
  },
3169
3215
  stack: [...current.stack, from]
@@ -7362,7 +7408,7 @@ function writeDetailCache(workspaceRoot, detail) {
7362
7408
  }
7363
7409
 
7364
7410
  // src/client/ticket-detail-hooks.ts
7365
- function useDetailRequest(client, workspaceRoot, ref, number, currentUpdatedAt) {
7411
+ function useDetailRequest(client, workspaceRoot, ref, number, repository, currentUpdatedAt) {
7366
7412
  const [detail, setDetail] = React26.useState(null);
7367
7413
  const [error, setError] = React26.useState(null);
7368
7414
  const [phase, setPhase] = React26.useState("loading");
@@ -7377,6 +7423,7 @@ function useDetailRequest(client, workspaceRoot, ref, number, currentUpdatedAt)
7377
7423
  workspaceRoot,
7378
7424
  ref,
7379
7425
  number,
7426
+ repository,
7380
7427
  currentUpdatedAt,
7381
7428
  attempt,
7382
7429
  readId,
@@ -7387,14 +7434,14 @@ function useDetailRequest(client, workspaceRoot, ref, number, currentUpdatedAt)
7387
7434
  setRefreshing,
7388
7435
  setRefreshError
7389
7436
  });
7390
- }, [client, workspaceRoot, ref, number, attempt, currentUpdatedAt]);
7437
+ }, [client, workspaceRoot, ref, number, repository, attempt, currentUpdatedAt]);
7391
7438
  const refresh = () => {
7392
7439
  if (readRunning.current) return;
7393
7440
  readRunning.current = true;
7394
7441
  const current = readId.current + 1;
7395
7442
  readId.current = current;
7396
7443
  setRefreshing(true);
7397
- void client.getDetail(workspaceRoot, ref, number).then((result) => {
7444
+ void client.getDetail(workspaceRoot, ref, number, repository ?? void 0).then((result) => {
7398
7445
  if (readId.current !== current) return;
7399
7446
  readRunning.current = false;
7400
7447
  setRefreshing(false);
@@ -7432,6 +7479,7 @@ function startDetailLoad(target) {
7432
7479
  workspaceRoot,
7433
7480
  ref,
7434
7481
  number,
7482
+ repository,
7435
7483
  currentUpdatedAt,
7436
7484
  readId,
7437
7485
  readRunning,
@@ -7464,7 +7512,7 @@ function startDetailLoad(target) {
7464
7512
  setDetail(null);
7465
7513
  setPhase("loading");
7466
7514
  }
7467
- void client.getDetail(workspaceRoot, ref, number).then((result) => {
7515
+ void client.getDetail(workspaceRoot, ref, number, repository ?? void 0).then((result) => {
7468
7516
  if (!active) return;
7469
7517
  applyDetailRead({
7470
7518
  workspaceRoot,
@@ -7518,7 +7566,12 @@ function useTicketMutation(client, options) {
7518
7566
  return;
7519
7567
  }
7520
7568
  const [fresh, snapshot] = await Promise.all([
7521
- client.getDetail(options.workspaceRoot, options.ref, options.number),
7569
+ client.getDetail(
7570
+ options.workspaceRoot,
7571
+ options.ref,
7572
+ options.number,
7573
+ options.repository ?? void 0
7574
+ ),
7522
7575
  client.refresh(options.workspaceRoot)
7523
7576
  ]);
7524
7577
  if (snapshot.ok && snapshot.result.kind === "full") {
@@ -11036,9 +11089,10 @@ function TicketDetailView(props) {
11036
11089
  }
11037
11090
  function useDetailViewState(props) {
11038
11091
  const { client, workspaceRoot } = props;
11039
- const { ref, number, ticket } = props.target;
11092
+ const { ref, number, repository, ticket } = props.target;
11040
11093
  const { current: currentTicket, updateFromSnapshot } = useCurrentTicket(ref, ticket);
11041
- const request = useDetailRequest(client, workspaceRoot, ref, number, currentTicket?.updatedAt);
11094
+ const updatedAt = currentTicket?.updatedAt;
11095
+ const request = useDetailRequest(client, workspaceRoot, ref, number, repository, updatedAt);
11042
11096
  const loadAttachment = React29.useMemo(
11043
11097
  () => createAttachmentLoader(client, workspaceRoot),
11044
11098
  [client, workspaceRoot]
@@ -11054,6 +11108,7 @@ function useDetailViewState(props) {
11054
11108
  workspaceRoot,
11055
11109
  ref,
11056
11110
  number,
11111
+ repository,
11057
11112
  onUpdated: request.replace,
11058
11113
  onSnapshot: updateFromSnapshot
11059
11114
  });
@@ -11248,7 +11303,7 @@ function useTicketTreeSession() {
11248
11303
  }
11249
11304
 
11250
11305
  // src/client/tickets-view.tsx
11251
- var React43 = __toESM(require("react"), 1);
11306
+ var React44 = __toESM(require("react"), 1);
11252
11307
 
11253
11308
  // src/client/my-tickets-bar.tsx
11254
11309
  var React31 = __toESM(require("react"), 1);
@@ -11525,6 +11580,32 @@ var ROW_AGE_STYLE = {
11525
11580
  lineHeight: "18px",
11526
11581
  whiteSpace: "nowrap"
11527
11582
  };
11583
+ var ASSIGNEE_GROUP_STYLE = {
11584
+ display: "inline-flex",
11585
+ alignItems: "center",
11586
+ gap: 4,
11587
+ minWidth: 0
11588
+ };
11589
+ var ASSIGNEE_ICON_STYLE = {
11590
+ display: "inline-flex",
11591
+ alignItems: "center",
11592
+ flex: "none",
11593
+ color: COLORS.tertiary,
11594
+ lineHeight: "18px"
11595
+ };
11596
+ var ASSIGNEE_NAME_STYLE = {
11597
+ color: COLORS.secondary,
11598
+ fontSize: 11,
11599
+ lineHeight: "18px",
11600
+ whiteSpace: "nowrap"
11601
+ };
11602
+ var ASSIGNEE_MORE_STYLE = {
11603
+ color: COLORS.tertiary,
11604
+ fontSize: 11,
11605
+ lineHeight: "18px",
11606
+ whiteSpace: "nowrap",
11607
+ cursor: "default"
11608
+ };
11528
11609
  var CARD_CONTENT_STYLE = {
11529
11610
  position: "relative",
11530
11611
  display: "flex",
@@ -11575,6 +11656,50 @@ var NUMBER_MARK_STYLE = {
11575
11656
  width: "0.6em",
11576
11657
  verticalAlign: "-1px"
11577
11658
  };
11659
+ var DISPLAY_MENU_WRAP_STYLE = {
11660
+ position: "relative",
11661
+ display: "inline-flex"
11662
+ };
11663
+ var DISPLAY_MENU_TRIGGER_STYLE = {
11664
+ display: "inline-flex",
11665
+ alignItems: "center",
11666
+ justifyContent: "center",
11667
+ border: `1px solid ${COLORS.border}`,
11668
+ borderRadius: 6,
11669
+ padding: "1px 6px",
11670
+ color: COLORS.secondary,
11671
+ background: COLORS.surfaceRaised,
11672
+ cursor: "pointer",
11673
+ font: "inherit",
11674
+ lineHeight: "20px"
11675
+ };
11676
+ var DISPLAY_MENU_PANEL_STYLE = {
11677
+ position: "absolute",
11678
+ top: "calc(100% + 4px)",
11679
+ right: 0,
11680
+ zIndex: 20,
11681
+ display: "flex",
11682
+ flexDirection: "column",
11683
+ gap: 2,
11684
+ minWidth: 132,
11685
+ padding: 4,
11686
+ border: `1px solid ${COLORS.border}`,
11687
+ borderRadius: 8,
11688
+ background: COLORS.surfaceRaised,
11689
+ boxShadow: "0 6px 18px rgba(0, 0, 0, 0.16), 0 0 0 0.5px rgba(0, 0, 0, 0.08)"
11690
+ };
11691
+ var DISPLAY_MENU_ITEM_STYLE = {
11692
+ ...CHIP_STYLE,
11693
+ display: "flex",
11694
+ alignItems: "center",
11695
+ justifyContent: "space-between",
11696
+ gap: 12,
11697
+ width: "100%",
11698
+ borderRadius: 5,
11699
+ // 浏览器默认按钮底色会在浮层里显成灰块;开启项才用抬起来的底色。
11700
+ background: "transparent",
11701
+ textAlign: "left"
11702
+ };
11578
11703
 
11579
11704
  // src/client/ticket-avatar.tsx
11580
11705
  function TicketAvatar(props) {
@@ -11697,6 +11822,7 @@ function refDisplay(ticket) {
11697
11822
 
11698
11823
  // src/client/ticket-list.tsx
11699
11824
  var MAX_EXTRA_LABELS = 3;
11825
+ var MAX_ROW_ASSIGNEES = 2;
11700
11826
  var STATUS_KEYS2 = {
11701
11827
  ready: "status.ready",
11702
11828
  blocked: "status.blocked",
@@ -11721,6 +11847,7 @@ function TicketList(props) {
11721
11847
  injection: props.injection,
11722
11848
  focused: ticket.ref === props.focused,
11723
11849
  now: props.now,
11850
+ fields: props.fields,
11724
11851
  onPick: props.onPick,
11725
11852
  onSkillAction: props.onSkillAction
11726
11853
  }
@@ -11734,6 +11861,7 @@ function TicketList(props) {
11734
11861
  injection: props.injection,
11735
11862
  focused: row.ticket.ref === props.focused,
11736
11863
  now: props.now,
11864
+ fields: props.fields,
11737
11865
  onPick: props.onPick,
11738
11866
  onSkillAction: props.onSkillAction,
11739
11867
  ...props.onToggleTree === void 0 ? {} : { onToggleTree: props.onToggleTree }
@@ -11793,7 +11921,7 @@ function TicketRow(props) {
11793
11921
  },
11794
11922
  /* @__PURE__ */ React34.createElement("span", { "aria-hidden": "true" }, props.row.expanded ? "\u25BE" : "\u25B8")
11795
11923
  ) : null, /* @__PURE__ */ React34.createElement(TicketNumber, { ticket }), ticket.title),
11796
- /* @__PURE__ */ React34.createElement(MetaRow, { ticket, row: props.row, now: props.now })
11924
+ /* @__PURE__ */ React34.createElement(MetaRow, { ticket, row: props.row, now: props.now, fields: props.fields })
11797
11925
  ),
11798
11926
  /* @__PURE__ */ React34.createElement(
11799
11927
  SkillActionBadge,
@@ -11820,31 +11948,73 @@ function MetaRow(props) {
11820
11948
  style: PARENT_BADGE_STYLE
11821
11949
  },
11822
11950
  t2("tree.parentBadge", { parent: ticket.parent })
11823
- ) : null, shown.map((label) => /* @__PURE__ */ React34.createElement("span", { key: label, "data-testid": "ticket-label", style: LABEL_BADGE_STYLE }, label)), hidden > 0 ? /* @__PURE__ */ React34.createElement("span", { "data-testid": "ticket-label-more", style: LABEL_BADGE_STYLE }, "+", String(hidden)) : null, ticket.author === null ? null : /* @__PURE__ */ React34.createElement(
11824
- AuthorMeta,
11951
+ ) : null, shown.map((label) => /* @__PURE__ */ React34.createElement("span", { key: label, "data-testid": "ticket-label", style: LABEL_BADGE_STYLE }, label)), hidden > 0 ? /* @__PURE__ */ React34.createElement("span", { "data-testid": "ticket-label-more", style: LABEL_BADGE_STYLE }, "+", String(hidden)) : null, props.fields.showAssignees && ticket.assignees.length > 0 ? /* @__PURE__ */ React34.createElement(AssigneeMeta, { assignees: ticket.assignees }) : null, props.fields.showAuthor && ticket.author !== null ? /* @__PURE__ */ React34.createElement(AuthorMeta, { author: ticket.author }) : null, /* @__PURE__ */ React34.createElement(
11952
+ TimeMeta,
11825
11953
  {
11826
- author: ticket.author,
11827
11954
  createdAt: ticket.createdAt,
11828
11955
  updatedAt: ticket.updatedAt,
11829
- now: props.now
11956
+ now: props.now,
11957
+ fields: props.fields,
11958
+ authorShown: props.fields.showAuthor && ticket.author !== null
11830
11959
  }
11831
11960
  ));
11832
11961
  }
11962
+ function AssigneeMeta(props) {
11963
+ const { t: t2 } = useI18n();
11964
+ const separator = t2("row.assigneesSeparator");
11965
+ const all = props.assignees.join(separator);
11966
+ const shown = props.assignees.slice(0, MAX_ROW_ASSIGNEES);
11967
+ const hidden = props.assignees.length - shown.length;
11968
+ return /* @__PURE__ */ React34.createElement(
11969
+ "span",
11970
+ {
11971
+ role: "group",
11972
+ "data-testid": "ticket-assignees",
11973
+ "aria-label": t2("row.assigneesA11y", { names: all }),
11974
+ title: t2("row.assigneesTitle", { names: all }),
11975
+ style: ASSIGNEE_GROUP_STYLE
11976
+ },
11977
+ /* @__PURE__ */ React34.createElement("span", { "aria-hidden": "true", style: ASSIGNEE_ICON_STYLE }, /* @__PURE__ */ React34.createElement(PersonIcon, null)),
11978
+ /* @__PURE__ */ React34.createElement("span", { "data-testid": "ticket-assignee", style: ASSIGNEE_NAME_STYLE }, shown.join(separator)),
11979
+ hidden > 0 ? /* @__PURE__ */ React34.createElement(
11980
+ "span",
11981
+ {
11982
+ "data-testid": "ticket-assignee-more",
11983
+ title: t2("row.assigneesMoreTitle", { count: hidden, names: all }),
11984
+ style: ASSIGNEE_MORE_STYLE
11985
+ },
11986
+ "+",
11987
+ String(hidden)
11988
+ ) : null
11989
+ );
11990
+ }
11833
11991
  function AuthorMeta(props) {
11834
11992
  const { t: t2 } = useI18n();
11835
11993
  const { author } = props;
11836
11994
  const name = authorName(author);
11837
11995
  const full = authorTitle(author, t2);
11838
- const age = formatRelativeTime(props.createdAt, props.now, t2);
11839
- return /* @__PURE__ */ React34.createElement(React34.Fragment, null, /* @__PURE__ */ React34.createElement(TicketAvatar, { author }), /* @__PURE__ */ React34.createElement("span", { "data-testid": "ticket-author", title: full, style: AUTHOR_NAME_STYLE }, name), age.length === 0 ? null : /* @__PURE__ */ React34.createElement(
11996
+ return /* @__PURE__ */ React34.createElement(React34.Fragment, null, /* @__PURE__ */ React34.createElement(TicketAvatar, { author }), /* @__PURE__ */ React34.createElement("span", { "data-testid": "ticket-author", title: full, style: AUTHOR_NAME_STYLE }, name));
11997
+ }
11998
+ function TimeMeta(props) {
11999
+ const { t: t2 } = useI18n();
12000
+ const createdAge = props.fields.showCreatedAt ? formatRelativeTime(props.createdAt, props.now, t2) : "";
12001
+ const updatedAge = props.fields.showUpdatedAt ? formatRelativeTime(props.updatedAt, props.now, t2) : "";
12002
+ const segments = [];
12003
+ if (createdAge.length > 0) {
12004
+ const bare = !props.fields.showUpdatedAt && props.authorShown;
12005
+ segments.push(bare ? createdAge : t2("row.time.created", { age: createdAge }));
12006
+ }
12007
+ if (updatedAge.length > 0) segments.push(t2("row.time.updated", { age: updatedAge }));
12008
+ if (segments.length === 0) return null;
12009
+ return /* @__PURE__ */ React34.createElement(
11840
12010
  "span",
11841
12011
  {
11842
12012
  "data-testid": "ticket-age",
11843
12013
  title: t2("tickets.age.title", { created: props.createdAt, updated: props.updatedAt }),
11844
12014
  style: ROW_AGE_STYLE
11845
12015
  },
11846
- age
11847
- ));
12016
+ segments.join(t2("row.time.separator"))
12017
+ );
11848
12018
  }
11849
12019
  function pickRowLabels(labels, limit) {
11850
12020
  const isTriageLabel = (label) => TRIAGE_LABELS.includes(label);
@@ -12166,10 +12336,96 @@ function LayoutControl(props) {
12166
12336
  }
12167
12337
 
12168
12338
  // src/client/tickets-toolbar.tsx
12169
- var React40 = __toESM(require("react"), 1);
12339
+ var React41 = __toESM(require("react"), 1);
12170
12340
 
12171
- // src/client/sort-control.tsx
12341
+ // src/client/row-display-control.tsx
12172
12342
  var React39 = __toESM(require("react"), 1);
12343
+ var CHECK_STYLE = {
12344
+ display: "inline-flex",
12345
+ color: COLORS.accent
12346
+ };
12347
+ var CHECK_OFF_STYLE = { ...CHECK_STYLE, visibility: "hidden" };
12348
+ var DISPLAY_ITEMS = [
12349
+ { field: "showAuthor", testId: "display-author", key: "row.showAuthor" },
12350
+ { field: "showCreatedAt", testId: "display-created", key: "row.showCreatedAt" },
12351
+ { field: "showUpdatedAt", testId: "display-updated", key: "row.showUpdatedAt" },
12352
+ { field: "showAssignees", testId: "display-assignees", key: "row.showAssignees" }
12353
+ ];
12354
+ function RowDisplayControl(props) {
12355
+ const { t: t2 } = useI18n();
12356
+ const [open, setOpen] = React39.useState(false);
12357
+ const wrapRef = React39.useRef(null);
12358
+ const triggerRef = React39.useRef(null);
12359
+ React39.useEffect(() => {
12360
+ if (!open) return void 0;
12361
+ const onPointerDown = (event) => {
12362
+ if (wrapRef.current?.contains(event.target) === true) return;
12363
+ setOpen(false);
12364
+ };
12365
+ const onKeyDown = (event) => {
12366
+ if (event.key !== "Escape") return;
12367
+ setOpen(false);
12368
+ triggerRef.current?.focus();
12369
+ };
12370
+ document.addEventListener("pointerdown", onPointerDown);
12371
+ document.addEventListener("keydown", onKeyDown);
12372
+ return () => {
12373
+ document.removeEventListener("pointerdown", onPointerDown);
12374
+ document.removeEventListener("keydown", onKeyDown);
12375
+ };
12376
+ }, [open]);
12377
+ return /* @__PURE__ */ React39.createElement("div", { ref: wrapRef, style: DISPLAY_MENU_WRAP_STYLE }, /* @__PURE__ */ React39.createElement(
12378
+ "button",
12379
+ {
12380
+ ref: triggerRef,
12381
+ type: "button",
12382
+ "data-testid": "display-settings",
12383
+ "aria-expanded": open,
12384
+ "aria-label": t2("row.displayGroup"),
12385
+ title: t2("row.displayGroupHint"),
12386
+ "data-hover": "soft",
12387
+ onClick: () => {
12388
+ setOpen((value) => !value);
12389
+ },
12390
+ style: {
12391
+ ...DISPLAY_MENU_TRIGGER_STYLE,
12392
+ ...open ? { background: COLORS.surfaceActive, color: COLORS.text } : void 0
12393
+ }
12394
+ },
12395
+ /* @__PURE__ */ React39.createElement(DisplaySettingsIcon, null)
12396
+ ), open ? /* @__PURE__ */ React39.createElement("div", { role: "group", "aria-label": t2("row.displayGroup"), style: DISPLAY_MENU_PANEL_STYLE }, DISPLAY_ITEMS.filter(
12397
+ (item) => item.field !== "showAssignees" || props.assigneesAvailable
12398
+ ).map((item) => /* @__PURE__ */ React39.createElement(
12399
+ MenuItem,
12400
+ {
12401
+ key: item.field,
12402
+ testId: item.testId,
12403
+ label: t2(item.key),
12404
+ pressed: props.fields[item.field],
12405
+ onToggle: () => {
12406
+ props.onToggleField(item.field);
12407
+ }
12408
+ }
12409
+ ))) : null);
12410
+ }
12411
+ function MenuItem(props) {
12412
+ return /* @__PURE__ */ React39.createElement(
12413
+ "button",
12414
+ {
12415
+ type: "button",
12416
+ "data-testid": props.testId,
12417
+ "aria-pressed": props.pressed,
12418
+ "data-hover": "soft",
12419
+ onClick: props.onToggle,
12420
+ style: DISPLAY_MENU_ITEM_STYLE
12421
+ },
12422
+ props.label,
12423
+ /* @__PURE__ */ React39.createElement("span", { "aria-hidden": "true", style: props.pressed ? CHECK_STYLE : CHECK_OFF_STYLE }, /* @__PURE__ */ React39.createElement(CheckIcon, null))
12424
+ );
12425
+ }
12426
+
12427
+ // src/client/sort-control.tsx
12428
+ var React40 = __toESM(require("react"), 1);
12173
12429
  var GROUP_STYLE2 = {
12174
12430
  ...SEGMENTED_STYLE,
12175
12431
  flexWrap: "nowrap",
@@ -12235,7 +12491,7 @@ function SortControl(props) {
12235
12491
  const next = props.direction === "asc" ? "desc" : "asc";
12236
12492
  const currentLabel = t2(DIRECTION_KEYS[props.direction]);
12237
12493
  const nextLabel = t2(DIRECTION_KEYS[next]);
12238
- return /* @__PURE__ */ React39.createElement("div", { role: "group", "aria-label": t2("sort.group"), style: GROUP_STYLE2 }, /* @__PURE__ */ React39.createElement("span", { style: SELECT_WRAP_STYLE }, /* @__PURE__ */ React39.createElement(
12494
+ return /* @__PURE__ */ React40.createElement("div", { role: "group", "aria-label": t2("sort.group"), style: GROUP_STYLE2 }, /* @__PURE__ */ React40.createElement("span", { style: SELECT_WRAP_STYLE }, /* @__PURE__ */ React40.createElement(
12239
12495
  "select",
12240
12496
  {
12241
12497
  "data-testid": "sort-key",
@@ -12247,8 +12503,8 @@ function SortControl(props) {
12247
12503
  },
12248
12504
  style: SELECT_STYLE
12249
12505
  },
12250
- TICKET_SORT_KEYS.map((key) => /* @__PURE__ */ React39.createElement("option", { key, value: key }, t2(SORT_KEYS[key])))
12251
- ), /* @__PURE__ */ React39.createElement("span", { style: CARET_STYLE }, /* @__PURE__ */ React39.createElement(CaretIcon, null))), /* @__PURE__ */ React39.createElement(
12506
+ TICKET_SORT_KEYS.map((key) => /* @__PURE__ */ React40.createElement("option", { key, value: key }, t2(SORT_KEYS[key])))
12507
+ ), /* @__PURE__ */ React40.createElement("span", { style: CARET_STYLE }, /* @__PURE__ */ React40.createElement(CaretIcon, null))), /* @__PURE__ */ React40.createElement(
12252
12508
  "button",
12253
12509
  {
12254
12510
  type: "button",
@@ -12264,7 +12520,7 @@ function SortControl(props) {
12264
12520
  ));
12265
12521
  }
12266
12522
  function CaretIcon() {
12267
- return /* @__PURE__ */ React39.createElement("svg", { width: "8", height: "8", viewBox: "0 0 8 8", "aria-hidden": "true" }, /* @__PURE__ */ React39.createElement("path", { d: "M0.5 2h7L4 6.5z", fill: "currentColor" }));
12523
+ return /* @__PURE__ */ React40.createElement("svg", { width: "8", height: "8", viewBox: "0 0 8 8", "aria-hidden": "true" }, /* @__PURE__ */ React40.createElement("path", { d: "M0.5 2h7L4 6.5z", fill: "currentColor" }));
12268
12524
  }
12269
12525
 
12270
12526
  // src/client/tickets-toolbar.tsx
@@ -12282,7 +12538,7 @@ var CHIP_STATS = {
12282
12538
  };
12283
12539
  function Toolbar(props) {
12284
12540
  const { t: t2 } = useI18n();
12285
- return /* @__PURE__ */ React40.createElement("div", { style: TOOLBAR_STYLE }, /* @__PURE__ */ React40.createElement("div", { role: "group", "aria-label": t2("filter.group"), style: SEGMENTED_STYLE }, TICKET_FILTERS.map((value) => /* @__PURE__ */ React40.createElement(
12541
+ return /* @__PURE__ */ React41.createElement("div", { style: TOOLBAR_STYLE }, /* @__PURE__ */ React41.createElement("div", { role: "group", "aria-label": t2("filter.group"), style: SEGMENTED_STYLE }, TICKET_FILTERS.map((value) => /* @__PURE__ */ React41.createElement(
12286
12542
  Chip,
12287
12543
  {
12288
12544
  key: value,
@@ -12295,7 +12551,7 @@ function Toolbar(props) {
12295
12551
  props.onFilter(value);
12296
12552
  }
12297
12553
  }
12298
- ))), /* @__PURE__ */ React40.createElement(
12554
+ ))), /* @__PURE__ */ React41.createElement(
12299
12555
  SortControl,
12300
12556
  {
12301
12557
  sortKey: props.sortKey,
@@ -12305,11 +12561,17 @@ function Toolbar(props) {
12305
12561
  props.onSort(props.sortKey);
12306
12562
  }
12307
12563
  }
12564
+ ), /* @__PURE__ */ React41.createElement(
12565
+ RowDisplayControl,
12566
+ {
12567
+ fields: props.fields,
12568
+ assigneesAvailable: props.assigneesAvailable,
12569
+ onToggleField: props.onToggleField
12570
+ }
12308
12571
  ));
12309
12572
  }
12310
- function Chip(props) {
12311
- const stat = props.stat;
12312
- return /* @__PURE__ */ React40.createElement(
12573
+ function ChipButton(props) {
12574
+ return /* @__PURE__ */ React41.createElement(
12313
12575
  "button",
12314
12576
  {
12315
12577
  type: "button",
@@ -12319,19 +12581,21 @@ function Chip(props) {
12319
12581
  onClick: props.onClick,
12320
12582
  style: { ...CHIP_STYLE, ...props.active ? CHIP_ACTIVE_STYLE : void 0 }
12321
12583
  },
12322
- stat === void 0 ? null : /* @__PURE__ */ React40.createElement("span", { "aria-hidden": "true", style: { ...CHIP_DOT_STYLE, background: stat.color } }),
12323
- props.label,
12324
- stat === void 0 ? null : /* @__PURE__ */ React40.createElement("span", { "data-testid": `stat-${stat.key}`, style: CHIP_COUNT_STYLE }, props.count[stat.key])
12584
+ props.children
12325
12585
  );
12326
12586
  }
12587
+ function Chip(props) {
12588
+ const stat = props.stat;
12589
+ return /* @__PURE__ */ React41.createElement(ChipButton, { testId: props.testId, active: props.active, onClick: props.onClick }, stat === void 0 ? null : /* @__PURE__ */ React41.createElement("span", { "aria-hidden": "true", style: { ...CHIP_DOT_STYLE, background: stat.color } }), props.label, stat === void 0 ? null : /* @__PURE__ */ React41.createElement("span", { "data-testid": `stat-${stat.key}`, style: CHIP_COUNT_STYLE }, props.count[stat.key]));
12590
+ }
12327
12591
 
12328
12592
  // src/client/use-collapsed-tickets.ts
12329
- var React41 = __toESM(require("react"), 1);
12593
+ var React42 = __toESM(require("react"), 1);
12330
12594
  function useCollapsedTickets(workspaceRoot, focused, visible) {
12331
12595
  const session = useTicketTreeSession();
12332
- const [localCollapsed, setLocalCollapsed] = React41.useState(() => /* @__PURE__ */ new Set());
12333
- const previousRoot = React41.useRef(workspaceRoot);
12334
- const expandedFor = React41.useRef(null);
12596
+ const [localCollapsed, setLocalCollapsed] = React42.useState(() => /* @__PURE__ */ new Set());
12597
+ const previousRoot = React42.useRef(workspaceRoot);
12598
+ const expandedFor = React42.useRef(null);
12335
12599
  if (previousRoot.current !== workspaceRoot) {
12336
12600
  previousRoot.current = workspaceRoot;
12337
12601
  expandedFor.current = null;
@@ -12339,7 +12603,7 @@ function useCollapsedTickets(workspaceRoot, focused, visible) {
12339
12603
  }
12340
12604
  const collapsed = session?.collapsed ?? localCollapsed;
12341
12605
  const setCollapsed = session?.setCollapsed ?? setLocalCollapsed;
12342
- React41.useEffect(() => {
12606
+ React42.useEffect(() => {
12343
12607
  if (focused === null || visible.length === 0 || expandedFor.current === focused) return;
12344
12608
  expandedFor.current = focused;
12345
12609
  setCollapsed((current) => expandAncestors(visible, current, focused));
@@ -12456,7 +12720,7 @@ function timestamp(value) {
12456
12720
  }
12457
12721
 
12458
12722
  // src/client/use-view-preference.ts
12459
- var React42 = __toESM(require("react"), 1);
12723
+ var React43 = __toESM(require("react"), 1);
12460
12724
 
12461
12725
  // src/client/view-preference.ts
12462
12726
  var DEFAULT_VIEW = {
@@ -12465,7 +12729,11 @@ var DEFAULT_VIEW = {
12465
12729
  direction: "asc",
12466
12730
  assignedToMe: false,
12467
12731
  createdByMe: false,
12468
- layout: "flat"
12732
+ layout: "flat",
12733
+ showAuthor: true,
12734
+ showCreatedAt: true,
12735
+ showUpdatedAt: false,
12736
+ showAssignees: false
12469
12737
  };
12470
12738
  var KEY_PREFIX = "dsh-mattpocock-workflow:view:";
12471
12739
  var STORAGE_VERSION = 1;
@@ -12503,7 +12771,11 @@ function readViewPreference(storage, workspaceRoot) {
12503
12771
  direction: isDirection(stored.direction) ? stored.direction : DEFAULT_VIEW.direction,
12504
12772
  assignedToMe: isBoolean(stored.assignedToMe) ? stored.assignedToMe : DEFAULT_VIEW.assignedToMe,
12505
12773
  createdByMe: isBoolean(stored.createdByMe) ? stored.createdByMe : DEFAULT_VIEW.createdByMe,
12506
- layout: isLayout(stored.layout) ? stored.layout : DEFAULT_VIEW.layout
12774
+ layout: isLayout(stored.layout) ? stored.layout : DEFAULT_VIEW.layout,
12775
+ showAuthor: isBoolean(stored.showAuthor) ? stored.showAuthor : DEFAULT_VIEW.showAuthor,
12776
+ showCreatedAt: isBoolean(stored.showCreatedAt) ? stored.showCreatedAt : DEFAULT_VIEW.showCreatedAt,
12777
+ showUpdatedAt: isBoolean(stored.showUpdatedAt) ? stored.showUpdatedAt : DEFAULT_VIEW.showUpdatedAt,
12778
+ showAssignees: isBoolean(stored.showAssignees) ? stored.showAssignees : DEFAULT_VIEW.showAssignees
12507
12779
  };
12508
12780
  }
12509
12781
  function writeViewPreference(storage, workspaceRoot, preference, now = Date.now) {
@@ -12518,6 +12790,10 @@ function writeViewPreference(storage, workspaceRoot, preference, now = Date.now)
12518
12790
  assignedToMe: preference.assignedToMe,
12519
12791
  createdByMe: preference.createdByMe,
12520
12792
  layout: preference.layout,
12793
+ showAuthor: preference.showAuthor,
12794
+ showCreatedAt: preference.showCreatedAt,
12795
+ showUpdatedAt: preference.showUpdatedAt,
12796
+ showAssignees: preference.showAssignees,
12521
12797
  savedAt: now(),
12522
12798
  version: STORAGE_VERSION
12523
12799
  })
@@ -12579,8 +12855,8 @@ function isLayout(value) {
12579
12855
 
12580
12856
  // src/client/use-view-preference.ts
12581
12857
  function useViewPreference(workspaceRoot) {
12582
- const storage = React42.useMemo(resolvePreferenceStorage, []);
12583
- const [viewState, setViewState] = React42.useState(() => ({
12858
+ const storage = React43.useMemo(resolvePreferenceStorage, []);
12859
+ const [viewState, setViewState] = React43.useState(() => ({
12584
12860
  workspaceRoot,
12585
12861
  preference: readViewPreference(storage, workspaceRoot)
12586
12862
  }));
@@ -12620,6 +12896,9 @@ function useViewPreference(workspaceRoot) {
12620
12896
  },
12621
12897
  setLayout: (layout) => {
12622
12898
  apply2({ ...preference, layout });
12899
+ },
12900
+ toggleRowField: (field) => {
12901
+ apply2({ ...preference, [field]: !preference[field] });
12623
12902
  }
12624
12903
  };
12625
12904
  }
@@ -12643,7 +12922,8 @@ function useTicketsViewState(props) {
12643
12922
  setLayout,
12644
12923
  toggleAssignedToMe,
12645
12924
  toggleCreatedByMe,
12646
- clearMyTickets
12925
+ clearMyTickets,
12926
+ toggleRowField
12647
12927
  } = useViewPreference(props.workspaceRoot);
12648
12928
  const now = useNow(props.now ?? Date.now);
12649
12929
  const ownActions = useTicketActions(props.workspaceRoot, props.injection);
@@ -12677,12 +12957,19 @@ function useTicketsViewState(props) {
12677
12957
  moreError,
12678
12958
  moreLoading,
12679
12959
  preference,
12960
+ rowFields: {
12961
+ showAuthor: preference.showAuthor,
12962
+ showCreatedAt: preference.showCreatedAt,
12963
+ showUpdatedAt: preference.showUpdatedAt,
12964
+ showAssignees: preference.showAssignees
12965
+ },
12680
12966
  setFilter,
12681
12967
  toggleSort,
12682
12968
  setLayout,
12683
12969
  toggleAssignedToMe,
12684
12970
  toggleCreatedByMe,
12685
12971
  clearMyTickets,
12972
+ toggleRowField,
12686
12973
  tickets,
12687
12974
  counts,
12688
12975
  myCounts,
@@ -12704,13 +12991,13 @@ function useTicketsViewState(props) {
12704
12991
  function TicketsView(props) {
12705
12992
  const { t: t2 } = useI18n();
12706
12993
  const state = useTicketsViewState(props);
12707
- return /* @__PURE__ */ React43.createElement(
12994
+ return /* @__PURE__ */ React44.createElement(
12708
12995
  "div",
12709
12996
  {
12710
12997
  "data-testid": "tickets-view",
12711
12998
  style: { display: "flex", flexDirection: "column", flex: 1, minHeight: 0 }
12712
12999
  },
12713
- /* @__PURE__ */ React43.createElement(
13000
+ /* @__PURE__ */ React44.createElement(
12714
13001
  TicketsHeader,
12715
13002
  {
12716
13003
  snapshot: state.snapshot,
@@ -12722,9 +13009,9 @@ function TicketsView(props) {
12722
13009
  onRefreshFull: state.refreshFull
12723
13010
  }
12724
13011
  ),
12725
- props.actions === void 0 ? /* @__PURE__ */ React43.createElement("div", { style: ACTION_BAR_STYLE }, /* @__PURE__ */ React43.createElement(ActionBar, { injection: props.injection, onInject: state.inject })) : null,
12726
- state.error !== null ? /* @__PURE__ */ React43.createElement(ErrorBanner, { error: state.error, onOpenEnvCheck: props.onOpenEnvCheck }) : null,
12727
- state.snapshot !== null ? /* @__PURE__ */ React43.createElement(
13012
+ props.actions === void 0 ? /* @__PURE__ */ React44.createElement("div", { style: ACTION_BAR_STYLE }, /* @__PURE__ */ React44.createElement(ActionBar, { injection: props.injection, onInject: state.inject })) : null,
13013
+ state.error !== null ? /* @__PURE__ */ React44.createElement(ErrorBanner, { error: state.error, onOpenEnvCheck: props.onOpenEnvCheck }) : null,
13014
+ state.snapshot !== null ? /* @__PURE__ */ React44.createElement(
12728
13015
  SnapshotContent,
12729
13016
  {
12730
13017
  snapshot: state.snapshot,
@@ -12740,6 +13027,7 @@ function TicketsView(props) {
12740
13027
  myCounts: state.myCounts,
12741
13028
  assignedToMe: state.preference.assignedToMe,
12742
13029
  createdByMe: state.preference.createdByMe,
13030
+ rowFields: state.rowFields,
12743
13031
  ticketCount: state.tickets.length,
12744
13032
  injected: state.injected,
12745
13033
  injection: props.injection,
@@ -12756,28 +13044,32 @@ function TicketsView(props) {
12756
13044
  onLayout: state.setLayout,
12757
13045
  onToggleAssigned: state.toggleAssignedToMe,
12758
13046
  onToggleCreated: state.toggleCreatedByMe,
13047
+ onToggleRowField: state.toggleRowField,
12759
13048
  onClearMyTickets: state.clearMyTickets,
12760
13049
  onToggleTree: state.toggleTree,
12761
13050
  onPick: props.onOpenTicket,
12762
13051
  onSkillAction: state.onSkillAction
12763
13052
  }
12764
- ) : state.phase === "loading" ? /* @__PURE__ */ React43.createElement("div", { "data-testid": "loading", style: EMPTY_STYLE }, t2("snapshot.loading")) : null,
12765
- /* @__PURE__ */ React43.createElement(Footer, { injection: props.injection, notice: state.notice, tone: state.noticeTone })
13053
+ ) : state.phase === "loading" ? /* @__PURE__ */ React44.createElement("div", { "data-testid": "loading", style: EMPTY_STYLE }, t2("snapshot.loading")) : null,
13054
+ /* @__PURE__ */ React44.createElement(Footer, { injection: props.injection, notice: state.notice, tone: state.noticeTone })
12766
13055
  );
12767
13056
  }
12768
13057
  function SnapshotContent(props) {
12769
13058
  const { t: t2 } = useI18n();
12770
- return /* @__PURE__ */ React43.createElement(React43.Fragment, null, /* @__PURE__ */ React43.createElement(
13059
+ return /* @__PURE__ */ React44.createElement(React44.Fragment, null, /* @__PURE__ */ React44.createElement(
12771
13060
  Toolbar,
12772
13061
  {
12773
13062
  filter: props.filter,
12774
13063
  sortKey: props.sortKey,
12775
13064
  direction: props.direction,
12776
13065
  counts: props.counts,
13066
+ fields: props.rowFields,
13067
+ assigneesAvailable: props.snapshot.backend !== "markdown",
12777
13068
  onFilter: props.onFilter,
12778
- onSort: props.onSort
13069
+ onSort: props.onSort,
13070
+ onToggleField: props.onToggleRowField
12779
13071
  }
12780
- ), props.snapshot.viewer === null ? null : /* @__PURE__ */ React43.createElement(
13072
+ ), props.snapshot.viewer === null ? null : /* @__PURE__ */ React44.createElement(
12781
13073
  MyTicketsBar,
12782
13074
  {
12783
13075
  viewer: props.snapshot.viewer,
@@ -12788,10 +13080,10 @@ function SnapshotContent(props) {
12788
13080
  onToggleCreated: props.onToggleCreated,
12789
13081
  onClear: props.onClearMyTickets
12790
13082
  }
12791
- ), /* @__PURE__ */ React43.createElement(
13083
+ ), /* @__PURE__ */ React44.createElement(
12792
13084
  TicketRows,
12793
13085
  {
12794
- layoutControl: /* @__PURE__ */ React43.createElement(
13086
+ layoutControl: /* @__PURE__ */ React44.createElement(
12795
13087
  LayoutControl,
12796
13088
  {
12797
13089
  layout: props.preferenceLayout,
@@ -12800,7 +13092,7 @@ function SnapshotContent(props) {
12800
13092
  onLayout: props.onLayout
12801
13093
  }
12802
13094
  ),
12803
- notes: /* @__PURE__ */ React43.createElement(TreeNotes, { ...props }),
13095
+ notes: /* @__PURE__ */ React44.createElement(TreeNotes, { ...props }),
12804
13096
  snapshot: props.snapshot,
12805
13097
  visible: props.visible,
12806
13098
  rows: props.rows,
@@ -12810,6 +13102,7 @@ function SnapshotContent(props) {
12810
13102
  injection: props.injection,
12811
13103
  focused: props.focused,
12812
13104
  now: props.now,
13105
+ fields: props.rowFields,
12813
13106
  more: props.more,
12814
13107
  onPick: props.onPick,
12815
13108
  onSkillAction: props.onSkillAction
@@ -12818,17 +13111,17 @@ function SnapshotContent(props) {
12818
13111
  }
12819
13112
  function TreeNotes(props) {
12820
13113
  const { t: t2 } = useI18n();
12821
- return /* @__PURE__ */ React43.createElement(React43.Fragment, null, props.layout === "tree" && props.snapshot.total > props.snapshot.loaded ? /* @__PURE__ */ React43.createElement("div", { "data-testid": "tree-coverage", style: TREE_NOTE_STYLE }, t2("tree.coverage", { loaded: props.snapshot.loaded })) : null, props.preferenceLayout === "tree" && !props.hierarchyAvailable ? /* @__PURE__ */ React43.createElement("div", { "data-testid": "tree-degraded", style: TREE_DEGRADED_STYLE }, t2("tree.degraded")) : null, props.preferenceLayout !== "tree" && !props.hierarchyAvailable ? /* @__PURE__ */ React43.createElement("div", { "data-testid": "tree-unavailable", style: TREE_NOTE_STYLE }, t2(hierarchyHintKey(props.snapshot))) : null);
13114
+ return /* @__PURE__ */ React44.createElement(React44.Fragment, null, props.layout === "tree" && props.snapshot.total > props.snapshot.loaded ? /* @__PURE__ */ React44.createElement("div", { "data-testid": "tree-coverage", style: TREE_NOTE_STYLE }, t2("tree.coverage", { loaded: props.snapshot.loaded })) : null, props.preferenceLayout === "tree" && !props.hierarchyAvailable ? /* @__PURE__ */ React44.createElement("div", { "data-testid": "tree-degraded", style: TREE_DEGRADED_STYLE }, t2("tree.degraded")) : null, props.preferenceLayout !== "tree" && !props.hierarchyAvailable ? /* @__PURE__ */ React44.createElement("div", { "data-testid": "tree-unavailable", style: TREE_NOTE_STYLE }, t2(hierarchyHintKey(props.snapshot))) : null);
12822
13115
  }
12823
13116
  function useFocusedTicket(focusRef, onFocusHandled, workspaceRoot) {
12824
- const [focused, setFocused] = React43.useState(null);
12825
- React43.useEffect(() => {
13117
+ const [focused, setFocused] = React44.useState(null);
13118
+ React44.useEffect(() => {
12826
13119
  if (focusRef === null || focusRef === void 0) return;
12827
13120
  setFocused(focusRef);
12828
13121
  onFocusHandled?.();
12829
13122
  }, [focusRef, onFocusHandled]);
12830
- const previousRoot = React43.useRef(workspaceRoot);
12831
- React43.useEffect(() => {
13123
+ const previousRoot = React44.useRef(workspaceRoot);
13124
+ React44.useEffect(() => {
12832
13125
  if (previousRoot.current === workspaceRoot) return;
12833
13126
  previousRoot.current = workspaceRoot;
12834
13127
  setFocused(null);
@@ -12842,7 +13135,7 @@ function TicketRows(props) {
12842
13135
  more.available && more.error === null && !more.loading,
12843
13136
  more.onLoadMore
12844
13137
  );
12845
- return /* @__PURE__ */ React43.createElement(React43.Fragment, null, /* @__PURE__ */ React43.createElement("div", { style: LIST_HEADER_STYLE }, /* @__PURE__ */ React43.createElement("span", { "data-testid": "loaded-total", style: LOADED_STYLE }, t2("tickets.loaded", { loaded: props.snapshot.loaded, total: props.snapshot.total }), more.capped ? t2("tickets.loadedCapped") : ""), props.layoutControl), props.notes, /* @__PURE__ */ React43.createElement(
13138
+ return /* @__PURE__ */ React44.createElement(React44.Fragment, null, /* @__PURE__ */ React44.createElement("div", { style: LIST_HEADER_STYLE }, /* @__PURE__ */ React44.createElement("span", { "data-testid": "loaded-total", style: LOADED_STYLE }, t2("tickets.loaded", { loaded: props.snapshot.loaded, total: props.snapshot.total }), more.capped ? t2("tickets.loadedCapped") : ""), props.layoutControl), props.notes, /* @__PURE__ */ React44.createElement(
12846
13139
  TicketList,
12847
13140
  {
12848
13141
  tickets: props.visible,
@@ -12853,9 +13146,10 @@ function TicketRows(props) {
12853
13146
  injection: props.injection,
12854
13147
  focused: props.focused,
12855
13148
  now: props.now,
13149
+ fields: props.fields,
12856
13150
  onPick: props.onPick,
12857
13151
  onSkillAction: props.onSkillAction,
12858
- footer: more.available ? /* @__PURE__ */ React43.createElement(MoreFooter, { state: more, sentinel }) : null
13152
+ footer: more.available ? /* @__PURE__ */ React44.createElement(MoreFooter, { state: more, sentinel }) : null
12859
13153
  }
12860
13154
  ));
12861
13155
  }
@@ -12863,11 +13157,11 @@ function TicketRows(props) {
12863
13157
  // src/client/task-panel.tsx
12864
13158
  var NO_CAPABILITIES = () => [];
12865
13159
  function TaskPanel(props) {
12866
- const [view, setView] = React44.useState("tickets");
12867
- const [focusBackend, setFocusBackend] = React44.useState(null);
13160
+ const [view, setView] = React45.useState("tickets");
13161
+ const [focusBackend, setFocusBackend] = React45.useState(null);
12868
13162
  const navigation = useDetailNavigation(props.workspaceRoot);
12869
- const [focusTicket, setFocusTicket] = React44.useState(null);
12870
- const previousView = React44.useRef("tickets");
13163
+ const [focusTicket, setFocusTicket] = React45.useState(null);
13164
+ const previousView = React45.useRef("tickets");
12871
13165
  const actions = useTicketActions(props.workspaceRoot, props.injection);
12872
13166
  const clientCapabilities = props.clientCapabilities ?? NO_CAPABILITIES;
12873
13167
  const request = useSnapshotRequest(props.client, props.workspaceRoot, {
@@ -12878,7 +13172,7 @@ function TaskPanel(props) {
12878
13172
  if (view !== "help") previousView.current = view;
12879
13173
  setView("help");
12880
13174
  };
12881
- return /* @__PURE__ */ React44.createElement("div", { "data-testid": "task-panel", "data-anvil-panel": "", style: PANEL_STYLE }, /* @__PURE__ */ React44.createElement("style", null, PANEL_SHEET), /* @__PURE__ */ React44.createElement(
13175
+ return /* @__PURE__ */ React45.createElement("div", { "data-testid": "task-panel", "data-anvil-panel": "", style: PANEL_STYLE }, /* @__PURE__ */ React45.createElement("style", null, PANEL_SHEET), /* @__PURE__ */ React45.createElement(
12882
13176
  ViewTabs,
12883
13177
  {
12884
13178
  view,
@@ -12895,9 +13189,9 @@ function TaskPanel(props) {
12895
13189
  setView("env");
12896
13190
  },
12897
13191
  onOpenHelp: openHelp,
12898
- actions: view === "tickets" && open === null ? /* @__PURE__ */ React44.createElement(ActionBar, { injection: props.injection, onInject: actions.inject }) : null
13192
+ actions: view === "tickets" && open === null ? /* @__PURE__ */ React45.createElement(ActionBar, { injection: props.injection, onInject: actions.inject }) : null
12899
13193
  }
12900
- ), /* @__PURE__ */ React44.createElement(TicketTreeSessionProvider, { workspaceRoot: props.workspaceRoot }, /* @__PURE__ */ React44.createElement(
13194
+ ), /* @__PURE__ */ React45.createElement(TicketTreeSessionProvider, { workspaceRoot: props.workspaceRoot }, /* @__PURE__ */ React45.createElement(
12901
13195
  PanelContent,
12902
13196
  {
12903
13197
  panel: props,
@@ -12937,7 +13231,7 @@ function TaskPanel(props) {
12937
13231
  function PanelContent(props) {
12938
13232
  const panel = props.panel;
12939
13233
  if (props.view === "tickets") {
12940
- return /* @__PURE__ */ React44.createElement(
13234
+ return /* @__PURE__ */ React45.createElement(
12941
13235
  TicketsPane,
12942
13236
  {
12943
13237
  client: panel.client,
@@ -12958,7 +13252,7 @@ function PanelContent(props) {
12958
13252
  );
12959
13253
  }
12960
13254
  if (props.view === "overview") {
12961
- return /* @__PURE__ */ React44.createElement(
13255
+ return /* @__PURE__ */ React45.createElement(
12962
13256
  OverviewPane,
12963
13257
  {
12964
13258
  request: props.request,
@@ -12970,7 +13264,7 @@ function PanelContent(props) {
12970
13264
  );
12971
13265
  }
12972
13266
  if (props.view === "env") {
12973
- return /* @__PURE__ */ React44.createElement(
13267
+ return /* @__PURE__ */ React45.createElement(
12974
13268
  EnvCheckView,
12975
13269
  {
12976
13270
  client: panel.client,
@@ -12981,10 +13275,10 @@ function PanelContent(props) {
12981
13275
  }
12982
13276
  );
12983
13277
  }
12984
- return /* @__PURE__ */ React44.createElement(HelpView, { onBack: props.onBack });
13278
+ return /* @__PURE__ */ React45.createElement(HelpView, { onBack: props.onBack });
12985
13279
  }
12986
13280
  function OverviewPane(props) {
12987
- return /* @__PURE__ */ React44.createElement(
13281
+ return /* @__PURE__ */ React45.createElement(
12988
13282
  OverviewView,
12989
13283
  {
12990
13284
  request: props.request,
@@ -13000,7 +13294,7 @@ function TicketsPane(props) {
13000
13294
  const open = props.open;
13001
13295
  const snapshot = props.request.snapshot;
13002
13296
  const current = findSnapshotTicket(snapshot?.tickets, open.target.ref) ?? open.target.ticket;
13003
- return /* @__PURE__ */ React44.createElement(
13297
+ return /* @__PURE__ */ React45.createElement(
13004
13298
  TicketDetailView,
13005
13299
  {
13006
13300
  key: open.target.ref,
@@ -13016,7 +13310,7 @@ function TicketsPane(props) {
13016
13310
  }
13017
13311
  );
13018
13312
  }
13019
- return /* @__PURE__ */ React44.createElement(
13313
+ return /* @__PURE__ */ React45.createElement(
13020
13314
  TicketsView,
13021
13315
  {
13022
13316
  request: props.request,
@@ -13033,7 +13327,7 @@ function TicketsPane(props) {
13033
13327
  }
13034
13328
  function ViewTabs(props) {
13035
13329
  const { t: t2 } = useI18n();
13036
- return /* @__PURE__ */ React44.createElement("div", { style: VIEW_BAR_STYLE }, /* @__PURE__ */ React44.createElement("div", { role: "group", "aria-label": t2("view.group"), style: VIEW_TABS_STYLE }, /* @__PURE__ */ React44.createElement(
13330
+ return /* @__PURE__ */ React45.createElement("div", { style: VIEW_BAR_STYLE }, /* @__PURE__ */ React45.createElement("div", { role: "group", "aria-label": t2("view.group"), style: VIEW_TABS_STYLE }, /* @__PURE__ */ React45.createElement(
13037
13331
  ViewChip,
13038
13332
  {
13039
13333
  testId: "view-tickets",
@@ -13041,7 +13335,7 @@ function ViewTabs(props) {
13041
13335
  active: props.view === "tickets",
13042
13336
  onClick: props.onOpenTickets
13043
13337
  }
13044
- ), /* @__PURE__ */ React44.createElement(
13338
+ ), /* @__PURE__ */ React45.createElement(
13045
13339
  ViewChip,
13046
13340
  {
13047
13341
  testId: "view-overview",
@@ -13049,7 +13343,7 @@ function ViewTabs(props) {
13049
13343
  active: props.view === "overview",
13050
13344
  onClick: props.onOpenOverview
13051
13345
  }
13052
- ), /* @__PURE__ */ React44.createElement(
13346
+ ), /* @__PURE__ */ React45.createElement(
13053
13347
  ViewChip,
13054
13348
  {
13055
13349
  testId: "view-env",
@@ -13057,10 +13351,10 @@ function ViewTabs(props) {
13057
13351
  active: props.view === "env",
13058
13352
  onClick: props.onOpenEnvCheck
13059
13353
  }
13060
- )), /* @__PURE__ */ React44.createElement("div", { style: VIEW_BAR_END_STYLE }, props.actions, /* @__PURE__ */ React44.createElement(TipsButton, { onClick: props.onOpenHelp })));
13354
+ )), /* @__PURE__ */ React45.createElement("div", { style: VIEW_BAR_END_STYLE }, props.actions, /* @__PURE__ */ React45.createElement(TipsButton, { onClick: props.onOpenHelp })));
13061
13355
  }
13062
13356
  function ViewChip(props) {
13063
- return /* @__PURE__ */ React44.createElement(
13357
+ return /* @__PURE__ */ React45.createElement(
13064
13358
  "button",
13065
13359
  {
13066
13360
  type: "button",
@@ -13075,7 +13369,7 @@ function ViewChip(props) {
13075
13369
  }
13076
13370
  function TipsButton(props) {
13077
13371
  const { t: t2 } = useI18n();
13078
- return /* @__PURE__ */ React44.createElement(
13372
+ return /* @__PURE__ */ React45.createElement(
13079
13373
  "button",
13080
13374
  {
13081
13375
  type: "button",
@@ -13085,11 +13379,11 @@ function TipsButton(props) {
13085
13379
  onClick: props.onClick,
13086
13380
  style: ICON_BUTTON_STYLE
13087
13381
  },
13088
- /* @__PURE__ */ React44.createElement(TipsIcon, null)
13382
+ /* @__PURE__ */ React45.createElement(TipsIcon, null)
13089
13383
  );
13090
13384
  }
13091
13385
  function TipsIcon() {
13092
- return /* @__PURE__ */ React44.createElement(
13386
+ return /* @__PURE__ */ React45.createElement(
13093
13387
  "svg",
13094
13388
  {
13095
13389
  width: 14,
@@ -13102,9 +13396,9 @@ function TipsIcon() {
13102
13396
  strokeLinecap: "round",
13103
13397
  strokeLinejoin: "round"
13104
13398
  },
13105
- /* @__PURE__ */ React44.createElement("path", { d: "M8 1.8a4.1 4.1 0 0 0-2.5 7.4c.3.2.5.5.5.9v.4h4v-.4c0-.4.2-.7.5-.9A4.1 4.1 0 0 0 8 1.8Z" }),
13106
- /* @__PURE__ */ React44.createElement("path", { d: "M6.4 12.6h3.2" }),
13107
- /* @__PURE__ */ React44.createElement("path", { d: "M7.2 14.4h1.6" })
13399
+ /* @__PURE__ */ React45.createElement("path", { d: "M8 1.8a4.1 4.1 0 0 0-2.5 7.4c.3.2.5.5.5.9v.4h4v-.4c0-.4.2-.7.5-.9A4.1 4.1 0 0 0 8 1.8Z" }),
13400
+ /* @__PURE__ */ React45.createElement("path", { d: "M6.4 12.6h3.2" }),
13401
+ /* @__PURE__ */ React45.createElement("path", { d: "M7.2 14.4h1.6" })
13108
13402
  );
13109
13403
  }
13110
13404
 
@@ -13226,7 +13520,7 @@ function registerInjection(scope, injectionRef, capabilities) {
13226
13520
  });
13227
13521
  }
13228
13522
  function TaskTabTitle() {
13229
- return /* @__PURE__ */ React45.createElement("span", null, "MattWorkflow");
13523
+ return /* @__PURE__ */ React46.createElement("span", null, "MattWorkflow");
13230
13524
  }
13231
13525
  function createTaskTab(client, injectionRef, capabilities, i18n) {
13232
13526
  return function TaskTab(props) {
@@ -13237,7 +13531,7 @@ function createTaskTab(client, injectionRef, capabilities, i18n) {
13237
13531
  );
13238
13532
  const readiness = useInjectionReadiness(injectionRef);
13239
13533
  const refreshSignal = useAgentActivitySignal(useSessions, sessionId);
13240
- const injection = React45.useMemo(
13534
+ const injection = React46.useMemo(
13241
13535
  () => ({
13242
13536
  canInjectCurrent: sessionId !== void 0 && readiness.current,
13243
13537
  canStartNewSession: readiness.newSession,
@@ -13245,7 +13539,7 @@ function createTaskTab(client, injectionRef, capabilities, i18n) {
13245
13539
  }),
13246
13540
  [injectionRef, sessionId, readiness.current, readiness.newSession]
13247
13541
  );
13248
- return /* @__PURE__ */ React45.createElement(I18nProvider, { i18n }, /* @__PURE__ */ React45.createElement(
13542
+ return /* @__PURE__ */ React46.createElement(I18nProvider, { i18n }, /* @__PURE__ */ React46.createElement(
13249
13543
  TaskPanel,
13250
13544
  {
13251
13545
  client,
@@ -13269,8 +13563,8 @@ function notify(ref) {
13269
13563
  for (const listener of ref.listeners) listener();
13270
13564
  }
13271
13565
  function useInjectionReadiness(ref) {
13272
- const [readiness, setReadiness] = React45.useState(() => readReadiness(ref));
13273
- React45.useEffect(() => {
13566
+ const [readiness, setReadiness] = React46.useState(() => readReadiness(ref));
13567
+ React46.useEffect(() => {
13274
13568
  const update = () => {
13275
13569
  setReadiness(readReadiness(ref));
13276
13570
  };
package/lib/index.js CHANGED
@@ -33,7 +33,7 @@ function isRecord(value) {
33
33
  }
34
34
 
35
35
  // src/core/snapshot-store.ts
36
- var SNAPSHOT_STORE_VERSION = 5;
36
+ var SNAPSHOT_STORE_VERSION = 6;
37
37
  var BACKENDS = ["github", "gitlab", "gitea", "markdown"];
38
38
  function serializeSnapshotStoreEntry(entry) {
39
39
  return JSON.stringify({
@@ -692,6 +692,16 @@ function repositorySlug(remote) {
692
692
  if (!REPOSITORY_SEGMENT.test(owner) || !REPOSITORY_SEGMENT.test(name2)) return void 0;
693
693
  return `${owner}/${name2}`;
694
694
  }
695
+ function parseRepositorySegment(value) {
696
+ if (value.includes("://") || value.includes("@")) return void 0;
697
+ const segments = value.split("/");
698
+ if (segments.length !== 2) return void 0;
699
+ const [owner, name2] = segments;
700
+ if (owner === void 0 || name2 === void 0) return void 0;
701
+ if (!REPOSITORY_SEGMENT.test(owner) || !REPOSITORY_SEGMENT.test(name2)) return void 0;
702
+ if (owner === "." || owner === ".." || name2 === "." || name2 === "..") return void 0;
703
+ return { owner, name: name2 };
704
+ }
695
705
  function buildAddress(host, path) {
696
706
  if (host === void 0 || path === void 0) return void 0;
697
707
  const normalizedHost = normalizeHost(host);
@@ -974,12 +984,21 @@ function parseDependencies(body) {
974
984
  for (const dependency of payload) {
975
985
  if (!isRecord(dependency)) continue;
976
986
  const number = dependency.number;
977
- if (typeof number === "number" && Number.isInteger(number) && number > 0) refs.push(number);
987
+ if (typeof number === "number" && Number.isInteger(number) && number > 0) {
988
+ const repository = readDependencyRepository(dependency.repository);
989
+ refs.push(repository === void 0 ? { number } : { number, repository });
990
+ }
978
991
  if (dependency.state === "closed") continue;
979
992
  open += 1;
980
993
  }
981
994
  return { received: payload.length, open, refs };
982
995
  }
996
+ function readDependencyRepository(value) {
997
+ if (!isRecord(value)) return void 0;
998
+ const fullName = value.full_name;
999
+ if (typeof fullName !== "string") return void 0;
1000
+ return parseRepositorySegment(fullName) === void 0 ? void 0 : fullName;
1001
+ }
983
1002
  function readStatus(stderr) {
984
1003
  const match = STATUS_LINE.exec(stderr);
985
1004
  if (match === null) return 200;
@@ -1309,7 +1328,7 @@ function parseNativeBlockers(output) {
1309
1328
  if (!isRecord(link)) continue;
1310
1329
  if (link.link_type !== "is_blocked_by") continue;
1311
1330
  const iid = link.iid;
1312
- if (typeof iid === "number" && Number.isInteger(iid) && iid > 0) refs.push(iid);
1331
+ if (typeof iid === "number" && Number.isInteger(iid) && iid > 0) refs.push({ number: iid });
1313
1332
  if (link.state === "closed") continue;
1314
1333
  open += 1;
1315
1334
  }
@@ -1976,8 +1995,10 @@ function hasDescriptionBlockers(description) {
1976
1995
  function countDescriptionBlockers(description, states) {
1977
1996
  return countOpenBlockers(descriptionBlockerNumbers(description), states);
1978
1997
  }
1979
- function remoteBlockerRefs(numbers) {
1980
- return numbers.map((number) => `#${String(number)}`);
1998
+ function remoteBlockerRefs(refs, repository) {
1999
+ return refs.map(
2000
+ (ref) => ref.repository === void 0 || ref.repository === repository ? `#${String(ref.number)}` : `${ref.repository}#${String(ref.number)}`
2001
+ );
1981
2002
  }
1982
2003
  function resolveOpenBlockers(input) {
1983
2004
  if (input.ticket.state !== "open" || input.ticket.number === null) {
@@ -1993,7 +2014,7 @@ function resolveOpenBlockers(input) {
1993
2014
  const numbers = descriptionBlockerNumbers(input.text);
1994
2015
  return {
1995
2016
  openBlockers: countOpenBlockers(numbers, input.states),
1996
- blockedBy: remoteBlockerRefs(numbers)
2017
+ blockedBy: remoteBlockerRefs(numbers.map((number) => ({ number })))
1997
2018
  };
1998
2019
  }
1999
2020
  function preambleOf2(description) {
@@ -2171,7 +2192,7 @@ function invalidPermission(message) {
2171
2192
  // src/adapters/gitea/detail.ts
2172
2193
  async function readGiteaDetail(deps, workspaceRoot, reference) {
2173
2194
  const number = requireTicketNumber(reference);
2174
- const repository = await readRepository(deps.run, workspaceRoot);
2195
+ const repository = reference.repository === void 0 ? await readRepository(deps.run, workspaceRoot) : repositoryOf(reference.repository);
2175
2196
  const issue = await readIssue(deps, workspaceRoot, repository, number);
2176
2197
  const comments = await readComments(deps, workspaceRoot, repository, number);
2177
2198
  return {
@@ -2190,6 +2211,13 @@ async function readGiteaDetail(deps, workspaceRoot, reference) {
2190
2211
  updatedAt: issue.updatedAt
2191
2212
  };
2192
2213
  }
2214
+ function repositoryOf(segment) {
2215
+ const parsed = parseRepositorySegment(segment);
2216
+ if (parsed === void 0) {
2217
+ throw new TrackerError("fetch-failed", "\u8DE8\u4ED3\u5E93\u5F15\u7528\u7684\u4ED3\u5E93\u6BB5\u4E0D\u5408\u6CD5\uFF0C\u9700\u8981 owner/name\u3002");
2218
+ }
2219
+ return { ...parsed, avatarBaseUrl: "" };
2220
+ }
2193
2221
  async function applyGiteaChanges(deps, workspaceRoot, reference, patch) {
2194
2222
  const number = requireTicketNumber(reference);
2195
2223
  const repository = await readRepository(deps.run, workspaceRoot);
@@ -2581,11 +2609,12 @@ async function readNativeResolution(deps, workspaceRoot, targets, pageSize, conc
2581
2609
  if (settled.some((entry) => entry.outcome === "unavailable")) return emptyResolution();
2582
2610
  const counts = /* @__PURE__ */ new Map();
2583
2611
  const blockedBy = /* @__PURE__ */ new Map();
2612
+ const repositoryName = `${repository.owner}/${repository.name}`;
2584
2613
  for (const entry of settled) {
2585
2614
  if (entry.outcome !== "ok") continue;
2586
2615
  counts.set(entry.ref, entry.blocked.open);
2587
2616
  if (entry.blocked.refs.length > 0) {
2588
- blockedBy.set(entry.ref, remoteBlockerRefs(entry.blocked.refs));
2617
+ blockedBy.set(entry.ref, remoteBlockerRefs(entry.blocked.refs, repositoryName));
2589
2618
  }
2590
2619
  }
2591
2620
  return { open: counts, blockedBy };
@@ -5126,7 +5155,13 @@ function readTicketParams(params) {
5126
5155
  if (number !== null && !(typeof number === "number" && Number.isInteger(number) && number > 0)) {
5127
5156
  return void 0;
5128
5157
  }
5129
- return { workspaceRoot, ref, number };
5158
+ let repository;
5159
+ if ("repository" in params && params.repository !== void 0) {
5160
+ const value = params.repository;
5161
+ if (typeof value !== "string" || parseRepositorySegment(value) === void 0) return void 0;
5162
+ repository = value;
5163
+ }
5164
+ return { workspaceRoot, ref, number, ...repository === void 0 ? {} : { repository } };
5130
5165
  }
5131
5166
 
5132
5167
  // src/host/snapshot-error.ts
@@ -6288,12 +6323,19 @@ async function getDetail(deps, params) {
6288
6323
  if (fetchDetail === void 0) {
6289
6324
  return unsupported(kind, "\u8BFB\u53D6\u5DE5\u5355\u8BE6\u60C5");
6290
6325
  }
6326
+ const crossRepository = target.repository !== void 0;
6327
+ if (crossRepository && kind !== "gitea") {
6328
+ return unsupported(kind, "\u6253\u5F00\u8DE8\u4ED3\u5E93\u5DE5\u5355");
6329
+ }
6291
6330
  const [detail, canDelete] = await Promise.all([
6292
6331
  fetchDetail(target.workspaceRoot, referenceOf(target)),
6293
- readCanDelete(resolved.tracker, target.workspaceRoot)
6332
+ crossRepository ? Promise.resolve(false) : readCanDelete(resolved.tracker, target.workspaceRoot)
6294
6333
  ]);
6295
6334
  logResult(deps, "info", kind, "get", startedAt);
6296
- return { ok: true, result: withCapabilities(kind, resolved.tracker, detail, canDelete) };
6335
+ return {
6336
+ ok: true,
6337
+ result: withCapabilities(kind, resolved.tracker, detail, canDelete, crossRepository)
6338
+ };
6297
6339
  } catch (error) {
6298
6340
  const mapped = mapError(error);
6299
6341
  logResult(deps, "warn", kind, "get", startedAt, mapped.code);
@@ -6318,6 +6360,9 @@ async function update(deps, params) {
6318
6360
  if (updateTicket === void 0) {
6319
6361
  return unsupported(kind, "\u4FEE\u6539\u5DE5\u5355\u5C5E\u6027");
6320
6362
  }
6363
+ if (target.repository !== void 0) {
6364
+ return unsupported(kind, "\u4FEE\u6539\u8DE8\u4ED3\u5E93\u5DE5\u5355");
6365
+ }
6321
6366
  await updateTicket(target.workspaceRoot, referenceOf(target), patch);
6322
6367
  await syncCachedTicket(deps, target.workspaceRoot, target.ref, patch);
6323
6368
  logResult(deps, "info", kind, "update", startedAt);
@@ -6368,6 +6413,9 @@ async function remove(deps, params) {
6368
6413
  if (deleteTicket === void 0) {
6369
6414
  return unsupported(kind, "\u5220\u9664\u5DE5\u5355");
6370
6415
  }
6416
+ if (target.repository !== void 0) {
6417
+ return unsupported(kind, "\u5220\u9664\u8DE8\u4ED3\u5E93\u5DE5\u5355");
6418
+ }
6371
6419
  if (!await readCanDelete(resolved.tracker, target.workspaceRoot)) {
6372
6420
  const code = ERROR_CODES.fetchFailed;
6373
6421
  logResult(deps, "warn", kind, "delete", startedAt, code);
@@ -6430,14 +6478,14 @@ async function removeCachedTicket(deps, workspaceRoot, ref) {
6430
6478
  } catch {
6431
6479
  }
6432
6480
  }
6433
- function withCapabilities(kind, tracker, detail, canDelete) {
6434
- const writable = tracker.updateTicket !== void 0;
6481
+ function withCapabilities(kind, tracker, detail, canDelete, readOnly) {
6482
+ const writable = !readOnly && tracker.updateTicket !== void 0;
6435
6483
  const capabilities = {
6436
6484
  labels: writable,
6437
6485
  assignees: writable,
6438
6486
  state: writable,
6439
6487
  link: detail.url !== null,
6440
- delete: canDelete
6488
+ delete: !readOnly && canDelete
6441
6489
  };
6442
6490
  return { ...detail, backend: kind, capabilities };
6443
6491
  }
@@ -6490,7 +6538,11 @@ function readField(params, key) {
6490
6538
  return key in params ? params[key] : void 0;
6491
6539
  }
6492
6540
  function referenceOf(target) {
6493
- return { ref: target.ref, number: target.number };
6541
+ return {
6542
+ ref: target.ref,
6543
+ number: target.number,
6544
+ ...target.repository === void 0 ? {} : { repository: target.repository }
6545
+ };
6494
6546
  }
6495
6547
  function unsupported(kind, action) {
6496
6548
  return failure3(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cnzgray/dsh-mattpocock-workflow",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "在 DSH 里运行 mattpocock/skills 工作流的 MattWorkflow 任务面板插件。",
5
5
  "license": "MIT",
6
6
  "type": "module",