@cnzgray/dsh-mattpocock-workflow 0.5.1 → 0.7.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/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 React48 = __toESM(require("react"), 1);
43
43
 
44
44
  // src/client/agent-activity.ts
45
45
  var React = __toESM(require("react"), 1);
@@ -191,6 +191,31 @@ 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}",
207
+ "tickets.hover.labels": "\u6807\u7B7E",
208
+ "tickets.hover.author": "\u521B\u5EFA\u4EBA",
209
+ "tickets.hover.assignees": "\u5206\u914D\u4EBA",
210
+ "tickets.hover.created": "\u521B\u5EFA",
211
+ "tickets.hover.updated": "\u66F4\u65B0",
212
+ "tickets.hover.comments": "\u8BC4\u8BBA",
213
+ "tickets.hover.blockedLabel": "\u963B\u585E",
214
+ "tickets.hover.blocked": "{count} \u5F20",
215
+ "tickets.hover.blockedRefs": "{count} \u5F20\uFF1A{refs}",
216
+ "tickets.hover.parentLabel": "\u7236\u7EA7",
217
+ "tickets.hover.parentOutside": "{parent}\uFF08\u4E0D\u5728\u5F53\u524D\u5217\u8868\uFF09",
218
+ "tickets.hover.openHint": "\u70B9\u51FB\u884C\u6253\u5F00\u8BE6\u60C5",
194
219
  "tickets.more.loading": "\u6B63\u5728\u52A0\u8F7D\u66F4\u591A\u2026",
195
220
  "tickets.more.scroll": "\u7EE7\u7EED\u5411\u4E0B\u6EDA\u52A8\u52A0\u8F7D\u66F4\u591A",
196
221
  "tickets.more.failed": "\u52A0\u8F7D\u66F4\u591A\u5931\u8D25\uFF1A{message}",
@@ -284,6 +309,7 @@ var zh = {
284
309
  "relative.hours": "{count} \u5C0F\u65F6\u524D",
285
310
  "relative.days": "{count} \u5929\u524D",
286
311
  "ticket.avatar.label": "\u521B\u5EFA\u4EBA\uFF1A{name}",
312
+ "ticket.avatar.assigneeLabel": "\u5206\u914D\u4EBA\uFF1A{name}",
287
313
  "ticket.author.title": "{name}\uFF08@{login}\uFF09",
288
314
  "ticket.number.copyAria": "\u590D\u5236 #{number} \u7684\u94FE\u63A5",
289
315
  "ticket.number.copiedTitle": "\u5DF2\u590D\u5236\u94FE\u63A5",
@@ -382,6 +408,7 @@ var zh = {
382
408
  "env.remedy.noSession": "\u5F53\u524D\u6CA1\u6709\u53EF\u7528\u4F1A\u8BDD\uFF0C\u65E0\u6CD5\u586B\u5165\u8F93\u5165\u6846\uFF1B\u53EF\u4EE5\u590D\u5236\u63D0\u793A\u8BCD\u3002",
383
409
  "env.remedy.fillFailed": "\u586B\u5165\u5931\u8D25\uFF1A\u5F53\u524D\u4F1A\u8BDD\u4E0D\u53EF\u7528\u3002",
384
410
  "env.remedy.copyFailed": "\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u624B\u52A8\u9009\u62E9{noun}\u3002",
411
+ "env.remedy.manualCopyAria": "\u624B\u52A8\u590D\u5236{noun}",
385
412
  "capability.category.host": "\u5BBF\u4E3B\u670D\u52A1",
386
413
  "capability.category.ui": "\u754C\u9762\u6269\u5C55\u70B9",
387
414
  "capability.state.present": "\u53EF\u7528",
@@ -665,6 +692,31 @@ var en = {
665
692
  "tickets.emptyFilter": "No tickets match the filter.",
666
693
  "tickets.a11y.open": "Open {ref}: {title}",
667
694
  "tickets.age.title": "Created: {created}; updated: {updated}",
695
+ "row.displayGroup": "Row details",
696
+ "row.displayGroupHint": "Choose which fields each row shows",
697
+ "row.showAuthor": "Author",
698
+ "row.showCreatedAt": "Created time",
699
+ "row.showUpdatedAt": "Updated time",
700
+ "row.showAssignees": "Assignees",
701
+ "row.time.created": "Created {age}",
702
+ "row.time.updated": "Updated {age}",
703
+ "row.time.separator": " \xB7 ",
704
+ "row.assigneesA11y": "Assignees: {names}",
705
+ "row.assigneesTitle": "Assignees: {names}",
706
+ "row.assigneesSeparator": ", ",
707
+ "row.assigneesMoreTitle": "{count} more assignees: {names}",
708
+ "tickets.hover.labels": "Labels",
709
+ "tickets.hover.author": "Author",
710
+ "tickets.hover.assignees": "Assignees",
711
+ "tickets.hover.created": "Created",
712
+ "tickets.hover.updated": "Updated",
713
+ "tickets.hover.comments": "Comments",
714
+ "tickets.hover.blockedLabel": "Blocked",
715
+ "tickets.hover.blocked": "{count} tickets",
716
+ "tickets.hover.blockedRefs": "{count} tickets: {refs}",
717
+ "tickets.hover.parentLabel": "Parent",
718
+ "tickets.hover.parentOutside": "{parent} (not in list)",
719
+ "tickets.hover.openHint": "Click the row to open details",
668
720
  "tickets.more.loading": "Loading more\u2026",
669
721
  "tickets.more.scroll": "Scroll down to load more",
670
722
  "tickets.more.failed": "Failed to load more: {message}",
@@ -758,6 +810,7 @@ var en = {
758
810
  "relative.hours": "{count} h ago",
759
811
  "relative.days": "{count} d ago",
760
812
  "ticket.avatar.label": "Created by {name}",
813
+ "ticket.avatar.assigneeLabel": "Assigned to {name}",
761
814
  "ticket.author.title": "{name} (@{login})",
762
815
  "ticket.number.copyAria": "Copy the link to #{number}",
763
816
  "ticket.number.copiedTitle": "Link copied",
@@ -856,6 +909,7 @@ var en = {
856
909
  "env.remedy.noSession": "No usable session; cannot fill the input. You can copy the prompt.",
857
910
  "env.remedy.fillFailed": "Fill failed: the current session is unavailable.",
858
911
  "env.remedy.copyFailed": "Copy failed; select the {noun} manually.",
912
+ "env.remedy.manualCopyAria": "Manually copy the {noun}",
859
913
  "capability.category.host": "Host service",
860
914
  "capability.category.ui": "UI extension",
861
915
  "capability.state.present": "Available",
@@ -1456,7 +1510,7 @@ function isSnapshotRefreshResultPayload(value) {
1456
1510
  return typeof value.version === "number" && typeof value.checkedAt === "number";
1457
1511
  }
1458
1512
  if (value.kind === "changes") {
1459
- return typeof value.version === "number" && typeof value.fetchedAt === "number" && Array.isArray(value.tickets) && value.tickets.every(hasTicketFilterFields) && isStringArray(value.removed) && typeof value.metrics === "object" && value.metrics !== null && (value.viewer === null || typeof value.viewer === "string") && typeof value.total === "number" && typeof value.loaded === "number" && typeof value.windowLimit === "number" && typeof value.blockersFinalized === "boolean";
1513
+ return typeof value.version === "number" && typeof value.fetchedAt === "number" && Array.isArray(value.tickets) && value.tickets.every(hasTicketSnapshotFields) && isStringArray(value.removed) && typeof value.metrics === "object" && value.metrics !== null && (value.viewer === null || typeof value.viewer === "string") && typeof value.total === "number" && typeof value.loaded === "number" && typeof value.windowLimit === "number" && typeof value.blockersFinalized === "boolean";
1460
1514
  }
1461
1515
  return false;
1462
1516
  }
@@ -1479,7 +1533,7 @@ function isWorkspaceSnapshot(value) {
1479
1533
  return false;
1480
1534
  }
1481
1535
  if (!("tickets" in value) || !Array.isArray(value.tickets)) return false;
1482
- if (!value.tickets.every(hasTicketFilterFields)) return false;
1536
+ if (!value.tickets.every(hasTicketSnapshotFields)) return false;
1483
1537
  if (!("metrics" in value) || typeof value.metrics !== "object" || value.metrics === null) {
1484
1538
  return false;
1485
1539
  }
@@ -1508,11 +1562,27 @@ function isSnapshotCacheInfo(value) {
1508
1562
  if (!("cleared" in value) || typeof value.cleared !== "number") return false;
1509
1563
  return true;
1510
1564
  }
1511
- function hasTicketFilterFields(value) {
1565
+ function hasTicketSnapshotFields(value) {
1512
1566
  if (typeof value !== "object" || value === null) return false;
1513
1567
  if (!("skillAction" in value) || !isSkillAction(value.skillAction)) return false;
1514
1568
  if (!("skillActionReason" in value) || !isActionReason(value.skillActionReason)) return false;
1515
- return "assignees" in value && isStringArray(value.assignees);
1569
+ if (!("assignees" in value)) return false;
1570
+ if (!Array.isArray(value.assignees) || !value.assignees.every(isTicketAuthor)) return false;
1571
+ if ("excerpt" in value && (typeof value.excerpt !== "string" || value.excerpt.length === 0)) {
1572
+ return false;
1573
+ }
1574
+ return !("commentCount" in value) || typeof value.commentCount === "number" && Number.isInteger(value.commentCount) && value.commentCount >= 0;
1575
+ }
1576
+ function isTicketAuthor(value) {
1577
+ if (typeof value !== "object" || value === null) return false;
1578
+ const author = value;
1579
+ if (typeof author.login !== "string" || author.login.length === 0) return false;
1580
+ for (const key of ["displayName", "avatarUrl"]) {
1581
+ if (!(key in author)) return false;
1582
+ const field = author[key];
1583
+ if (field !== null && typeof field !== "string") return false;
1584
+ }
1585
+ return true;
1516
1586
  }
1517
1587
  function isStringArray(value) {
1518
1588
  return Array.isArray(value) && value.every((item) => typeof item === "string");
@@ -1776,7 +1846,7 @@ function disposerOf(handle) {
1776
1846
  }
1777
1847
 
1778
1848
  // src/client/task-panel.tsx
1779
- var React44 = __toESM(require("react"), 1);
1849
+ var React47 = __toESM(require("react"), 1);
1780
1850
 
1781
1851
  // src/client/action-bar.tsx
1782
1852
  var React5 = __toESM(require("react"), 1);
@@ -1972,6 +2042,17 @@ function TrashIcon() {
1972
2042
  }
1973
2043
  ));
1974
2044
  }
2045
+ function DisplaySettingsIcon() {
2046
+ return /* @__PURE__ */ React3.createElement("svg", { width: "13", height: "13", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true" }, /* @__PURE__ */ React3.createElement(
2047
+ "path",
2048
+ {
2049
+ d: "M2.5 5h2M7.5 5h6M2.5 11h6M11.5 11h2",
2050
+ stroke: "currentColor",
2051
+ strokeWidth: "1.2",
2052
+ strokeLinecap: "round"
2053
+ }
2054
+ ), /* @__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" }));
2055
+ }
1975
2056
  function FlatListIcon() {
1976
2057
  return /* @__PURE__ */ React3.createElement("svg", { width: "12", height: "12", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true" }, /* @__PURE__ */ React3.createElement(
1977
2058
  "path",
@@ -2223,7 +2304,8 @@ var CHIP_STYLE = {
2223
2304
  color: COLORS.secondary,
2224
2305
  padding: "2px 10px",
2225
2306
  cursor: "pointer",
2226
- font: "inherit",
2307
+ // 只继承字体家族:font 简写会把选中态的 fontWeight 一起重置。
2308
+ fontFamily: "inherit",
2227
2309
  fontSize: 12,
2228
2310
  lineHeight: "20px",
2229
2311
  whiteSpace: "nowrap"
@@ -2344,6 +2426,7 @@ var EMPTY_STYLE = {
2344
2426
  color: COLORS.secondary
2345
2427
  };
2346
2428
  var LIST_STYLE = {
2429
+ position: "relative",
2347
2430
  display: "flex",
2348
2431
  flexDirection: "column",
2349
2432
  gap: 6,
@@ -2743,8 +2826,11 @@ var DETAIL_ROOT_STYLE = {
2743
2826
  var DETAIL_HEADER_STYLE = {
2744
2827
  position: "relative",
2745
2828
  display: "flex",
2829
+ // 窄侧栏里放不下全部动作时折到下一行;不折行会把整页撑宽,出现页面级横向滚动条。
2830
+ flexWrap: "wrap",
2746
2831
  alignItems: "center",
2747
- gap: 6,
2832
+ columnGap: 6,
2833
+ rowGap: 4,
2748
2834
  minWidth: 0,
2749
2835
  padding: "6px 8px 6px 6px",
2750
2836
  borderBottom: `1px solid ${COLORS.border}`
@@ -2784,6 +2870,7 @@ var DETAIL_REF_LINK_STYLE = {
2784
2870
  textUnderlineOffset: 2
2785
2871
  };
2786
2872
  var DETAIL_SCROLL_STYLE = {
2873
+ position: "relative",
2787
2874
  display: "flex",
2788
2875
  flexDirection: "column",
2789
2876
  gap: 14,
@@ -3316,6 +3403,28 @@ var ENV_REMEDY_NOTICE_STYLE = {
3316
3403
  color: COLORS.warn,
3317
3404
  fontSize: 12
3318
3405
  };
3406
+ var ENV_REMEDY_FAILURE_STYLE = {
3407
+ display: "flex",
3408
+ flexDirection: "column",
3409
+ alignItems: "stretch",
3410
+ gap: 6,
3411
+ width: "100%"
3412
+ };
3413
+ var ENV_REMEDY_MANUAL_COPY_STYLE = {
3414
+ boxSizing: "border-box",
3415
+ width: "100%",
3416
+ minHeight: "3.5em",
3417
+ padding: "6px 8px",
3418
+ border: `1px solid ${COLORS.borderStrong}`,
3419
+ borderRadius: 6,
3420
+ background: COLORS.surface,
3421
+ color: COLORS.text,
3422
+ fontFamily: "inherit",
3423
+ fontSize: 12,
3424
+ lineHeight: 1.5,
3425
+ resize: "vertical",
3426
+ userSelect: "text"
3427
+ };
3319
3428
  var ENV_STATUS_COLORS = {
3320
3429
  pass: COLORS.success,
3321
3430
  fail: COLORS.error,
@@ -3760,7 +3869,7 @@ function CopyButton(props) {
3760
3869
  const { t: t2 } = useI18n();
3761
3870
  const [state, setState] = React9.useState("idle");
3762
3871
  React9.useEffect(() => {
3763
- if (state === "idle") return void 0;
3872
+ if (state !== "copied") return void 0;
3764
3873
  const timer = window.setTimeout(() => {
3765
3874
  setState("idle");
3766
3875
  }, 1500);
@@ -3781,7 +3890,40 @@ function CopyButton(props) {
3781
3890
  style: BUTTON_STYLE
3782
3891
  },
3783
3892
  state === "copied" ? t2("common.copied") : props.label
3784
- ), state === "failed" ? /* @__PURE__ */ React9.createElement("span", { role: "status", "data-testid": `${props.testId}-failed`, style: ENV_REMEDY_NOTICE_STYLE }, t2("env.remedy.copyFailed", { noun: props.noun })) : null);
3893
+ ), state === "failed" ? /* @__PURE__ */ React9.createElement("div", { style: ENV_REMEDY_FAILURE_STYLE }, /* @__PURE__ */ React9.createElement(
3894
+ "span",
3895
+ {
3896
+ role: "status",
3897
+ "data-testid": `${props.testId}-failed`,
3898
+ style: ENV_REMEDY_NOTICE_STYLE
3899
+ },
3900
+ t2("env.remedy.copyFailed", { noun: props.noun })
3901
+ ), /* @__PURE__ */ React9.createElement(ManualCopyField, { text: props.text, noun: props.noun, testId: `${props.testId}-manual` })) : null);
3902
+ }
3903
+ function ManualCopyField(props) {
3904
+ const { t: t2 } = useI18n();
3905
+ const field = React9.useRef(null);
3906
+ React9.useEffect(() => {
3907
+ const node = field.current;
3908
+ if (node === null) return;
3909
+ node.focus();
3910
+ node.select();
3911
+ }, []);
3912
+ return /* @__PURE__ */ React9.createElement(
3913
+ "textarea",
3914
+ {
3915
+ ref: field,
3916
+ "data-testid": props.testId,
3917
+ readOnly: true,
3918
+ spellCheck: false,
3919
+ value: props.text,
3920
+ "aria-label": t2("env.remedy.manualCopyAria", { noun: props.noun }),
3921
+ onFocus: (event) => {
3922
+ event.currentTarget.select();
3923
+ },
3924
+ style: ENV_REMEDY_MANUAL_COPY_STYLE
3925
+ }
3926
+ );
3785
3927
  }
3786
3928
  async function copyText(text) {
3787
3929
  const { clipboard } = navigator;
@@ -5826,6 +5968,8 @@ function useNow(clock) {
5826
5968
 
5827
5969
  // src/client/snapshot-request.ts
5828
5970
  var React17 = __toESM(require("react"), 1);
5971
+ var AUTO_REFRESH_INTERVAL_MS = 6e4;
5972
+ var FOCUS_REFRESH_MIN_MS = 6e4;
5829
5973
  function snapshotRefreshNotice(snapshot, refreshError, t2) {
5830
5974
  if (refreshError !== null) return refreshError.message;
5831
5975
  const hostMessage = snapshot?.refreshError?.message;
@@ -5864,6 +6008,7 @@ function useSnapshotRequest(client, workspaceRoot, options) {
5864
6008
  const handledSignal = React17.useRef(signal);
5865
6009
  const [retry, setRetry] = React17.useState(0);
5866
6010
  const handledRetry = React17.useRef(0);
6011
+ const lastRequestAt = React17.useRef(0);
5867
6012
  const run = React17.useCallback(
5868
6013
  async (mode) => {
5869
6014
  if (mode === "auto" && inFlight.current > 0) {
@@ -5871,6 +6016,7 @@ function useSnapshotRequest(client, workspaceRoot, options) {
5871
6016
  return;
5872
6017
  }
5873
6018
  inFlight.current += 1;
6019
+ lastRequestAt.current = Date.now();
5874
6020
  try {
5875
6021
  const applied = await load(mode);
5876
6022
  if (applied !== null && applied.source === "live") autoRefreshed.current = false;
@@ -5905,17 +6051,11 @@ function useSnapshotRequest(client, workspaceRoot, options) {
5905
6051
  if (workspaceRoot === void 0) return;
5906
6052
  void run("auto");
5907
6053
  }, [signal, workspaceRoot, run]);
6054
+ usePeriodicRefresh(workspaceRoot, run, lastRequestAt);
5908
6055
  React17.useEffect(() => {
5909
6056
  queued.current = false;
5910
6057
  }, [workspaceRoot]);
5911
- const refresh = React17.useCallback(() => {
5912
- if (phase === "loading" || phase === "refreshing") return;
5913
- void run("refresh");
5914
- }, [phase, run]);
5915
- const refreshFull = React17.useCallback(() => {
5916
- if (phase === "loading" || phase === "refreshing") return;
5917
- void run("refresh-full");
5918
- }, [phase, run]);
6058
+ const { refresh, refreshFull } = useManualRefresh(phase, run);
5919
6059
  return {
5920
6060
  snapshot,
5921
6061
  error,
@@ -5928,6 +6068,44 @@ function useSnapshotRequest(client, workspaceRoot, options) {
5928
6068
  moreLoading
5929
6069
  };
5930
6070
  }
6071
+ function usePeriodicRefresh(workspaceRoot, run, lastRequestAt) {
6072
+ React17.useEffect(() => {
6073
+ if (workspaceRoot === void 0) return void 0;
6074
+ const timer = setInterval(() => {
6075
+ if (document.visibilityState === "hidden") return;
6076
+ void run("auto");
6077
+ }, AUTO_REFRESH_INTERVAL_MS);
6078
+ return () => {
6079
+ clearInterval(timer);
6080
+ };
6081
+ }, [workspaceRoot, run]);
6082
+ React17.useEffect(() => {
6083
+ if (workspaceRoot === void 0) return void 0;
6084
+ const onReturn = () => {
6085
+ if (document.visibilityState === "hidden") return;
6086
+ if (Date.now() - lastRequestAt.current < FOCUS_REFRESH_MIN_MS) return;
6087
+ void run("auto");
6088
+ };
6089
+ document.addEventListener("visibilitychange", onReturn);
6090
+ window.addEventListener("focus", onReturn);
6091
+ return () => {
6092
+ document.removeEventListener("visibilitychange", onReturn);
6093
+ window.removeEventListener("focus", onReturn);
6094
+ };
6095
+ }, [workspaceRoot, run, lastRequestAt]);
6096
+ }
6097
+ function useManualRefresh(phase, run) {
6098
+ const busy = phase === "loading" || phase === "refreshing";
6099
+ const refresh = React17.useCallback(() => {
6100
+ if (busy) return;
6101
+ void run("refresh");
6102
+ }, [busy, run]);
6103
+ const refreshFull = React17.useCallback(() => {
6104
+ if (busy) return;
6105
+ void run("refresh-full");
6106
+ }, [busy, run]);
6107
+ return { refresh, refreshFull };
6108
+ }
5931
6109
  function useSnapshotLoader(client, workspaceRoot, t2) {
5932
6110
  const [snapshot, setSnapshot] = React17.useState(null);
5933
6111
  const [error, setError] = React17.useState(null);
@@ -6837,6 +7015,19 @@ var React24 = __toESM(require("react"), 1);
6837
7015
 
6838
7016
  // src/client/ticket-visuals.tsx
6839
7017
  var React23 = __toESM(require("react"), 1);
7018
+ var STATUS_LABEL_KEYS = {
7019
+ ready: "status.ready",
7020
+ blocked: "status.blocked",
7021
+ closed: "status.closed",
7022
+ open: "status.open"
7023
+ };
7024
+ function TicketStatusBadge(props) {
7025
+ const { t: t2 } = useI18n();
7026
+ return /* @__PURE__ */ React23.createElement("span", { style: STATUS_BADGES[props.status] }, /* @__PURE__ */ React23.createElement("span", { style: STATUS_DOT_STYLE }), t2(STATUS_LABEL_KEYS[props.status]));
7027
+ }
7028
+ function extraLabelsOf(ticket) {
7029
+ return ticket.labels.filter((label) => label !== ticket.category);
7030
+ }
6840
7031
  function Avatar(props) {
6841
7032
  const size = props.size ?? 20;
6842
7033
  const tint = props.name === null ? COLORS.tertiary : `hsl(${String(hue(props.name))} 55% 48%)`;
@@ -11266,7 +11457,7 @@ function useTicketTreeSession() {
11266
11457
  }
11267
11458
 
11268
11459
  // src/client/tickets-view.tsx
11269
- var React43 = __toESM(require("react"), 1);
11460
+ var React46 = __toESM(require("react"), 1);
11270
11461
 
11271
11462
  // src/client/my-tickets-bar.tsx
11272
11463
  var React31 = __toESM(require("react"), 1);
@@ -11295,7 +11486,8 @@ var MY_FILTER_CHIP_STYLE = {
11295
11486
  color: COLORS.secondary,
11296
11487
  background: "transparent",
11297
11488
  cursor: "pointer",
11298
- font: "inherit",
11489
+ // 只继承字体家族:font 简写会把选中态的 fontWeight 一起重置。
11490
+ fontFamily: "inherit",
11299
11491
  fontSize: 12,
11300
11492
  lineHeight: "20px",
11301
11493
  whiteSpace: "nowrap"
@@ -11423,7 +11615,7 @@ function MineChip(props) {
11423
11615
  }
11424
11616
 
11425
11617
  // src/client/ticket-list.tsx
11426
- var React34 = __toESM(require("react"), 1);
11618
+ var React36 = __toESM(require("react"), 1);
11427
11619
 
11428
11620
  // src/client/author-text.ts
11429
11621
  function authorName(author) {
@@ -11528,6 +11720,12 @@ var AVATAR_COLORS = [
11528
11720
  "#953800",
11529
11721
  "#424a53"
11530
11722
  ];
11723
+ var AUTHOR_GROUP_STYLE = {
11724
+ display: "inline-flex",
11725
+ alignItems: "center",
11726
+ gap: 8,
11727
+ minWidth: 0
11728
+ };
11531
11729
  var AUTHOR_NAME_STYLE = {
11532
11730
  maxWidth: "12ch",
11533
11731
  overflow: "hidden",
@@ -11543,6 +11741,39 @@ var ROW_AGE_STYLE = {
11543
11741
  lineHeight: "18px",
11544
11742
  whiteSpace: "nowrap"
11545
11743
  };
11744
+ var ASSIGNEE_GROUP_STYLE = {
11745
+ display: "inline-flex",
11746
+ alignItems: "center",
11747
+ gap: 6,
11748
+ minWidth: 0
11749
+ };
11750
+ var ASSIGNEE_PERSON_STYLE = {
11751
+ display: "inline-flex",
11752
+ alignItems: "center",
11753
+ gap: 3,
11754
+ minWidth: 0
11755
+ };
11756
+ var ASSIGNEE_NAME_STYLE = {
11757
+ color: COLORS.secondary,
11758
+ fontSize: 11,
11759
+ lineHeight: "18px",
11760
+ whiteSpace: "nowrap"
11761
+ };
11762
+ var TICKET_EXCERPT_STYLE = {
11763
+ overflow: "hidden",
11764
+ textOverflow: "ellipsis",
11765
+ whiteSpace: "nowrap",
11766
+ color: COLORS.tertiary,
11767
+ fontSize: 11,
11768
+ lineHeight: "16px"
11769
+ };
11770
+ var ASSIGNEE_MORE_STYLE = {
11771
+ color: COLORS.tertiary,
11772
+ fontSize: 11,
11773
+ lineHeight: "18px",
11774
+ whiteSpace: "nowrap",
11775
+ cursor: "default"
11776
+ };
11546
11777
  var CARD_CONTENT_STYLE = {
11547
11778
  position: "relative",
11548
11779
  display: "flex",
@@ -11593,20 +11824,65 @@ var NUMBER_MARK_STYLE = {
11593
11824
  width: "0.6em",
11594
11825
  verticalAlign: "-1px"
11595
11826
  };
11827
+ var DISPLAY_MENU_WRAP_STYLE = {
11828
+ position: "relative",
11829
+ display: "inline-flex"
11830
+ };
11831
+ var DISPLAY_MENU_TRIGGER_STYLE = {
11832
+ display: "inline-flex",
11833
+ alignItems: "center",
11834
+ justifyContent: "center",
11835
+ border: `1px solid ${COLORS.border}`,
11836
+ borderRadius: 6,
11837
+ padding: "1px 6px",
11838
+ color: COLORS.secondary,
11839
+ background: COLORS.surfaceRaised,
11840
+ cursor: "pointer",
11841
+ font: "inherit",
11842
+ lineHeight: "20px"
11843
+ };
11844
+ var DISPLAY_MENU_PANEL_STYLE = {
11845
+ position: "absolute",
11846
+ top: "calc(100% + 4px)",
11847
+ right: 0,
11848
+ zIndex: 20,
11849
+ display: "flex",
11850
+ flexDirection: "column",
11851
+ gap: 2,
11852
+ minWidth: 132,
11853
+ padding: 4,
11854
+ border: `1px solid ${COLORS.border}`,
11855
+ borderRadius: 8,
11856
+ background: COLORS.surfaceRaised,
11857
+ boxShadow: "0 6px 18px rgba(0, 0, 0, 0.16), 0 0 0 0.5px rgba(0, 0, 0, 0.08)"
11858
+ };
11859
+ var DISPLAY_MENU_ITEM_STYLE = {
11860
+ ...CHIP_STYLE,
11861
+ display: "flex",
11862
+ alignItems: "center",
11863
+ justifyContent: "space-between",
11864
+ gap: 12,
11865
+ width: "100%",
11866
+ borderRadius: 5,
11867
+ // 浏览器默认按钮底色会在浮层里显成灰块;开启项才用抬起来的底色。
11868
+ background: "transparent",
11869
+ textAlign: "left"
11870
+ };
11596
11871
 
11597
11872
  // src/client/ticket-avatar.tsx
11598
11873
  function TicketAvatar(props) {
11599
11874
  const { t: t2 } = useI18n();
11600
11875
  const [failedSrc, setFailedSrc] = React32.useState(null);
11601
11876
  const { author } = props;
11602
- const label = t2("ticket.avatar.label", { name: authorName(author) });
11877
+ const testId = props.testId ?? "ticket-avatar";
11878
+ const label = props.role === "assignee" ? t2("ticket.avatar.assigneeLabel", { name: authorName(author) }) : t2("ticket.avatar.label", { name: authorName(author) });
11603
11879
  const hint = authorTitle(author, t2);
11604
11880
  const src = usableAvatarUrl(author.avatarUrl);
11605
11881
  if (src !== null && src !== failedSrc) {
11606
11882
  return /* @__PURE__ */ React32.createElement(
11607
11883
  "img",
11608
11884
  {
11609
- "data-testid": "ticket-avatar",
11885
+ "data-testid": testId,
11610
11886
  src,
11611
11887
  alt: label,
11612
11888
  "aria-label": label,
@@ -11621,7 +11897,7 @@ function TicketAvatar(props) {
11621
11897
  return /* @__PURE__ */ React32.createElement(
11622
11898
  "span",
11623
11899
  {
11624
- "data-testid": "ticket-avatar",
11900
+ "data-testid": testId,
11625
11901
  role: "img",
11626
11902
  "aria-label": label,
11627
11903
  title: hint,
@@ -11656,25 +11932,356 @@ function initialOf(login) {
11656
11932
  return first === void 0 ? "?" : first.toUpperCase();
11657
11933
  }
11658
11934
 
11659
- // src/client/ticket-number.tsx
11935
+ // src/client/ticket-hover-card.tsx
11660
11936
  var React33 = __toESM(require("react"), 1);
11937
+
11938
+ // src/client/hover-card-position.ts
11939
+ var HOVER_CARD_GAP = 6;
11940
+ var HOVER_CARD_MARGIN = 8;
11941
+ var HOVER_CARD_WIDTH = 360;
11942
+ function placeHoverCard(anchor, card, bounds) {
11943
+ const minTop = bounds.top + HOVER_CARD_MARGIN;
11944
+ const belowTop = anchor.top + anchor.height + HOVER_CARD_GAP;
11945
+ const aboveTop = anchor.top - HOVER_CARD_GAP - card.height;
11946
+ const bottomLimit = bounds.top + bounds.height - HOVER_CARD_MARGIN;
11947
+ let top;
11948
+ if (belowTop + card.height <= bottomLimit) {
11949
+ top = belowTop;
11950
+ } else if (aboveTop >= minTop) {
11951
+ top = aboveTop;
11952
+ } else {
11953
+ top = minTop;
11954
+ }
11955
+ const minLeft = bounds.left + HOVER_CARD_MARGIN;
11956
+ const maxLeft = bounds.left + bounds.width - HOVER_CARD_MARGIN - card.width;
11957
+ const left = maxLeft <= minLeft ? minLeft : Math.max(minLeft, Math.min(anchor.left, maxLeft));
11958
+ return { top, left };
11959
+ }
11960
+
11961
+ // src/client/ticket-hover-card-styles.ts
11962
+ var HOVER_CARD_STYLE = {
11963
+ position: "fixed",
11964
+ zIndex: 30,
11965
+ boxSizing: "border-box",
11966
+ overflowY: "auto",
11967
+ padding: "10px 12px 9px",
11968
+ border: `1px solid ${COLORS.border}`,
11969
+ borderRadius: 8,
11970
+ background: COLORS.surfaceRaised,
11971
+ boxShadow: "0 8px 24px rgba(0, 0, 0, 0.18)",
11972
+ color: COLORS.text,
11973
+ cursor: "default"
11974
+ };
11975
+ var HOVER_CARD_HEADER_STYLE = {
11976
+ display: "flex",
11977
+ alignItems: "center",
11978
+ flexWrap: "wrap",
11979
+ gap: 6,
11980
+ marginBottom: 6
11981
+ };
11982
+ var HOVER_CARD_REF_STYLE = {
11983
+ color: COLORS.tertiary,
11984
+ fontSize: 12,
11985
+ fontWeight: 500,
11986
+ fontVariantNumeric: "tabular-nums",
11987
+ overflowWrap: "anywhere"
11988
+ };
11989
+ var HOVER_CARD_TITLE_STYLE = {
11990
+ maxHeight: "2.9em",
11991
+ overflow: "hidden",
11992
+ marginBottom: 8,
11993
+ fontWeight: 600,
11994
+ lineHeight: "1.45",
11995
+ overflowWrap: "anywhere"
11996
+ };
11997
+ var HOVER_CARD_EXCERPT_STYLE = {
11998
+ maxHeight: 72,
11999
+ overflow: "hidden",
12000
+ marginBottom: 8,
12001
+ color: COLORS.secondary,
12002
+ fontSize: 12,
12003
+ lineHeight: "18px",
12004
+ overflowWrap: "anywhere"
12005
+ };
12006
+ var HOVER_CARD_GRID_STYLE = {
12007
+ display: "grid",
12008
+ gridTemplateColumns: "auto minmax(0, 1fr)",
12009
+ columnGap: 8,
12010
+ rowGap: 4,
12011
+ alignItems: "start",
12012
+ fontSize: 12,
12013
+ lineHeight: "18px"
12014
+ };
12015
+ var HOVER_CARD_LABEL_STYLE = {
12016
+ color: COLORS.tertiary,
12017
+ fontSize: 11,
12018
+ lineHeight: "18px",
12019
+ whiteSpace: "nowrap"
12020
+ };
12021
+ var HOVER_CARD_VALUE_STYLE = {
12022
+ color: COLORS.secondary,
12023
+ minWidth: 0,
12024
+ overflowWrap: "anywhere"
12025
+ };
12026
+ var HOVER_CARD_LABELS_STYLE = {
12027
+ display: "flex",
12028
+ flexWrap: "wrap",
12029
+ gap: 4,
12030
+ minWidth: 0
12031
+ };
12032
+ var HOVER_CARD_PEOPLE_STYLE = {
12033
+ display: "flex",
12034
+ flexWrap: "wrap",
12035
+ alignItems: "center",
12036
+ gap: "2px 8px",
12037
+ minWidth: 0
12038
+ };
12039
+ var HOVER_CARD_PERSON_STYLE = {
12040
+ display: "inline-flex",
12041
+ alignItems: "center",
12042
+ gap: 4,
12043
+ minWidth: 0
12044
+ };
12045
+ var HOVER_CARD_PERSON_NAME_STYLE = {
12046
+ color: COLORS.secondary,
12047
+ overflowWrap: "anywhere"
12048
+ };
12049
+ var HOVER_CARD_LOGIN_STYLE = {
12050
+ color: COLORS.tertiary,
12051
+ fontSize: 11
12052
+ };
12053
+ var HOVER_CARD_FOOTER_STYLE = {
12054
+ marginTop: 8,
12055
+ paddingTop: 6,
12056
+ borderTop: `1px solid ${COLORS.border}`,
12057
+ color: COLORS.tertiary,
12058
+ fontSize: 11,
12059
+ lineHeight: "16px"
12060
+ };
12061
+
12062
+ // src/client/ticket-hover-card.tsx
12063
+ function TicketHoverCard(props) {
12064
+ const { t: t2 } = useI18n();
12065
+ const cardRef = React33.useRef(null);
12066
+ const [position, setPosition] = React33.useState(null);
12067
+ const { ticket } = props;
12068
+ const width = Math.max(0, Math.min(HOVER_CARD_WIDTH, props.bounds.width - HOVER_CARD_MARGIN * 2));
12069
+ const maxHeight = Math.max(0, props.bounds.height - HOVER_CARD_MARGIN * 2);
12070
+ React33.useLayoutEffect(() => {
12071
+ const card = cardRef.current;
12072
+ if (card === null) return;
12073
+ const rect = card.getBoundingClientRect();
12074
+ setPosition(
12075
+ placeHoverCard(props.anchor, { width: rect.width, height: rect.height }, props.bounds)
12076
+ );
12077
+ }, [props.anchor, props.bounds, ticket.ref, ticket.updatedAt]);
12078
+ return /* @__PURE__ */ React33.createElement(
12079
+ "div",
12080
+ {
12081
+ ref: cardRef,
12082
+ "data-testid": "ticket-hover-card",
12083
+ "aria-hidden": "true",
12084
+ style: {
12085
+ ...HOVER_CARD_STYLE,
12086
+ width,
12087
+ maxHeight,
12088
+ top: position?.top ?? 0,
12089
+ left: position?.left ?? 0,
12090
+ visibility: position === null ? "hidden" : "visible"
12091
+ },
12092
+ onPointerEnter: props.onPointerEnter,
12093
+ onPointerLeave: props.onPointerLeave,
12094
+ onPointerDown: (event) => {
12095
+ event.stopPropagation();
12096
+ }
12097
+ },
12098
+ /* @__PURE__ */ React33.createElement(HoverHeader, { ticket }),
12099
+ /* @__PURE__ */ React33.createElement("div", { style: HOVER_CARD_TITLE_STYLE }, ticket.title),
12100
+ ticket.excerpt === void 0 ? null : /* @__PURE__ */ React33.createElement("div", { "data-testid": "hover-excerpt", style: HOVER_CARD_EXCERPT_STYLE }, ticket.excerpt),
12101
+ /* @__PURE__ */ React33.createElement(HoverDetails, { ticket, tickets: props.tickets, now: props.now }),
12102
+ /* @__PURE__ */ React33.createElement("div", { style: HOVER_CARD_FOOTER_STYLE }, t2("tickets.hover.openHint"))
12103
+ );
12104
+ }
12105
+ function HoverHeader(props) {
12106
+ const { ticket } = props;
12107
+ return /* @__PURE__ */ React33.createElement("div", { style: HOVER_CARD_HEADER_STYLE }, /* @__PURE__ */ React33.createElement("span", { "data-testid": "hover-ref", style: HOVER_CARD_REF_STYLE }, ticket.number === null ? ticket.ref : `#${String(ticket.number)}`), /* @__PURE__ */ React33.createElement(TicketStatusBadge, { status: ticket.status }), ticket.category === null ? null : /* @__PURE__ */ React33.createElement("span", { style: CATEGORY_BADGES[ticket.category] }, ticket.category));
12108
+ }
12109
+ function HoverDetails(props) {
12110
+ const { t: t2 } = useI18n();
12111
+ const { ticket } = props;
12112
+ const extraLabels = extraLabelsOf(ticket);
12113
+ const blockers = blockerItems(ticket, props.tickets);
12114
+ const parent = ticket.parent;
12115
+ const parentOutside = parent !== void 0 && !props.tickets.some((item) => item.ref === parent);
12116
+ return /* @__PURE__ */ React33.createElement("div", { style: HOVER_CARD_GRID_STYLE }, extraLabels.length === 0 ? null : /* @__PURE__ */ React33.createElement(HoverField, { label: t2("tickets.hover.labels"), valueStyle: HOVER_CARD_LABELS_STYLE }, extraLabels.map((label) => /* @__PURE__ */ React33.createElement("span", { key: label, "data-testid": "hover-label", style: LABEL_BADGE_STYLE }, label))), ticket.author === null ? null : /* @__PURE__ */ React33.createElement(HoverField, { label: t2("tickets.hover.author") }, /* @__PURE__ */ React33.createElement(PersonChip, { user: ticket.author, testId: "hover-author-avatar" })), ticket.assignees.length === 0 ? null : /* @__PURE__ */ React33.createElement(HoverField, { label: t2("tickets.hover.assignees"), valueStyle: HOVER_CARD_PEOPLE_STYLE }, ticket.assignees.map((user) => /* @__PURE__ */ React33.createElement(
12117
+ PersonChip,
12118
+ {
12119
+ key: user.login,
12120
+ user,
12121
+ role: "assignee",
12122
+ testId: "hover-assignee-avatar"
12123
+ }
12124
+ ))), /* @__PURE__ */ React33.createElement(HoverField, { label: t2("tickets.hover.created") }, timeText(ticket.createdAt, props.now, t2)), /* @__PURE__ */ React33.createElement(HoverField, { label: t2("tickets.hover.updated") }, timeText(ticket.updatedAt, props.now, t2)), ticket.commentCount === void 0 ? null : /* @__PURE__ */ React33.createElement(HoverField, { label: t2("tickets.hover.comments") }, /* @__PURE__ */ React33.createElement("span", { "data-testid": "hover-comments" }, String(ticket.commentCount))), ticket.openBlockers === 0 ? null : /* @__PURE__ */ React33.createElement(HoverField, { label: t2("tickets.hover.blockedLabel") }, blockers.length === 0 ? t2("tickets.hover.blocked", { count: ticket.openBlockers }) : t2("tickets.hover.blockedRefs", {
12125
+ count: blockers.length,
12126
+ refs: blockers.map((item) => item.ref).join(t2("common.listSeparator"))
12127
+ })), parent === void 0 ? null : /* @__PURE__ */ React33.createElement(HoverField, { label: t2("tickets.hover.parentLabel") }, parentOutside ? t2("tickets.hover.parentOutside", { parent }) : parent));
12128
+ }
12129
+ function HoverField(props) {
12130
+ return /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement("span", { style: HOVER_CARD_LABEL_STYLE }, props.label), /* @__PURE__ */ React33.createElement("span", { style: props.valueStyle ?? HOVER_CARD_VALUE_STYLE }, props.children));
12131
+ }
12132
+ function PersonChip(props) {
12133
+ return /* @__PURE__ */ React33.createElement("span", { style: HOVER_CARD_PERSON_STYLE }, /* @__PURE__ */ React33.createElement(TicketAvatar, { author: props.user, role: props.role, testId: props.testId }), /* @__PURE__ */ React33.createElement("span", { style: HOVER_CARD_PERSON_NAME_STYLE }, authorName(props.user)), props.user.displayName === null ? null : /* @__PURE__ */ React33.createElement("span", { style: HOVER_CARD_LOGIN_STYLE }, "@", props.user.login));
12134
+ }
12135
+ function timeText(value, now, t2) {
12136
+ const age = formatRelativeTime(value, now, t2);
12137
+ const absolute = formatTime(value);
12138
+ return age.length === 0 ? absolute : `${absolute}${t2("row.time.separator")}${age}`;
12139
+ }
12140
+
12141
+ // src/client/ticket-hover.ts
12142
+ var React34 = __toESM(require("react"), 1);
12143
+ var HOVER_OPEN_DELAY_MS = 350;
12144
+ var HOVER_CLOSE_DELAY_MS = 120;
12145
+ function clearTimer(timer) {
12146
+ if (timer.current === null) return;
12147
+ window.clearTimeout(timer.current);
12148
+ timer.current = null;
12149
+ }
12150
+ function hoverTargetOf(element) {
12151
+ const surface = element.closest('[data-hover="card"]');
12152
+ const rect = (surface ?? element).getBoundingClientRect();
12153
+ const panelRect = element.closest("[data-anvil-panel]")?.getBoundingClientRect();
12154
+ return {
12155
+ anchor: { top: rect.top, left: rect.left, width: rect.width, height: rect.height },
12156
+ bounds: panelRect === void 0 ? { top: 0, left: 0, width: window.innerWidth, height: window.innerHeight } : {
12157
+ top: panelRect.top,
12158
+ left: panelRect.left,
12159
+ width: panelRect.width,
12160
+ height: panelRect.height
12161
+ }
12162
+ };
12163
+ }
12164
+ function useTicketHover(tickets) {
12165
+ const [hovered, setHovered] = React34.useState(null);
12166
+ const listRef = React34.useRef(null);
12167
+ const openTimer = React34.useRef(null);
12168
+ const closeTimer = React34.useRef(null);
12169
+ const targetRef = React34.useRef(null);
12170
+ const close = React34.useCallback(() => {
12171
+ clearTimer(openTimer);
12172
+ clearTimer(closeTimer);
12173
+ targetRef.current = null;
12174
+ setHovered(null);
12175
+ }, []);
12176
+ const scheduleClose = React34.useCallback(() => {
12177
+ clearTimer(closeTimer);
12178
+ closeTimer.current = window.setTimeout(() => {
12179
+ closeTimer.current = null;
12180
+ targetRef.current = null;
12181
+ setHovered(null);
12182
+ }, HOVER_CLOSE_DELAY_MS);
12183
+ }, []);
12184
+ const open = React34.useCallback((ref, anchor, bounds) => {
12185
+ clearTimer(openTimer);
12186
+ clearTimer(closeTimer);
12187
+ if (targetRef.current !== null && targetRef.current !== ref) {
12188
+ targetRef.current = null;
12189
+ setHovered(null);
12190
+ }
12191
+ targetRef.current = ref;
12192
+ openTimer.current = window.setTimeout(() => {
12193
+ openTimer.current = null;
12194
+ setHovered({ ref, anchor, bounds });
12195
+ }, HOVER_OPEN_DELAY_MS);
12196
+ }, []);
12197
+ const leave = React34.useCallback(
12198
+ (ref) => {
12199
+ clearTimer(openTimer);
12200
+ if (targetRef.current === ref) scheduleClose();
12201
+ },
12202
+ [scheduleClose]
12203
+ );
12204
+ const enterCard = React34.useCallback(() => {
12205
+ clearTimer(closeTimer);
12206
+ }, []);
12207
+ const leaveCard = React34.useCallback(() => {
12208
+ scheduleClose();
12209
+ }, [scheduleClose]);
12210
+ React34.useEffect(
12211
+ () => () => {
12212
+ clearTimer(openTimer);
12213
+ clearTimer(closeTimer);
12214
+ },
12215
+ []
12216
+ );
12217
+ useDismissHover(hovered !== null, listRef, close);
12218
+ useCloseOnListChange(tickets, targetRef, close);
12219
+ return { hovered, listRef, open, leave, enterCard, leaveCard };
12220
+ }
12221
+ function useDismissHover(active, listRef, close) {
12222
+ React34.useEffect(() => {
12223
+ const list = listRef.current;
12224
+ if (list === null) return void 0;
12225
+ list.addEventListener("scroll", close, { passive: true });
12226
+ return () => {
12227
+ list.removeEventListener("scroll", close);
12228
+ };
12229
+ }, [listRef, close]);
12230
+ React34.useEffect(() => {
12231
+ if (!active) return void 0;
12232
+ const onResize = () => {
12233
+ close();
12234
+ };
12235
+ const onKeyDown = (event) => {
12236
+ if (event.key === "Escape") close();
12237
+ };
12238
+ const onPointerDown = () => {
12239
+ close();
12240
+ };
12241
+ const onBlur = () => {
12242
+ close();
12243
+ };
12244
+ window.addEventListener("resize", onResize);
12245
+ window.addEventListener("blur", onBlur);
12246
+ document.addEventListener("keydown", onKeyDown);
12247
+ document.addEventListener("pointerdown", onPointerDown);
12248
+ return () => {
12249
+ window.removeEventListener("resize", onResize);
12250
+ window.removeEventListener("blur", onBlur);
12251
+ document.removeEventListener("keydown", onKeyDown);
12252
+ document.removeEventListener("pointerdown", onPointerDown);
12253
+ };
12254
+ }, [active, close]);
12255
+ }
12256
+ function useCloseOnListChange(tickets, targetRef, close) {
12257
+ const refs = tickets.map((ticket) => ticket.ref).join("\n");
12258
+ const previous = React34.useRef(refs);
12259
+ React34.useEffect(() => {
12260
+ if (previous.current === refs) return;
12261
+ previous.current = refs;
12262
+ if (targetRef.current !== null) close();
12263
+ }, [refs, targetRef, close]);
12264
+ }
12265
+
12266
+ // src/client/ticket-number.tsx
12267
+ var React35 = __toESM(require("react"), 1);
11661
12268
  var REF_DISPLAY_LIMIT = 40;
11662
12269
  function TicketNumber(props) {
11663
12270
  const { ticket } = props;
11664
12271
  const url = ticket.url ?? null;
11665
12272
  if (url === null || ticket.number === null) {
11666
12273
  const display = refDisplay(ticket);
11667
- return /* @__PURE__ */ React33.createElement(
12274
+ return /* @__PURE__ */ React35.createElement(
11668
12275
  "span",
11669
12276
  {
11670
12277
  "data-testid": "ticket-ref",
11671
12278
  style: ticket.number === null ? LOCAL_REF_STYLE : NUMBER_BADGE_STYLE,
11672
12279
  ...display.full === void 0 ? {} : { title: display.full }
11673
12280
  },
11674
- ticket.number === null ? display.text : /* @__PURE__ */ React33.createElement(NumberText, { number: ticket.number })
12281
+ ticket.number === null ? display.text : /* @__PURE__ */ React35.createElement(NumberText, { number: ticket.number })
11675
12282
  );
11676
12283
  }
11677
- return /* @__PURE__ */ React33.createElement(CopyableNumber, { number: ticket.number, url });
12284
+ return /* @__PURE__ */ React35.createElement(CopyableNumber, { number: ticket.number, url });
11678
12285
  }
11679
12286
  function CopyableNumber(props) {
11680
12287
  const { t: t2 } = useI18n();
@@ -11682,7 +12289,7 @@ function CopyableNumber(props) {
11682
12289
  const copied = copy.status === "copied";
11683
12290
  const failed = copy.status === "failed";
11684
12291
  const color = copied ? COLORS.success : failed ? COLORS.error : void 0;
11685
- return /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement(
12292
+ return /* @__PURE__ */ React35.createElement(React35.Fragment, null, /* @__PURE__ */ React35.createElement(
11686
12293
  "button",
11687
12294
  {
11688
12295
  type: "button",
@@ -11697,11 +12304,11 @@ function CopyableNumber(props) {
11697
12304
  },
11698
12305
  style: color === void 0 ? NUMBER_BUTTON_STYLE : { ...NUMBER_BUTTON_STYLE, color }
11699
12306
  },
11700
- /* @__PURE__ */ React33.createElement(NumberText, { number: props.number, copied })
11701
- ), copied ? /* @__PURE__ */ React33.createElement("span", { role: "status", style: VISUALLY_HIDDEN_STYLE }, t2("ticket.number.copiedNotice")) : null);
12307
+ /* @__PURE__ */ React35.createElement(NumberText, { number: props.number, copied })
12308
+ ), copied ? /* @__PURE__ */ React35.createElement("span", { role: "status", style: VISUALLY_HIDDEN_STYLE }, t2("ticket.number.copiedNotice")) : null);
11702
12309
  }
11703
12310
  function NumberText(props) {
11704
- return /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement("span", { style: NUMBER_MARK_STYLE }, props.copied === true ? /* @__PURE__ */ React33.createElement(CheckIcon, null) : "#"), String(props.number));
12311
+ return /* @__PURE__ */ React35.createElement(React35.Fragment, null, /* @__PURE__ */ React35.createElement("span", { style: NUMBER_MARK_STYLE }, props.copied === true ? /* @__PURE__ */ React35.createElement(CheckIcon, null) : "#"), String(props.number));
11705
12312
  }
11706
12313
  function refDisplay(ticket) {
11707
12314
  if (ticket.ref.length <= REF_DISPLAY_LIMIT) return { text: ticket.ref };
@@ -11715,22 +12322,21 @@ function refDisplay(ticket) {
11715
12322
 
11716
12323
  // src/client/ticket-list.tsx
11717
12324
  var MAX_EXTRA_LABELS = 3;
11718
- var STATUS_KEYS2 = {
11719
- ready: "status.ready",
11720
- blocked: "status.blocked",
11721
- closed: "status.closed",
11722
- open: "status.open"
11723
- };
12325
+ var MAX_ROW_ASSIGNEES = 2;
11724
12326
  var ROWS_STYLE = {
11725
12327
  display: "flex",
11726
12328
  flexDirection: "column",
11727
12329
  gap: 6
11728
12330
  };
11729
12331
  function TicketList(props) {
12332
+ const renderedTickets = props.rows === void 0 ? props.tickets : props.rows.map((row) => row.ticket);
12333
+ const hover = useTicketHover(renderedTickets);
11730
12334
  if (props.tickets.length === 0) {
11731
- return /* @__PURE__ */ React34.createElement("div", { "data-testid": "empty", style: EMPTY_STYLE }, props.emptyText);
12335
+ return /* @__PURE__ */ React36.createElement("div", { "data-testid": "empty", style: EMPTY_STYLE }, props.emptyText);
11732
12336
  }
11733
- return /* @__PURE__ */ React34.createElement("div", { "data-testid": "ticket-scroll", style: LIST_STYLE }, /* @__PURE__ */ React34.createElement("div", { role: "list", "data-testid": "ticket-list", style: ROWS_STYLE }, props.rows === void 0 ? props.tickets.map((ticket) => /* @__PURE__ */ React34.createElement(
12337
+ const hovered = hover.hovered;
12338
+ const activeTicket = hovered === null ? void 0 : renderedTickets.find((ticket) => ticket.ref === hovered.ref);
12339
+ return /* @__PURE__ */ React36.createElement(React36.Fragment, null, /* @__PURE__ */ React36.createElement("div", { ref: hover.listRef, "data-testid": "ticket-scroll", style: LIST_STYLE }, /* @__PURE__ */ React36.createElement("div", { role: "list", "data-testid": "ticket-list", style: ROWS_STYLE }, props.rows === void 0 ? props.tickets.map((ticket) => /* @__PURE__ */ React36.createElement(
11734
12340
  TicketRow,
11735
12341
  {
11736
12342
  key: ticket.ref,
@@ -11739,10 +12345,13 @@ function TicketList(props) {
11739
12345
  injection: props.injection,
11740
12346
  focused: ticket.ref === props.focused,
11741
12347
  now: props.now,
12348
+ fields: props.fields,
11742
12349
  onPick: props.onPick,
11743
- onSkillAction: props.onSkillAction
12350
+ onSkillAction: props.onSkillAction,
12351
+ onHoverStart: hover.open,
12352
+ onHoverEnd: hover.leave
11744
12353
  }
11745
- )) : props.rows.map((row) => /* @__PURE__ */ React34.createElement(
12354
+ )) : props.rows.map((row) => /* @__PURE__ */ React36.createElement(
11746
12355
  TicketRow,
11747
12356
  {
11748
12357
  key: row.ticket.ref,
@@ -11752,16 +12361,31 @@ function TicketList(props) {
11752
12361
  injection: props.injection,
11753
12362
  focused: row.ticket.ref === props.focused,
11754
12363
  now: props.now,
12364
+ fields: props.fields,
11755
12365
  onPick: props.onPick,
11756
12366
  onSkillAction: props.onSkillAction,
12367
+ onHoverStart: hover.open,
12368
+ onHoverEnd: hover.leave,
11757
12369
  ...props.onToggleTree === void 0 ? {} : { onToggleTree: props.onToggleTree }
11758
12370
  }
11759
- ))), props.footer);
12371
+ ))), props.footer), hovered === null || activeTicket === void 0 ? null : /* @__PURE__ */ React36.createElement(
12372
+ TicketHoverCard,
12373
+ {
12374
+ key: activeTicket.ref,
12375
+ ticket: activeTicket,
12376
+ tickets: renderedTickets,
12377
+ anchor: hovered.anchor,
12378
+ bounds: hovered.bounds,
12379
+ now: props.now,
12380
+ onPointerEnter: hover.enterCard,
12381
+ onPointerLeave: hover.leaveCard
12382
+ }
12383
+ ));
11760
12384
  }
11761
12385
  function TicketRow(props) {
11762
12386
  const { t: t2 } = useI18n();
11763
12387
  const { ticket } = props;
11764
- return /* @__PURE__ */ React34.createElement(
12388
+ return /* @__PURE__ */ React36.createElement(
11765
12389
  "div",
11766
12390
  {
11767
12391
  role: "listitem",
@@ -11775,16 +12399,25 @@ function TicketRow(props) {
11775
12399
  ...props.row === void 0 ? {} : { marginLeft: props.row.depth * TREE_INDENT }
11776
12400
  }
11777
12401
  },
11778
- /* @__PURE__ */ React34.createElement(
12402
+ /* @__PURE__ */ React36.createElement(
11779
12403
  "div",
11780
12404
  {
11781
12405
  "data-testid": "ticket-row",
11782
12406
  "data-ref": ticket.ref,
11783
12407
  "data-depth": props.row === void 0 ? void 0 : String(props.row.depth),
11784
12408
  "data-focused": props.focused ? "true" : void 0,
11785
- style: CARD_CONTENT_STYLE
12409
+ style: CARD_CONTENT_STYLE,
12410
+ onPointerEnter: (event) => {
12411
+ if (event.pointerType === "touch") return;
12412
+ const target = hoverTargetOf(event.currentTarget);
12413
+ props.onHoverStart(ticket.ref, target.anchor, target.bounds);
12414
+ },
12415
+ onPointerLeave: (event) => {
12416
+ if (event.pointerType === "touch") return;
12417
+ props.onHoverEnd(ticket.ref);
12418
+ }
11786
12419
  },
11787
- /* @__PURE__ */ React34.createElement(
12420
+ /* @__PURE__ */ React36.createElement(
11788
12421
  "button",
11789
12422
  {
11790
12423
  type: "button",
@@ -11793,7 +12426,7 @@ function TicketRow(props) {
11793
12426
  style: CARD_OPEN_STYLE
11794
12427
  }
11795
12428
  ),
11796
- /* @__PURE__ */ React34.createElement("span", { style: CARD_TITLE_STYLE }, props.row?.hasChildren === true ? /* @__PURE__ */ React34.createElement(
12429
+ /* @__PURE__ */ React36.createElement("span", { style: CARD_TITLE_STYLE }, props.row?.hasChildren === true ? /* @__PURE__ */ React36.createElement(
11797
12430
  "button",
11798
12431
  {
11799
12432
  type: "button",
@@ -11809,11 +12442,12 @@ function TicketRow(props) {
11809
12442
  },
11810
12443
  style: TREE_TOGGLE_STYLE
11811
12444
  },
11812
- /* @__PURE__ */ React34.createElement("span", { "aria-hidden": "true" }, props.row.expanded ? "\u25BE" : "\u25B8")
11813
- ) : null, /* @__PURE__ */ React34.createElement(TicketNumber, { ticket }), ticket.title),
11814
- /* @__PURE__ */ React34.createElement(MetaRow, { ticket, row: props.row, now: props.now })
12445
+ /* @__PURE__ */ React36.createElement("span", { "aria-hidden": "true" }, props.row.expanded ? "\u25BE" : "\u25B8")
12446
+ ) : null, /* @__PURE__ */ React36.createElement(TicketNumber, { ticket }), ticket.title),
12447
+ /* @__PURE__ */ React36.createElement(MetaRow, { ticket, row: props.row, now: props.now, fields: props.fields }),
12448
+ ticket.excerpt === void 0 ? null : /* @__PURE__ */ React36.createElement("span", { "data-testid": "ticket-excerpt", style: TICKET_EXCERPT_STYLE }, ticket.excerpt)
11815
12449
  ),
11816
- /* @__PURE__ */ React34.createElement(
12450
+ /* @__PURE__ */ React36.createElement(
11817
12451
  SkillActionBadge,
11818
12452
  {
11819
12453
  ticket,
@@ -11828,9 +12462,9 @@ function TicketRow(props) {
11828
12462
  function MetaRow(props) {
11829
12463
  const { t: t2 } = useI18n();
11830
12464
  const { ticket, row } = props;
11831
- const extra = ticket.labels.filter((label) => label !== ticket.category);
12465
+ const extra = extraLabelsOf(ticket);
11832
12466
  const { shown, hidden } = pickRowLabels(extra, MAX_EXTRA_LABELS);
11833
- return /* @__PURE__ */ React34.createElement("span", { style: CARD_META_STYLE }, /* @__PURE__ */ React34.createElement("span", { style: STATUS_BADGES[ticket.status] }, /* @__PURE__ */ React34.createElement("span", { style: STATUS_DOT_STYLE }), t2(STATUS_KEYS2[ticket.status])), ticket.category === null ? null : /* @__PURE__ */ React34.createElement("span", { style: CATEGORY_BADGES[ticket.category] }, ticket.category), row?.hasChildren === true ? /* @__PURE__ */ React34.createElement("span", { "data-testid": "tree-child-count", style: TREE_CHILD_COUNT_STYLE }, t2("tree.childCount", { count: row.childCount })) : null, row?.parentOutside === true && ticket.parent !== void 0 ? /* @__PURE__ */ React34.createElement(
12467
+ return /* @__PURE__ */ React36.createElement("span", { style: CARD_META_STYLE }, /* @__PURE__ */ React36.createElement(TicketStatusBadge, { status: ticket.status }), ticket.category === null ? null : /* @__PURE__ */ React36.createElement("span", { style: CATEGORY_BADGES[ticket.category] }, ticket.category), row?.hasChildren === true ? /* @__PURE__ */ React36.createElement("span", { "data-testid": "tree-child-count", style: TREE_CHILD_COUNT_STYLE }, t2("tree.childCount", { count: row.childCount })) : null, row?.parentOutside === true && ticket.parent !== void 0 ? /* @__PURE__ */ React36.createElement(
11834
12468
  "span",
11835
12469
  {
11836
12470
  "data-testid": "parent-badge",
@@ -11838,31 +12472,72 @@ function MetaRow(props) {
11838
12472
  style: PARENT_BADGE_STYLE
11839
12473
  },
11840
12474
  t2("tree.parentBadge", { parent: ticket.parent })
11841
- ) : 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(
11842
- AuthorMeta,
12475
+ ) : null, shown.map((label) => /* @__PURE__ */ React36.createElement("span", { key: label, "data-testid": "ticket-label", style: LABEL_BADGE_STYLE }, label)), hidden > 0 ? /* @__PURE__ */ React36.createElement("span", { "data-testid": "ticket-label-more", style: LABEL_BADGE_STYLE }, "+", String(hidden)) : null, props.fields.showAssignees && ticket.assignees.length > 0 ? /* @__PURE__ */ React36.createElement(AssigneeMeta, { assignees: ticket.assignees }) : null, props.fields.showAuthor && ticket.author !== null ? /* @__PURE__ */ React36.createElement(AuthorMeta, { author: ticket.author }) : null, /* @__PURE__ */ React36.createElement(
12476
+ TimeMeta,
11843
12477
  {
11844
- author: ticket.author,
11845
12478
  createdAt: ticket.createdAt,
11846
12479
  updatedAt: ticket.updatedAt,
11847
- now: props.now
12480
+ now: props.now,
12481
+ fields: props.fields,
12482
+ authorShown: props.fields.showAuthor && ticket.author !== null
11848
12483
  }
11849
12484
  ));
11850
12485
  }
12486
+ function AssigneeMeta(props) {
12487
+ const { t: t2 } = useI18n();
12488
+ const separator = t2("row.assigneesSeparator");
12489
+ const all = props.assignees.map((author) => authorName(author)).join(separator);
12490
+ const shown = props.assignees.slice(0, MAX_ROW_ASSIGNEES);
12491
+ const hidden = props.assignees.length - shown.length;
12492
+ return /* @__PURE__ */ React36.createElement(
12493
+ "span",
12494
+ {
12495
+ role: "group",
12496
+ "data-testid": "ticket-assignees",
12497
+ "aria-label": t2("row.assigneesA11y", { names: all }),
12498
+ title: t2("row.assigneesTitle", { names: all }),
12499
+ style: ASSIGNEE_GROUP_STYLE
12500
+ },
12501
+ shown.map((author) => /* @__PURE__ */ React36.createElement("span", { key: author.login, style: ASSIGNEE_PERSON_STYLE }, /* @__PURE__ */ React36.createElement(TicketAvatar, { author, role: "assignee", testId: "ticket-assignee-avatar" }), /* @__PURE__ */ React36.createElement("span", { "data-testid": "ticket-assignee", style: ASSIGNEE_NAME_STYLE }, authorName(author)))),
12502
+ hidden > 0 ? /* @__PURE__ */ React36.createElement(
12503
+ "span",
12504
+ {
12505
+ "data-testid": "ticket-assignee-more",
12506
+ title: t2("row.assigneesMoreTitle", { count: hidden, names: all }),
12507
+ style: ASSIGNEE_MORE_STYLE
12508
+ },
12509
+ "+",
12510
+ String(hidden)
12511
+ ) : null
12512
+ );
12513
+ }
11851
12514
  function AuthorMeta(props) {
11852
12515
  const { t: t2 } = useI18n();
11853
12516
  const { author } = props;
11854
12517
  const name = authorName(author);
11855
12518
  const full = authorTitle(author, t2);
11856
- const age = formatRelativeTime(props.createdAt, props.now, t2);
11857
- 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(
12519
+ return /* @__PURE__ */ React36.createElement("span", { "data-testid": "ticket-author-group", style: AUTHOR_GROUP_STYLE }, /* @__PURE__ */ React36.createElement(TicketAvatar, { author }), /* @__PURE__ */ React36.createElement("span", { "data-testid": "ticket-author", title: full, style: AUTHOR_NAME_STYLE }, name));
12520
+ }
12521
+ function TimeMeta(props) {
12522
+ const { t: t2 } = useI18n();
12523
+ const createdAge = props.fields.showCreatedAt ? formatRelativeTime(props.createdAt, props.now, t2) : "";
12524
+ const updatedAge = props.fields.showUpdatedAt ? formatRelativeTime(props.updatedAt, props.now, t2) : "";
12525
+ const segments = [];
12526
+ if (createdAge.length > 0) {
12527
+ const bare = !props.fields.showUpdatedAt && props.authorShown;
12528
+ segments.push(bare ? createdAge : t2("row.time.created", { age: createdAge }));
12529
+ }
12530
+ if (updatedAge.length > 0) segments.push(t2("row.time.updated", { age: updatedAge }));
12531
+ if (segments.length === 0) return null;
12532
+ return /* @__PURE__ */ React36.createElement(
11858
12533
  "span",
11859
12534
  {
11860
12535
  "data-testid": "ticket-age",
11861
12536
  title: t2("tickets.age.title", { created: props.createdAt, updated: props.updatedAt }),
11862
12537
  style: ROW_AGE_STYLE
11863
12538
  },
11864
- age
11865
- ));
12539
+ segments.join(t2("row.time.separator"))
12540
+ );
11866
12541
  }
11867
12542
  function pickRowLabels(labels, limit) {
11868
12543
  const isTriageLabel = (label) => TRIAGE_LABELS.includes(label);
@@ -11880,11 +12555,11 @@ function pickRowLabels(labels, limit) {
11880
12555
  }
11881
12556
 
11882
12557
  // src/client/tickets-view-footer.tsx
11883
- var React35 = __toESM(require("react"), 1);
12558
+ var React37 = __toESM(require("react"), 1);
11884
12559
  function Footer(props) {
11885
12560
  const { t: t2 } = useI18n();
11886
12561
  if (props.injection.canInjectCurrent && props.notice === null) return null;
11887
- return /* @__PURE__ */ React35.createElement(
12562
+ return /* @__PURE__ */ React37.createElement(
11888
12563
  "footer",
11889
12564
  {
11890
12565
  style: {
@@ -11895,10 +12570,10 @@ function Footer(props) {
11895
12570
  borderTop: `1px solid ${COLORS.border}`
11896
12571
  }
11897
12572
  },
11898
- props.injection.canInjectCurrent ? null : /* @__PURE__ */ React35.createElement("div", { "data-testid": "no-session-hint", style: { color: COLORS.secondary, fontSize: 12 } }, t2(
12573
+ props.injection.canInjectCurrent ? null : /* @__PURE__ */ React37.createElement("div", { "data-testid": "no-session-hint", style: { color: COLORS.secondary, fontSize: 12 } }, t2(
11899
12574
  props.injection.canStartNewSession ? "injection.footerNewSession" : "injection.footerUnavailable"
11900
12575
  )),
11901
- props.notice === null ? null : /* @__PURE__ */ React35.createElement(
12576
+ props.notice === null ? null : /* @__PURE__ */ React37.createElement(
11902
12577
  "div",
11903
12578
  {
11904
12579
  role: "status",
@@ -11911,7 +12586,7 @@ function Footer(props) {
11911
12586
  }
11912
12587
 
11913
12588
  // src/client/tickets-header.tsx
11914
- var React36 = __toESM(require("react"), 1);
12589
+ var React38 = __toESM(require("react"), 1);
11915
12590
  var REFRESH_ERROR_STYLE2 = {
11916
12591
  color: COLORS.error,
11917
12592
  fontSize: 12,
@@ -11922,7 +12597,7 @@ var REFRESH_ERROR_STYLE2 = {
11922
12597
  };
11923
12598
  function TicketsHeader(props) {
11924
12599
  const { t: t2 } = useI18n();
11925
- return /* @__PURE__ */ React36.createElement("header", { style: HEADER_STYLE }, /* @__PURE__ */ React36.createElement("div", { style: { display: "flex", alignItems: "center", gap: 8, minWidth: 0 } }, /* @__PURE__ */ React36.createElement("div", { style: REPO_CHIP_STYLE }, /* @__PURE__ */ React36.createElement(FolderIcon, null), /* @__PURE__ */ React36.createElement(
12600
+ return /* @__PURE__ */ React38.createElement("header", { style: HEADER_STYLE }, /* @__PURE__ */ React38.createElement("div", { style: { display: "flex", alignItems: "center", gap: 8, minWidth: 0 } }, /* @__PURE__ */ React38.createElement("div", { style: REPO_CHIP_STYLE }, /* @__PURE__ */ React38.createElement(FolderIcon, null), /* @__PURE__ */ React38.createElement(
11926
12601
  "span",
11927
12602
  {
11928
12603
  "data-testid": "repo-name",
@@ -11930,7 +12605,7 @@ function TicketsHeader(props) {
11930
12605
  ...props.snapshot === null ? {} : { title: props.snapshot.repository }
11931
12606
  },
11932
12607
  props.snapshot?.repository ?? (props.loading ? t2("repo.identifying") : t2("repo.unidentified"))
11933
- )), props.snapshot === null ? null : /* @__PURE__ */ React36.createElement("span", { "data-testid": "backend-badge", style: BACKEND_BADGE_STYLE }, backendLabel(props.snapshot.backend, t2)), props.snapshot === null ? null : /* @__PURE__ */ React36.createElement(SourceBadge2, { source: props.snapshot.source }), props.snapshot?.backend === "gitea" && props.snapshot.repositoryHost !== null ? /* @__PURE__ */ React36.createElement(
12608
+ )), props.snapshot === null ? null : /* @__PURE__ */ React38.createElement("span", { "data-testid": "backend-badge", style: BACKEND_BADGE_STYLE }, backendLabel(props.snapshot.backend, t2)), props.snapshot === null ? null : /* @__PURE__ */ React38.createElement(SourceBadge2, { source: props.snapshot.source }), props.snapshot?.backend === "gitea" && props.snapshot.repositoryHost !== null ? /* @__PURE__ */ React38.createElement(
11934
12609
  "span",
11935
12610
  {
11936
12611
  "data-testid": "repo-host",
@@ -11938,7 +12613,7 @@ function TicketsHeader(props) {
11938
12613
  style: REPO_HOST_STYLE
11939
12614
  },
11940
12615
  props.snapshot.repositoryHost
11941
- ) : null), /* @__PURE__ */ React36.createElement("div", { style: { display: "flex", alignItems: "center", gap: 4, flex: "none" } }, /* @__PURE__ */ React36.createElement("span", { "data-testid": "snapshot-age", style: AGE_STYLE }, props.snapshot === null ? t2("snapshot.none") : formatRelativeTime(props.snapshot.fetchedAt, props.now, t2)), props.notice === null ? null : /* @__PURE__ */ React36.createElement("span", { "data-testid": "refresh-error", title: props.notice, style: REFRESH_ERROR_STYLE2 }, props.notice), /* @__PURE__ */ React36.createElement(
12616
+ ) : null), /* @__PURE__ */ React38.createElement("div", { style: { display: "flex", alignItems: "center", gap: 4, flex: "none" } }, /* @__PURE__ */ React38.createElement("span", { "data-testid": "snapshot-age", style: AGE_STYLE }, props.snapshot === null ? t2("snapshot.none") : formatRelativeTime(props.snapshot.fetchedAt, props.now, t2)), props.notice === null ? null : /* @__PURE__ */ React38.createElement("span", { "data-testid": "refresh-error", title: props.notice, style: REFRESH_ERROR_STYLE2 }, props.notice), /* @__PURE__ */ React38.createElement(
11942
12617
  "button",
11943
12618
  {
11944
12619
  type: "button",
@@ -11955,13 +12630,13 @@ function TicketsHeader(props) {
11955
12630
  },
11956
12631
  style: { ...REFRESH_BUTTON_STYLE, opacity: props.busy ? 0.6 : 1 }
11957
12632
  },
11958
- /* @__PURE__ */ React36.createElement(RefreshIcon, null),
12633
+ /* @__PURE__ */ React38.createElement(RefreshIcon, null),
11959
12634
  props.busy ? t2("refresh.busy") : t2("refresh.action")
11960
12635
  )));
11961
12636
  }
11962
12637
  function SourceBadge2(props) {
11963
12638
  const { t: t2 } = useI18n();
11964
- return /* @__PURE__ */ React36.createElement(
12639
+ return /* @__PURE__ */ React38.createElement(
11965
12640
  "span",
11966
12641
  {
11967
12642
  "data-testid": "snapshot-source",
@@ -11975,7 +12650,7 @@ function SourceBadge2(props) {
11975
12650
  }
11976
12651
 
11977
12652
  // src/client/tickets-more.tsx
11978
- var React37 = __toESM(require("react"), 1);
12653
+ var React39 = __toESM(require("react"), 1);
11979
12654
  var MORE_STYLE = {
11980
12655
  display: "flex",
11981
12656
  alignItems: "center",
@@ -12007,7 +12682,7 @@ function moreStateOf(snapshot) {
12007
12682
  function MoreFooter(props) {
12008
12683
  const { t: t2 } = useI18n();
12009
12684
  const { state } = props;
12010
- return /* @__PURE__ */ React37.createElement("div", { ref: props.sentinel, "data-testid": "load-more", style: MORE_STYLE }, state.loading ? t2("tickets.more.loading") : state.error === null ? t2("tickets.more.scroll") : t2("tickets.more.failed", { message: state.error.message }), state.error === null ? null : /* @__PURE__ */ React37.createElement(
12685
+ return /* @__PURE__ */ React39.createElement("div", { ref: props.sentinel, "data-testid": "load-more", style: MORE_STYLE }, state.loading ? t2("tickets.more.loading") : state.error === null ? t2("tickets.more.scroll") : t2("tickets.more.failed", { message: state.error.message }), state.error === null ? null : /* @__PURE__ */ React39.createElement(
12011
12686
  "button",
12012
12687
  {
12013
12688
  type: "button",
@@ -12019,8 +12694,8 @@ function MoreFooter(props) {
12019
12694
  ));
12020
12695
  }
12021
12696
  function useMoreSentinel(active, onVisible) {
12022
- const node = React37.useRef(null);
12023
- React37.useEffect(() => {
12697
+ const node = React39.useRef(null);
12698
+ React39.useEffect(() => {
12024
12699
  if (!active) return;
12025
12700
  const target = node.current;
12026
12701
  if (target === null || typeof IntersectionObserver === "undefined") return;
@@ -12128,7 +12803,7 @@ function ancestorRefs(byRef, ref) {
12128
12803
  }
12129
12804
 
12130
12805
  // src/client/tickets-tree-controls.tsx
12131
- var React38 = __toESM(require("react"), 1);
12806
+ var React40 = __toESM(require("react"), 1);
12132
12807
  function hierarchyHintKey(snapshot) {
12133
12808
  if (snapshot.hierarchy === "none") {
12134
12809
  if (snapshot.backend === "gitlab") return "layout.gitlabUnavailable";
@@ -12141,7 +12816,7 @@ function hierarchyHintKey(snapshot) {
12141
12816
  }
12142
12817
  function LayoutControl(props) {
12143
12818
  const { t: t2 } = useI18n();
12144
- return /* @__PURE__ */ React38.createElement("div", { role: "group", "aria-label": t2("layout.group"), style: ICON_SEGMENTED_STYLE }, /* @__PURE__ */ React38.createElement(
12819
+ return /* @__PURE__ */ React40.createElement("div", { role: "group", "aria-label": t2("layout.group"), style: ICON_SEGMENTED_STYLE }, /* @__PURE__ */ React40.createElement(
12145
12820
  "button",
12146
12821
  {
12147
12822
  type: "button",
@@ -12159,8 +12834,8 @@ function LayoutControl(props) {
12159
12834
  ...props.layout === "flat" ? CHIP_ACTIVE_STYLE : void 0
12160
12835
  }
12161
12836
  },
12162
- /* @__PURE__ */ React38.createElement(FlatListIcon, null)
12163
- ), /* @__PURE__ */ React38.createElement(
12837
+ /* @__PURE__ */ React40.createElement(FlatListIcon, null)
12838
+ ), /* @__PURE__ */ React40.createElement(
12164
12839
  "button",
12165
12840
  {
12166
12841
  type: "button",
@@ -12179,15 +12854,101 @@ function LayoutControl(props) {
12179
12854
  ...props.layout === "tree" ? CHIP_ACTIVE_STYLE : void 0
12180
12855
  }
12181
12856
  },
12182
- /* @__PURE__ */ React38.createElement(TreeListIcon, null)
12857
+ /* @__PURE__ */ React40.createElement(TreeListIcon, null)
12183
12858
  ));
12184
12859
  }
12185
12860
 
12186
12861
  // src/client/tickets-toolbar.tsx
12187
- var React40 = __toESM(require("react"), 1);
12862
+ var React43 = __toESM(require("react"), 1);
12863
+
12864
+ // src/client/row-display-control.tsx
12865
+ var React41 = __toESM(require("react"), 1);
12866
+ var CHECK_STYLE = {
12867
+ display: "inline-flex",
12868
+ color: COLORS.accent
12869
+ };
12870
+ var CHECK_OFF_STYLE = { ...CHECK_STYLE, visibility: "hidden" };
12871
+ var DISPLAY_ITEMS = [
12872
+ { field: "showAuthor", testId: "display-author", key: "row.showAuthor" },
12873
+ { field: "showCreatedAt", testId: "display-created", key: "row.showCreatedAt" },
12874
+ { field: "showUpdatedAt", testId: "display-updated", key: "row.showUpdatedAt" },
12875
+ { field: "showAssignees", testId: "display-assignees", key: "row.showAssignees" }
12876
+ ];
12877
+ function RowDisplayControl(props) {
12878
+ const { t: t2 } = useI18n();
12879
+ const [open, setOpen] = React41.useState(false);
12880
+ const wrapRef = React41.useRef(null);
12881
+ const triggerRef = React41.useRef(null);
12882
+ React41.useEffect(() => {
12883
+ if (!open) return void 0;
12884
+ const onPointerDown = (event) => {
12885
+ if (wrapRef.current?.contains(event.target) === true) return;
12886
+ setOpen(false);
12887
+ };
12888
+ const onKeyDown = (event) => {
12889
+ if (event.key !== "Escape") return;
12890
+ setOpen(false);
12891
+ triggerRef.current?.focus();
12892
+ };
12893
+ document.addEventListener("pointerdown", onPointerDown);
12894
+ document.addEventListener("keydown", onKeyDown);
12895
+ return () => {
12896
+ document.removeEventListener("pointerdown", onPointerDown);
12897
+ document.removeEventListener("keydown", onKeyDown);
12898
+ };
12899
+ }, [open]);
12900
+ return /* @__PURE__ */ React41.createElement("div", { ref: wrapRef, style: DISPLAY_MENU_WRAP_STYLE }, /* @__PURE__ */ React41.createElement(
12901
+ "button",
12902
+ {
12903
+ ref: triggerRef,
12904
+ type: "button",
12905
+ "data-testid": "display-settings",
12906
+ "aria-expanded": open,
12907
+ "aria-label": t2("row.displayGroup"),
12908
+ title: t2("row.displayGroupHint"),
12909
+ "data-hover": "soft",
12910
+ onClick: () => {
12911
+ setOpen((value) => !value);
12912
+ },
12913
+ style: {
12914
+ ...DISPLAY_MENU_TRIGGER_STYLE,
12915
+ ...open ? { background: COLORS.surfaceActive, color: COLORS.text } : void 0
12916
+ }
12917
+ },
12918
+ /* @__PURE__ */ React41.createElement(DisplaySettingsIcon, null)
12919
+ ), open ? /* @__PURE__ */ React41.createElement("div", { role: "group", "aria-label": t2("row.displayGroup"), style: DISPLAY_MENU_PANEL_STYLE }, DISPLAY_ITEMS.filter(
12920
+ (item) => item.field !== "showAssignees" || props.assigneesAvailable
12921
+ ).map((item) => /* @__PURE__ */ React41.createElement(
12922
+ MenuItem,
12923
+ {
12924
+ key: item.field,
12925
+ testId: item.testId,
12926
+ label: t2(item.key),
12927
+ pressed: props.fields[item.field],
12928
+ onToggle: () => {
12929
+ props.onToggleField(item.field);
12930
+ }
12931
+ }
12932
+ ))) : null);
12933
+ }
12934
+ function MenuItem(props) {
12935
+ return /* @__PURE__ */ React41.createElement(
12936
+ "button",
12937
+ {
12938
+ type: "button",
12939
+ "data-testid": props.testId,
12940
+ "aria-pressed": props.pressed,
12941
+ "data-hover": "soft",
12942
+ onClick: props.onToggle,
12943
+ style: DISPLAY_MENU_ITEM_STYLE
12944
+ },
12945
+ props.label,
12946
+ /* @__PURE__ */ React41.createElement("span", { "aria-hidden": "true", style: props.pressed ? CHECK_STYLE : CHECK_OFF_STYLE }, /* @__PURE__ */ React41.createElement(CheckIcon, null))
12947
+ );
12948
+ }
12188
12949
 
12189
12950
  // src/client/sort-control.tsx
12190
- var React39 = __toESM(require("react"), 1);
12951
+ var React42 = __toESM(require("react"), 1);
12191
12952
  var GROUP_STYLE2 = {
12192
12953
  ...SEGMENTED_STYLE,
12193
12954
  flexWrap: "nowrap",
@@ -12253,7 +13014,7 @@ function SortControl(props) {
12253
13014
  const next = props.direction === "asc" ? "desc" : "asc";
12254
13015
  const currentLabel = t2(DIRECTION_KEYS[props.direction]);
12255
13016
  const nextLabel = t2(DIRECTION_KEYS[next]);
12256
- 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(
13017
+ return /* @__PURE__ */ React42.createElement("div", { role: "group", "aria-label": t2("sort.group"), style: GROUP_STYLE2 }, /* @__PURE__ */ React42.createElement("span", { style: SELECT_WRAP_STYLE }, /* @__PURE__ */ React42.createElement(
12257
13018
  "select",
12258
13019
  {
12259
13020
  "data-testid": "sort-key",
@@ -12265,8 +13026,8 @@ function SortControl(props) {
12265
13026
  },
12266
13027
  style: SELECT_STYLE
12267
13028
  },
12268
- TICKET_SORT_KEYS.map((key) => /* @__PURE__ */ React39.createElement("option", { key, value: key }, t2(SORT_KEYS[key])))
12269
- ), /* @__PURE__ */ React39.createElement("span", { style: CARET_STYLE }, /* @__PURE__ */ React39.createElement(CaretIcon, null))), /* @__PURE__ */ React39.createElement(
13029
+ TICKET_SORT_KEYS.map((key) => /* @__PURE__ */ React42.createElement("option", { key, value: key }, t2(SORT_KEYS[key])))
13030
+ ), /* @__PURE__ */ React42.createElement("span", { style: CARET_STYLE }, /* @__PURE__ */ React42.createElement(CaretIcon, null))), /* @__PURE__ */ React42.createElement(
12270
13031
  "button",
12271
13032
  {
12272
13033
  type: "button",
@@ -12282,7 +13043,7 @@ function SortControl(props) {
12282
13043
  ));
12283
13044
  }
12284
13045
  function CaretIcon() {
12285
- 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" }));
13046
+ return /* @__PURE__ */ React42.createElement("svg", { width: "8", height: "8", viewBox: "0 0 8 8", "aria-hidden": "true" }, /* @__PURE__ */ React42.createElement("path", { d: "M0.5 2h7L4 6.5z", fill: "currentColor" }));
12286
13047
  }
12287
13048
 
12288
13049
  // src/client/tickets-toolbar.tsx
@@ -12300,7 +13061,7 @@ var CHIP_STATS = {
12300
13061
  };
12301
13062
  function Toolbar(props) {
12302
13063
  const { t: t2 } = useI18n();
12303
- 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(
13064
+ return /* @__PURE__ */ React43.createElement("div", { style: TOOLBAR_STYLE }, /* @__PURE__ */ React43.createElement("div", { role: "group", "aria-label": t2("filter.group"), style: SEGMENTED_STYLE }, TICKET_FILTERS.map((value) => /* @__PURE__ */ React43.createElement(
12304
13065
  Chip,
12305
13066
  {
12306
13067
  key: value,
@@ -12313,7 +13074,7 @@ function Toolbar(props) {
12313
13074
  props.onFilter(value);
12314
13075
  }
12315
13076
  }
12316
- ))), /* @__PURE__ */ React40.createElement(
13077
+ ))), /* @__PURE__ */ React43.createElement(
12317
13078
  SortControl,
12318
13079
  {
12319
13080
  sortKey: props.sortKey,
@@ -12323,11 +13084,17 @@ function Toolbar(props) {
12323
13084
  props.onSort(props.sortKey);
12324
13085
  }
12325
13086
  }
13087
+ ), /* @__PURE__ */ React43.createElement(
13088
+ RowDisplayControl,
13089
+ {
13090
+ fields: props.fields,
13091
+ assigneesAvailable: props.assigneesAvailable,
13092
+ onToggleField: props.onToggleField
13093
+ }
12326
13094
  ));
12327
13095
  }
12328
- function Chip(props) {
12329
- const stat = props.stat;
12330
- return /* @__PURE__ */ React40.createElement(
13096
+ function ChipButton(props) {
13097
+ return /* @__PURE__ */ React43.createElement(
12331
13098
  "button",
12332
13099
  {
12333
13100
  type: "button",
@@ -12337,19 +13104,21 @@ function Chip(props) {
12337
13104
  onClick: props.onClick,
12338
13105
  style: { ...CHIP_STYLE, ...props.active ? CHIP_ACTIVE_STYLE : void 0 }
12339
13106
  },
12340
- stat === void 0 ? null : /* @__PURE__ */ React40.createElement("span", { "aria-hidden": "true", style: { ...CHIP_DOT_STYLE, background: stat.color } }),
12341
- props.label,
12342
- stat === void 0 ? null : /* @__PURE__ */ React40.createElement("span", { "data-testid": `stat-${stat.key}`, style: CHIP_COUNT_STYLE }, props.count[stat.key])
13107
+ props.children
12343
13108
  );
12344
13109
  }
13110
+ function Chip(props) {
13111
+ const stat = props.stat;
13112
+ return /* @__PURE__ */ React43.createElement(ChipButton, { testId: props.testId, active: props.active, onClick: props.onClick }, stat === void 0 ? null : /* @__PURE__ */ React43.createElement("span", { "aria-hidden": "true", style: { ...CHIP_DOT_STYLE, background: stat.color } }), props.label, stat === void 0 ? null : /* @__PURE__ */ React43.createElement("span", { "data-testid": `stat-${stat.key}`, style: CHIP_COUNT_STYLE }, props.count[stat.key]));
13113
+ }
12345
13114
 
12346
13115
  // src/client/use-collapsed-tickets.ts
12347
- var React41 = __toESM(require("react"), 1);
13116
+ var React44 = __toESM(require("react"), 1);
12348
13117
  function useCollapsedTickets(workspaceRoot, focused, visible) {
12349
13118
  const session = useTicketTreeSession();
12350
- const [localCollapsed, setLocalCollapsed] = React41.useState(() => /* @__PURE__ */ new Set());
12351
- const previousRoot = React41.useRef(workspaceRoot);
12352
- const expandedFor = React41.useRef(null);
13119
+ const [localCollapsed, setLocalCollapsed] = React44.useState(() => /* @__PURE__ */ new Set());
13120
+ const previousRoot = React44.useRef(workspaceRoot);
13121
+ const expandedFor = React44.useRef(null);
12353
13122
  if (previousRoot.current !== workspaceRoot) {
12354
13123
  previousRoot.current = workspaceRoot;
12355
13124
  expandedFor.current = null;
@@ -12357,7 +13126,7 @@ function useCollapsedTickets(workspaceRoot, focused, visible) {
12357
13126
  }
12358
13127
  const collapsed = session?.collapsed ?? localCollapsed;
12359
13128
  const setCollapsed = session?.setCollapsed ?? setLocalCollapsed;
12360
- React41.useEffect(() => {
13129
+ React44.useEffect(() => {
12361
13130
  if (focused === null || visible.length === 0 || expandedFor.current === focused) return;
12362
13131
  expandedFor.current = focused;
12363
13132
  setCollapsed((current) => expandAncestors(visible, current, focused));
@@ -12420,7 +13189,7 @@ function sameLogin(left, right) {
12420
13189
  return left.toLowerCase() === right.toLowerCase();
12421
13190
  }
12422
13191
  function isAssignedTo(ticket, viewer) {
12423
- return ticket.assignees.some((login) => sameLogin(login, viewer));
13192
+ return ticket.assignees.some((author) => sameLogin(author.login, viewer));
12424
13193
  }
12425
13194
  function isCreatedBy(ticket, viewer) {
12426
13195
  return ticket.author !== null && sameLogin(ticket.author.login, viewer);
@@ -12474,7 +13243,7 @@ function timestamp(value) {
12474
13243
  }
12475
13244
 
12476
13245
  // src/client/use-view-preference.ts
12477
- var React42 = __toESM(require("react"), 1);
13246
+ var React45 = __toESM(require("react"), 1);
12478
13247
 
12479
13248
  // src/client/view-preference.ts
12480
13249
  var DEFAULT_VIEW = {
@@ -12483,7 +13252,11 @@ var DEFAULT_VIEW = {
12483
13252
  direction: "asc",
12484
13253
  assignedToMe: false,
12485
13254
  createdByMe: false,
12486
- layout: "flat"
13255
+ layout: "flat",
13256
+ showAuthor: true,
13257
+ showCreatedAt: true,
13258
+ showUpdatedAt: false,
13259
+ showAssignees: false
12487
13260
  };
12488
13261
  var KEY_PREFIX = "dsh-mattpocock-workflow:view:";
12489
13262
  var STORAGE_VERSION = 1;
@@ -12521,7 +13294,11 @@ function readViewPreference(storage, workspaceRoot) {
12521
13294
  direction: isDirection(stored.direction) ? stored.direction : DEFAULT_VIEW.direction,
12522
13295
  assignedToMe: isBoolean(stored.assignedToMe) ? stored.assignedToMe : DEFAULT_VIEW.assignedToMe,
12523
13296
  createdByMe: isBoolean(stored.createdByMe) ? stored.createdByMe : DEFAULT_VIEW.createdByMe,
12524
- layout: isLayout(stored.layout) ? stored.layout : DEFAULT_VIEW.layout
13297
+ layout: isLayout(stored.layout) ? stored.layout : DEFAULT_VIEW.layout,
13298
+ showAuthor: isBoolean(stored.showAuthor) ? stored.showAuthor : DEFAULT_VIEW.showAuthor,
13299
+ showCreatedAt: isBoolean(stored.showCreatedAt) ? stored.showCreatedAt : DEFAULT_VIEW.showCreatedAt,
13300
+ showUpdatedAt: isBoolean(stored.showUpdatedAt) ? stored.showUpdatedAt : DEFAULT_VIEW.showUpdatedAt,
13301
+ showAssignees: isBoolean(stored.showAssignees) ? stored.showAssignees : DEFAULT_VIEW.showAssignees
12525
13302
  };
12526
13303
  }
12527
13304
  function writeViewPreference(storage, workspaceRoot, preference, now = Date.now) {
@@ -12536,6 +13313,10 @@ function writeViewPreference(storage, workspaceRoot, preference, now = Date.now)
12536
13313
  assignedToMe: preference.assignedToMe,
12537
13314
  createdByMe: preference.createdByMe,
12538
13315
  layout: preference.layout,
13316
+ showAuthor: preference.showAuthor,
13317
+ showCreatedAt: preference.showCreatedAt,
13318
+ showUpdatedAt: preference.showUpdatedAt,
13319
+ showAssignees: preference.showAssignees,
12539
13320
  savedAt: now(),
12540
13321
  version: STORAGE_VERSION
12541
13322
  })
@@ -12597,8 +13378,8 @@ function isLayout(value) {
12597
13378
 
12598
13379
  // src/client/use-view-preference.ts
12599
13380
  function useViewPreference(workspaceRoot) {
12600
- const storage = React42.useMemo(resolvePreferenceStorage, []);
12601
- const [viewState, setViewState] = React42.useState(() => ({
13381
+ const storage = React45.useMemo(resolvePreferenceStorage, []);
13382
+ const [viewState, setViewState] = React45.useState(() => ({
12602
13383
  workspaceRoot,
12603
13384
  preference: readViewPreference(storage, workspaceRoot)
12604
13385
  }));
@@ -12638,6 +13419,9 @@ function useViewPreference(workspaceRoot) {
12638
13419
  },
12639
13420
  setLayout: (layout) => {
12640
13421
  apply2({ ...preference, layout });
13422
+ },
13423
+ toggleRowField: (field) => {
13424
+ apply2({ ...preference, [field]: !preference[field] });
12641
13425
  }
12642
13426
  };
12643
13427
  }
@@ -12661,7 +13445,8 @@ function useTicketsViewState(props) {
12661
13445
  setLayout,
12662
13446
  toggleAssignedToMe,
12663
13447
  toggleCreatedByMe,
12664
- clearMyTickets
13448
+ clearMyTickets,
13449
+ toggleRowField
12665
13450
  } = useViewPreference(props.workspaceRoot);
12666
13451
  const now = useNow(props.now ?? Date.now);
12667
13452
  const ownActions = useTicketActions(props.workspaceRoot, props.injection);
@@ -12695,12 +13480,19 @@ function useTicketsViewState(props) {
12695
13480
  moreError,
12696
13481
  moreLoading,
12697
13482
  preference,
13483
+ rowFields: {
13484
+ showAuthor: preference.showAuthor,
13485
+ showCreatedAt: preference.showCreatedAt,
13486
+ showUpdatedAt: preference.showUpdatedAt,
13487
+ showAssignees: preference.showAssignees
13488
+ },
12698
13489
  setFilter,
12699
13490
  toggleSort,
12700
13491
  setLayout,
12701
13492
  toggleAssignedToMe,
12702
13493
  toggleCreatedByMe,
12703
13494
  clearMyTickets,
13495
+ toggleRowField,
12704
13496
  tickets,
12705
13497
  counts,
12706
13498
  myCounts,
@@ -12722,13 +13514,13 @@ function useTicketsViewState(props) {
12722
13514
  function TicketsView(props) {
12723
13515
  const { t: t2 } = useI18n();
12724
13516
  const state = useTicketsViewState(props);
12725
- return /* @__PURE__ */ React43.createElement(
13517
+ return /* @__PURE__ */ React46.createElement(
12726
13518
  "div",
12727
13519
  {
12728
13520
  "data-testid": "tickets-view",
12729
13521
  style: { display: "flex", flexDirection: "column", flex: 1, minHeight: 0 }
12730
13522
  },
12731
- /* @__PURE__ */ React43.createElement(
13523
+ /* @__PURE__ */ React46.createElement(
12732
13524
  TicketsHeader,
12733
13525
  {
12734
13526
  snapshot: state.snapshot,
@@ -12740,9 +13532,9 @@ function TicketsView(props) {
12740
13532
  onRefreshFull: state.refreshFull
12741
13533
  }
12742
13534
  ),
12743
- props.actions === void 0 ? /* @__PURE__ */ React43.createElement("div", { style: ACTION_BAR_STYLE }, /* @__PURE__ */ React43.createElement(ActionBar, { injection: props.injection, onInject: state.inject })) : null,
12744
- state.error !== null ? /* @__PURE__ */ React43.createElement(ErrorBanner, { error: state.error, onOpenEnvCheck: props.onOpenEnvCheck }) : null,
12745
- state.snapshot !== null ? /* @__PURE__ */ React43.createElement(
13535
+ props.actions === void 0 ? /* @__PURE__ */ React46.createElement("div", { style: ACTION_BAR_STYLE }, /* @__PURE__ */ React46.createElement(ActionBar, { injection: props.injection, onInject: state.inject })) : null,
13536
+ state.error !== null ? /* @__PURE__ */ React46.createElement(ErrorBanner, { error: state.error, onOpenEnvCheck: props.onOpenEnvCheck }) : null,
13537
+ state.snapshot !== null ? /* @__PURE__ */ React46.createElement(
12746
13538
  SnapshotContent,
12747
13539
  {
12748
13540
  snapshot: state.snapshot,
@@ -12758,6 +13550,7 @@ function TicketsView(props) {
12758
13550
  myCounts: state.myCounts,
12759
13551
  assignedToMe: state.preference.assignedToMe,
12760
13552
  createdByMe: state.preference.createdByMe,
13553
+ rowFields: state.rowFields,
12761
13554
  ticketCount: state.tickets.length,
12762
13555
  injected: state.injected,
12763
13556
  injection: props.injection,
@@ -12774,28 +13567,32 @@ function TicketsView(props) {
12774
13567
  onLayout: state.setLayout,
12775
13568
  onToggleAssigned: state.toggleAssignedToMe,
12776
13569
  onToggleCreated: state.toggleCreatedByMe,
13570
+ onToggleRowField: state.toggleRowField,
12777
13571
  onClearMyTickets: state.clearMyTickets,
12778
13572
  onToggleTree: state.toggleTree,
12779
13573
  onPick: props.onOpenTicket,
12780
13574
  onSkillAction: state.onSkillAction
12781
13575
  }
12782
- ) : state.phase === "loading" ? /* @__PURE__ */ React43.createElement("div", { "data-testid": "loading", style: EMPTY_STYLE }, t2("snapshot.loading")) : null,
12783
- /* @__PURE__ */ React43.createElement(Footer, { injection: props.injection, notice: state.notice, tone: state.noticeTone })
13576
+ ) : state.phase === "loading" ? /* @__PURE__ */ React46.createElement("div", { "data-testid": "loading", style: EMPTY_STYLE }, t2("snapshot.loading")) : null,
13577
+ /* @__PURE__ */ React46.createElement(Footer, { injection: props.injection, notice: state.notice, tone: state.noticeTone })
12784
13578
  );
12785
13579
  }
12786
13580
  function SnapshotContent(props) {
12787
13581
  const { t: t2 } = useI18n();
12788
- return /* @__PURE__ */ React43.createElement(React43.Fragment, null, /* @__PURE__ */ React43.createElement(
13582
+ return /* @__PURE__ */ React46.createElement(React46.Fragment, null, /* @__PURE__ */ React46.createElement(
12789
13583
  Toolbar,
12790
13584
  {
12791
13585
  filter: props.filter,
12792
13586
  sortKey: props.sortKey,
12793
13587
  direction: props.direction,
12794
13588
  counts: props.counts,
13589
+ fields: props.rowFields,
13590
+ assigneesAvailable: props.snapshot.backend !== "markdown",
12795
13591
  onFilter: props.onFilter,
12796
- onSort: props.onSort
13592
+ onSort: props.onSort,
13593
+ onToggleField: props.onToggleRowField
12797
13594
  }
12798
- ), props.snapshot.viewer === null ? null : /* @__PURE__ */ React43.createElement(
13595
+ ), props.snapshot.viewer === null ? null : /* @__PURE__ */ React46.createElement(
12799
13596
  MyTicketsBar,
12800
13597
  {
12801
13598
  viewer: props.snapshot.viewer,
@@ -12806,10 +13603,10 @@ function SnapshotContent(props) {
12806
13603
  onToggleCreated: props.onToggleCreated,
12807
13604
  onClear: props.onClearMyTickets
12808
13605
  }
12809
- ), /* @__PURE__ */ React43.createElement(
13606
+ ), /* @__PURE__ */ React46.createElement(
12810
13607
  TicketRows,
12811
13608
  {
12812
- layoutControl: /* @__PURE__ */ React43.createElement(
13609
+ layoutControl: /* @__PURE__ */ React46.createElement(
12813
13610
  LayoutControl,
12814
13611
  {
12815
13612
  layout: props.preferenceLayout,
@@ -12818,7 +13615,7 @@ function SnapshotContent(props) {
12818
13615
  onLayout: props.onLayout
12819
13616
  }
12820
13617
  ),
12821
- notes: /* @__PURE__ */ React43.createElement(TreeNotes, { ...props }),
13618
+ notes: /* @__PURE__ */ React46.createElement(TreeNotes, { ...props }),
12822
13619
  snapshot: props.snapshot,
12823
13620
  visible: props.visible,
12824
13621
  rows: props.rows,
@@ -12828,6 +13625,7 @@ function SnapshotContent(props) {
12828
13625
  injection: props.injection,
12829
13626
  focused: props.focused,
12830
13627
  now: props.now,
13628
+ fields: props.rowFields,
12831
13629
  more: props.more,
12832
13630
  onPick: props.onPick,
12833
13631
  onSkillAction: props.onSkillAction
@@ -12836,17 +13634,17 @@ function SnapshotContent(props) {
12836
13634
  }
12837
13635
  function TreeNotes(props) {
12838
13636
  const { t: t2 } = useI18n();
12839
- 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);
13637
+ return /* @__PURE__ */ React46.createElement(React46.Fragment, null, props.layout === "tree" && props.snapshot.total > props.snapshot.loaded ? /* @__PURE__ */ React46.createElement("div", { "data-testid": "tree-coverage", style: TREE_NOTE_STYLE }, t2("tree.coverage", { loaded: props.snapshot.loaded })) : null, props.preferenceLayout === "tree" && !props.hierarchyAvailable ? /* @__PURE__ */ React46.createElement("div", { "data-testid": "tree-degraded", style: TREE_DEGRADED_STYLE }, t2("tree.degraded")) : null, props.preferenceLayout !== "tree" && !props.hierarchyAvailable ? /* @__PURE__ */ React46.createElement("div", { "data-testid": "tree-unavailable", style: TREE_NOTE_STYLE }, t2(hierarchyHintKey(props.snapshot))) : null);
12840
13638
  }
12841
13639
  function useFocusedTicket(focusRef, onFocusHandled, workspaceRoot) {
12842
- const [focused, setFocused] = React43.useState(null);
12843
- React43.useEffect(() => {
13640
+ const [focused, setFocused] = React46.useState(null);
13641
+ React46.useEffect(() => {
12844
13642
  if (focusRef === null || focusRef === void 0) return;
12845
13643
  setFocused(focusRef);
12846
13644
  onFocusHandled?.();
12847
13645
  }, [focusRef, onFocusHandled]);
12848
- const previousRoot = React43.useRef(workspaceRoot);
12849
- React43.useEffect(() => {
13646
+ const previousRoot = React46.useRef(workspaceRoot);
13647
+ React46.useEffect(() => {
12850
13648
  if (previousRoot.current === workspaceRoot) return;
12851
13649
  previousRoot.current = workspaceRoot;
12852
13650
  setFocused(null);
@@ -12860,7 +13658,7 @@ function TicketRows(props) {
12860
13658
  more.available && more.error === null && !more.loading,
12861
13659
  more.onLoadMore
12862
13660
  );
12863
- 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(
13661
+ return /* @__PURE__ */ React46.createElement(React46.Fragment, null, /* @__PURE__ */ React46.createElement("div", { style: LIST_HEADER_STYLE }, /* @__PURE__ */ React46.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__ */ React46.createElement(
12864
13662
  TicketList,
12865
13663
  {
12866
13664
  tickets: props.visible,
@@ -12871,9 +13669,10 @@ function TicketRows(props) {
12871
13669
  injection: props.injection,
12872
13670
  focused: props.focused,
12873
13671
  now: props.now,
13672
+ fields: props.fields,
12874
13673
  onPick: props.onPick,
12875
13674
  onSkillAction: props.onSkillAction,
12876
- footer: more.available ? /* @__PURE__ */ React43.createElement(MoreFooter, { state: more, sentinel }) : null
13675
+ footer: more.available ? /* @__PURE__ */ React46.createElement(MoreFooter, { state: more, sentinel }) : null
12877
13676
  }
12878
13677
  ));
12879
13678
  }
@@ -12881,11 +13680,11 @@ function TicketRows(props) {
12881
13680
  // src/client/task-panel.tsx
12882
13681
  var NO_CAPABILITIES = () => [];
12883
13682
  function TaskPanel(props) {
12884
- const [view, setView] = React44.useState("tickets");
12885
- const [focusBackend, setFocusBackend] = React44.useState(null);
13683
+ const [view, setView] = React47.useState("tickets");
13684
+ const [focusBackend, setFocusBackend] = React47.useState(null);
12886
13685
  const navigation = useDetailNavigation(props.workspaceRoot);
12887
- const [focusTicket, setFocusTicket] = React44.useState(null);
12888
- const previousView = React44.useRef("tickets");
13686
+ const [focusTicket, setFocusTicket] = React47.useState(null);
13687
+ const previousView = React47.useRef("tickets");
12889
13688
  const actions = useTicketActions(props.workspaceRoot, props.injection);
12890
13689
  const clientCapabilities = props.clientCapabilities ?? NO_CAPABILITIES;
12891
13690
  const request = useSnapshotRequest(props.client, props.workspaceRoot, {
@@ -12896,7 +13695,7 @@ function TaskPanel(props) {
12896
13695
  if (view !== "help") previousView.current = view;
12897
13696
  setView("help");
12898
13697
  };
12899
- 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(
13698
+ return /* @__PURE__ */ React47.createElement("div", { "data-testid": "task-panel", "data-anvil-panel": "", style: PANEL_STYLE }, /* @__PURE__ */ React47.createElement("style", null, PANEL_SHEET), /* @__PURE__ */ React47.createElement(
12900
13699
  ViewTabs,
12901
13700
  {
12902
13701
  view,
@@ -12913,9 +13712,9 @@ function TaskPanel(props) {
12913
13712
  setView("env");
12914
13713
  },
12915
13714
  onOpenHelp: openHelp,
12916
- actions: view === "tickets" && open === null ? /* @__PURE__ */ React44.createElement(ActionBar, { injection: props.injection, onInject: actions.inject }) : null
13715
+ actions: view === "tickets" && open === null ? /* @__PURE__ */ React47.createElement(ActionBar, { injection: props.injection, onInject: actions.inject }) : null
12917
13716
  }
12918
- ), /* @__PURE__ */ React44.createElement(TicketTreeSessionProvider, { workspaceRoot: props.workspaceRoot }, /* @__PURE__ */ React44.createElement(
13717
+ ), /* @__PURE__ */ React47.createElement(TicketTreeSessionProvider, { workspaceRoot: props.workspaceRoot }, /* @__PURE__ */ React47.createElement(
12919
13718
  PanelContent,
12920
13719
  {
12921
13720
  panel: props,
@@ -12955,7 +13754,7 @@ function TaskPanel(props) {
12955
13754
  function PanelContent(props) {
12956
13755
  const panel = props.panel;
12957
13756
  if (props.view === "tickets") {
12958
- return /* @__PURE__ */ React44.createElement(
13757
+ return /* @__PURE__ */ React47.createElement(
12959
13758
  TicketsPane,
12960
13759
  {
12961
13760
  client: panel.client,
@@ -12976,7 +13775,7 @@ function PanelContent(props) {
12976
13775
  );
12977
13776
  }
12978
13777
  if (props.view === "overview") {
12979
- return /* @__PURE__ */ React44.createElement(
13778
+ return /* @__PURE__ */ React47.createElement(
12980
13779
  OverviewPane,
12981
13780
  {
12982
13781
  request: props.request,
@@ -12988,7 +13787,7 @@ function PanelContent(props) {
12988
13787
  );
12989
13788
  }
12990
13789
  if (props.view === "env") {
12991
- return /* @__PURE__ */ React44.createElement(
13790
+ return /* @__PURE__ */ React47.createElement(
12992
13791
  EnvCheckView,
12993
13792
  {
12994
13793
  client: panel.client,
@@ -12999,10 +13798,10 @@ function PanelContent(props) {
12999
13798
  }
13000
13799
  );
13001
13800
  }
13002
- return /* @__PURE__ */ React44.createElement(HelpView, { onBack: props.onBack });
13801
+ return /* @__PURE__ */ React47.createElement(HelpView, { onBack: props.onBack });
13003
13802
  }
13004
13803
  function OverviewPane(props) {
13005
- return /* @__PURE__ */ React44.createElement(
13804
+ return /* @__PURE__ */ React47.createElement(
13006
13805
  OverviewView,
13007
13806
  {
13008
13807
  request: props.request,
@@ -13018,7 +13817,7 @@ function TicketsPane(props) {
13018
13817
  const open = props.open;
13019
13818
  const snapshot = props.request.snapshot;
13020
13819
  const current = findSnapshotTicket(snapshot?.tickets, open.target.ref) ?? open.target.ticket;
13021
- return /* @__PURE__ */ React44.createElement(
13820
+ return /* @__PURE__ */ React47.createElement(
13022
13821
  TicketDetailView,
13023
13822
  {
13024
13823
  key: open.target.ref,
@@ -13034,7 +13833,7 @@ function TicketsPane(props) {
13034
13833
  }
13035
13834
  );
13036
13835
  }
13037
- return /* @__PURE__ */ React44.createElement(
13836
+ return /* @__PURE__ */ React47.createElement(
13038
13837
  TicketsView,
13039
13838
  {
13040
13839
  request: props.request,
@@ -13051,7 +13850,7 @@ function TicketsPane(props) {
13051
13850
  }
13052
13851
  function ViewTabs(props) {
13053
13852
  const { t: t2 } = useI18n();
13054
- 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(
13853
+ return /* @__PURE__ */ React47.createElement("div", { style: VIEW_BAR_STYLE }, /* @__PURE__ */ React47.createElement("div", { role: "group", "aria-label": t2("view.group"), style: VIEW_TABS_STYLE }, /* @__PURE__ */ React47.createElement(
13055
13854
  ViewChip,
13056
13855
  {
13057
13856
  testId: "view-tickets",
@@ -13059,7 +13858,7 @@ function ViewTabs(props) {
13059
13858
  active: props.view === "tickets",
13060
13859
  onClick: props.onOpenTickets
13061
13860
  }
13062
- ), /* @__PURE__ */ React44.createElement(
13861
+ ), /* @__PURE__ */ React47.createElement(
13063
13862
  ViewChip,
13064
13863
  {
13065
13864
  testId: "view-overview",
@@ -13067,7 +13866,7 @@ function ViewTabs(props) {
13067
13866
  active: props.view === "overview",
13068
13867
  onClick: props.onOpenOverview
13069
13868
  }
13070
- ), /* @__PURE__ */ React44.createElement(
13869
+ ), /* @__PURE__ */ React47.createElement(
13071
13870
  ViewChip,
13072
13871
  {
13073
13872
  testId: "view-env",
@@ -13075,10 +13874,10 @@ function ViewTabs(props) {
13075
13874
  active: props.view === "env",
13076
13875
  onClick: props.onOpenEnvCheck
13077
13876
  }
13078
- )), /* @__PURE__ */ React44.createElement("div", { style: VIEW_BAR_END_STYLE }, props.actions, /* @__PURE__ */ React44.createElement(TipsButton, { onClick: props.onOpenHelp })));
13877
+ )), /* @__PURE__ */ React47.createElement("div", { style: VIEW_BAR_END_STYLE }, props.actions, /* @__PURE__ */ React47.createElement(TipsButton, { onClick: props.onOpenHelp })));
13079
13878
  }
13080
13879
  function ViewChip(props) {
13081
- return /* @__PURE__ */ React44.createElement(
13880
+ return /* @__PURE__ */ React47.createElement(
13082
13881
  "button",
13083
13882
  {
13084
13883
  type: "button",
@@ -13093,7 +13892,7 @@ function ViewChip(props) {
13093
13892
  }
13094
13893
  function TipsButton(props) {
13095
13894
  const { t: t2 } = useI18n();
13096
- return /* @__PURE__ */ React44.createElement(
13895
+ return /* @__PURE__ */ React47.createElement(
13097
13896
  "button",
13098
13897
  {
13099
13898
  type: "button",
@@ -13103,11 +13902,11 @@ function TipsButton(props) {
13103
13902
  onClick: props.onClick,
13104
13903
  style: ICON_BUTTON_STYLE
13105
13904
  },
13106
- /* @__PURE__ */ React44.createElement(TipsIcon, null)
13905
+ /* @__PURE__ */ React47.createElement(TipsIcon, null)
13107
13906
  );
13108
13907
  }
13109
13908
  function TipsIcon() {
13110
- return /* @__PURE__ */ React44.createElement(
13909
+ return /* @__PURE__ */ React47.createElement(
13111
13910
  "svg",
13112
13911
  {
13113
13912
  width: 14,
@@ -13120,9 +13919,9 @@ function TipsIcon() {
13120
13919
  strokeLinecap: "round",
13121
13920
  strokeLinejoin: "round"
13122
13921
  },
13123
- /* @__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" }),
13124
- /* @__PURE__ */ React44.createElement("path", { d: "M6.4 12.6h3.2" }),
13125
- /* @__PURE__ */ React44.createElement("path", { d: "M7.2 14.4h1.6" })
13922
+ /* @__PURE__ */ React47.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" }),
13923
+ /* @__PURE__ */ React47.createElement("path", { d: "M6.4 12.6h3.2" }),
13924
+ /* @__PURE__ */ React47.createElement("path", { d: "M7.2 14.4h1.6" })
13126
13925
  );
13127
13926
  }
13128
13927
 
@@ -13244,7 +14043,7 @@ function registerInjection(scope, injectionRef, capabilities) {
13244
14043
  });
13245
14044
  }
13246
14045
  function TaskTabTitle() {
13247
- return /* @__PURE__ */ React45.createElement("span", null, "MattWorkflow");
14046
+ return /* @__PURE__ */ React48.createElement("span", null, "MattWorkflow");
13248
14047
  }
13249
14048
  function createTaskTab(client, injectionRef, capabilities, i18n) {
13250
14049
  return function TaskTab(props) {
@@ -13255,7 +14054,7 @@ function createTaskTab(client, injectionRef, capabilities, i18n) {
13255
14054
  );
13256
14055
  const readiness = useInjectionReadiness(injectionRef);
13257
14056
  const refreshSignal = useAgentActivitySignal(useSessions, sessionId);
13258
- const injection = React45.useMemo(
14057
+ const injection = React48.useMemo(
13259
14058
  () => ({
13260
14059
  canInjectCurrent: sessionId !== void 0 && readiness.current,
13261
14060
  canStartNewSession: readiness.newSession,
@@ -13263,7 +14062,7 @@ function createTaskTab(client, injectionRef, capabilities, i18n) {
13263
14062
  }),
13264
14063
  [injectionRef, sessionId, readiness.current, readiness.newSession]
13265
14064
  );
13266
- return /* @__PURE__ */ React45.createElement(I18nProvider, { i18n }, /* @__PURE__ */ React45.createElement(
14065
+ return /* @__PURE__ */ React48.createElement(I18nProvider, { i18n }, /* @__PURE__ */ React48.createElement(
13267
14066
  TaskPanel,
13268
14067
  {
13269
14068
  client,
@@ -13287,8 +14086,8 @@ function notify(ref) {
13287
14086
  for (const listener of ref.listeners) listener();
13288
14087
  }
13289
14088
  function useInjectionReadiness(ref) {
13290
- const [readiness, setReadiness] = React45.useState(() => readReadiness(ref));
13291
- React45.useEffect(() => {
14089
+ const [readiness, setReadiness] = React48.useState(() => readReadiness(ref));
14090
+ React48.useEffect(() => {
13292
14091
  const update = () => {
13293
14092
  setReadiness(readReadiness(ref));
13294
14093
  };