@cnzgray/dsh-mattpocock-workflow 0.1.2 → 0.3.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.
Files changed (3) hide show
  1. package/README.md +3 -1
  2. package/lib/client.js +614 -465
  3. package/package.json +1 -1
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 React42 = __toESM(require("react"), 1);
42
+ var React43 = __toESM(require("react"), 1);
43
43
 
44
44
  // src/client/agent-activity.ts
45
45
  var React = __toESM(require("react"), 1);
@@ -78,6 +78,24 @@ function useAgentActivitySignal(useSessions, sessionId) {
78
78
  }
79
79
 
80
80
  // src/protocol/env-check.ts
81
+ var ENV_CHECK_IDS = {
82
+ /** 用户主目录可解析。 */
83
+ home: "home",
84
+ /** 已选择工单后端。 */
85
+ backend: "backend",
86
+ /** 后端对应的命令行工具已安装。 */
87
+ cli: "cli",
88
+ /** 命令行工具已登录。 */
89
+ auth: "auth",
90
+ /** 当前仓库可通过后端接口访问。 */
91
+ repository: "repository",
92
+ /** 工作区已用 `setup-matt-pocock-skills` 初始化。 */
93
+ workspace: "workspace",
94
+ /** 工作区里的本地工单目录可读;只在本地 Markdown 后端或后端未判定时检查。 */
95
+ localIssues: "local-issues",
96
+ /** 一项必需技能已安装;subject 是技能名。 */
97
+ skill: "skill"
98
+ };
81
99
  var UI_CAPABILITY_IDS = [
82
100
  "slots",
83
101
  "sidebarRightTabs",
@@ -331,9 +349,13 @@ var zh = {
331
349
  "env.remedy.loginCliGeneric": "\u767B\u5F55\u540E\u7AEF\u5BF9\u5E94\u7684\u547D\u4EE4\u884C\u5DE5\u5177\uFF08gh / glab / tea\uFF09\uFF0C\u767B\u5F55\u540E\u91CD\u65B0\u68C0\u67E5\u3002",
332
350
  "env.remedy.loginCli": "\u767B\u5F55 {cli}\uFF1B\u81EA\u5EFA\u5B9E\u4F8B\u8981\u5728\u767B\u5F55\u65F6\u586B\u5B9E\u4F8B\u5730\u5740\uFF0C\u767B\u5F55\u540E\u91CD\u65B0\u68C0\u67E5\u3002",
333
351
  "env.remedy.skillMissing": "\u7F3A\u5931\u6280\u80FD",
334
- "env.remedy.installSkillSummary": "\u8BA9\u5F53\u524D\u4F1A\u8BDD\u628A {skill} \u6280\u80FD\u88C5\u5230 DSH \u4F1A\u626B\u63CF\u7684\u6280\u80FD\u76EE\u5F55\uFF08\u5982 .agents/skills\uFF09\uFF0C\u6765\u6E90\u662F mattpocock/skills\u3002",
335
- "env.remedy.installSkillPrompt": "\u5B89\u88C5 mattpocock/skills \u91CC\u7684 {skill} \u6280\u80FD\u5230\u5F53\u524D\u5DE5\u4F5C\u533A DSH \u4F1A\u626B\u63CF\u7684\u6280\u80FD\u76EE\u5F55\uFF08\u5982 .agents/skills \u6216 .dsh/skills\uFF09\uFF0C\u8BA9\u73AF\u5883\u68C0\u67E5\u9879\u300C{title}\u300D\u901A\u8FC7\u3002\u88C5\u597D\u540E\u544A\u8BC9\u6211\uFF0C\u6211\u518D\u91CD\u65B0\u68C0\u67E5\u3002",
352
+ "env.remedy.installSkillSummary": "\u8BA9\u5F53\u524D\u4F1A\u8BDD\u628A {skill} \u88C5\u5230 ~/.agents/skills\uFF08DSH \u6280\u80FD\u76EE\u5F55\uFF09\uFF0C\u6240\u6709\u5DE5\u4F5C\u533A\u901A\u7528\u3002",
353
+ "env.remedy.installSkillPrompt": "\u4ECE mattpocock/skills \u5B89\u88C5 {skill} \u6280\u80FD\u5230 ~/.agents/skills\uFF08~/.dsh/skills \u540C\u6837\u6709\u6548\uFF09\uFF0C\u76EE\u5F55\u7ED3\u6784\u662F <\u6280\u80FD\u540D>/SKILL.md\uFF1B\u88C5\u5230\u4E3B\u76EE\u5F55\u540E\u6240\u6709\u5DE5\u4F5C\u533A\u90FD\u53EF\u7528\u3002\u88C5\u597D\u540E\u544A\u8BC9\u6211\uFF0C\u6211\u518D\u91CD\u65B0\u68C0\u67E5\u3002",
354
+ "env.remedy.installSkillsSummary": "\u4E00\u6761\u63D0\u793A\u8BCD\u628A {count} \u9879\u7F3A\u5931\u6280\u80FD\u88C5\u5230 ~/.agents/skills\uFF08DSH \u6280\u80FD\u76EE\u5F55\uFF09\uFF0C\u6240\u6709\u5DE5\u4F5C\u533A\u901A\u7528\u3002",
355
+ "env.remedy.installSkillsPrompt": "\u4ECE mattpocock/skills \u4E00\u6B21\u88C5\u9F50\u8FD9\u4E9B\u6280\u80FD\uFF1A\n{skills}\n\u88C5\u5230 ~/.agents/skills\uFF08~/.dsh/skills \u540C\u6837\u6709\u6548\uFF09\uFF0C\u6BCF\u4E2A\u6280\u80FD\u6309 <\u6280\u80FD\u540D>/SKILL.md \u5B58\u653E\uFF1B\u88C5\u5230\u4E3B\u76EE\u5F55\u540E\u6240\u6709\u5DE5\u4F5C\u533A\u90FD\u53EF\u7528\u3002\u88C5\u597D\u540E\u544A\u8BC9\u6211\uFF0C\u6211\u518D\u91CD\u65B0\u68C0\u67E5\u3002",
336
356
  "env.remedy.installSkillLink": "mattpocock/skills \u4ED3\u5E93",
357
+ "env.skills.title": "\u6280\u80FD\u603B\u88C5",
358
+ "env.skills.detail": "\u7F3A\u5C11 {count} \u9879\u5FC5\u9700\u6280\u80FD\uFF1A{skills}",
337
359
  "env.remedy.initWorkspaceSummary": "\u8BA9\u5F53\u524D\u4F1A\u8BDD\u8FD0\u884C {skill}\uFF0C\u628A\u5DE5\u4F5C\u533A\u6309\u9762\u677F\u8981\u6C42\u521D\u59CB\u5316\u3002",
338
360
  "env.remedy.initWorkspacePrompt": "\u521D\u59CB\u5316\u5F53\u524D\u5DE5\u4F5C\u533A\u3002\u73AF\u5883\u68C0\u67E5\u9879\u300C{title}\u300D\u672A\u901A\u8FC7\uFF1A{detail}\u3002",
339
361
  "env.remedy.initWorkspaceOutro": "\u6309\u6280\u80FD\u5B8C\u6210\u521D\u59CB\u5316\u540E\u544A\u8BC9\u6211\uFF0C\u6211\u518D\u91CD\u65B0\u68C0\u67E5\u3002",
@@ -493,6 +515,9 @@ var zh = {
493
515
  "detail.comments": "{count} \u6761\u8BC4\u8BBA",
494
516
  "detail.loading": "\u6B63\u5728\u8BFB\u53D6\u5DE5\u5355\u8BE6\u60C5\u2026",
495
517
  "detail.loadFailed": "\u8BFB\u53D6\u5DE5\u5355\u8BE6\u60C5\u5931\u8D25\u3002",
518
+ "detail.refresh": "\u5237\u65B0\u5DE5\u5355",
519
+ "detail.refreshing": "\u6B63\u5728\u5237\u65B0\u5DE5\u5355\u2026",
520
+ "detail.refreshFailed": "\u5237\u65B0\u5931\u8D25\uFF1A{detail}",
496
521
  "detail.bodyLabel": "\u6B63\u6587",
497
522
  "detail.noBody": "\u8FD9\u5F20\u5DE5\u5355\u6CA1\u6709\u6B63\u6587\u3002",
498
523
  "detail.attachment.loading": "\u6B63\u5728\u52A0\u8F7D\u56FE\u7247\uFF1A{name}",
@@ -788,9 +813,13 @@ var en = {
788
813
  "env.remedy.loginCliGeneric": "Sign in to the command-line tool for the backend (gh / glab / tea), then recheck.",
789
814
  "env.remedy.loginCli": "Sign in to {cli}; for self-hosted instances, enter the instance address, then recheck.",
790
815
  "env.remedy.skillMissing": "missing skill",
791
- "env.remedy.installSkillSummary": "Have the current session install the {skill} skill into a directory DSH scans (such as .agents/skills); the source is mattpocock/skills.",
792
- "env.remedy.installSkillPrompt": "Install the {skill} skill from mattpocock/skills into a directory DSH scans in the current workspace (such as .agents/skills or .dsh/skills) so the environment check \u201C{title}\u201D passes. Tell me when it is done and I will recheck.",
816
+ "env.remedy.installSkillSummary": "Have the current session install {skill} into ~/.agents/skills (a DSH skills directory); works in every workspace.",
817
+ "env.remedy.installSkillPrompt": "Install the {skill} skill from mattpocock/skills into ~/.agents/skills (~/.dsh/skills works too), as <skill>/SKILL.md; skills in the home directory work in every workspace. Tell me when it is done and I will recheck.",
818
+ "env.remedy.installSkillsSummary": "One prompt installs {count} missing skills into ~/.agents/skills (a DSH skills directory); works in every workspace.",
819
+ "env.remedy.installSkillsPrompt": "Install these skills from mattpocock/skills in one go:\n{skills}\nPut them under ~/.agents/skills (~/.dsh/skills works too), one directory per skill as <skill>/SKILL.md; skills in the home directory work in every workspace. Tell me when it is done and I will recheck.",
793
820
  "env.remedy.installSkillLink": "mattpocock/skills repository",
821
+ "env.skills.title": "Install all skills",
822
+ "env.skills.detail": "Missing {count} required skills: {skills}",
794
823
  "env.remedy.initWorkspaceSummary": "Have the current session run {skill} to initialize the workspace as the panel expects.",
795
824
  "env.remedy.initWorkspacePrompt": "Initialize the current workspace. The environment check \u201C{title}\u201D failed: {detail}.",
796
825
  "env.remedy.initWorkspaceOutro": "Tell me when the skill finishes initialization and I will recheck.",
@@ -950,6 +979,9 @@ var en = {
950
979
  "detail.comments": "{count} comments",
951
980
  "detail.loading": "Loading ticket details\u2026",
952
981
  "detail.loadFailed": "Failed to load ticket details.",
982
+ "detail.refresh": "Refresh ticket",
983
+ "detail.refreshing": "Refreshing ticket\u2026",
984
+ "detail.refreshFailed": "Refresh failed: {detail}",
953
985
  "detail.bodyLabel": "Body",
954
986
  "detail.noBody": "This ticket has no body.",
955
987
  "detail.attachment.loading": "Loading image: {name}",
@@ -1698,7 +1730,7 @@ function disposerOf(handle) {
1698
1730
  }
1699
1731
 
1700
1732
  // src/client/task-panel.tsx
1701
- var React41 = __toESM(require("react"), 1);
1733
+ var React42 = __toESM(require("react"), 1);
1702
1734
 
1703
1735
  // src/client/action-bar.tsx
1704
1736
  var React5 = __toESM(require("react"), 1);
@@ -2649,7 +2681,7 @@ function DraftAction(props) {
2649
2681
  }
2650
2682
 
2651
2683
  // src/client/env-check-view.tsx
2652
- var React8 = __toESM(require("react"), 1);
2684
+ var React9 = __toESM(require("react"), 1);
2653
2685
 
2654
2686
  // src/client/env-capabilities.tsx
2655
2687
  var React6 = __toESM(require("react"), 1);
@@ -2678,18 +2710,28 @@ var ENV_BODY_STYLE = {
2678
2710
  overflow: "auto",
2679
2711
  padding: "0 12px 12px"
2680
2712
  };
2681
- var ENV_CARD_STYLE = {
2682
- display: "grid",
2683
- gridTemplateColumns: "auto minmax(0, 1fr)",
2684
- columnGap: 10,
2685
- rowGap: 4,
2686
- alignItems: "start",
2713
+ var CARD_SURFACE_STYLE = {
2687
2714
  padding: "9px 12px",
2688
2715
  border: `1px solid ${COLORS.border}`,
2689
2716
  borderRadius: 10,
2690
2717
  background: COLORS.surface,
2691
2718
  color: COLORS.text
2692
2719
  };
2720
+ var ENV_SECTION_STYLE = {
2721
+ ...CARD_SURFACE_STYLE,
2722
+ display: "flex",
2723
+ flexDirection: "column",
2724
+ alignItems: "flex-start",
2725
+ gap: 4
2726
+ };
2727
+ var ENV_CARD_STYLE = {
2728
+ ...CARD_SURFACE_STYLE,
2729
+ display: "grid",
2730
+ gridTemplateColumns: "auto minmax(0, 1fr)",
2731
+ columnGap: 10,
2732
+ rowGap: 4,
2733
+ alignItems: "start"
2734
+ };
2693
2735
  var ENV_CARD_HIGHLIGHT_STYLE = {
2694
2736
  borderColor: COLORS.accent,
2695
2737
  boxShadow: `0 0 0 1px ${COLORS.accent}`
@@ -2980,6 +3022,9 @@ var CLI = {
2980
3022
  }
2981
3023
  };
2982
3024
  var SKILLS_REPO = "https://github.com/mattpocock/skills";
3025
+ function skillsRepoLink(t2) {
3026
+ return { href: SKILLS_REPO, label: t2("env.remedy.installSkillLink") };
3027
+ }
2983
3028
  function cliOf(subject) {
2984
3029
  return subject === "github" || subject === "gitlab" || subject === "gitea" ? CLI[subject] : void 0;
2985
3030
  }
@@ -3033,9 +3078,9 @@ var REMEDIES = {
3033
3078
  summary: t2("env.remedy.installSkillSummary", { skill }),
3034
3079
  action: {
3035
3080
  kind: "session",
3036
- prompt: t2("env.remedy.installSkillPrompt", { skill, title: context.title })
3081
+ prompt: t2("env.remedy.installSkillPrompt", { skill })
3037
3082
  },
3038
- link: { href: SKILLS_REPO, label: t2("env.remedy.installSkillLink") }
3083
+ link: skillsRepoLink(t2)
3039
3084
  };
3040
3085
  },
3041
3086
  "init-workspace": (context, t2) => ({
@@ -3100,6 +3145,17 @@ var REMEDIES = {
3100
3145
  function remedyContent(code, context, t2) {
3101
3146
  return REMEDIES[code](context, t2);
3102
3147
  }
3148
+ function installSkillsContent(skills, t2) {
3149
+ const list = skills.map((skill) => `- ${skill}`).join("\n");
3150
+ return {
3151
+ summary: t2("env.remedy.installSkillsSummary", { count: skills.length }),
3152
+ action: {
3153
+ kind: "session",
3154
+ prompt: t2("env.remedy.installSkillsPrompt", { skills: list })
3155
+ },
3156
+ link: skillsRepoLink(t2)
3157
+ };
3158
+ }
3103
3159
 
3104
3160
  // src/client/env-remedy-view.tsx
3105
3161
  function RemedySection(props) {
@@ -3117,17 +3173,20 @@ function RemedySection(props) {
3117
3173
  },
3118
3174
  t2
3119
3175
  );
3120
- return /* @__PURE__ */ React7.createElement("div", { "data-testid": "env-remedy", "data-code": remedy.code, style: ENV_REMEDY_STYLE }, /* @__PURE__ */ React7.createElement("div", { "data-testid": "env-remedy-summary", style: ENV_DETAIL_STYLE }, content.summary), /* @__PURE__ */ React7.createElement(RemedyActionView, { action: content.action, handlers: props.handlers }), content.link === void 0 ? null : /* @__PURE__ */ React7.createElement(
3176
+ return /* @__PURE__ */ React7.createElement("div", { "data-testid": "env-remedy", "data-code": remedy.code, style: ENV_REMEDY_STYLE }, /* @__PURE__ */ React7.createElement("div", { "data-testid": "env-remedy-summary", style: ENV_DETAIL_STYLE }, content.summary), /* @__PURE__ */ React7.createElement(RemedyActionView, { action: content.action, handlers: props.handlers }), content.link === void 0 ? null : /* @__PURE__ */ React7.createElement(RemedyLink, { href: content.link.href, label: content.link.label }));
3177
+ }
3178
+ function RemedyLink(props) {
3179
+ return /* @__PURE__ */ React7.createElement(
3121
3180
  "a",
3122
3181
  {
3123
3182
  "data-testid": "env-remedy-link",
3124
- href: content.link.href,
3183
+ href: props.href,
3125
3184
  target: "_blank",
3126
3185
  rel: "noreferrer",
3127
3186
  style: ENV_REMEDY_LINK_STYLE
3128
3187
  },
3129
- content.link.label
3130
- ));
3188
+ props.label
3189
+ );
3131
3190
  }
3132
3191
  function RemedyActionView(props) {
3133
3192
  const { t: t2 } = useI18n();
@@ -3223,6 +3282,23 @@ async function copyText(text) {
3223
3282
  }
3224
3283
  }
3225
3284
 
3285
+ // src/client/env-skill-batch.tsx
3286
+ var React8 = __toESM(require("react"), 1);
3287
+ function missingSkills(items) {
3288
+ return items.flatMap(
3289
+ (item) => item.id === ENV_CHECK_IDS.skill && item.status === "fail" && item.subject !== null ? [item.subject] : []
3290
+ );
3291
+ }
3292
+ function SkillBatchCard(props) {
3293
+ const { t: t2 } = useI18n();
3294
+ if (props.skills.length < 2) return null;
3295
+ const content = installSkillsContent(props.skills, t2);
3296
+ return /* @__PURE__ */ React8.createElement("section", { "data-testid": "env-skill-batch", style: ENV_SECTION_STYLE }, /* @__PURE__ */ React8.createElement("div", { "data-testid": "env-skill-batch-title", style: ENV_TITLE_STYLE }, t2("env.skills.title")), /* @__PURE__ */ React8.createElement("div", { "data-testid": "env-skill-batch-detail", style: ENV_DETAIL_STYLE }, t2("env.skills.detail", {
3297
+ count: props.skills.length,
3298
+ skills: props.skills.join(t2("common.listSeparator"))
3299
+ })), /* @__PURE__ */ React8.createElement("div", { "data-testid": "env-skill-batch-summary", style: ENV_DETAIL_STYLE }, content.summary), /* @__PURE__ */ React8.createElement(SessionAction, { prompt: content.action.prompt, injection: props.injection }), /* @__PURE__ */ React8.createElement(RemedyLink, { href: content.link.href, label: content.link.label }));
3300
+ }
3301
+
3226
3302
  // src/client/relative-time.ts
3227
3303
  function formatRelativeTime(value, now, t2) {
3228
3304
  const timestamp2 = typeof value === "number" ? value : Date.parse(value);
@@ -3243,16 +3319,8 @@ var STATUS_KEYS = {
3243
3319
  skipped: "env.status.skipped"
3244
3320
  };
3245
3321
  var ENV_CACHE_SECTION_STYLE = {
3246
- display: "flex",
3247
- flexDirection: "column",
3248
- alignItems: "flex-start",
3249
- gap: 4,
3250
- margin: "0 12px 12px",
3251
- padding: "9px 12px",
3252
- border: `1px solid ${COLORS.border}`,
3253
- borderRadius: 10,
3254
- background: COLORS.surface,
3255
- color: COLORS.text
3322
+ ...ENV_SECTION_STYLE,
3323
+ margin: "0 12px 12px"
3256
3324
  };
3257
3325
  var ENV_CACHE_ERROR_STYLE = {
3258
3326
  color: COLORS.error,
@@ -3272,16 +3340,16 @@ function EnvCheckView(props) {
3272
3340
  busy,
3273
3341
  onRetry: recheck
3274
3342
  };
3275
- return /* @__PURE__ */ React8.createElement(
3343
+ return /* @__PURE__ */ React9.createElement(
3276
3344
  "div",
3277
3345
  {
3278
3346
  "data-testid": "env-check-view",
3279
3347
  style: { display: "flex", flexDirection: "column", flex: 1, minHeight: 0 }
3280
3348
  },
3281
- /* @__PURE__ */ React8.createElement("header", { style: ENV_HEADER_STYLE }, /* @__PURE__ */ React8.createElement("span", { "data-testid": "env-summary", style: ENV_SUMMARY_STYLE }, t2("env.summary", {
3349
+ /* @__PURE__ */ React9.createElement("header", { style: ENV_HEADER_STYLE }, /* @__PURE__ */ React9.createElement("span", { "data-testid": "env-summary", style: ENV_SUMMARY_STYLE }, t2("env.summary", {
3282
3350
  pass: report?.items.filter((item) => item.status === "pass").length ?? 0,
3283
3351
  total: report?.items.length ?? 0
3284
- })), /* @__PURE__ */ React8.createElement("span", { "data-testid": "env-backend", style: ENV_BACKEND_STYLE }, envBackendLabel(report?.backend ?? null, t2)), /* @__PURE__ */ React8.createElement(
3352
+ })), /* @__PURE__ */ React9.createElement("span", { "data-testid": "env-backend", style: ENV_BACKEND_STYLE }, envBackendLabel(report?.backend ?? null, t2)), /* @__PURE__ */ React9.createElement(
3285
3353
  "button",
3286
3354
  {
3287
3355
  type: "button",
@@ -3293,7 +3361,7 @@ function EnvCheckView(props) {
3293
3361
  },
3294
3362
  busy ? t2("env.checking") : t2("env.recheck")
3295
3363
  )),
3296
- error === null ? null : /* @__PURE__ */ React8.createElement(
3364
+ error === null ? null : /* @__PURE__ */ React9.createElement(
3297
3365
  ErrorAlert,
3298
3366
  {
3299
3367
  error,
@@ -3302,8 +3370,8 @@ function EnvCheckView(props) {
3302
3370
  onRetry: recheck
3303
3371
  }
3304
3372
  ),
3305
- report === null && phase === "loading" ? /* @__PURE__ */ React8.createElement("div", { "data-testid": "env-loading", style: EMPTY_STYLE }, t2("env.loading")) : null,
3306
- report === null ? null : /* @__PURE__ */ React8.createElement("div", { style: ENV_BODY_STYLE }, /* @__PURE__ */ React8.createElement(
3373
+ report === null && phase === "loading" ? /* @__PURE__ */ React9.createElement("div", { "data-testid": "env-loading", style: EMPTY_STYLE }, t2("env.loading")) : null,
3374
+ report === null ? null : /* @__PURE__ */ React9.createElement("div", { style: ENV_BODY_STYLE }, /* @__PURE__ */ React9.createElement(SkillBatchCard, { skills: missingSkills(report.items), injection: props.injection }), /* @__PURE__ */ React9.createElement(
3307
3375
  ItemList,
3308
3376
  {
3309
3377
  report,
@@ -3312,17 +3380,17 @@ function EnvCheckView(props) {
3312
3380
  onJump: jumpTo,
3313
3381
  handlers
3314
3382
  }
3315
- ), /* @__PURE__ */ React8.createElement(CapabilityPanel, { capabilities })),
3316
- props.workspaceRoot === void 0 ? null : /* @__PURE__ */ React8.createElement(CacheSection, { state: cache })
3383
+ ), /* @__PURE__ */ React9.createElement(CapabilityPanel, { capabilities })),
3384
+ props.workspaceRoot === void 0 ? null : /* @__PURE__ */ React9.createElement(CacheSection, { state: cache })
3317
3385
  );
3318
3386
  }
3319
3387
  function useSnapshotCache(client, workspaceRoot) {
3320
3388
  const { t: t2 } = useI18n();
3321
- const [info, setInfo] = React8.useState(null);
3322
- const [error, setError] = React8.useState(null);
3323
- const [notice, setNotice] = React8.useState(null);
3324
- const [busy, setBusy] = React8.useState(false);
3325
- const load = React8.useCallback(async () => {
3389
+ const [info, setInfo] = React9.useState(null);
3390
+ const [error, setError] = React9.useState(null);
3391
+ const [notice, setNotice] = React9.useState(null);
3392
+ const [busy, setBusy] = React9.useState(false);
3393
+ const load = React9.useCallback(async () => {
3326
3394
  if (workspaceRoot === void 0) return;
3327
3395
  const result = await requestCache(client, workspaceRoot, false, t2);
3328
3396
  if (!result.ok) {
@@ -3331,13 +3399,13 @@ function useSnapshotCache(client, workspaceRoot) {
3331
3399
  }
3332
3400
  setInfo(result.result);
3333
3401
  }, [client, workspaceRoot, t2]);
3334
- React8.useEffect(() => {
3402
+ React9.useEffect(() => {
3335
3403
  setInfo(null);
3336
3404
  setError(null);
3337
3405
  setNotice(null);
3338
3406
  void load();
3339
3407
  }, [load]);
3340
- const clearAsync = React8.useCallback(async () => {
3408
+ const clearAsync = React9.useCallback(async () => {
3341
3409
  if (workspaceRoot === void 0) return;
3342
3410
  setBusy(true);
3343
3411
  setError(null);
@@ -3351,7 +3419,7 @@ function useSnapshotCache(client, workspaceRoot) {
3351
3419
  setNotice(result.result.cleared);
3352
3420
  await load();
3353
3421
  }, [client, workspaceRoot, load, t2]);
3354
- const clear = React8.useCallback(() => {
3422
+ const clear = React9.useCallback(() => {
3355
3423
  void clearAsync();
3356
3424
  }, [clearAsync]);
3357
3425
  return { info, error, notice, busy, clear };
@@ -3373,9 +3441,9 @@ async function requestCache(client, workspaceRoot, clear, t2) {
3373
3441
  function CacheSection(props) {
3374
3442
  const { t: t2 } = useI18n();
3375
3443
  const info = props.state.info;
3376
- return /* @__PURE__ */ React8.createElement("section", { "data-testid": "env-cache", style: ENV_CACHE_SECTION_STYLE }, /* @__PURE__ */ React8.createElement("div", { style: ENV_TITLE_STYLE }, t2("env.cache.title")), /* @__PURE__ */ React8.createElement("div", { "data-testid": "env-cache-location", style: ENV_DETAIL_STYLE }, info === null ? t2("env.cache.loading") : info.location), /* @__PURE__ */ React8.createElement("div", { "data-testid": "env-cache-entries", style: ENV_DETAIL_STYLE }, info === null ? t2("env.cache.entriesUnknown") : t2("env.cache.entries", { count: info.entries })), /* @__PURE__ */ React8.createElement("div", { "data-testid": "env-cache-written", style: ENV_DETAIL_STYLE }, info === null ? t2("env.cache.writtenUnknown") : info.lastWrittenAt === null ? t2("env.cache.neverWritten") : t2("env.cache.lastWritten", {
3444
+ return /* @__PURE__ */ React9.createElement("section", { "data-testid": "env-cache", style: ENV_CACHE_SECTION_STYLE }, /* @__PURE__ */ React9.createElement("div", { style: ENV_TITLE_STYLE }, t2("env.cache.title")), /* @__PURE__ */ React9.createElement("div", { "data-testid": "env-cache-location", style: ENV_DETAIL_STYLE }, info === null ? t2("env.cache.loading") : info.location), /* @__PURE__ */ React9.createElement("div", { "data-testid": "env-cache-entries", style: ENV_DETAIL_STYLE }, info === null ? t2("env.cache.entriesUnknown") : t2("env.cache.entries", { count: info.entries })), /* @__PURE__ */ React9.createElement("div", { "data-testid": "env-cache-written", style: ENV_DETAIL_STYLE }, info === null ? t2("env.cache.writtenUnknown") : info.lastWrittenAt === null ? t2("env.cache.neverWritten") : t2("env.cache.lastWritten", {
3377
3445
  time: formatRelativeTime(info.lastWrittenAt, Date.now(), t2)
3378
- })), /* @__PURE__ */ React8.createElement(
3446
+ })), /* @__PURE__ */ React9.createElement(
3379
3447
  "button",
3380
3448
  {
3381
3449
  type: "button",
@@ -3386,15 +3454,15 @@ function CacheSection(props) {
3386
3454
  style: BUTTON_STYLE
3387
3455
  },
3388
3456
  props.state.busy ? t2("env.cache.clearing") : t2("env.cache.clear")
3389
- ), props.state.notice === null ? null : /* @__PURE__ */ React8.createElement("div", { "data-testid": "env-cache-notice", style: ENV_SKIP_STYLE }, t2("env.cache.cleared", { count: props.state.notice })), props.state.error === null ? null : /* @__PURE__ */ React8.createElement("div", { role: "alert", "data-testid": "env-cache-error", style: ENV_CACHE_ERROR_STYLE }, props.state.error.message));
3457
+ ), props.state.notice === null ? null : /* @__PURE__ */ React9.createElement("div", { "data-testid": "env-cache-notice", style: ENV_SKIP_STYLE }, t2("env.cache.cleared", { count: props.state.notice })), props.state.error === null ? null : /* @__PURE__ */ React9.createElement("div", { role: "alert", "data-testid": "env-cache-error", style: ENV_CACHE_ERROR_STYLE }, props.state.error.message));
3390
3458
  }
3391
3459
  function useEnvCheckRequest(client, workspaceRoot) {
3392
3460
  const { t: t2 } = useI18n();
3393
- const [report, setReport] = React8.useState(null);
3394
- const [error, setError] = React8.useState(null);
3395
- const [phase, setPhase] = React8.useState("loading");
3396
- const sequence = React8.useRef(0);
3397
- const request = React8.useCallback(
3461
+ const [report, setReport] = React9.useState(null);
3462
+ const [error, setError] = React9.useState(null);
3463
+ const [phase, setPhase] = React9.useState("loading");
3464
+ const sequence = React9.useRef(0);
3465
+ const request = React9.useCallback(
3398
3466
  async (keepResult) => {
3399
3467
  const current = sequence.current + 1;
3400
3468
  sequence.current = current;
@@ -3419,32 +3487,32 @@ function useEnvCheckRequest(client, workspaceRoot) {
3419
3487
  },
3420
3488
  [client, workspaceRoot, t2]
3421
3489
  );
3422
- React8.useEffect(() => {
3490
+ React9.useEffect(() => {
3423
3491
  setReport(null);
3424
3492
  setError(null);
3425
3493
  void request(false);
3426
3494
  }, [request]);
3427
- const recheck = React8.useCallback(() => {
3495
+ const recheck = React9.useCallback(() => {
3428
3496
  if (phase === "loading" || phase === "refreshing") return;
3429
3497
  void request(true);
3430
3498
  }, [phase, request]);
3431
3499
  return { report, error, phase, recheck };
3432
3500
  }
3433
3501
  function useFocusBackend(report, backend, jumpTo) {
3434
- React8.useEffect(() => {
3502
+ React9.useEffect(() => {
3435
3503
  if (report === null || backend === null) return;
3436
3504
  const target = report.items.find((item) => item.status === "fail" && item.subject === backend);
3437
3505
  if (target !== void 0) jumpTo(target);
3438
3506
  }, [report, backend, jumpTo]);
3439
3507
  }
3440
3508
  function useRootCauseJump() {
3441
- const cards = React8.useRef(/* @__PURE__ */ new Map());
3442
- const [highlighted, setHighlighted] = React8.useState(null);
3443
- const registerCard = React8.useCallback((key, node) => {
3509
+ const cards = React9.useRef(/* @__PURE__ */ new Map());
3510
+ const [highlighted, setHighlighted] = React9.useState(null);
3511
+ const registerCard = React9.useCallback((key, node) => {
3444
3512
  if (node === null) cards.current.delete(key);
3445
3513
  else cards.current.set(key, node);
3446
3514
  }, []);
3447
- const jumpTo = React8.useCallback((target) => {
3515
+ const jumpTo = React9.useCallback((target) => {
3448
3516
  const key = refKey(target);
3449
3517
  const node = cards.current.get(key);
3450
3518
  if (node === void 0) return;
@@ -3452,7 +3520,7 @@ function useRootCauseJump() {
3452
3520
  node.focus();
3453
3521
  setHighlighted(key);
3454
3522
  }, []);
3455
- React8.useEffect(() => {
3523
+ React9.useEffect(() => {
3456
3524
  if (highlighted === null) return void 0;
3457
3525
  const timer = window.setTimeout(() => {
3458
3526
  setHighlighted(null);
@@ -3468,7 +3536,7 @@ function refKey(ref) {
3468
3536
  }
3469
3537
  function ErrorAlert(props) {
3470
3538
  const { t: t2 } = useI18n();
3471
- return /* @__PURE__ */ React8.createElement("div", { role: "alert", "data-testid": "env-error", style: ERROR_STYLE }, /* @__PURE__ */ React8.createElement("div", null, props.error.message), props.canRetry ? /* @__PURE__ */ React8.createElement(
3539
+ return /* @__PURE__ */ React9.createElement("div", { role: "alert", "data-testid": "env-error", style: ERROR_STYLE }, /* @__PURE__ */ React9.createElement("div", null, props.error.message), props.canRetry ? /* @__PURE__ */ React9.createElement(
3472
3540
  "button",
3473
3541
  {
3474
3542
  type: "button",
@@ -3481,7 +3549,7 @@ function ErrorAlert(props) {
3481
3549
  ) : null);
3482
3550
  }
3483
3551
  function ItemList(props) {
3484
- return /* @__PURE__ */ React8.createElement(
3552
+ return /* @__PURE__ */ React9.createElement(
3485
3553
  "div",
3486
3554
  {
3487
3555
  role: "list",
@@ -3490,7 +3558,7 @@ function ItemList(props) {
3490
3558
  },
3491
3559
  props.report.items.map((item) => {
3492
3560
  const key = refKey(item);
3493
- return /* @__PURE__ */ React8.createElement("div", { role: "listitem", key }, /* @__PURE__ */ React8.createElement(
3561
+ return /* @__PURE__ */ React9.createElement("div", { role: "listitem", key }, /* @__PURE__ */ React9.createElement(
3494
3562
  ItemCard,
3495
3563
  {
3496
3564
  item,
@@ -3514,7 +3582,7 @@ function ItemCard(props) {
3514
3582
  (candidate) => candidate.id === blockedBy.id && candidate.subject === blockedBy.subject
3515
3583
  );
3516
3584
  const blockerTitle = blocker === void 0 ? null : envCheckTitle(blocker, t2);
3517
- return /* @__PURE__ */ React8.createElement(
3585
+ return /* @__PURE__ */ React9.createElement(
3518
3586
  "div",
3519
3587
  {
3520
3588
  ref: (node) => {
@@ -3531,8 +3599,8 @@ function ItemCard(props) {
3531
3599
  ...props.highlighted ? ENV_CARD_HIGHLIGHT_STYLE : void 0
3532
3600
  }
3533
3601
  },
3534
- /* @__PURE__ */ React8.createElement(StatusIcon, { status: item.status }),
3535
- /* @__PURE__ */ React8.createElement("div", { style: { minWidth: 0 } }, /* @__PURE__ */ React8.createElement("div", { "data-testid": "env-item-title", style: ENV_TITLE_STYLE }, envCheckTitle(item, t2)), /* @__PURE__ */ React8.createElement("div", { "data-testid": "env-item-detail", style: ENV_DETAIL_STYLE }, item.detail), item.status === "fail" ? /* @__PURE__ */ React8.createElement(RemedySection, { item, report: props.report, handlers: props.handlers }) : null, blockerTitle === null || blockedBy === null ? null : /* @__PURE__ */ React8.createElement("div", { "data-testid": "env-item-blocked", style: ENV_SKIP_STYLE }, t2("env.blockedBy", { title: blockerTitle }), /* @__PURE__ */ React8.createElement(
3602
+ /* @__PURE__ */ React9.createElement(StatusIcon, { status: item.status }),
3603
+ /* @__PURE__ */ React9.createElement("div", { style: { minWidth: 0 } }, /* @__PURE__ */ React9.createElement("div", { "data-testid": "env-item-title", style: ENV_TITLE_STYLE }, envCheckTitle(item, t2)), /* @__PURE__ */ React9.createElement("div", { "data-testid": "env-item-detail", style: ENV_DETAIL_STYLE }, item.detail), item.status === "fail" ? /* @__PURE__ */ React9.createElement(RemedySection, { item, report: props.report, handlers: props.handlers }) : null, blockerTitle === null || blockedBy === null ? null : /* @__PURE__ */ React9.createElement("div", { "data-testid": "env-item-blocked", style: ENV_SKIP_STYLE }, t2("env.blockedBy", { title: blockerTitle }), /* @__PURE__ */ React9.createElement(
3536
3604
  "button",
3537
3605
  {
3538
3606
  type: "button",
@@ -3551,7 +3619,7 @@ function StatusIcon(props) {
3551
3619
  const { t: t2 } = useI18n();
3552
3620
  const color = ENV_STATUS_COLORS[props.status];
3553
3621
  const path = props.status === "pass" ? "M4.5 8.5l2.5 2.5 4.5-5" : props.status === "fail" ? "M5 5l6 6M11 5l-6 6" : "M4.5 8h7";
3554
- return /* @__PURE__ */ React8.createElement(
3622
+ return /* @__PURE__ */ React9.createElement(
3555
3623
  "svg",
3556
3624
  {
3557
3625
  width: "16",
@@ -3562,13 +3630,13 @@ function StatusIcon(props) {
3562
3630
  "aria-label": t2(STATUS_KEYS[props.status]),
3563
3631
  style: { color, flex: "none", marginTop: 1 }
3564
3632
  },
3565
- /* @__PURE__ */ React8.createElement("circle", { cx: "8", cy: "8", r: "6.25", stroke: "currentColor", strokeWidth: "1.3" }),
3566
- /* @__PURE__ */ React8.createElement("path", { d: path, stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", fill: "none" })
3633
+ /* @__PURE__ */ React9.createElement("circle", { cx: "8", cy: "8", r: "6.25", stroke: "currentColor", strokeWidth: "1.3" }),
3634
+ /* @__PURE__ */ React9.createElement("path", { d: path, stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", fill: "none" })
3567
3635
  );
3568
3636
  }
3569
3637
 
3570
3638
  // src/client/help-view.tsx
3571
- var React9 = __toESM(require("react"), 1);
3639
+ var React10 = __toESM(require("react"), 1);
3572
3640
 
3573
3641
  // src/client/help-flow.ts
3574
3642
  var STOPPING_COMMAND_NODE = { command: null, state: null, note: null, stops: true };
@@ -3822,15 +3890,15 @@ var STOP_DOT_STYLE = {
3822
3890
  var DIAGRAM_MAX_WIDTH = 360;
3823
3891
  function HelpView(props) {
3824
3892
  const { t: t2 } = useI18n();
3825
- const [activeId, setActiveId] = React9.useState(HELP_DIAGRAMS[0]?.id ?? "");
3893
+ const [activeId, setActiveId] = React10.useState(HELP_DIAGRAMS[0]?.id ?? "");
3826
3894
  const active = HELP_DIAGRAMS.find((diagram) => diagram.id === activeId) ?? HELP_DIAGRAMS[0];
3827
- return /* @__PURE__ */ React9.createElement(
3895
+ return /* @__PURE__ */ React10.createElement(
3828
3896
  "div",
3829
3897
  {
3830
3898
  "data-testid": "help-view",
3831
3899
  style: { display: "flex", flexDirection: "column", flex: 1, minHeight: 0 }
3832
3900
  },
3833
- /* @__PURE__ */ React9.createElement(
3901
+ /* @__PURE__ */ React10.createElement(
3834
3902
  "header",
3835
3903
  {
3836
3904
  style: {
@@ -3842,10 +3910,10 @@ function HelpView(props) {
3842
3910
  borderBottom: `1px solid ${COLORS.border}`
3843
3911
  }
3844
3912
  },
3845
- /* @__PURE__ */ React9.createElement("button", { type: "button", "data-testid": "help-back", onClick: props.onBack, style: BUTTON_STYLE }, t2("common.back")),
3846
- /* @__PURE__ */ React9.createElement("span", { style: { fontSize: 13, fontWeight: 600 } }, t2("view.help"))
3913
+ /* @__PURE__ */ React10.createElement("button", { type: "button", "data-testid": "help-back", onClick: props.onBack, style: BUTTON_STYLE }, t2("common.back")),
3914
+ /* @__PURE__ */ React10.createElement("span", { style: { fontSize: 13, fontWeight: 600 } }, t2("view.help"))
3847
3915
  ),
3848
- /* @__PURE__ */ React9.createElement(
3916
+ /* @__PURE__ */ React10.createElement(
3849
3917
  "div",
3850
3918
  {
3851
3919
  style: {
@@ -3858,8 +3926,8 @@ function HelpView(props) {
3858
3926
  padding: "12px 12px 16px"
3859
3927
  }
3860
3928
  },
3861
- /* @__PURE__ */ React9.createElement("p", { style: { margin: 0, color: COLORS.secondary, fontSize: 12, lineHeight: 1.6 } }, t2("help.intro")),
3862
- /* @__PURE__ */ React9.createElement(
3929
+ /* @__PURE__ */ React10.createElement("p", { style: { margin: 0, color: COLORS.secondary, fontSize: 12, lineHeight: 1.6 } }, t2("help.intro")),
3930
+ /* @__PURE__ */ React10.createElement(
3863
3931
  ScenarioTabs,
3864
3932
  {
3865
3933
  activeId: active?.id,
@@ -3868,7 +3936,7 @@ function HelpView(props) {
3868
3936
  }
3869
3937
  }
3870
3938
  ),
3871
- active === void 0 ? null : /* @__PURE__ */ React9.createElement(
3939
+ active === void 0 ? null : /* @__PURE__ */ React10.createElement(
3872
3940
  "div",
3873
3941
  {
3874
3942
  id: "flow-diagrams",
@@ -3884,15 +3952,15 @@ function HelpView(props) {
3884
3952
  borderRadius: 10
3885
3953
  }
3886
3954
  },
3887
- /* @__PURE__ */ React9.createElement(Diagram, { key: active.id, diagram: active }),
3888
- /* @__PURE__ */ React9.createElement(Legend, null)
3955
+ /* @__PURE__ */ React10.createElement(Diagram, { key: active.id, diagram: active }),
3956
+ /* @__PURE__ */ React10.createElement(Legend, null)
3889
3957
  )
3890
3958
  )
3891
3959
  );
3892
3960
  }
3893
3961
  function ScenarioTabs(props) {
3894
3962
  const { t: t2 } = useI18n();
3895
- return /* @__PURE__ */ React9.createElement(
3963
+ return /* @__PURE__ */ React10.createElement(
3896
3964
  "div",
3897
3965
  {
3898
3966
  role: "tablist",
@@ -3901,7 +3969,7 @@ function ScenarioTabs(props) {
3901
3969
  },
3902
3970
  HELP_DIAGRAMS.map((diagram) => {
3903
3971
  const selected = diagram.id === props.activeId;
3904
- return /* @__PURE__ */ React9.createElement(
3972
+ return /* @__PURE__ */ React10.createElement(
3905
3973
  "button",
3906
3974
  {
3907
3975
  key: diagram.id,
@@ -3924,7 +3992,7 @@ function ScenarioTabs(props) {
3924
3992
  }
3925
3993
  function Legend() {
3926
3994
  const { t: t2 } = useI18n();
3927
- return /* @__PURE__ */ React9.createElement(
3995
+ return /* @__PURE__ */ React10.createElement(
3928
3996
  "div",
3929
3997
  {
3930
3998
  "data-testid": "flow-legend",
@@ -3939,13 +4007,13 @@ function Legend() {
3939
4007
  fontSize: 11
3940
4008
  }
3941
4009
  },
3942
- /* @__PURE__ */ React9.createElement("span", { "data-testid": "legend-plugin", style: LEGEND_ITEM_STYLE }, /* @__PURE__ */ React9.createElement(Swatch, { color: COLORS.accent, filled: true }), t2("help.legend.plugin")),
3943
- /* @__PURE__ */ React9.createElement("span", { "data-testid": "legend-matt", style: LEGEND_ITEM_STYLE }, /* @__PURE__ */ React9.createElement(Swatch, { color: COLORS.borderStrong }), t2("help.legend.matt")),
3944
- /* @__PURE__ */ React9.createElement("span", { "data-testid": "legend-stop", style: LEGEND_ITEM_STYLE }, /* @__PURE__ */ React9.createElement("span", { style: STOP_DOT_STYLE }), t2("help.legend.stop"))
4010
+ /* @__PURE__ */ React10.createElement("span", { "data-testid": "legend-plugin", style: LEGEND_ITEM_STYLE }, /* @__PURE__ */ React10.createElement(Swatch, { color: COLORS.accent, filled: true }), t2("help.legend.plugin")),
4011
+ /* @__PURE__ */ React10.createElement("span", { "data-testid": "legend-matt", style: LEGEND_ITEM_STYLE }, /* @__PURE__ */ React10.createElement(Swatch, { color: COLORS.borderStrong }), t2("help.legend.matt")),
4012
+ /* @__PURE__ */ React10.createElement("span", { "data-testid": "legend-stop", style: LEGEND_ITEM_STYLE }, /* @__PURE__ */ React10.createElement("span", { style: STOP_DOT_STYLE }), t2("help.legend.stop"))
3945
4013
  );
3946
4014
  }
3947
4015
  function Swatch(props) {
3948
- return /* @__PURE__ */ React9.createElement(
4016
+ return /* @__PURE__ */ React10.createElement(
3949
4017
  "span",
3950
4018
  {
3951
4019
  style: {
@@ -3963,7 +4031,7 @@ function Diagram(props) {
3963
4031
  const { t: t2 } = useI18n();
3964
4032
  const layout = layoutDiagram(props.diagram);
3965
4033
  const markerId = `flow-arrow-${props.diagram.id}`;
3966
- return /* @__PURE__ */ React9.createElement("section", { style: { display: "flex", flexDirection: "column", gap: 10 } }, /* @__PURE__ */ React9.createElement("div", { style: { display: "flex", flexDirection: "column", gap: 3 } }, /* @__PURE__ */ React9.createElement("h3", { style: { margin: 0, fontSize: 13, fontWeight: 600, color: COLORS.text } }, t2(props.diagram.titleKey)), /* @__PURE__ */ React9.createElement("p", { style: { margin: 0, color: COLORS.secondary, fontSize: 12, lineHeight: 1.6 } }, t2(props.diagram.summaryKey))), /* @__PURE__ */ React9.createElement(
4034
+ return /* @__PURE__ */ React10.createElement("section", { style: { display: "flex", flexDirection: "column", gap: 10 } }, /* @__PURE__ */ React10.createElement("div", { style: { display: "flex", flexDirection: "column", gap: 3 } }, /* @__PURE__ */ React10.createElement("h3", { style: { margin: 0, fontSize: 13, fontWeight: 600, color: COLORS.text } }, t2(props.diagram.titleKey)), /* @__PURE__ */ React10.createElement("p", { style: { margin: 0, color: COLORS.secondary, fontSize: 12, lineHeight: 1.6 } }, t2(props.diagram.summaryKey))), /* @__PURE__ */ React10.createElement(
3967
4035
  "svg",
3968
4036
  {
3969
4037
  role: "img",
@@ -3977,7 +4045,7 @@ function Diagram(props) {
3977
4045
  margin: "0 auto"
3978
4046
  }
3979
4047
  },
3980
- /* @__PURE__ */ React9.createElement("defs", null, /* @__PURE__ */ React9.createElement(
4048
+ /* @__PURE__ */ React10.createElement("defs", null, /* @__PURE__ */ React10.createElement(
3981
4049
  "marker",
3982
4050
  {
3983
4051
  id: markerId,
@@ -3988,10 +4056,10 @@ function Diagram(props) {
3988
4056
  markerHeight: "6",
3989
4057
  orient: "auto-start-reverse"
3990
4058
  },
3991
- /* @__PURE__ */ React9.createElement("path", { d: "M0,0 L8,4 L0,8 z", fill: COLORS.borderStrong })
4059
+ /* @__PURE__ */ React10.createElement("path", { d: "M0,0 L8,4 L0,8 z", fill: COLORS.borderStrong })
3992
4060
  )),
3993
4061
  layout.rows.map(
3994
- (row, index) => row.frame === null ? null : /* @__PURE__ */ React9.createElement(
4062
+ (row, index) => row.frame === null ? null : /* @__PURE__ */ React10.createElement(
3995
4063
  "rect",
3996
4064
  {
3997
4065
  key: `frame-${String(index)}`,
@@ -4006,8 +4074,8 @@ function Diagram(props) {
4006
4074
  }
4007
4075
  )
4008
4076
  ),
4009
- /* @__PURE__ */ React9.createElement(Connectors, { rows: layout.rows, markerId }),
4010
- layout.rows.flatMap((row) => row.lines.flat()).map((placed, index) => /* @__PURE__ */ React9.createElement(NodeShape, { key: `${String(index)}-${placed.node.command ?? ""}`, placed }))
4077
+ /* @__PURE__ */ React10.createElement(Connectors, { rows: layout.rows, markerId }),
4078
+ layout.rows.flatMap((row) => row.lines.flat()).map((placed, index) => /* @__PURE__ */ React10.createElement(NodeShape, { key: `${String(index)}-${placed.node.command ?? ""}`, placed }))
4011
4079
  ));
4012
4080
  }
4013
4081
  function Connectors(props) {
@@ -4030,7 +4098,7 @@ function Connectors(props) {
4030
4098
  const end = to2[0];
4031
4099
  if (start === void 0 || end === void 0) continue;
4032
4100
  paths.push(
4033
- /* @__PURE__ */ React9.createElement(
4101
+ /* @__PURE__ */ React10.createElement(
4034
4102
  "line",
4035
4103
  {
4036
4104
  key: `line-${String(index)}`,
@@ -4047,7 +4115,7 @@ function Connectors(props) {
4047
4115
  continue;
4048
4116
  }
4049
4117
  const segments = [
4050
- ...from.map((point) => /* @__PURE__ */ React9.createElement(
4118
+ ...from.map((point) => /* @__PURE__ */ React10.createElement(
4051
4119
  "line",
4052
4120
  {
4053
4121
  key: `from-${String(index)}-${String(point.x)}`,
@@ -4059,7 +4127,7 @@ function Connectors(props) {
4059
4127
  strokeWidth: 1.2
4060
4128
  }
4061
4129
  )),
4062
- /* @__PURE__ */ React9.createElement(
4130
+ /* @__PURE__ */ React10.createElement(
4063
4131
  "line",
4064
4132
  {
4065
4133
  key: `bar-${String(index)}`,
@@ -4072,7 +4140,7 @@ function Connectors(props) {
4072
4140
  strokeLinecap: "round"
4073
4141
  }
4074
4142
  ),
4075
- ...to2.map((point) => /* @__PURE__ */ React9.createElement(
4143
+ ...to2.map((point) => /* @__PURE__ */ React10.createElement(
4076
4144
  "line",
4077
4145
  {
4078
4146
  key: `to-${String(index)}-${String(point.x)}`,
@@ -4086,9 +4154,9 @@ function Connectors(props) {
4086
4154
  }
4087
4155
  ))
4088
4156
  ];
4089
- paths.push(/* @__PURE__ */ React9.createElement("g", { key: `connector-${String(index)}` }, segments));
4157
+ paths.push(/* @__PURE__ */ React10.createElement("g", { key: `connector-${String(index)}` }, segments));
4090
4158
  }
4091
- return /* @__PURE__ */ React9.createElement("g", null, paths);
4159
+ return /* @__PURE__ */ React10.createElement("g", null, paths);
4092
4160
  }
4093
4161
  function edgePoints(row, side) {
4094
4162
  const y = side === "top" ? row.edgeTop : row.edgeBottom;
@@ -4106,14 +4174,14 @@ function NodeShape(props) {
4106
4174
  const centerX = placed.x + placed.width / 2;
4107
4175
  const label = command === null ? helpStateText(node, t2) : command.name;
4108
4176
  const plugin = command?.owner === "plugin";
4109
- return /* @__PURE__ */ React9.createElement(
4177
+ return /* @__PURE__ */ React10.createElement(
4110
4178
  "g",
4111
4179
  {
4112
4180
  "data-command": command?.name,
4113
4181
  "data-owner": command?.owner,
4114
4182
  "data-stops": node.stops ? "true" : "false"
4115
4183
  },
4116
- /* @__PURE__ */ React9.createElement(
4184
+ /* @__PURE__ */ React10.createElement(
4117
4185
  "rect",
4118
4186
  {
4119
4187
  x: placed.x,
@@ -4127,7 +4195,7 @@ function NodeShape(props) {
4127
4195
  strokeDasharray: command === null ? "3 3" : void 0
4128
4196
  }
4129
4197
  ),
4130
- /* @__PURE__ */ React9.createElement(
4198
+ /* @__PURE__ */ React10.createElement(
4131
4199
  "text",
4132
4200
  {
4133
4201
  x: centerX,
@@ -4139,7 +4207,7 @@ function NodeShape(props) {
4139
4207
  },
4140
4208
  label
4141
4209
  ),
4142
- node.note === null ? null : /* @__PURE__ */ React9.createElement(
4210
+ node.note === null ? null : /* @__PURE__ */ React10.createElement(
4143
4211
  "text",
4144
4212
  {
4145
4213
  x: centerX,
@@ -4150,7 +4218,7 @@ function NodeShape(props) {
4150
4218
  },
4151
4219
  t2(node.note)
4152
4220
  ),
4153
- node.stops ? /* @__PURE__ */ React9.createElement("circle", { cx: placed.x + placed.width, cy: placed.y, r: 3.5, fill: COLORS.warn }) : null
4221
+ node.stops ? /* @__PURE__ */ React10.createElement("circle", { cx: placed.x + placed.width, cy: placed.y, r: 3.5, fill: COLORS.warn }) : null
4154
4222
  );
4155
4223
  }
4156
4224
  function helpStateText(node, t2) {
@@ -4204,10 +4272,10 @@ function splitLines(nodes) {
4204
4272
  }
4205
4273
 
4206
4274
  // src/client/overview-view.tsx
4207
- var React15 = __toESM(require("react"), 1);
4275
+ var React16 = __toESM(require("react"), 1);
4208
4276
 
4209
4277
  // src/client/error-banner.tsx
4210
- var React10 = __toESM(require("react"), 1);
4278
+ var React11 = __toESM(require("react"), 1);
4211
4279
 
4212
4280
  // src/client/error-text.ts
4213
4281
  var ERROR_MESSAGES = {
@@ -4231,7 +4299,7 @@ function isEnvIssue(code) {
4231
4299
  // src/client/error-banner.tsx
4232
4300
  function ErrorBanner(props) {
4233
4301
  const { t: t2 } = useI18n();
4234
- return /* @__PURE__ */ React10.createElement("div", { role: "alert", "data-testid": "error", style: ERROR_STYLE }, /* @__PURE__ */ React10.createElement("div", null, errorText(props.error, t2)), isEnvIssue(props.error.code) ? /* @__PURE__ */ React10.createElement(
4302
+ return /* @__PURE__ */ React11.createElement("div", { role: "alert", "data-testid": "error", style: ERROR_STYLE }, /* @__PURE__ */ React11.createElement("div", null, errorText(props.error, t2)), isEnvIssue(props.error.code) ? /* @__PURE__ */ React11.createElement(
4235
4303
  "button",
4236
4304
  {
4237
4305
  type: "button",
@@ -4463,7 +4531,7 @@ var EMPTY_BAR_STYLE = {
4463
4531
  };
4464
4532
 
4465
4533
  // src/client/overview-charts.tsx
4466
- var React11 = __toESM(require("react"), 1);
4534
+ var React12 = __toESM(require("react"), 1);
4467
4535
 
4468
4536
  // src/client/overview-styles.ts
4469
4537
  var TIER_COLORS = {
@@ -4897,7 +4965,7 @@ function sampleNote(snapshot, t2) {
4897
4965
  function TierMeter(props) {
4898
4966
  const level = tierLevel(props.tier);
4899
4967
  const fill = props.tier === null ? COLORS.track : TIER_COLORS[props.tier];
4900
- return /* @__PURE__ */ React11.createElement("span", { role: "img", "aria-label": props.label, title: props.label, style: TIER_METER_STYLE }, [1, 2, 3].map((step) => /* @__PURE__ */ React11.createElement(
4968
+ return /* @__PURE__ */ React12.createElement("span", { role: "img", "aria-label": props.label, title: props.label, style: TIER_METER_STYLE }, [1, 2, 3].map((step) => /* @__PURE__ */ React12.createElement(
4901
4969
  "span",
4902
4970
  {
4903
4971
  key: step,
@@ -4913,11 +4981,11 @@ var CLOSED_COLOR = NEUTRAL_FILL;
4913
4981
  function FlowChart(props) {
4914
4982
  const { t: t2 } = useI18n();
4915
4983
  const { buckets } = props;
4916
- const [active, setActive] = React11.useState(null);
4984
+ const [active, setActive] = React12.useState(null);
4917
4985
  const hasClosed = buckets.some((bucket) => bucket.closed !== null);
4918
4986
  const peak = Math.max(1, ...buckets.map((bucket) => Math.max(bucket.opened, bucket.closed ?? 0)));
4919
4987
  const shown = buckets[active ?? buckets.length - 1];
4920
- return /* @__PURE__ */ React11.createElement("div", { "data-testid": "flow-chart", style: { display: "flex", flexDirection: "column", gap: 6 } }, /* @__PURE__ */ React11.createElement(FlowLegend, { hasClosed }), /* @__PURE__ */ React11.createElement(
4988
+ return /* @__PURE__ */ React12.createElement("div", { "data-testid": "flow-chart", style: { display: "flex", flexDirection: "column", gap: 6 } }, /* @__PURE__ */ React12.createElement(FlowLegend, { hasClosed }), /* @__PURE__ */ React12.createElement(
4921
4989
  "div",
4922
4990
  {
4923
4991
  style: { ...FLOW_PLOT_STYLE, marginTop: 14 },
@@ -4925,8 +4993,8 @@ function FlowChart(props) {
4925
4993
  setActive(null);
4926
4994
  }
4927
4995
  },
4928
- /* @__PURE__ */ React11.createElement("div", { "aria-hidden": "true", style: FLOW_PEAK_LINE_STYLE }, /* @__PURE__ */ React11.createElement("span", { style: FLOW_PEAK_LABEL_STYLE }, String(peak))),
4929
- buckets.map((bucket, index) => /* @__PURE__ */ React11.createElement(
4996
+ /* @__PURE__ */ React12.createElement("div", { "aria-hidden": "true", style: FLOW_PEAK_LINE_STYLE }, /* @__PURE__ */ React12.createElement("span", { style: FLOW_PEAK_LABEL_STYLE }, String(peak))),
4997
+ buckets.map((bucket, index) => /* @__PURE__ */ React12.createElement(
4930
4998
  "div",
4931
4999
  {
4932
5000
  key: bucket.start,
@@ -4947,7 +5015,7 @@ function FlowChart(props) {
4947
5015
  background: active === index ? COLORS.track : "transparent"
4948
5016
  }
4949
5017
  },
4950
- /* @__PURE__ */ React11.createElement(
5018
+ /* @__PURE__ */ React12.createElement(
4951
5019
  FlowBar,
4952
5020
  {
4953
5021
  value: bucket.opened,
@@ -4957,7 +5025,7 @@ function FlowChart(props) {
4957
5025
  index
4958
5026
  }
4959
5027
  ),
4960
- bucket.closed === null ? null : /* @__PURE__ */ React11.createElement(
5028
+ bucket.closed === null ? null : /* @__PURE__ */ React12.createElement(
4961
5029
  FlowBar,
4962
5030
  {
4963
5031
  value: bucket.closed,
@@ -4968,10 +5036,10 @@ function FlowChart(props) {
4968
5036
  }
4969
5037
  )
4970
5038
  ))
4971
- ), /* @__PURE__ */ React11.createElement("div", { "aria-hidden": "true", style: FLOW_AXIS_STYLE }, buckets.map((bucket, index) => /* @__PURE__ */ React11.createElement("span", { key: bucket.start, style: FLOW_AXIS_LABEL_STYLE }, axisLabel(bucket, buckets.length - 1 - index, t2)))), shown === void 0 ? null : /* @__PURE__ */ React11.createElement(FlowReadout, { bucket: shown }));
5039
+ ), /* @__PURE__ */ React12.createElement("div", { "aria-hidden": "true", style: FLOW_AXIS_STYLE }, buckets.map((bucket, index) => /* @__PURE__ */ React12.createElement("span", { key: bucket.start, style: FLOW_AXIS_LABEL_STYLE }, axisLabel(bucket, buckets.length - 1 - index, t2)))), shown === void 0 ? null : /* @__PURE__ */ React12.createElement(FlowReadout, { bucket: shown }));
4972
5040
  }
4973
5041
  function FlowBar(props) {
4974
- return /* @__PURE__ */ React11.createElement(
5042
+ return /* @__PURE__ */ React12.createElement(
4975
5043
  "span",
4976
5044
  {
4977
5045
  style: {
@@ -4986,12 +5054,12 @@ function FlowBar(props) {
4986
5054
  }
4987
5055
  function FlowLegend(props) {
4988
5056
  const { t: t2 } = useI18n();
4989
- return /* @__PURE__ */ React11.createElement("div", { style: LEGEND_STYLE }, /* @__PURE__ */ React11.createElement("span", { style: LEGEND_ITEM_STYLE2 }, /* @__PURE__ */ React11.createElement("span", { "aria-hidden": "true", style: { ...SERIES_KEY_STYLE, background: OPENED_COLOR } }), t2("overview.flow.opened")), props.hasClosed ? /* @__PURE__ */ React11.createElement("span", { style: LEGEND_ITEM_STYLE2 }, /* @__PURE__ */ React11.createElement("span", { "aria-hidden": "true", style: { ...SERIES_KEY_STYLE, background: CLOSED_COLOR } }), t2("overview.flow.closed")) : null);
5057
+ return /* @__PURE__ */ React12.createElement("div", { style: LEGEND_STYLE }, /* @__PURE__ */ React12.createElement("span", { style: LEGEND_ITEM_STYLE2 }, /* @__PURE__ */ React12.createElement("span", { "aria-hidden": "true", style: { ...SERIES_KEY_STYLE, background: OPENED_COLOR } }), t2("overview.flow.opened")), props.hasClosed ? /* @__PURE__ */ React12.createElement("span", { style: LEGEND_ITEM_STYLE2 }, /* @__PURE__ */ React12.createElement("span", { "aria-hidden": "true", style: { ...SERIES_KEY_STYLE, background: CLOSED_COLOR } }), t2("overview.flow.closed")) : null);
4990
5058
  }
4991
5059
  function FlowReadout(props) {
4992
5060
  const { t: t2 } = useI18n();
4993
5061
  const { bucket } = props;
4994
- return /* @__PURE__ */ React11.createElement("div", { "data-testid": "flow-readout", "aria-live": "polite", style: READOUT_STYLE }, /* @__PURE__ */ React11.createElement("span", null, flowRange(bucket)), /* @__PURE__ */ React11.createElement("span", null, /* @__PURE__ */ React11.createElement("span", { style: READOUT_VALUE_STYLE }, String(bucket.opened)), " ", t2("overview.flow.opened")), bucket.closed === null ? null : /* @__PURE__ */ React11.createElement("span", null, /* @__PURE__ */ React11.createElement("span", { style: READOUT_VALUE_STYLE }, String(bucket.closed)), " ", t2("overview.flow.closed")));
5062
+ return /* @__PURE__ */ React12.createElement("div", { "data-testid": "flow-readout", "aria-live": "polite", style: READOUT_STYLE }, /* @__PURE__ */ React12.createElement("span", null, flowRange(bucket)), /* @__PURE__ */ React12.createElement("span", null, /* @__PURE__ */ React12.createElement("span", { style: READOUT_VALUE_STYLE }, String(bucket.opened)), " ", t2("overview.flow.opened")), bucket.closed === null ? null : /* @__PURE__ */ React12.createElement("span", null, /* @__PURE__ */ React12.createElement("span", { style: READOUT_VALUE_STYLE }, String(bucket.closed)), " ", t2("overview.flow.closed")));
4995
5063
  }
4996
5064
  function axisLabel(bucket, weeksAgo, t2) {
4997
5065
  if (weeksAgo === 0) return t2("overview.flow.thisWeek");
@@ -5011,13 +5079,13 @@ function flowSummary(bucket, t2) {
5011
5079
  function AgeHistogram(props) {
5012
5080
  const { t: t2 } = useI18n();
5013
5081
  const peak = Math.max(1, ...props.buckets.map((bucket) => bucket.count));
5014
- return /* @__PURE__ */ React11.createElement("div", { "data-testid": "age-histogram", style: AGE_LIST_STYLE }, props.buckets.map((bucket) => /* @__PURE__ */ React11.createElement(React11.Fragment, { key: bucket.key }, /* @__PURE__ */ React11.createElement("span", { style: AGE_LABEL_STYLE }, bucket.label), /* @__PURE__ */ React11.createElement(
5082
+ return /* @__PURE__ */ React12.createElement("div", { "data-testid": "age-histogram", style: AGE_LIST_STYLE }, props.buckets.map((bucket) => /* @__PURE__ */ React12.createElement(React12.Fragment, { key: bucket.key }, /* @__PURE__ */ React12.createElement("span", { style: AGE_LABEL_STYLE }, bucket.label), /* @__PURE__ */ React12.createElement(
5015
5083
  "span",
5016
5084
  {
5017
5085
  style: AGE_TRACK_STYLE,
5018
5086
  title: t2("overview.age.countTitle", { label: bucket.label, count: bucket.count })
5019
5087
  },
5020
- /* @__PURE__ */ React11.createElement(
5088
+ /* @__PURE__ */ React12.createElement(
5021
5089
  "span",
5022
5090
  {
5023
5091
  style: {
@@ -5028,7 +5096,7 @@ function AgeHistogram(props) {
5028
5096
  }
5029
5097
  }
5030
5098
  )
5031
- ), /* @__PURE__ */ React11.createElement("span", { "data-testid": `age-${bucket.key}`, style: AGE_COUNT_STYLE }, String(bucket.count)))));
5099
+ ), /* @__PURE__ */ React12.createElement("span", { "data-testid": `age-${bucket.key}`, style: AGE_COUNT_STYLE }, String(bucket.count)))));
5032
5100
  }
5033
5101
  var INLINE_LABEL_MIN_RATIO = 0.12;
5034
5102
  function SegmentedBar(props) {
@@ -5042,7 +5110,7 @@ function SegmentedBar(props) {
5042
5110
  ratio: formatPercent(segmentRatio(segment, total))
5043
5111
  })
5044
5112
  ).join(t2("common.clauseSeparator"));
5045
- return /* @__PURE__ */ React11.createElement("div", { "data-testid": props.testId, style: { display: "flex", flexDirection: "column", gap: 6 } }, /* @__PURE__ */ React11.createElement("span", { style: { color: COLORS.secondary, fontSize: 11 } }, props.title), visible.length === 0 ? /* @__PURE__ */ React11.createElement("div", { style: EMPTY_BAR_STYLE }) : /* @__PURE__ */ React11.createElement(
5113
+ return /* @__PURE__ */ React12.createElement("div", { "data-testid": props.testId, style: { display: "flex", flexDirection: "column", gap: 6 } }, /* @__PURE__ */ React12.createElement("span", { style: { color: COLORS.secondary, fontSize: 11 } }, props.title), visible.length === 0 ? /* @__PURE__ */ React12.createElement("div", { style: EMPTY_BAR_STYLE }) : /* @__PURE__ */ React12.createElement(
5046
5114
  "div",
5047
5115
  {
5048
5116
  role: "img",
@@ -5051,7 +5119,7 @@ function SegmentedBar(props) {
5051
5119
  },
5052
5120
  visible.map((segment) => {
5053
5121
  const ratio = segmentRatio(segment, total);
5054
- return /* @__PURE__ */ React11.createElement(
5122
+ return /* @__PURE__ */ React12.createElement(
5055
5123
  "span",
5056
5124
  {
5057
5125
  key: segment.key,
@@ -5070,14 +5138,14 @@ function SegmentedBar(props) {
5070
5138
  ratio >= INLINE_LABEL_MIN_RATIO ? formatPercent(ratio) : null
5071
5139
  );
5072
5140
  })
5073
- ), /* @__PURE__ */ React11.createElement("div", { style: LEGEND_STYLE }, props.segments.map((segment) => /* @__PURE__ */ React11.createElement(
5141
+ ), /* @__PURE__ */ React12.createElement("div", { style: LEGEND_STYLE }, props.segments.map((segment) => /* @__PURE__ */ React12.createElement(
5074
5142
  "span",
5075
5143
  {
5076
5144
  key: segment.key,
5077
5145
  "data-testid": `${props.testId}-${segment.key}`,
5078
5146
  style: LEGEND_ITEM_STYLE2
5079
5147
  },
5080
- /* @__PURE__ */ React11.createElement(
5148
+ /* @__PURE__ */ React12.createElement(
5081
5149
  "span",
5082
5150
  {
5083
5151
  "aria-hidden": "true",
@@ -5093,12 +5161,12 @@ function SegmentedBar(props) {
5093
5161
  }
5094
5162
 
5095
5163
  // src/client/overview-pressure.tsx
5096
- var React12 = __toESM(require("react"), 1);
5164
+ var React13 = __toESM(require("react"), 1);
5097
5165
  function PressureSection(props) {
5098
5166
  const { t: t2 } = useI18n();
5099
5167
  const { snapshot } = props;
5100
5168
  const { pressure, coverage } = snapshot.metrics;
5101
- return /* @__PURE__ */ React12.createElement("section", { "data-testid": "pressure-overview", style: SECTION_STYLE }, /* @__PURE__ */ React12.createElement("div", { style: SECTION_TITLE_STYLE }, /* @__PURE__ */ React12.createElement("span", null, t2("overview.pressure.title")), /* @__PURE__ */ React12.createElement(
5169
+ return /* @__PURE__ */ React13.createElement("section", { "data-testid": "pressure-overview", style: SECTION_STYLE }, /* @__PURE__ */ React13.createElement("div", { style: SECTION_TITLE_STYLE }, /* @__PURE__ */ React13.createElement("span", null, t2("overview.pressure.title")), /* @__PURE__ */ React13.createElement(
5102
5170
  "span",
5103
5171
  {
5104
5172
  "data-testid": "pressure-tier",
@@ -5106,14 +5174,14 @@ function PressureSection(props) {
5106
5174
  style: TIER_BADGE_STYLES[pressure.tier]
5107
5175
  },
5108
5176
  pressureTierLabel(pressure.tier, t2)
5109
- )), /* @__PURE__ */ React12.createElement("div", { "data-testid": "metric-grid", style: DIMENSION_GRID_STYLE }, pressure.dimensions.map((report) => /* @__PURE__ */ React12.createElement(
5177
+ )), /* @__PURE__ */ React13.createElement("div", { "data-testid": "metric-grid", style: DIMENSION_GRID_STYLE }, pressure.dimensions.map((report) => /* @__PURE__ */ React13.createElement(
5110
5178
  DimensionCard,
5111
5179
  {
5112
5180
  key: report.dimension,
5113
5181
  report,
5114
5182
  rows: visibleRows(report, snapshot, t2)
5115
5183
  }
5116
- ))), /* @__PURE__ */ React12.createElement("div", { style: NOTE_STYLE }, t2("overview.pressure.note"), coverage.truncated ? /* @__PURE__ */ React12.createElement("span", { "data-testid": "pressure-coverage" }, t2("overview.pressure.coverage", {
5184
+ ))), /* @__PURE__ */ React13.createElement("div", { style: NOTE_STYLE }, t2("overview.pressure.note"), coverage.truncated ? /* @__PURE__ */ React13.createElement("span", { "data-testid": "pressure-coverage" }, t2("overview.pressure.coverage", {
5117
5185
  loaded: snapshot.loaded,
5118
5186
  total: snapshot.total
5119
5187
  })) : t2("overview.pressure.period")));
@@ -5124,14 +5192,14 @@ function DimensionCard(props) {
5124
5192
  const name = pressureDimensionLabel(report.dimension, t2);
5125
5193
  const tierLabel = report.tier === null ? t2("overview.pressure.unavailable") : pressureTierLabel(report.tier, t2);
5126
5194
  const basis = pressureDimensionBasis(report.dimension, t2);
5127
- return /* @__PURE__ */ React12.createElement(
5195
+ return /* @__PURE__ */ React13.createElement(
5128
5196
  "div",
5129
5197
  {
5130
5198
  "data-testid": `pressure-${report.dimension}`,
5131
5199
  "data-tier": report.tier,
5132
5200
  style: DIMENSION_CARD_STYLE
5133
5201
  },
5134
- /* @__PURE__ */ React12.createElement("div", { style: DIMENSION_HEAD_STYLE }, /* @__PURE__ */ React12.createElement("span", { style: DIMENSION_NAME_STYLE, title: t2("overview.pressure.basis", { basis }) }, name), report.provisional ? /* @__PURE__ */ React12.createElement("span", { "data-testid": `pressure-provisional-${report.dimension}`, style: PROVISIONAL_STYLE }, t2("overview.pressure.provisional")) : null, /* @__PURE__ */ React12.createElement("span", { style: { ...TIER_TEXT_STYLE, marginLeft: "auto" } }, /* @__PURE__ */ React12.createElement(
5202
+ /* @__PURE__ */ React13.createElement("div", { style: DIMENSION_HEAD_STYLE }, /* @__PURE__ */ React13.createElement("span", { style: DIMENSION_NAME_STYLE, title: t2("overview.pressure.basis", { basis }) }, name), report.provisional ? /* @__PURE__ */ React13.createElement("span", { "data-testid": `pressure-provisional-${report.dimension}`, style: PROVISIONAL_STYLE }, t2("overview.pressure.provisional")) : null, /* @__PURE__ */ React13.createElement("span", { style: { ...TIER_TEXT_STYLE, marginLeft: "auto" } }, /* @__PURE__ */ React13.createElement(
5135
5203
  "span",
5136
5204
  {
5137
5205
  "aria-hidden": "true",
@@ -5140,16 +5208,16 @@ function DimensionCard(props) {
5140
5208
  background: report.tier === null ? COLORS.tertiary : TIER_COLORS[report.tier]
5141
5209
  }
5142
5210
  }
5143
- ), /* @__PURE__ */ React12.createElement("span", { "data-testid": `pressure-tier-${report.dimension}` }, tierLabel))),
5144
- /* @__PURE__ */ React12.createElement(
5211
+ ), /* @__PURE__ */ React13.createElement("span", { "data-testid": `pressure-tier-${report.dimension}` }, tierLabel))),
5212
+ /* @__PURE__ */ React13.createElement(
5145
5213
  TierMeter,
5146
5214
  {
5147
5215
  tier: report.tier,
5148
5216
  label: t2("overview.pressure.tierLabel", { name, tier: tierLabel })
5149
5217
  }
5150
5218
  ),
5151
- /* @__PURE__ */ React12.createElement("div", null, /* @__PURE__ */ React12.createElement("div", { "data-testid": `pressure-facts-${report.dimension}`, style: DIMENSION_FACT_STYLE }, pressureFacts(report, t2)), /* @__PURE__ */ React12.createElement("div", { style: DIMENSION_BASIS_STYLE }, t2("overview.pressure.basis", { basis })), pressureGaps(report, t2).map((gap) => /* @__PURE__ */ React12.createElement("div", { key: gap, "data-testid": `pressure-gap-${report.dimension}`, style: NOTE_STYLE }, gap))),
5152
- /* @__PURE__ */ React12.createElement("dl", { style: METRIC_ROWS_STYLE }, props.rows.map((row) => /* @__PURE__ */ React12.createElement("div", { key: row.testId, "data-testid": row.testId, style: { display: "contents" } }, /* @__PURE__ */ React12.createElement("dt", { style: METRIC_ROW_LABEL_STYLE }, row.label), /* @__PURE__ */ React12.createElement("dd", { style: METRIC_ROW_VALUE_STYLE }, row.value), row.note === void 0 ? null : /* @__PURE__ */ React12.createElement("dd", { style: METRIC_ROW_NOTE_STYLE }, row.note))))
5219
+ /* @__PURE__ */ React13.createElement("div", null, /* @__PURE__ */ React13.createElement("div", { "data-testid": `pressure-facts-${report.dimension}`, style: DIMENSION_FACT_STYLE }, pressureFacts(report, t2)), /* @__PURE__ */ React13.createElement("div", { style: DIMENSION_BASIS_STYLE }, t2("overview.pressure.basis", { basis })), pressureGaps(report, t2).map((gap) => /* @__PURE__ */ React13.createElement("div", { key: gap, "data-testid": `pressure-gap-${report.dimension}`, style: NOTE_STYLE }, gap))),
5220
+ /* @__PURE__ */ React13.createElement("dl", { style: METRIC_ROWS_STYLE }, props.rows.map((row) => /* @__PURE__ */ React13.createElement("div", { key: row.testId, "data-testid": row.testId, style: { display: "contents" } }, /* @__PURE__ */ React13.createElement("dt", { style: METRIC_ROW_LABEL_STYLE }, row.label), /* @__PURE__ */ React13.createElement("dd", { style: METRIC_ROW_VALUE_STYLE }, row.value), row.note === void 0 ? null : /* @__PURE__ */ React13.createElement("dd", { style: METRIC_ROW_NOTE_STYLE }, row.note))))
5153
5221
  );
5154
5222
  }
5155
5223
  function visibleRows(report, snapshot, t2) {
@@ -5229,11 +5297,11 @@ function dimensionRows(dimension, snapshot, t2) {
5229
5297
  }
5230
5298
 
5231
5299
  // src/client/snapshot-age.ts
5232
- var React13 = __toESM(require("react"), 1);
5300
+ var React14 = __toESM(require("react"), 1);
5233
5301
  var AGE_TICK_MS = 3e4;
5234
5302
  function useNow(clock) {
5235
- const [now, setNow] = React13.useState(() => clock());
5236
- React13.useEffect(() => {
5303
+ const [now, setNow] = React14.useState(() => clock());
5304
+ React14.useEffect(() => {
5237
5305
  const id = setInterval(() => {
5238
5306
  setNow(clock());
5239
5307
  }, AGE_TICK_MS);
@@ -5245,7 +5313,7 @@ function useNow(clock) {
5245
5313
  }
5246
5314
 
5247
5315
  // src/client/snapshot-request.ts
5248
- var React14 = __toESM(require("react"), 1);
5316
+ var React15 = __toESM(require("react"), 1);
5249
5317
  function snapshotRefreshNotice(snapshot, refreshError, t2) {
5250
5318
  if (refreshError !== null) return refreshError.message;
5251
5319
  const hostMessage = snapshot?.refreshError?.message;
@@ -5278,13 +5346,13 @@ function useSnapshotRequest(client, workspaceRoot, options) {
5278
5346
  const { t: t2 } = useI18n();
5279
5347
  const { snapshot, error, refreshError, phase, moreError, moreLoading, load, more } = useSnapshotLoader(client, workspaceRoot, t2);
5280
5348
  const signal = options?.signal ?? 0;
5281
- const autoRefreshed = React14.useRef(false);
5282
- const inFlight = React14.useRef(0);
5283
- const queued = React14.useRef(false);
5284
- const handledSignal = React14.useRef(signal);
5285
- const [retry, setRetry] = React14.useState(0);
5286
- const handledRetry = React14.useRef(0);
5287
- const run = React14.useCallback(
5349
+ const autoRefreshed = React15.useRef(false);
5350
+ const inFlight = React15.useRef(0);
5351
+ const queued = React15.useRef(false);
5352
+ const handledSignal = React15.useRef(signal);
5353
+ const [retry, setRetry] = React15.useState(0);
5354
+ const handledRetry = React15.useRef(0);
5355
+ const run = React15.useCallback(
5288
5356
  async (mode) => {
5289
5357
  if (mode === "auto" && inFlight.current > 0) {
5290
5358
  queued.current = true;
@@ -5310,29 +5378,29 @@ function useSnapshotRequest(client, workspaceRoot, options) {
5310
5378
  },
5311
5379
  [load]
5312
5380
  );
5313
- React14.useEffect(() => {
5381
+ React15.useEffect(() => {
5314
5382
  if (retry === handledRetry.current) return;
5315
5383
  handledRetry.current = retry;
5316
5384
  void run("auto");
5317
5385
  }, [retry, run]);
5318
- React14.useEffect(() => {
5386
+ React15.useEffect(() => {
5319
5387
  autoRefreshed.current = false;
5320
5388
  void run("get");
5321
5389
  }, [run]);
5322
- React14.useEffect(() => {
5390
+ React15.useEffect(() => {
5323
5391
  if (signal === handledSignal.current) return;
5324
5392
  handledSignal.current = signal;
5325
5393
  if (workspaceRoot === void 0) return;
5326
5394
  void run("auto");
5327
5395
  }, [signal, workspaceRoot, run]);
5328
- React14.useEffect(() => {
5396
+ React15.useEffect(() => {
5329
5397
  queued.current = false;
5330
5398
  }, [workspaceRoot]);
5331
- const refresh = React14.useCallback(() => {
5399
+ const refresh = React15.useCallback(() => {
5332
5400
  if (phase === "loading" || phase === "refreshing") return;
5333
5401
  void run("refresh");
5334
5402
  }, [phase, run]);
5335
- const refreshFull = React14.useCallback(() => {
5403
+ const refreshFull = React15.useCallback(() => {
5336
5404
  if (phase === "loading" || phase === "refreshing") return;
5337
5405
  void run("refresh-full");
5338
5406
  }, [phase, run]);
@@ -5349,17 +5417,17 @@ function useSnapshotRequest(client, workspaceRoot, options) {
5349
5417
  };
5350
5418
  }
5351
5419
  function useSnapshotLoader(client, workspaceRoot, t2) {
5352
- const [snapshot, setSnapshot] = React14.useState(null);
5353
- const [error, setError] = React14.useState(null);
5354
- const [refreshError, setRefreshError] = React14.useState(null);
5355
- const [phase, setPhase] = React14.useState("loading");
5356
- const [moreError, setMoreError] = React14.useState(null);
5357
- const [moreLoading, setMoreLoading] = React14.useState(false);
5358
- const sequence = React14.useRef(0);
5359
- const hasData = React14.useRef(false);
5360
- const latest = React14.useRef(null);
5361
- const moreRunning = React14.useRef(false);
5362
- const target = React14.useMemo(
5420
+ const [snapshot, setSnapshot] = React15.useState(null);
5421
+ const [error, setError] = React15.useState(null);
5422
+ const [refreshError, setRefreshError] = React15.useState(null);
5423
+ const [phase, setPhase] = React15.useState("loading");
5424
+ const [moreError, setMoreError] = React15.useState(null);
5425
+ const [moreLoading, setMoreLoading] = React15.useState(false);
5426
+ const sequence = React15.useRef(0);
5427
+ const hasData = React15.useRef(false);
5428
+ const latest = React15.useRef(null);
5429
+ const moreRunning = React15.useRef(false);
5430
+ const target = React15.useMemo(
5363
5431
  () => ({
5364
5432
  client,
5365
5433
  workspaceRoot,
@@ -5376,14 +5444,14 @@ function useSnapshotLoader(client, workspaceRoot, t2) {
5376
5444
  }),
5377
5445
  [client, workspaceRoot, t2]
5378
5446
  );
5379
- const load = React14.useCallback(
5447
+ const load = React15.useCallback(
5380
5448
  (mode) => loadSnapshot(target, mode),
5381
5449
  [target]
5382
5450
  );
5383
- const more = React14.useCallback(() => {
5451
+ const more = React15.useCallback(() => {
5384
5452
  void loadMoreSnapshot(target, moreRunning);
5385
5453
  }, [target]);
5386
- React14.useEffect(() => {
5454
+ React15.useEffect(() => {
5387
5455
  setSnapshot(null);
5388
5456
  setError(null);
5389
5457
  setRefreshError(null);
@@ -5503,13 +5571,13 @@ function OverviewView(props) {
5503
5571
  const { snapshot, error, refreshError, phase, refresh } = props.request;
5504
5572
  const nowValue = useNow(clock);
5505
5573
  const busy = phase === "loading" || phase === "refreshing";
5506
- return /* @__PURE__ */ React15.createElement(
5574
+ return /* @__PURE__ */ React16.createElement(
5507
5575
  "div",
5508
5576
  {
5509
5577
  "data-testid": "overview-view",
5510
5578
  style: { display: "flex", flexDirection: "column", flex: 1, minHeight: 0 }
5511
5579
  },
5512
- /* @__PURE__ */ React15.createElement(
5580
+ /* @__PURE__ */ React16.createElement(
5513
5581
  Identity,
5514
5582
  {
5515
5583
  snapshot,
@@ -5520,13 +5588,13 @@ function OverviewView(props) {
5520
5588
  onRefresh: refresh
5521
5589
  }
5522
5590
  ),
5523
- error === null ? null : /* @__PURE__ */ React15.createElement(ErrorBanner, { error, onOpenEnvCheck: props.onOpenEnvCheck }),
5524
- snapshot === null ? phase === "loading" ? /* @__PURE__ */ React15.createElement("div", { "data-testid": "overview-loading", style: EMPTY_STYLE }, t2("snapshot.loading")) : null : /* @__PURE__ */ React15.createElement("div", { style: OVERVIEW_STYLE }, /* @__PURE__ */ React15.createElement(PressureSection, { snapshot }), /* @__PURE__ */ React15.createElement(FlowSection, { snapshot }), /* @__PURE__ */ React15.createElement(AgeSection, { snapshot }), /* @__PURE__ */ React15.createElement(CompositionSection, { snapshot }), /* @__PURE__ */ React15.createElement(AttentionSection, { items: snapshot.metrics.attention, onOpenTicket: props.onOpenTicket }))
5591
+ error === null ? null : /* @__PURE__ */ React16.createElement(ErrorBanner, { error, onOpenEnvCheck: props.onOpenEnvCheck }),
5592
+ snapshot === null ? phase === "loading" ? /* @__PURE__ */ React16.createElement("div", { "data-testid": "overview-loading", style: EMPTY_STYLE }, t2("snapshot.loading")) : null : /* @__PURE__ */ React16.createElement("div", { style: OVERVIEW_STYLE }, /* @__PURE__ */ React16.createElement(PressureSection, { snapshot }), /* @__PURE__ */ React16.createElement(FlowSection, { snapshot }), /* @__PURE__ */ React16.createElement(AgeSection, { snapshot }), /* @__PURE__ */ React16.createElement(CompositionSection, { snapshot }), /* @__PURE__ */ React16.createElement(AttentionSection, { items: snapshot.metrics.attention, onOpenTicket: props.onOpenTicket }))
5525
5593
  );
5526
5594
  }
5527
5595
  function SourceBadge(props) {
5528
5596
  const { t: t2 } = useI18n();
5529
- return /* @__PURE__ */ React15.createElement(
5597
+ return /* @__PURE__ */ React16.createElement(
5530
5598
  "span",
5531
5599
  {
5532
5600
  "data-testid": "overview-source",
@@ -5542,7 +5610,7 @@ function Identity(props) {
5542
5610
  const { t: t2 } = useI18n();
5543
5611
  const snapshot = props.snapshot;
5544
5612
  const host = snapshot?.repositoryHost ?? null;
5545
- return /* @__PURE__ */ React15.createElement("header", { style: IDENTITY_STYLE }, /* @__PURE__ */ React15.createElement("div", { style: IDENTITY_ROW_STYLE }, /* @__PURE__ */ React15.createElement("div", { style: REPO_CHIP_STYLE }, /* @__PURE__ */ React15.createElement(FolderIcon, null), /* @__PURE__ */ React15.createElement(
5613
+ return /* @__PURE__ */ React16.createElement("header", { style: IDENTITY_STYLE }, /* @__PURE__ */ React16.createElement("div", { style: IDENTITY_ROW_STYLE }, /* @__PURE__ */ React16.createElement("div", { style: REPO_CHIP_STYLE }, /* @__PURE__ */ React16.createElement(FolderIcon, null), /* @__PURE__ */ React16.createElement(
5546
5614
  "span",
5547
5615
  {
5548
5616
  "data-testid": "overview-repo",
@@ -5550,7 +5618,7 @@ function Identity(props) {
5550
5618
  ...snapshot === null ? {} : { title: snapshot.repository }
5551
5619
  },
5552
5620
  snapshot?.repository ?? (props.loading ? t2("repo.identifying") : t2("repo.unidentified"))
5553
- )), snapshot === null ? null : /* @__PURE__ */ React15.createElement("span", { "data-testid": "overview-backend", style: BACKEND_BADGE_STYLE }, backendLabel(snapshot.backend, t2)), snapshot === null ? null : /* @__PURE__ */ React15.createElement(SourceBadge, { source: snapshot.source }), host === null ? null : /* @__PURE__ */ React15.createElement("span", { "data-testid": "overview-host", title: host, style: REPO_HOST_STYLE }, host)), /* @__PURE__ */ React15.createElement("div", { style: IDENTITY_META_STYLE }, /* @__PURE__ */ React15.createElement("span", { "data-testid": "overview-age", style: { ...AGE_STYLE, fontSize: "inherit" } }, snapshot === null ? t2("snapshot.none") : formatRelativeTime(snapshot.fetchedAt, props.now, t2)), props.notice === null ? null : /* @__PURE__ */ React15.createElement(
5621
+ )), snapshot === null ? null : /* @__PURE__ */ React16.createElement("span", { "data-testid": "overview-backend", style: BACKEND_BADGE_STYLE }, backendLabel(snapshot.backend, t2)), snapshot === null ? null : /* @__PURE__ */ React16.createElement(SourceBadge, { source: snapshot.source }), host === null ? null : /* @__PURE__ */ React16.createElement("span", { "data-testid": "overview-host", title: host, style: REPO_HOST_STYLE }, host)), /* @__PURE__ */ React16.createElement("div", { style: IDENTITY_META_STYLE }, /* @__PURE__ */ React16.createElement("span", { "data-testid": "overview-age", style: { ...AGE_STYLE, fontSize: "inherit" } }, snapshot === null ? t2("snapshot.none") : formatRelativeTime(snapshot.fetchedAt, props.now, t2)), props.notice === null ? null : /* @__PURE__ */ React16.createElement(
5554
5622
  "span",
5555
5623
  {
5556
5624
  "data-testid": "overview-refresh-error",
@@ -5558,11 +5626,11 @@ function Identity(props) {
5558
5626
  style: REFRESH_ERROR_STYLE
5559
5627
  },
5560
5628
  props.notice
5561
- ), /* @__PURE__ */ React15.createElement("span", { "aria-hidden": "true", style: IDENTITY_SEPARATOR_STYLE }, "\xB7"), /* @__PURE__ */ React15.createElement("span", { "data-testid": "overview-loaded" }, snapshot === null ? props.loading ? t2("snapshot.loading") : t2("snapshot.notLoaded") : t2("overview.loaded", { loaded: snapshot.loaded, total: snapshot.total })), /* @__PURE__ */ React15.createElement(OverviewRefreshButton, { busy: props.busy, onRefresh: props.onRefresh })));
5629
+ ), /* @__PURE__ */ React16.createElement("span", { "aria-hidden": "true", style: IDENTITY_SEPARATOR_STYLE }, "\xB7"), /* @__PURE__ */ React16.createElement("span", { "data-testid": "overview-loaded" }, snapshot === null ? props.loading ? t2("snapshot.loading") : t2("snapshot.notLoaded") : t2("overview.loaded", { loaded: snapshot.loaded, total: snapshot.total })), /* @__PURE__ */ React16.createElement(OverviewRefreshButton, { busy: props.busy, onRefresh: props.onRefresh })));
5562
5630
  }
5563
5631
  function OverviewRefreshButton(props) {
5564
5632
  const { t: t2 } = useI18n();
5565
- return /* @__PURE__ */ React15.createElement(
5633
+ return /* @__PURE__ */ React16.createElement(
5566
5634
  "button",
5567
5635
  {
5568
5636
  type: "button",
@@ -5577,7 +5645,7 @@ function OverviewRefreshButton(props) {
5577
5645
  opacity: props.busy ? 0.6 : 1
5578
5646
  }
5579
5647
  },
5580
- /* @__PURE__ */ React15.createElement(RefreshIcon, null),
5648
+ /* @__PURE__ */ React16.createElement(RefreshIcon, null),
5581
5649
  props.busy ? t2("refresh.busy") : t2("refresh.action")
5582
5650
  );
5583
5651
  }
@@ -5588,7 +5656,7 @@ function FlowSection(props) {
5588
5656
  const truncated = metrics.coverage.truncated;
5589
5657
  const sample = sampleNote(props.snapshot, t2);
5590
5658
  const count = (value) => t2("overview.metric.tickets", { count: value });
5591
- return /* @__PURE__ */ React15.createElement("section", { "data-testid": "flow", style: SECTION_STYLE }, /* @__PURE__ */ React15.createElement("div", { style: SECTION_TITLE_STYLE }, t2("overview.section.flow")), /* @__PURE__ */ React15.createElement("div", { style: CHART_CARD_STYLE }, /* @__PURE__ */ React15.createElement("div", { style: FLOW_STATS_STYLE }, /* @__PURE__ */ React15.createElement(
5659
+ return /* @__PURE__ */ React16.createElement("section", { "data-testid": "flow", style: SECTION_STYLE }, /* @__PURE__ */ React16.createElement("div", { style: SECTION_TITLE_STYLE }, t2("overview.section.flow")), /* @__PURE__ */ React16.createElement("div", { style: CHART_CARD_STYLE }, /* @__PURE__ */ React16.createElement("div", { style: FLOW_STATS_STYLE }, /* @__PURE__ */ React16.createElement(
5592
5660
  MetricCard,
5593
5661
  {
5594
5662
  testId: "metric-opened",
@@ -5596,7 +5664,7 @@ function FlowSection(props) {
5596
5664
  value: metricText(metrics.openedLast30Days, count, t2),
5597
5665
  note: joinNotes(gapNote(metrics.openedLast30Days, t2), sample)
5598
5666
  }
5599
- ), /* @__PURE__ */ React15.createElement(
5667
+ ), /* @__PURE__ */ React16.createElement(
5600
5668
  MetricCard,
5601
5669
  {
5602
5670
  testId: "metric-closed",
@@ -5608,7 +5676,7 @@ function FlowSection(props) {
5608
5676
  sample
5609
5677
  )
5610
5678
  }
5611
- ), /* @__PURE__ */ React15.createElement(
5679
+ ), /* @__PURE__ */ React16.createElement(
5612
5680
  MetricCard,
5613
5681
  {
5614
5682
  testId: "metric-net-flow",
@@ -5624,7 +5692,7 @@ function FlowSection(props) {
5624
5692
  sample
5625
5693
  )
5626
5694
  }
5627
- )), hasTicketTimes(props.snapshot) ? /* @__PURE__ */ React15.createElement(
5695
+ )), hasTicketTimes(props.snapshot) ? /* @__PURE__ */ React16.createElement(
5628
5696
  FlowChart,
5629
5697
  {
5630
5698
  buckets: weeklyFlow(tickets, fetchedAt, {
@@ -5641,21 +5709,21 @@ function AgeSection(props) {
5641
5709
  const { t: t2 } = useI18n();
5642
5710
  const { tickets, fetchedAt } = props.snapshot;
5643
5711
  if (!hasTicketTimes(props.snapshot)) return null;
5644
- return /* @__PURE__ */ React15.createElement("section", { "data-testid": "age", style: SECTION_STYLE }, /* @__PURE__ */ React15.createElement("div", { style: SECTION_TITLE_STYLE }, /* @__PURE__ */ React15.createElement("span", null, t2("overview.section.age")), /* @__PURE__ */ React15.createElement("span", { style: CHART_CAPTION_STYLE }, t2("overview.section.age.caption"))), /* @__PURE__ */ React15.createElement("div", { style: CHART_CARD_STYLE }, /* @__PURE__ */ React15.createElement(AgeHistogram, { buckets: updateAgeBuckets(tickets, fetchedAt, t2) })));
5712
+ return /* @__PURE__ */ React16.createElement("section", { "data-testid": "age", style: SECTION_STYLE }, /* @__PURE__ */ React16.createElement("div", { style: SECTION_TITLE_STYLE }, /* @__PURE__ */ React16.createElement("span", null, t2("overview.section.age")), /* @__PURE__ */ React16.createElement("span", { style: CHART_CAPTION_STYLE }, t2("overview.section.age.caption"))), /* @__PURE__ */ React16.createElement("div", { style: CHART_CARD_STYLE }, /* @__PURE__ */ React16.createElement(AgeHistogram, { buckets: updateAgeBuckets(tickets, fetchedAt, t2) })));
5645
5713
  }
5646
5714
  function MetricCard(props) {
5647
- return /* @__PURE__ */ React15.createElement("div", { "data-testid": props.testId, style: FLAT_METRIC_STYLE }, /* @__PURE__ */ React15.createElement("span", { style: METRIC_LABEL_STYLE }, props.label), /* @__PURE__ */ React15.createElement("span", { style: METRIC_VALUE_STYLE }, props.value), props.note === void 0 ? null : /* @__PURE__ */ React15.createElement("span", { style: METRIC_NOTE_STYLE, title: props.note }, props.note));
5715
+ return /* @__PURE__ */ React16.createElement("div", { "data-testid": props.testId, style: FLAT_METRIC_STYLE }, /* @__PURE__ */ React16.createElement("span", { style: METRIC_LABEL_STYLE }, props.label), /* @__PURE__ */ React16.createElement("span", { style: METRIC_VALUE_STYLE }, props.value), props.note === void 0 ? null : /* @__PURE__ */ React16.createElement("span", { style: METRIC_NOTE_STYLE, title: props.note }, props.note));
5648
5716
  }
5649
5717
  function CompositionSection(props) {
5650
5718
  const { t: t2 } = useI18n();
5651
- return /* @__PURE__ */ React15.createElement("section", { "data-testid": "composition", style: SECTION_STYLE }, /* @__PURE__ */ React15.createElement("div", { style: SECTION_TITLE_STYLE }, t2("overview.section.composition")), /* @__PURE__ */ React15.createElement("div", { style: { ...CHART_CARD_STYLE, gap: 14 } }, /* @__PURE__ */ React15.createElement(
5719
+ return /* @__PURE__ */ React16.createElement("section", { "data-testid": "composition", style: SECTION_STYLE }, /* @__PURE__ */ React16.createElement("div", { style: SECTION_TITLE_STYLE }, t2("overview.section.composition")), /* @__PURE__ */ React16.createElement("div", { style: { ...CHART_CARD_STYLE, gap: 14 } }, /* @__PURE__ */ React16.createElement(
5652
5720
  SegmentedBar,
5653
5721
  {
5654
5722
  testId: "status-distribution",
5655
5723
  title: t2("overview.distribution.status"),
5656
5724
  segments: statusSegments(props.snapshot.tickets, t2)
5657
5725
  }
5658
- ), /* @__PURE__ */ React15.createElement(
5726
+ ), /* @__PURE__ */ React16.createElement(
5659
5727
  SegmentedBar,
5660
5728
  {
5661
5729
  testId: "category-distribution",
@@ -5666,7 +5734,7 @@ function CompositionSection(props) {
5666
5734
  }
5667
5735
  function AttentionSection(props) {
5668
5736
  const { t: t2 } = useI18n();
5669
- return /* @__PURE__ */ React15.createElement("section", { "data-testid": "attention", style: SECTION_STYLE }, /* @__PURE__ */ React15.createElement("div", { style: SECTION_TITLE_STYLE }, /* @__PURE__ */ React15.createElement("span", null, t2("overview.section.attention")), /* @__PURE__ */ React15.createElement("span", { style: CARD_BASIS_STYLE }, t2("overview.attention.count", { count: props.items.length }))), props.items.length === 0 ? /* @__PURE__ */ React15.createElement("div", { "data-testid": "attention-empty", style: NOTE_STYLE }, t2("overview.attention.empty")) : /* @__PURE__ */ React15.createElement("div", { style: ATTENTION_LIST_STYLE }, props.items.map((item) => /* @__PURE__ */ React15.createElement(
5737
+ return /* @__PURE__ */ React16.createElement("section", { "data-testid": "attention", style: SECTION_STYLE }, /* @__PURE__ */ React16.createElement("div", { style: SECTION_TITLE_STYLE }, /* @__PURE__ */ React16.createElement("span", null, t2("overview.section.attention")), /* @__PURE__ */ React16.createElement("span", { style: CARD_BASIS_STYLE }, t2("overview.attention.count", { count: props.items.length }))), props.items.length === 0 ? /* @__PURE__ */ React16.createElement("div", { "data-testid": "attention-empty", style: NOTE_STYLE }, t2("overview.attention.empty")) : /* @__PURE__ */ React16.createElement("div", { style: ATTENTION_LIST_STYLE }, props.items.map((item) => /* @__PURE__ */ React16.createElement(
5670
5738
  "button",
5671
5739
  {
5672
5740
  key: item.ref,
@@ -5680,9 +5748,9 @@ function AttentionSection(props) {
5680
5748
  },
5681
5749
  style: ATTENTION_ITEM_STYLE
5682
5750
  },
5683
- /* @__PURE__ */ React15.createElement("span", { style: ATTENTION_REF_STYLE, title: item.ref }, displayRef(item)),
5684
- /* @__PURE__ */ React15.createElement("span", { style: ATTENTION_TITLE_STYLE, title: item.title }, item.title),
5685
- /* @__PURE__ */ React15.createElement("span", { style: ATTENTION_REASON_STYLE }, attentionText(item, t2))
5751
+ /* @__PURE__ */ React16.createElement("span", { style: ATTENTION_REF_STYLE, title: item.ref }, displayRef(item)),
5752
+ /* @__PURE__ */ React16.createElement("span", { style: ATTENTION_TITLE_STYLE, title: item.title }, item.title),
5753
+ /* @__PURE__ */ React16.createElement("span", { style: ATTENTION_REASON_STYLE }, attentionText(item, t2))
5686
5754
  ))));
5687
5755
  }
5688
5756
  function displayRef(item) {
@@ -5692,13 +5760,13 @@ function displayRef(item) {
5692
5760
  }
5693
5761
 
5694
5762
  // src/client/ticket-actions.ts
5695
- var React17 = __toESM(require("react"), 1);
5763
+ var React18 = __toESM(require("react"), 1);
5696
5764
 
5697
5765
  // src/client/use-draft-injection.ts
5698
- var React16 = __toESM(require("react"), 1);
5766
+ var React17 = __toESM(require("react"), 1);
5699
5767
  function useDraftInjection(injection) {
5700
5768
  const { t: t2 } = useI18n();
5701
- const [state, setState] = React16.useState(null);
5769
+ const [state, setState] = React17.useState(null);
5702
5770
  const notice = state === null ? null : injectionNotice(state.outcome, state.target, t2);
5703
5771
  const noticeTone = state === null ? null : state.outcome === "unavailable" ? "error" : "info";
5704
5772
  const inject2 = (text, target) => {
@@ -5721,9 +5789,9 @@ function injectionNotice(outcome, target, t2) {
5721
5789
 
5722
5790
  // src/client/ticket-actions.ts
5723
5791
  function useTicketActions(workspaceRoot, injection) {
5724
- const [injected, setInjected] = React17.useState(null);
5792
+ const [injected, setInjected] = React18.useState(null);
5725
5793
  const { notice, noticeTone, inject: injectPrompt } = useDraftInjection(injection);
5726
- React17.useEffect(() => {
5794
+ React18.useEffect(() => {
5727
5795
  setInjected(null);
5728
5796
  }, [workspaceRoot]);
5729
5797
  const inject2 = (text, target) => {
@@ -5740,10 +5808,10 @@ function useTicketActions(workspaceRoot, injection) {
5740
5808
  }
5741
5809
 
5742
5810
  // src/client/ticket-detail-view.tsx
5743
- var React26 = __toESM(require("react"), 1);
5811
+ var React27 = __toESM(require("react"), 1);
5744
5812
 
5745
5813
  // src/client/skill-action-badge.tsx
5746
- var React18 = __toESM(require("react"), 1);
5814
+ var React19 = __toESM(require("react"), 1);
5747
5815
 
5748
5816
  // src/client/skill-action-text.ts
5749
5817
  var ACTION_HINTS = {
@@ -5788,7 +5856,7 @@ function SkillActionBadge(props) {
5788
5856
  const label = actionBadgeLabel(ticket, t2);
5789
5857
  const hint = actionHint(ticket, t2);
5790
5858
  if (ticket.skillAction === "none") {
5791
- return /* @__PURE__ */ React18.createElement(
5859
+ return /* @__PURE__ */ React19.createElement(
5792
5860
  "span",
5793
5861
  {
5794
5862
  "data-testid": "action-reason",
@@ -5802,7 +5870,7 @@ function SkillActionBadge(props) {
5802
5870
  }
5803
5871
  const canFill = props.injection.canInjectCurrent;
5804
5872
  const buttonHint = badgeHint(hint, props.injected, canFill, t2);
5805
- return /* @__PURE__ */ React18.createElement(
5873
+ return /* @__PURE__ */ React19.createElement(
5806
5874
  SplitAction,
5807
5875
  {
5808
5876
  testId: "skill-badge",
@@ -5811,7 +5879,7 @@ function SkillActionBadge(props) {
5811
5879
  ...props.injected ? { "data-injected": "true" } : {}
5812
5880
  },
5813
5881
  label,
5814
- icon: props.injected ? /* @__PURE__ */ React18.createElement(CheckIcon, null) : /* @__PURE__ */ React18.createElement(InsertDraftIcon, null),
5882
+ icon: props.injected ? /* @__PURE__ */ React19.createElement(CheckIcon, null) : /* @__PURE__ */ React19.createElement(InsertDraftIcon, null),
5815
5883
  title: buttonHint,
5816
5884
  ariaLabel: `${label}\uFF1A${buttonHint}`,
5817
5885
  primaryStyle: {
@@ -5841,7 +5909,7 @@ function badgeHint(hint, injected, canInject, t2) {
5841
5909
  }
5842
5910
 
5843
5911
  // src/client/ticket-delete.tsx
5844
- var React19 = __toESM(require("react"), 1);
5912
+ var React20 = __toESM(require("react"), 1);
5845
5913
 
5846
5914
  // src/client/ticket-detail-styles.ts
5847
5915
  var CONTROL_LINE_HEIGHT = "18px";
@@ -6028,6 +6096,10 @@ var DETAIL_ERROR_STYLE = {
6028
6096
  color: COLORS.error,
6029
6097
  fontSize: 12
6030
6098
  };
6099
+ var DETAIL_REFRESH_ERROR_STYLE = {
6100
+ ...DETAIL_ERROR_STYLE,
6101
+ margin: "8px 12px 0"
6102
+ };
6031
6103
  var HEADER_TEXT_BUTTON_STYLE = {
6032
6104
  ...DETAIL_BACK_STYLE,
6033
6105
  padding: "3px 8px"
@@ -6266,10 +6338,10 @@ var DELETE_PANEL_ACTIONS_STYLE = {
6266
6338
  // src/client/ticket-delete.tsx
6267
6339
  function MoreMenu(props) {
6268
6340
  const { t: t2 } = useI18n();
6269
- const [open, setOpen] = React19.useState(false);
6270
- const wrapper = React19.useRef(null);
6271
- const menuId = React19.useId();
6272
- React19.useEffect(() => {
6341
+ const [open, setOpen] = React20.useState(false);
6342
+ const wrapper = React20.useRef(null);
6343
+ const menuId = React20.useId();
6344
+ React20.useEffect(() => {
6273
6345
  if (!open) return;
6274
6346
  const onPointer = (event) => {
6275
6347
  if (wrapper.current?.contains(event.target) !== true) setOpen(false);
@@ -6279,7 +6351,7 @@ function MoreMenu(props) {
6279
6351
  document.removeEventListener("mousedown", onPointer);
6280
6352
  };
6281
6353
  }, [open]);
6282
- return /* @__PURE__ */ React19.createElement(
6354
+ return /* @__PURE__ */ React20.createElement(
6283
6355
  "div",
6284
6356
  {
6285
6357
  ref: wrapper,
@@ -6291,7 +6363,7 @@ function MoreMenu(props) {
6291
6363
  }
6292
6364
  }
6293
6365
  },
6294
- /* @__PURE__ */ React19.createElement(
6366
+ /* @__PURE__ */ React20.createElement(
6295
6367
  "button",
6296
6368
  {
6297
6369
  type: "button",
@@ -6307,9 +6379,9 @@ function MoreMenu(props) {
6307
6379
  },
6308
6380
  style: MENU_TRIGGER_STYLE
6309
6381
  },
6310
- /* @__PURE__ */ React19.createElement(MoreIcon, null)
6382
+ /* @__PURE__ */ React20.createElement(MoreIcon, null)
6311
6383
  ),
6312
- open ? /* @__PURE__ */ React19.createElement("div", { id: menuId, role: "menu", "aria-label": t2("detail.delete.more"), style: MENU_STYLE }, /* @__PURE__ */ React19.createElement(
6384
+ open ? /* @__PURE__ */ React20.createElement("div", { id: menuId, role: "menu", "aria-label": t2("detail.delete.more"), style: MENU_STYLE }, /* @__PURE__ */ React20.createElement(
6313
6385
  "button",
6314
6386
  {
6315
6387
  type: "button",
@@ -6323,18 +6395,18 @@ function MoreMenu(props) {
6323
6395
  },
6324
6396
  style: MENU_ITEM_DANGER_STYLE
6325
6397
  },
6326
- /* @__PURE__ */ React19.createElement(TrashIcon, null),
6398
+ /* @__PURE__ */ React20.createElement(TrashIcon, null),
6327
6399
  t2("detail.delete.menu")
6328
6400
  )) : null
6329
6401
  );
6330
6402
  }
6331
6403
  function DeleteConfirm(props) {
6332
6404
  const { t: t2 } = useI18n();
6333
- const [typed, setTyped] = React19.useState("");
6334
- const titleId = React19.useId();
6335
- const inputId = React19.useId();
6405
+ const [typed, setTyped] = React20.useState("");
6406
+ const titleId = React20.useId();
6407
+ const inputId = React20.useId();
6336
6408
  const confirmed = typed.trim() === TICKET_DELETE_CONFIRMATION;
6337
- return /* @__PURE__ */ React19.createElement(
6409
+ return /* @__PURE__ */ React20.createElement(
6338
6410
  "section",
6339
6411
  {
6340
6412
  role: "alertdialog",
@@ -6348,10 +6420,10 @@ function DeleteConfirm(props) {
6348
6420
  },
6349
6421
  style: DELETE_PANEL_STYLE
6350
6422
  },
6351
- /* @__PURE__ */ React19.createElement("h3", { id: titleId, style: DELETE_PANEL_TITLE_STYLE }, t2("detail.delete.title", { ref: props.refText })),
6352
- /* @__PURE__ */ React19.createElement("p", { style: DELETE_PANEL_TEXT_STYLE }, t2("detail.delete.body", { title: props.title, backend: props.backendLabel })),
6353
- /* @__PURE__ */ React19.createElement("label", { htmlFor: inputId, style: DELETE_PANEL_TEXT_STYLE }, t2("detail.delete.confirmBefore"), /* @__PURE__ */ React19.createElement("code", null, TICKET_DELETE_CONFIRMATION), t2("detail.delete.confirmAfter")),
6354
- /* @__PURE__ */ React19.createElement(
6423
+ /* @__PURE__ */ React20.createElement("h3", { id: titleId, style: DELETE_PANEL_TITLE_STYLE }, t2("detail.delete.title", { ref: props.refText })),
6424
+ /* @__PURE__ */ React20.createElement("p", { style: DELETE_PANEL_TEXT_STYLE }, t2("detail.delete.body", { title: props.title, backend: props.backendLabel })),
6425
+ /* @__PURE__ */ React20.createElement("label", { htmlFor: inputId, style: DELETE_PANEL_TEXT_STYLE }, t2("detail.delete.confirmBefore"), /* @__PURE__ */ React20.createElement("code", null, TICKET_DELETE_CONFIRMATION), t2("detail.delete.confirmAfter")),
6426
+ /* @__PURE__ */ React20.createElement(
6355
6427
  "input",
6356
6428
  {
6357
6429
  id: inputId,
@@ -6370,8 +6442,8 @@ function DeleteConfirm(props) {
6370
6442
  style: DETAIL_INPUT_STYLE
6371
6443
  }
6372
6444
  ),
6373
- props.error === null ? null : /* @__PURE__ */ React19.createElement("div", { role: "alert", "data-testid": "delete-error", style: DELETE_PANEL_TEXT_STYLE }, errorText(props.error, t2)),
6374
- /* @__PURE__ */ React19.createElement(
6445
+ props.error === null ? null : /* @__PURE__ */ React20.createElement("div", { role: "alert", "data-testid": "delete-error", style: DELETE_PANEL_TEXT_STYLE }, errorText(props.error, t2)),
6446
+ /* @__PURE__ */ React20.createElement(
6375
6447
  DeleteActions,
6376
6448
  {
6377
6449
  confirmed,
@@ -6384,7 +6456,7 @@ function DeleteConfirm(props) {
6384
6456
  }
6385
6457
  function DeleteActions(props) {
6386
6458
  const { t: t2 } = useI18n();
6387
- return /* @__PURE__ */ React19.createElement("div", { style: DELETE_PANEL_ACTIONS_STYLE }, /* @__PURE__ */ React19.createElement(
6459
+ return /* @__PURE__ */ React20.createElement("div", { style: DELETE_PANEL_ACTIONS_STYLE }, /* @__PURE__ */ React20.createElement(
6388
6460
  "button",
6389
6461
  {
6390
6462
  type: "button",
@@ -6395,7 +6467,7 @@ function DeleteActions(props) {
6395
6467
  style: DETAIL_BUTTON_STYLE
6396
6468
  },
6397
6469
  t2("detail.delete.cancel")
6398
- ), /* @__PURE__ */ React19.createElement(
6470
+ ), /* @__PURE__ */ React20.createElement(
6399
6471
  "button",
6400
6472
  {
6401
6473
  type: "button",
@@ -6410,17 +6482,17 @@ function DeleteActions(props) {
6410
6482
  }
6411
6483
 
6412
6484
  // src/client/ticket-detail-fields.tsx
6413
- var React22 = __toESM(require("react"), 1);
6485
+ var React23 = __toESM(require("react"), 1);
6414
6486
 
6415
6487
  // src/client/ticket-combobox.tsx
6416
- var React21 = __toESM(require("react"), 1);
6488
+ var React22 = __toESM(require("react"), 1);
6417
6489
 
6418
6490
  // src/client/ticket-visuals.tsx
6419
- var React20 = __toESM(require("react"), 1);
6491
+ var React21 = __toESM(require("react"), 1);
6420
6492
  function Avatar(props) {
6421
6493
  const size = props.size ?? 20;
6422
6494
  const tint = props.name === null ? COLORS.tertiary : `hsl(${String(hue(props.name))} 55% 48%)`;
6423
- return /* @__PURE__ */ React20.createElement(
6495
+ return /* @__PURE__ */ React21.createElement(
6424
6496
  "span",
6425
6497
  {
6426
6498
  "aria-hidden": "true",
@@ -6484,9 +6556,9 @@ var MAX_VISIBLE = 8;
6484
6556
  function TokenEditor(props) {
6485
6557
  const { t: t2 } = useI18n();
6486
6558
  const { kind, busy } = props;
6487
- const listId = React21.useId();
6488
- const [draft, setDraft] = React21.useState("");
6489
- const [active, setActive] = React21.useState(0);
6559
+ const listId = React22.useId();
6560
+ const [draft, setDraft] = React22.useState("");
6561
+ const [active, setActive] = React22.useState(0);
6490
6562
  const query = draft.trim();
6491
6563
  const matches = filterSuggestions(props.source, props.selected, query);
6492
6564
  const activeItem = matches[active];
@@ -6503,7 +6575,7 @@ function TokenEditor(props) {
6503
6575
  },
6504
6576
  onClose: props.onClose
6505
6577
  });
6506
- return /* @__PURE__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement(
6578
+ return /* @__PURE__ */ React22.createElement(React22.Fragment, null, /* @__PURE__ */ React22.createElement(
6507
6579
  "input",
6508
6580
  {
6509
6581
  "data-testid": `${kind}-input`,
@@ -6527,7 +6599,7 @@ function TokenEditor(props) {
6527
6599
  },
6528
6600
  style: DETAIL_INLINE_INPUT_STYLE
6529
6601
  }
6530
- ), /* @__PURE__ */ React21.createElement(
6602
+ ), /* @__PURE__ */ React22.createElement(
6531
6603
  EditorButtons,
6532
6604
  {
6533
6605
  kind,
@@ -6539,7 +6611,7 @@ function TokenEditor(props) {
6539
6611
  onAssignSelf: props.onAssignSelf,
6540
6612
  onClose: props.onClose
6541
6613
  }
6542
- ), /* @__PURE__ */ React21.createElement(
6614
+ ), /* @__PURE__ */ React22.createElement(
6543
6615
  SuggestionList,
6544
6616
  {
6545
6617
  listId,
@@ -6577,7 +6649,7 @@ function comboboxKeyHandler(options) {
6577
6649
  function EditorButtons(props) {
6578
6650
  const { t: t2 } = useI18n();
6579
6651
  const assignSelf = props.onAssignSelf;
6580
- return /* @__PURE__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement(
6652
+ return /* @__PURE__ */ React22.createElement(React22.Fragment, null, /* @__PURE__ */ React22.createElement(
6581
6653
  "button",
6582
6654
  {
6583
6655
  type: "button",
@@ -6589,7 +6661,7 @@ function EditorButtons(props) {
6589
6661
  style: DETAIL_SMALL_BUTTON_STYLE
6590
6662
  },
6591
6663
  t2("detail.combo.add")
6592
- ), assignSelf === void 0 ? null : /* @__PURE__ */ React21.createElement(
6664
+ ), assignSelf === void 0 ? null : /* @__PURE__ */ React22.createElement(
6593
6665
  "button",
6594
6666
  {
6595
6667
  type: "button",
@@ -6609,7 +6681,7 @@ function EditorButtons(props) {
6609
6681
  function SuggestionList(props) {
6610
6682
  const { t: t2 } = useI18n();
6611
6683
  const note = listNote(props.source, props.matches.length, props.query, t2);
6612
- return /* @__PURE__ */ React21.createElement(
6684
+ return /* @__PURE__ */ React22.createElement(
6613
6685
  "ul",
6614
6686
  {
6615
6687
  id: props.listId,
@@ -6618,7 +6690,7 @@ function SuggestionList(props) {
6618
6690
  "aria-label": t2("detail.combo.candidates"),
6619
6691
  style: COMBO_LIST_STYLE
6620
6692
  },
6621
- props.matches.map((item, index) => /* @__PURE__ */ React21.createElement(
6693
+ props.matches.map((item, index) => /* @__PURE__ */ React22.createElement(
6622
6694
  "li",
6623
6695
  {
6624
6696
  key: item.value,
@@ -6635,11 +6707,11 @@ function SuggestionList(props) {
6635
6707
  },
6636
6708
  style: index === props.active ? { ...COMBO_OPTION_STYLE, ...COMBO_OPTION_ACTIVE_STYLE } : COMBO_OPTION_STYLE
6637
6709
  },
6638
- item.color === null ? /* @__PURE__ */ React21.createElement(Avatar, { name: item.value, size: 18 }) : /* @__PURE__ */ React21.createElement("span", { style: { ...COMBO_SWATCH_STYLE, background: item.color } }),
6639
- /* @__PURE__ */ React21.createElement("span", { "data-option-name": "", style: { minWidth: 0 } }, item.value),
6640
- item.detail === null ? null : /* @__PURE__ */ React21.createElement("span", { style: COMBO_OPTION_DETAIL_STYLE }, item.detail)
6710
+ item.color === null ? /* @__PURE__ */ React22.createElement(Avatar, { name: item.value, size: 18 }) : /* @__PURE__ */ React22.createElement("span", { style: { ...COMBO_SWATCH_STYLE, background: item.color } }),
6711
+ /* @__PURE__ */ React22.createElement("span", { "data-option-name": "", style: { minWidth: 0 } }, item.value),
6712
+ item.detail === null ? null : /* @__PURE__ */ React22.createElement("span", { style: COMBO_OPTION_DETAIL_STYLE }, item.detail)
6641
6713
  )),
6642
- note === null ? null : /* @__PURE__ */ React21.createElement("li", { role: "presentation", style: COMBO_EMPTY_STYLE }, note)
6714
+ note === null ? null : /* @__PURE__ */ React22.createElement("li", { role: "presentation", style: COMBO_EMPTY_STYLE }, note)
6643
6715
  );
6644
6716
  }
6645
6717
  function listNote(source, count, query, t2) {
@@ -6674,7 +6746,8 @@ function HeaderActions(props) {
6674
6746
  const { detail, busy } = props;
6675
6747
  const next = detail.state === "open" ? "closed" : "open";
6676
6748
  const copied = props.copy.status === "copied";
6677
- return /* @__PURE__ */ React22.createElement(React22.Fragment, null, detail.capabilities.state ? /* @__PURE__ */ React22.createElement(
6749
+ const refreshLabel = props.refreshing ? t2("detail.refreshing") : t2("detail.refresh");
6750
+ return /* @__PURE__ */ React23.createElement(React23.Fragment, null, detail.capabilities.state ? /* @__PURE__ */ React23.createElement(
6678
6751
  "button",
6679
6752
  {
6680
6753
  type: "button",
@@ -6687,7 +6760,20 @@ function HeaderActions(props) {
6687
6760
  style: next === "closed" ? HEADER_CLOSE_STYLE : HEADER_TEXT_BUTTON_STYLE
6688
6761
  },
6689
6762
  t2(next === "closed" ? "detail.close" : "detail.reopen")
6690
- ) : null, detail.url === null ? null : /* @__PURE__ */ React22.createElement(
6763
+ ) : null, /* @__PURE__ */ React23.createElement(
6764
+ "button",
6765
+ {
6766
+ type: "button",
6767
+ "data-testid": "detail-refresh",
6768
+ "data-hover": "soft",
6769
+ disabled: props.refreshDisabled,
6770
+ "aria-label": refreshLabel,
6771
+ title: refreshLabel,
6772
+ onClick: props.onRefresh,
6773
+ style: { ...HEADER_ICON_BUTTON_STYLE, opacity: props.refreshDisabled ? 0.6 : 1 }
6774
+ },
6775
+ /* @__PURE__ */ React23.createElement(RefreshIcon, null)
6776
+ ), detail.url === null ? null : /* @__PURE__ */ React23.createElement(
6691
6777
  "button",
6692
6778
  {
6693
6779
  type: "button",
@@ -6698,14 +6784,14 @@ function HeaderActions(props) {
6698
6784
  onClick: props.onCopy,
6699
6785
  style: copied ? { ...HEADER_ICON_BUTTON_STYLE, color: COLORS.success } : HEADER_ICON_BUTTON_STYLE
6700
6786
  },
6701
- copied ? /* @__PURE__ */ React22.createElement(CheckIcon, null) : /* @__PURE__ */ React22.createElement(LinkIcon, null)
6702
- ), copied ? /* @__PURE__ */ React22.createElement("span", { role: "status", "data-testid": "copy-notice", style: VISUALLY_HIDDEN_STYLE }, t2("detail.copiedNotice")) : null);
6787
+ copied ? /* @__PURE__ */ React23.createElement(CheckIcon, null) : /* @__PURE__ */ React23.createElement(LinkIcon, null)
6788
+ ), copied ? /* @__PURE__ */ React23.createElement("span", { role: "status", "data-testid": "copy-notice", style: VISUALLY_HIDDEN_STYLE }, t2("detail.copiedNotice")) : null);
6703
6789
  }
6704
6790
  function CopyFailure(props) {
6705
6791
  const { t: t2 } = useI18n();
6706
6792
  const { copy, url } = props;
6707
6793
  if (copy.status !== "failed" || url === null) return null;
6708
- return /* @__PURE__ */ React22.createElement(
6794
+ return /* @__PURE__ */ React23.createElement(
6709
6795
  "div",
6710
6796
  {
6711
6797
  role: "alert",
@@ -6713,7 +6799,7 @@ function CopyFailure(props) {
6713
6799
  style: { ...DETAIL_ERROR_STYLE, ...DETAIL_STACK_STYLE }
6714
6800
  },
6715
6801
  copy.message,
6716
- /* @__PURE__ */ React22.createElement(
6802
+ /* @__PURE__ */ React23.createElement(
6717
6803
  "input",
6718
6804
  {
6719
6805
  "data-testid": "detail-link",
@@ -6732,12 +6818,12 @@ function PropertyStrip(props) {
6732
6818
  const { t: t2 } = useI18n();
6733
6819
  const { detail, busy, options } = props;
6734
6820
  const unsupported = unsupportedActions(detail);
6735
- return /* @__PURE__ */ React22.createElement("div", { style: DETAIL_STACK_STYLE }, /* @__PURE__ */ React22.createElement("div", { style: DETAIL_STRIP_STYLE }, /* @__PURE__ */ React22.createElement(
6821
+ return /* @__PURE__ */ React23.createElement("div", { style: DETAIL_STACK_STYLE }, /* @__PURE__ */ React23.createElement("div", { style: DETAIL_STRIP_STYLE }, /* @__PURE__ */ React23.createElement(
6736
6822
  TokenGroup,
6737
6823
  {
6738
6824
  kind: "label",
6739
6825
  name: t2("detail.labels"),
6740
- icon: /* @__PURE__ */ React22.createElement(TagIcon, null),
6826
+ icon: /* @__PURE__ */ React23.createElement(TagIcon, null),
6741
6827
  values: detail.labels,
6742
6828
  colors: options.labelColors,
6743
6829
  emptyText: t2("detail.noLabels"),
@@ -6750,12 +6836,12 @@ function PropertyStrip(props) {
6750
6836
  props.onApply({ labels });
6751
6837
  }
6752
6838
  }
6753
- ), /* @__PURE__ */ React22.createElement(
6839
+ ), /* @__PURE__ */ React23.createElement(
6754
6840
  TokenGroup,
6755
6841
  {
6756
6842
  kind: "assignee",
6757
6843
  name: t2("detail.assignees"),
6758
- icon: /* @__PURE__ */ React22.createElement(PersonIcon, null),
6844
+ icon: /* @__PURE__ */ React23.createElement(PersonIcon, null),
6759
6845
  values: detail.assignees,
6760
6846
  colors: null,
6761
6847
  emptyText: t2("detail.noAssignees"),
@@ -6771,15 +6857,15 @@ function PropertyStrip(props) {
6771
6857
  props.onApply({ assignSelf: true });
6772
6858
  }
6773
6859
  }
6774
- )), unsupported.length === 0 ? null : /* @__PURE__ */ React22.createElement("div", { "data-testid": "detail-unsupported-note", style: DETAIL_HINT_STYLE }, t2("detail.unsupported", {
6860
+ )), unsupported.length === 0 ? null : /* @__PURE__ */ React23.createElement("div", { "data-testid": "detail-unsupported-note", style: DETAIL_HINT_STYLE }, t2("detail.unsupported", {
6775
6861
  backend: backendLabel(detail.backend, t2),
6776
6862
  actions: unsupported.map((key) => t2(key)).join(t2("common.listSeparator"))
6777
6863
  })));
6778
6864
  }
6779
6865
  function TokenGroup(props) {
6780
6866
  const { kind, values, busy } = props;
6781
- const [editing, setEditing] = React22.useState(false);
6782
- return /* @__PURE__ */ React22.createElement(
6867
+ const [editing, setEditing] = React23.useState(false);
6868
+ return /* @__PURE__ */ React23.createElement(
6783
6869
  "div",
6784
6870
  {
6785
6871
  role: "group",
@@ -6787,9 +6873,9 @@ function TokenGroup(props) {
6787
6873
  "data-testid": kind === "label" ? "detail-labels" : "detail-assignees",
6788
6874
  style: editing ? { ...DETAIL_GROUP_STYLE, flexBasis: "100%" } : DETAIL_GROUP_STYLE
6789
6875
  },
6790
- /* @__PURE__ */ React22.createElement("span", { title: props.name, style: DETAIL_GROUP_ICON_STYLE }, props.icon),
6791
- values.length === 0 && !editing ? /* @__PURE__ */ React22.createElement("span", { style: DETAIL_TOKEN_EMPTY_STYLE }, props.emptyText) : null,
6792
- values.map((value) => /* @__PURE__ */ React22.createElement(
6876
+ /* @__PURE__ */ React23.createElement("span", { title: props.name, style: DETAIL_GROUP_ICON_STYLE }, props.icon),
6877
+ values.length === 0 && !editing ? /* @__PURE__ */ React23.createElement("span", { style: DETAIL_TOKEN_EMPTY_STYLE }, props.emptyText) : null,
6878
+ values.map((value) => /* @__PURE__ */ React23.createElement(
6793
6879
  Token,
6794
6880
  {
6795
6881
  key: value,
@@ -6804,7 +6890,7 @@ function TokenGroup(props) {
6804
6890
  }
6805
6891
  }
6806
6892
  )),
6807
- !props.editable ? null : editing ? /* @__PURE__ */ React22.createElement(
6893
+ !props.editable ? null : editing ? /* @__PURE__ */ React23.createElement(
6808
6894
  TokenEditor,
6809
6895
  {
6810
6896
  kind,
@@ -6821,7 +6907,7 @@ function TokenGroup(props) {
6821
6907
  setEditing(false);
6822
6908
  }
6823
6909
  }
6824
- ) : /* @__PURE__ */ React22.createElement(
6910
+ ) : /* @__PURE__ */ React23.createElement(
6825
6911
  AddTokenButton,
6826
6912
  {
6827
6913
  kind,
@@ -6837,7 +6923,7 @@ function TokenGroup(props) {
6837
6923
  }
6838
6924
  function AddTokenButton(props) {
6839
6925
  const { t: t2 } = useI18n();
6840
- return /* @__PURE__ */ React22.createElement(
6926
+ return /* @__PURE__ */ React23.createElement(
6841
6927
  "button",
6842
6928
  {
6843
6929
  type: "button",
@@ -6849,7 +6935,7 @@ function AddTokenButton(props) {
6849
6935
  onClick: props.onOpen,
6850
6936
  style: DETAIL_ADD_STYLE
6851
6937
  },
6852
- /* @__PURE__ */ React22.createElement(PlusIcon, null)
6938
+ /* @__PURE__ */ React23.createElement(PlusIcon, null)
6853
6939
  );
6854
6940
  }
6855
6941
  function Token(props) {
@@ -6861,7 +6947,7 @@ function Token(props) {
6861
6947
  ...isAssignee ? { paddingLeft: 2 } : labelColorStyle(props.color ?? null),
6862
6948
  ...props.editable ? {} : { paddingRight: 9 }
6863
6949
  };
6864
- return /* @__PURE__ */ React22.createElement("span", { "data-testid": `${props.kind}-chip`, style }, isAssignee ? /* @__PURE__ */ React22.createElement(Avatar, { name: props.value, size: 16 }) : null, /* @__PURE__ */ React22.createElement("span", { "data-token-name": "", style: isAssignee ? { marginLeft: 3 } : void 0 }, props.value), props.editable ? /* @__PURE__ */ React22.createElement(
6950
+ return /* @__PURE__ */ React23.createElement("span", { "data-testid": `${props.kind}-chip`, style }, isAssignee ? /* @__PURE__ */ React23.createElement(Avatar, { name: props.value, size: 16 }) : null, /* @__PURE__ */ React23.createElement("span", { "data-token-name": "", style: isAssignee ? { marginLeft: 3 } : void 0 }, props.value), props.editable ? /* @__PURE__ */ React23.createElement(
6865
6951
  "button",
6866
6952
  {
6867
6953
  type: "button",
@@ -6873,7 +6959,7 @@ function Token(props) {
6873
6959
  onClick: props.onRemove,
6874
6960
  style: { ...DETAIL_TOKEN_REMOVE_STYLE, color: "inherit", opacity: 0.7 }
6875
6961
  },
6876
- /* @__PURE__ */ React22.createElement(CloseIcon, null)
6962
+ /* @__PURE__ */ React23.createElement(CloseIcon, null)
6877
6963
  ) : null);
6878
6964
  }
6879
6965
  function unsupportedActions(detail) {
@@ -6886,7 +6972,7 @@ function unsupportedActions(detail) {
6886
6972
  }
6887
6973
 
6888
6974
  // src/client/ticket-detail-hooks.ts
6889
- var React23 = __toESM(require("react"), 1);
6975
+ var React24 = __toESM(require("react"), 1);
6890
6976
 
6891
6977
  // src/client/clipboard.ts
6892
6978
  async function copyText2(text, t2) {
@@ -6905,15 +6991,23 @@ async function copyText2(text, t2) {
6905
6991
 
6906
6992
  // src/client/ticket-detail-hooks.ts
6907
6993
  function useDetailRequest(client, workspaceRoot, ref, number) {
6908
- const [detail, setDetail] = React23.useState(null);
6909
- const [error, setError] = React23.useState(null);
6910
- const [phase, setPhase] = React23.useState("loading");
6911
- const [attempt, setAttempt] = React23.useState(0);
6912
- React23.useEffect(() => {
6994
+ const [detail, setDetail] = React24.useState(null);
6995
+ const [error, setError] = React24.useState(null);
6996
+ const [phase, setPhase] = React24.useState("loading");
6997
+ const [attempt, setAttempt] = React24.useState(0);
6998
+ const [refreshing, setRefreshing] = React24.useState(false);
6999
+ const [refreshError, setRefreshError] = React24.useState(null);
7000
+ const readId = React24.useRef(0);
7001
+ const readRunning = React24.useRef(false);
7002
+ React24.useEffect(() => {
6913
7003
  let active = true;
7004
+ readId.current += 1;
7005
+ readRunning.current = false;
6914
7006
  setDetail(null);
6915
7007
  setError(null);
6916
7008
  setPhase("loading");
7009
+ setRefreshing(false);
7010
+ setRefreshError(null);
6917
7011
  void client.getDetail(workspaceRoot, ref, number).then((result) => {
6918
7012
  if (!active) return;
6919
7013
  if (result.ok) {
@@ -6926,8 +7020,27 @@ function useDetailRequest(client, workspaceRoot, ref, number) {
6926
7020
  });
6927
7021
  return () => {
6928
7022
  active = false;
7023
+ readId.current += 1;
6929
7024
  };
6930
7025
  }, [client, workspaceRoot, ref, number, attempt]);
7026
+ const refresh = () => {
7027
+ if (readRunning.current) return;
7028
+ readRunning.current = true;
7029
+ const current = readId.current + 1;
7030
+ readId.current = current;
7031
+ setRefreshing(true);
7032
+ void client.getDetail(workspaceRoot, ref, number).then((result) => {
7033
+ if (readId.current !== current) return;
7034
+ readRunning.current = false;
7035
+ setRefreshing(false);
7036
+ if (result.ok) {
7037
+ setDetail(result.result);
7038
+ setRefreshError(null);
7039
+ return;
7040
+ }
7041
+ setRefreshError(result.error);
7042
+ });
7043
+ };
6931
7044
  return {
6932
7045
  detail,
6933
7046
  error,
@@ -6935,13 +7048,16 @@ function useDetailRequest(client, workspaceRoot, ref, number) {
6935
7048
  reload: () => {
6936
7049
  setAttempt((value) => value + 1);
6937
7050
  },
6938
- replace: setDetail
7051
+ replace: setDetail,
7052
+ refresh,
7053
+ refreshing,
7054
+ refreshError
6939
7055
  };
6940
7056
  }
6941
7057
  function useTicketMutation(client, options) {
6942
- const [busy, setBusy] = React23.useState(false);
6943
- const [error, setError] = React23.useState(null);
6944
- const running = React23.useRef(false);
7058
+ const [busy, setBusy] = React24.useState(false);
7059
+ const [error, setError] = React24.useState(null);
7060
+ const running = React24.useRef(false);
6945
7061
  const apply2 = (patch) => {
6946
7062
  if (running.current) return;
6947
7063
  running.current = true;
@@ -6978,9 +7094,9 @@ function useTicketMutation(client, options) {
6978
7094
  return { busy, error, apply: apply2 };
6979
7095
  }
6980
7096
  function useEscapeKey(onBack) {
6981
- const handler = React23.useRef(onBack);
7097
+ const handler = React24.useRef(onBack);
6982
7098
  handler.current = onBack;
6983
- React23.useEffect(() => {
7099
+ React24.useEffect(() => {
6984
7100
  const listener = (event) => {
6985
7101
  if (event.key === "Escape") handler.current();
6986
7102
  };
@@ -6992,16 +7108,16 @@ function useEscapeKey(onBack) {
6992
7108
  }
6993
7109
  function useTicketOptions(client, workspaceRoot, eager) {
6994
7110
  const { t: t2 } = useI18n();
6995
- const [load, setLoad] = React23.useState({ status: "idle" });
6996
- const started = React23.useRef(false);
6997
- const mounted = React23.useRef(true);
6998
- React23.useEffect(() => {
7111
+ const [load, setLoad] = React24.useState({ status: "idle" });
7112
+ const started = React24.useRef(false);
7113
+ const mounted = React24.useRef(true);
7114
+ React24.useEffect(() => {
6999
7115
  mounted.current = true;
7000
7116
  return () => {
7001
7117
  mounted.current = false;
7002
7118
  };
7003
7119
  }, []);
7004
- const request = React23.useCallback(() => {
7120
+ const request = React24.useCallback(() => {
7005
7121
  if (started.current) return;
7006
7122
  started.current = true;
7007
7123
  setLoad({ status: "loading" });
@@ -7012,7 +7128,7 @@ function useTicketOptions(client, workspaceRoot, eager) {
7012
7128
  );
7013
7129
  });
7014
7130
  }, [client, workspaceRoot]);
7015
- React23.useEffect(() => {
7131
+ React24.useEffect(() => {
7016
7132
  if (eager) request();
7017
7133
  }, [eager, request]);
7018
7134
  return optionsState(load, request, t2);
@@ -7047,9 +7163,9 @@ function optionsState(load, request, t2) {
7047
7163
  };
7048
7164
  }
7049
7165
  function useTicketDeletion(client, target) {
7050
- const [confirming, setConfirming] = React23.useState(false);
7051
- const [deleting, setDeleting] = React23.useState(false);
7052
- const [error, setError] = React23.useState(null);
7166
+ const [confirming, setConfirming] = React24.useState(false);
7167
+ const [deleting, setDeleting] = React24.useState(false);
7168
+ const [error, setError] = React24.useState(null);
7053
7169
  const confirm = () => {
7054
7170
  if (deleting) return;
7055
7171
  setDeleting(true);
@@ -7082,8 +7198,8 @@ function useTicketDeletion(client, target) {
7082
7198
  }
7083
7199
  var COPIED_RESET_MS = 2e3;
7084
7200
  function useCopyLink(url, t2) {
7085
- const [copy, setCopy] = React23.useState({ status: "idle" });
7086
- React23.useEffect(() => {
7201
+ const [copy, setCopy] = React24.useState({ status: "idle" });
7202
+ React24.useEffect(() => {
7087
7203
  if (copy.status !== "copied") return;
7088
7204
  const timer = setTimeout(() => {
7089
7205
  setCopy({ status: "idle" });
@@ -7102,7 +7218,7 @@ function useCopyLink(url, t2) {
7102
7218
  }
7103
7219
 
7104
7220
  // src/client/ticket-timeline.tsx
7105
- var React25 = __toESM(require("react"), 1);
7221
+ var React26 = __toESM(require("react"), 1);
7106
7222
 
7107
7223
  // node_modules/.pnpm/markdown-to-jsx@9.10.3_react@19.3.1/node_modules/markdown-to-jsx/dist/react.js
7108
7224
  var Ye = __toESM(require("react"), 1);
@@ -10252,13 +10368,13 @@ function Ln(e2 = "", t2 = {}) {
10252
10368
  }
10253
10369
 
10254
10370
  // src/client/markdown-body.tsx
10255
- var React24 = __toESM(require("react"), 1);
10371
+ var React25 = __toESM(require("react"), 1);
10256
10372
  function MarkdownBody(props) {
10257
10373
  const attachments = props.attachments ?? null;
10258
- const content = React24.useMemo(() => {
10374
+ const content = React25.useMemo(() => {
10259
10375
  const overrides = attachments === null ? { a: { component: ExternalLink } } : {
10260
10376
  a: {
10261
- component: (attributes) => /* @__PURE__ */ React24.createElement(
10377
+ component: (attributes) => /* @__PURE__ */ React25.createElement(
10262
10378
  ExternalLink,
10263
10379
  {
10264
10380
  ...attributes,
@@ -10267,17 +10383,17 @@ function MarkdownBody(props) {
10267
10383
  )
10268
10384
  },
10269
10385
  img: {
10270
- component: (attributes) => /* @__PURE__ */ React24.createElement(UploadImage, { ...attributes, attachments })
10386
+ component: (attributes) => /* @__PURE__ */ React25.createElement(UploadImage, { ...attributes, attachments })
10271
10387
  }
10272
10388
  };
10273
10389
  return Ln(props.source, {
10274
10390
  disableParsingRawHTML: true,
10275
10391
  forceBlock: true,
10276
- wrapper: React24.Fragment,
10392
+ wrapper: React25.Fragment,
10277
10393
  overrides
10278
10394
  });
10279
10395
  }, [attachments, props.source]);
10280
- return /* @__PURE__ */ React24.createElement("div", { "data-testid": props.testId, ...{ [MARKDOWN_ATTRIBUTE]: "" } }, content);
10396
+ return /* @__PURE__ */ React25.createElement("div", { "data-testid": props.testId, ...{ [MARKDOWN_ATTRIBUTE]: "" } }, content);
10281
10397
  }
10282
10398
  function uploadPathOf(baseUrl, src) {
10283
10399
  if (src === void 0) return null;
@@ -10292,8 +10408,8 @@ function UploadImage(props) {
10292
10408
  const { attachments, ...attributes } = props;
10293
10409
  const { t: t2 } = useI18n();
10294
10410
  const path = uploadPathOf(attachments.baseUrl, attributes.src);
10295
- const [loaded, setLoaded] = React24.useState(null);
10296
- React24.useEffect(() => {
10411
+ const [loaded, setLoaded] = React25.useState(null);
10412
+ React25.useEffect(() => {
10297
10413
  if (path === null) return void 0;
10298
10414
  let active = true;
10299
10415
  void attachments.load(path).then((url) => {
@@ -10303,16 +10419,16 @@ function UploadImage(props) {
10303
10419
  active = false;
10304
10420
  };
10305
10421
  }, [attachments, path]);
10306
- if (path === null) return /* @__PURE__ */ React24.createElement("img", { ...attributes });
10422
+ if (path === null) return /* @__PURE__ */ React25.createElement("img", { ...attributes });
10307
10423
  const name = attributes.alt !== void 0 && attributes.alt.length > 0 ? attributes.alt : fileName(path);
10308
10424
  const state = loaded?.path === path ? loaded : null;
10309
10425
  if (state === null) {
10310
- return /* @__PURE__ */ React24.createElement("span", { "data-attachment": "loading", role: "img", "aria-label": name }, t2("detail.attachment.loading", { name }));
10426
+ return /* @__PURE__ */ React25.createElement("span", { "data-attachment": "loading", role: "img", "aria-label": name }, t2("detail.attachment.loading", { name }));
10311
10427
  }
10312
10428
  if (state.url !== null) {
10313
- return /* @__PURE__ */ React24.createElement("img", { ...attributes, src: state.url, alt: name, "data-attachment": "loaded" });
10429
+ return /* @__PURE__ */ React25.createElement("img", { ...attributes, src: state.url, alt: name, "data-attachment": "loaded" });
10314
10430
  }
10315
- return /* @__PURE__ */ React24.createElement(
10431
+ return /* @__PURE__ */ React25.createElement(
10316
10432
  ExternalLink,
10317
10433
  {
10318
10434
  "data-attachment": "failed",
@@ -10330,19 +10446,19 @@ function fileName(path) {
10330
10446
  }
10331
10447
  }
10332
10448
  function ExternalLink(props) {
10333
- return /* @__PURE__ */ React24.createElement("a", { ...props, target: "_blank", rel: "noopener noreferrer" });
10449
+ return /* @__PURE__ */ React25.createElement("a", { ...props, target: "_blank", rel: "noopener noreferrer" });
10334
10450
  }
10335
10451
 
10336
10452
  // src/client/ticket-timeline.tsx
10337
10453
  function Timeline(props) {
10338
10454
  const { t: t2 } = useI18n();
10339
10455
  const { detail, loadAttachment } = props;
10340
- const attachments = React25.useMemo(
10456
+ const attachments = React26.useMemo(
10341
10457
  () => detail.uploadsBaseUrl === null || loadAttachment === void 0 ? null : { baseUrl: detail.uploadsBaseUrl, load: loadAttachment },
10342
10458
  [detail.uploadsBaseUrl, loadAttachment]
10343
10459
  );
10344
10460
  const count = detail.comments.length;
10345
- return /* @__PURE__ */ React25.createElement("div", { style: TIMELINE_STYLE }, /* @__PURE__ */ React25.createElement(
10461
+ return /* @__PURE__ */ React26.createElement("div", { style: TIMELINE_STYLE }, /* @__PURE__ */ React26.createElement(
10346
10462
  TimelineCard,
10347
10463
  {
10348
10464
  testId: "detail-body-section",
@@ -10353,8 +10469,8 @@ function Timeline(props) {
10353
10469
  isTicketAuthor: false,
10354
10470
  ariaLabel: t2("detail.bodyLabel")
10355
10471
  },
10356
- detail.body.trim().length === 0 ? /* @__PURE__ */ React25.createElement("div", { "data-testid": "detail-no-body", style: TIMELINE_EMPTY_STYLE }, t2("detail.noBody")) : /* @__PURE__ */ React25.createElement(MarkdownBody, { testId: "detail-body", source: detail.body, attachments })
10357
- ), /* @__PURE__ */ React25.createElement("section", { "data-testid": "detail-comments", "aria-label": t2("detail.commentsAria", { count }) }, count === 0 ? /* @__PURE__ */ React25.createElement(React25.Fragment, null, /* @__PURE__ */ React25.createElement("div", { style: TIMELINE_CONNECTOR_STYLE }), /* @__PURE__ */ React25.createElement("div", { "data-testid": "detail-no-comments", style: TIMELINE_EMPTY_STYLE }, t2("detail.noComments"))) : detail.comments.map((comment, index) => /* @__PURE__ */ React25.createElement(
10472
+ detail.body.trim().length === 0 ? /* @__PURE__ */ React26.createElement("div", { "data-testid": "detail-no-body", style: TIMELINE_EMPTY_STYLE }, t2("detail.noBody")) : /* @__PURE__ */ React26.createElement(MarkdownBody, { testId: "detail-body", source: detail.body, attachments })
10473
+ ), /* @__PURE__ */ React26.createElement("section", { "data-testid": "detail-comments", "aria-label": t2("detail.commentsAria", { count }) }, count === 0 ? /* @__PURE__ */ React26.createElement(React26.Fragment, null, /* @__PURE__ */ React26.createElement("div", { style: TIMELINE_CONNECTOR_STYLE }), /* @__PURE__ */ React26.createElement("div", { "data-testid": "detail-no-comments", style: TIMELINE_EMPTY_STYLE }, t2("detail.noComments"))) : detail.comments.map((comment, index) => /* @__PURE__ */ React26.createElement(
10358
10474
  CommentCard,
10359
10475
  {
10360
10476
  key: `${comment.author ?? ""}:${comment.createdAt ?? ""}:${String(index)}`,
@@ -10367,7 +10483,7 @@ function Timeline(props) {
10367
10483
  function CommentCard(props) {
10368
10484
  const { t: t2 } = useI18n();
10369
10485
  const { comment } = props;
10370
- return /* @__PURE__ */ React25.createElement(React25.Fragment, null, /* @__PURE__ */ React25.createElement("div", { style: TIMELINE_CONNECTOR_STYLE }), /* @__PURE__ */ React25.createElement(
10486
+ return /* @__PURE__ */ React26.createElement(React26.Fragment, null, /* @__PURE__ */ React26.createElement("div", { style: TIMELINE_CONNECTOR_STYLE }), /* @__PURE__ */ React26.createElement(
10371
10487
  TimelineCard,
10372
10488
  {
10373
10489
  testId: "detail-comment",
@@ -10378,13 +10494,13 @@ function CommentCard(props) {
10378
10494
  isTicketAuthor: comment.author !== null && comment.author === props.ticketAuthor,
10379
10495
  ariaLabel: t2("detail.commentBy", { author: comment.author ?? t2("detail.unsigned") })
10380
10496
  },
10381
- /* @__PURE__ */ React25.createElement(MarkdownBody, { source: comment.body, attachments: props.attachments })
10497
+ /* @__PURE__ */ React26.createElement(MarkdownBody, { source: comment.body, attachments: props.attachments })
10382
10498
  ));
10383
10499
  }
10384
10500
  function TimelineCard(props) {
10385
10501
  const { t: t2 } = useI18n();
10386
10502
  const header = props.isTicketAuthor ? { ...TIMELINE_CARD_HEADER_STYLE, ...TIMELINE_CARD_AUTHOR_HEADER_STYLE } : TIMELINE_CARD_HEADER_STYLE;
10387
- return /* @__PURE__ */ React25.createElement("article", { "data-testid": props.testId, "aria-label": props.ariaLabel, style: TIMELINE_CARD_STYLE }, /* @__PURE__ */ React25.createElement("header", { style: header }, /* @__PURE__ */ React25.createElement(Avatar, { name: props.author }), /* @__PURE__ */ React25.createElement("span", { "data-testid": props.authorTestId, style: TIMELINE_TIME_STYLE }, /* @__PURE__ */ React25.createElement("span", { style: TIMELINE_NAME_STYLE }, props.author ?? t2("detail.unsigned")), props.time === null ? "" : ` ${props.verb} ${formatTime(props.time)}`), props.isTicketAuthor ? /* @__PURE__ */ React25.createElement("span", { "data-testid": "author-badge", style: TIMELINE_AUTHOR_BADGE_STYLE }, t2("detail.author")) : null), /* @__PURE__ */ React25.createElement("div", { style: TIMELINE_CARD_BODY_STYLE }, props.children));
10503
+ return /* @__PURE__ */ React26.createElement("article", { "data-testid": props.testId, "aria-label": props.ariaLabel, style: TIMELINE_CARD_STYLE }, /* @__PURE__ */ React26.createElement("header", { style: header }, /* @__PURE__ */ React26.createElement(Avatar, { name: props.author }), /* @__PURE__ */ React26.createElement("span", { "data-testid": props.authorTestId, style: TIMELINE_TIME_STYLE }, /* @__PURE__ */ React26.createElement("span", { style: TIMELINE_NAME_STYLE }, props.author ?? t2("detail.unsigned")), props.time === null ? "" : ` ${props.verb} ${formatTime(props.time)}`), props.isTicketAuthor ? /* @__PURE__ */ React26.createElement("span", { "data-testid": "author-badge", style: TIMELINE_AUTHOR_BADGE_STYLE }, t2("detail.author")) : null), /* @__PURE__ */ React26.createElement("div", { style: TIMELINE_CARD_BODY_STYLE }, props.children));
10388
10504
  }
10389
10505
  function formatTime(value) {
10390
10506
  const match = /^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2})/.exec(value);
@@ -10413,24 +10529,18 @@ function TicketDetailView(props) {
10413
10529
  const ref = ticket.ref;
10414
10530
  const number = ticket.number;
10415
10531
  const request = useDetailRequest(client, workspaceRoot, ref, number);
10416
- const loadAttachment = React26.useMemo(
10532
+ const loadAttachment = React27.useMemo(
10417
10533
  () => createAttachmentLoader(client, workspaceRoot),
10418
10534
  [client, workspaceRoot]
10419
10535
  );
10420
10536
  const detail = request.detail;
10421
- const [currentTicket, setCurrentTicket] = React26.useState(ticket);
10422
- React26.useEffect(() => {
10423
- setCurrentTicket(ticket);
10424
- }, [ticket]);
10537
+ const { current: currentTicket, updateFromSnapshot } = useCurrentTicket(ticket);
10425
10538
  const mutation = useTicketMutation(client, {
10426
10539
  workspaceRoot,
10427
10540
  ref,
10428
10541
  number,
10429
10542
  onUpdated: request.replace,
10430
- onSnapshot: (snapshot) => {
10431
- const next = snapshot.tickets.find((item) => item.ref === ref);
10432
- if (next !== void 0) setCurrentTicket(next);
10433
- }
10543
+ onSnapshot: updateFromSnapshot
10434
10544
  });
10435
10545
  const deletion = useTicketDeletion(client, {
10436
10546
  workspaceRoot,
@@ -10441,9 +10551,13 @@ function TicketDetailView(props) {
10441
10551
  const options = useTicketOptions(client, workspaceRoot, detail?.capabilities.labels === true);
10442
10552
  const { injected, notice, onSkillAction } = useTicketActions(workspaceRoot, props.injection);
10443
10553
  const link = useCopyLink(detail?.url ?? null, t2);
10444
- const busy = mutation.busy || deletion.deleting;
10554
+ const { busy, refreshDisabled, onRefresh } = refreshControls(request, {
10555
+ onRefreshSnapshot: props.onRefreshSnapshot,
10556
+ writeBusy: mutation.busy || deletion.deleting,
10557
+ confirming: deletion.confirming
10558
+ });
10445
10559
  useEscapeKey(props.onBack);
10446
- return /* @__PURE__ */ React26.createElement("div", { "data-testid": "ticket-detail", style: DETAIL_ROOT_STYLE }, /* @__PURE__ */ React26.createElement(DetailHeader, { refText: ref, detail, onBack: props.onBack }, /* @__PURE__ */ React26.createElement(
10560
+ return /* @__PURE__ */ React27.createElement("div", { "data-testid": "ticket-detail", style: DETAIL_ROOT_STYLE }, /* @__PURE__ */ React27.createElement(DetailHeader, { refText: ref, detail, onBack: props.onBack }, /* @__PURE__ */ React27.createElement(
10447
10561
  SkillActionBadge,
10448
10562
  {
10449
10563
  ticket: currentTicket,
@@ -10451,16 +10565,19 @@ function TicketDetailView(props) {
10451
10565
  injection: props.injection,
10452
10566
  onSkillAction
10453
10567
  }
10454
- ), detail === null ? null : /* @__PURE__ */ React26.createElement(
10568
+ ), detail === null ? null : /* @__PURE__ */ React27.createElement(
10455
10569
  HeaderActions,
10456
10570
  {
10457
10571
  detail,
10458
10572
  busy,
10459
10573
  onApply: mutation.apply,
10460
10574
  copy: link.copy,
10461
- onCopy: link.onCopy
10575
+ onCopy: link.onCopy,
10576
+ onRefresh,
10577
+ refreshing: request.refreshing,
10578
+ refreshDisabled
10462
10579
  }
10463
- ), detail?.capabilities.delete === true ? /* @__PURE__ */ React26.createElement(MoreMenu, { onDelete: deletion.open }) : null), detail !== null ? /* @__PURE__ */ React26.createElement(
10580
+ ), detail?.capabilities.delete === true ? /* @__PURE__ */ React27.createElement(MoreMenu, { onDelete: deletion.open }) : null), /* @__PURE__ */ React27.createElement(RefreshFailure, { error: request.refreshError }), detail !== null ? /* @__PURE__ */ React27.createElement(
10464
10581
  DetailContent,
10465
10582
  {
10466
10583
  detail,
@@ -10473,13 +10590,42 @@ function TicketDetailView(props) {
10473
10590
  deletion,
10474
10591
  onApply: mutation.apply
10475
10592
  }
10476
- ) : request.phase === "error" ? /* @__PURE__ */ React26.createElement(LoadError, { error: request.error, onRetry: request.reload }) : /* @__PURE__ */ React26.createElement("div", { "data-testid": "detail-loading", style: EMPTY_STYLE }, t2("detail.loading")));
10593
+ ) : request.phase === "error" ? /* @__PURE__ */ React27.createElement(LoadError, { error: request.error, onRetry: request.reload }) : /* @__PURE__ */ React27.createElement("div", { "data-testid": "detail-loading", style: EMPTY_STYLE }, t2("detail.loading")));
10594
+ }
10595
+ function useCurrentTicket(ticket) {
10596
+ const [current, setCurrent] = React27.useState(ticket);
10597
+ React27.useEffect(() => {
10598
+ setCurrent(ticket);
10599
+ }, [ticket]);
10600
+ return {
10601
+ current,
10602
+ updateFromSnapshot: (snapshot) => {
10603
+ const next = snapshot.tickets.find((item) => item.ref === ticket.ref);
10604
+ if (next !== void 0) setCurrent(next);
10605
+ }
10606
+ };
10607
+ }
10608
+ function refreshControls(request, options) {
10609
+ const busy = options.writeBusy || request.refreshing;
10610
+ return {
10611
+ busy,
10612
+ refreshDisabled: busy || options.confirming,
10613
+ onRefresh: () => {
10614
+ request.refresh();
10615
+ options.onRefreshSnapshot();
10616
+ }
10617
+ };
10618
+ }
10619
+ function RefreshFailure(props) {
10620
+ const { t: t2 } = useI18n();
10621
+ if (props.error === null) return null;
10622
+ return /* @__PURE__ */ React27.createElement("div", { role: "alert", "data-testid": "detail-refresh-error", style: DETAIL_REFRESH_ERROR_STYLE }, t2("detail.refreshFailed", { detail: errorText(props.error, t2) }));
10477
10623
  }
10478
10624
  function DetailHeader(props) {
10479
10625
  const { t: t2 } = useI18n();
10480
10626
  const { detail } = props;
10481
10627
  const url = detail?.url ?? null;
10482
- return /* @__PURE__ */ React26.createElement("header", { style: DETAIL_HEADER_STYLE }, /* @__PURE__ */ React26.createElement(
10628
+ return /* @__PURE__ */ React27.createElement("header", { style: DETAIL_HEADER_STYLE }, /* @__PURE__ */ React27.createElement(
10483
10629
  "button",
10484
10630
  {
10485
10631
  type: "button",
@@ -10489,9 +10635,9 @@ function DetailHeader(props) {
10489
10635
  onClick: props.onBack,
10490
10636
  style: DETAIL_BACK_STYLE
10491
10637
  },
10492
- /* @__PURE__ */ React26.createElement(ChevronLeftIcon, null),
10638
+ /* @__PURE__ */ React27.createElement(ChevronLeftIcon, null),
10493
10639
  t2("detail.back")
10494
- ), url === null ? /* @__PURE__ */ React26.createElement("span", { "data-testid": "detail-ref", title: props.refText, style: DETAIL_REF_STYLE }, props.refText) : /* @__PURE__ */ React26.createElement(
10640
+ ), url === null ? /* @__PURE__ */ React27.createElement("span", { "data-testid": "detail-ref", title: props.refText, style: DETAIL_REF_STYLE }, props.refText) : /* @__PURE__ */ React27.createElement(
10495
10641
  "a",
10496
10642
  {
10497
10643
  "data-testid": "detail-ref",
@@ -10503,13 +10649,13 @@ function DetailHeader(props) {
10503
10649
  style: DETAIL_REF_LINK_STYLE
10504
10650
  },
10505
10651
  props.refText
10506
- ), detail === null ? null : /* @__PURE__ */ React26.createElement("span", { "data-testid": "detail-backend", style: BACKEND_BADGE_STYLE }, backendLabel(detail.backend, t2)), /* @__PURE__ */ React26.createElement("span", { style: { flex: 1 } }), props.children);
10652
+ ), detail === null ? null : /* @__PURE__ */ React27.createElement("span", { "data-testid": "detail-backend", style: BACKEND_BADGE_STYLE }, backendLabel(detail.backend, t2)), /* @__PURE__ */ React27.createElement("span", { style: { flex: 1 } }), props.children);
10507
10653
  }
10508
10654
  function DetailContent(props) {
10509
10655
  const { t: t2 } = useI18n();
10510
10656
  const { detail, deletion } = props;
10511
10657
  const fieldProps = { detail, busy: props.busy, onApply: props.onApply };
10512
- return /* @__PURE__ */ React26.createElement("div", { "data-testid": "detail-content", "aria-busy": props.busy, style: DETAIL_SCROLL_STYLE }, deletion.confirming ? /* @__PURE__ */ React26.createElement(
10658
+ return /* @__PURE__ */ React27.createElement("div", { "data-testid": "detail-content", "aria-busy": props.busy, style: DETAIL_SCROLL_STYLE }, deletion.confirming ? /* @__PURE__ */ React27.createElement(
10513
10659
  DeleteConfirm,
10514
10660
  {
10515
10661
  refText: detail.ref,
@@ -10520,17 +10666,17 @@ function DetailContent(props) {
10520
10666
  onCancel: deletion.cancel,
10521
10667
  onConfirm: deletion.confirm
10522
10668
  }
10523
- ) : null, /* @__PURE__ */ React26.createElement(CopyFailure, { copy: props.copy, url: detail.url }), props.notice === null ? null : /* @__PURE__ */ React26.createElement("div", { role: "status", "data-testid": "inject-notice", style: DETAIL_HINT_STYLE }, props.notice), /* @__PURE__ */ React26.createElement(TitleBlock, { detail }), /* @__PURE__ */ React26.createElement(PropertyStrip, { ...fieldProps, options: props.options }), props.mutationError === null ? null : /* @__PURE__ */ React26.createElement("div", { role: "alert", "data-testid": "detail-error", style: DETAIL_ERROR_STYLE }, errorText(props.mutationError, t2)), /* @__PURE__ */ React26.createElement(Timeline, { detail, loadAttachment: props.loadAttachment }));
10669
+ ) : null, /* @__PURE__ */ React27.createElement(CopyFailure, { copy: props.copy, url: detail.url }), props.notice === null ? null : /* @__PURE__ */ React27.createElement("div", { role: "status", "data-testid": "inject-notice", style: DETAIL_HINT_STYLE }, props.notice), /* @__PURE__ */ React27.createElement(TitleBlock, { detail }), /* @__PURE__ */ React27.createElement(PropertyStrip, { ...fieldProps, options: props.options }), props.mutationError === null ? null : /* @__PURE__ */ React27.createElement("div", { role: "alert", "data-testid": "detail-error", style: DETAIL_ERROR_STYLE }, errorText(props.mutationError, t2)), /* @__PURE__ */ React27.createElement(Timeline, { detail, loadAttachment: props.loadAttachment }));
10524
10670
  }
10525
10671
  var NOWRAP_STYLE = { whiteSpace: "nowrap" };
10526
10672
  function TitleBlock(props) {
10527
10673
  const { t: t2 } = useI18n();
10528
10674
  const { detail } = props;
10529
- return /* @__PURE__ */ React26.createElement("div", { style: DETAIL_STACK_STYLE }, /* @__PURE__ */ React26.createElement("h2", { "data-testid": "detail-title", title: detail.title, style: DETAIL_TITLE_STYLE }, detail.title), /* @__PURE__ */ React26.createElement("div", { "data-testid": "detail-meta", style: TITLE_META_ROW_STYLE }, /* @__PURE__ */ React26.createElement("span", { "data-testid": "detail-state", style: STATE_PILL_STYLES[detail.state] }, /* @__PURE__ */ React26.createElement("span", { style: STATUS_DOT_STYLE, "aria-hidden": "true" }), t2(detail.state === "open" ? "detail.state.open" : "detail.state.closed")), /* @__PURE__ */ React26.createElement("span", { style: NOWRAP_STYLE }, detail.author === null ? null : /* @__PURE__ */ React26.createElement("span", { style: TITLE_META_NAME_STYLE }, detail.author, " "), t2("detail.createdAt", { time: formatTime(detail.createdAt) }), " \xB7"), /* @__PURE__ */ React26.createElement("span", { style: NOWRAP_STYLE }, t2("detail.updatedAt", { time: formatTime(detail.updatedAt) }), " \xB7"), /* @__PURE__ */ React26.createElement("span", { style: NOWRAP_STYLE }, t2("detail.comments", { count: detail.comments.length }))));
10675
+ return /* @__PURE__ */ React27.createElement("div", { style: DETAIL_STACK_STYLE }, /* @__PURE__ */ React27.createElement("h2", { "data-testid": "detail-title", title: detail.title, style: DETAIL_TITLE_STYLE }, detail.title), /* @__PURE__ */ React27.createElement("div", { "data-testid": "detail-meta", style: TITLE_META_ROW_STYLE }, /* @__PURE__ */ React27.createElement("span", { "data-testid": "detail-state", style: STATE_PILL_STYLES[detail.state] }, /* @__PURE__ */ React27.createElement("span", { style: STATUS_DOT_STYLE, "aria-hidden": "true" }), t2(detail.state === "open" ? "detail.state.open" : "detail.state.closed")), /* @__PURE__ */ React27.createElement("span", { style: NOWRAP_STYLE }, detail.author === null ? null : /* @__PURE__ */ React27.createElement("span", { style: TITLE_META_NAME_STYLE }, detail.author, " "), t2("detail.createdAt", { time: formatTime(detail.createdAt) }), " \xB7"), /* @__PURE__ */ React27.createElement("span", { style: NOWRAP_STYLE }, t2("detail.updatedAt", { time: formatTime(detail.updatedAt) }), " \xB7"), /* @__PURE__ */ React27.createElement("span", { style: NOWRAP_STYLE }, t2("detail.comments", { count: detail.comments.length }))));
10530
10676
  }
10531
10677
  function LoadError(props) {
10532
10678
  const { t: t2 } = useI18n();
10533
- return /* @__PURE__ */ React26.createElement("div", { style: DETAIL_SCROLL_STYLE }, /* @__PURE__ */ React26.createElement("div", { role: "alert", "data-testid": "detail-load-error", style: ERROR_STYLE }, /* @__PURE__ */ React26.createElement("div", null, props.error === null ? t2("detail.loadFailed") : errorText(props.error, t2)), /* @__PURE__ */ React26.createElement(
10679
+ return /* @__PURE__ */ React27.createElement("div", { style: DETAIL_SCROLL_STYLE }, /* @__PURE__ */ React27.createElement("div", { role: "alert", "data-testid": "detail-load-error", style: ERROR_STYLE }, /* @__PURE__ */ React27.createElement("div", null, props.error === null ? t2("detail.loadFailed") : errorText(props.error, t2)), /* @__PURE__ */ React27.createElement(
10534
10680
  "button",
10535
10681
  {
10536
10682
  type: "button",
@@ -10544,27 +10690,27 @@ function LoadError(props) {
10544
10690
  }
10545
10691
 
10546
10692
  // src/client/ticket-tree-session.tsx
10547
- var React27 = __toESM(require("react"), 1);
10548
- var CONTEXT = React27.createContext(null);
10693
+ var React28 = __toESM(require("react"), 1);
10694
+ var CONTEXT = React28.createContext(null);
10549
10695
  function TicketTreeSessionProvider(props) {
10550
- const [collapsed, setCollapsed] = React27.useState(() => /* @__PURE__ */ new Set());
10551
- const previousRoot = React27.useRef(props.workspaceRoot);
10696
+ const [collapsed, setCollapsed] = React28.useState(() => /* @__PURE__ */ new Set());
10697
+ const previousRoot = React28.useRef(props.workspaceRoot);
10552
10698
  if (previousRoot.current !== props.workspaceRoot) {
10553
10699
  previousRoot.current = props.workspaceRoot;
10554
10700
  setCollapsed(/* @__PURE__ */ new Set());
10555
10701
  }
10556
- const value = React27.useMemo(() => ({ collapsed, setCollapsed }), [collapsed]);
10557
- return /* @__PURE__ */ React27.createElement(CONTEXT.Provider, { value }, props.children);
10702
+ const value = React28.useMemo(() => ({ collapsed, setCollapsed }), [collapsed]);
10703
+ return /* @__PURE__ */ React28.createElement(CONTEXT.Provider, { value }, props.children);
10558
10704
  }
10559
10705
  function useTicketTreeSession() {
10560
- return React27.useContext(CONTEXT);
10706
+ return React28.useContext(CONTEXT);
10561
10707
  }
10562
10708
 
10563
10709
  // src/client/tickets-view.tsx
10564
- var React40 = __toESM(require("react"), 1);
10710
+ var React41 = __toESM(require("react"), 1);
10565
10711
 
10566
10712
  // src/client/my-tickets-bar.tsx
10567
- var React28 = __toESM(require("react"), 1);
10713
+ var React29 = __toESM(require("react"), 1);
10568
10714
 
10569
10715
  // src/client/my-filter-styles.ts
10570
10716
  var MY_FILTER_ROW_STYLE = {
@@ -10636,7 +10782,7 @@ var MY_FILTER_VIEWER_STYLE = {
10636
10782
  // src/client/my-tickets-bar.tsx
10637
10783
  function MyTicketsBar(props) {
10638
10784
  const { t: t2 } = useI18n();
10639
- return /* @__PURE__ */ React28.createElement(
10785
+ return /* @__PURE__ */ React29.createElement(
10640
10786
  "div",
10641
10787
  {
10642
10788
  "data-testid": "mine-filters",
@@ -10644,8 +10790,8 @@ function MyTicketsBar(props) {
10644
10790
  "aria-label": t2("mine.group"),
10645
10791
  style: MY_FILTER_ROW_STYLE
10646
10792
  },
10647
- /* @__PURE__ */ React28.createElement("span", { "aria-hidden": "true", style: MY_FILTER_ICON_STYLE }, /* @__PURE__ */ React28.createElement(PersonIcon, null)),
10648
- /* @__PURE__ */ React28.createElement(
10793
+ /* @__PURE__ */ React29.createElement("span", { "aria-hidden": "true", style: MY_FILTER_ICON_STYLE }, /* @__PURE__ */ React29.createElement(PersonIcon, null)),
10794
+ /* @__PURE__ */ React29.createElement(
10649
10795
  MineChip,
10650
10796
  {
10651
10797
  testId: "mine-assigned",
@@ -10655,7 +10801,7 @@ function MyTicketsBar(props) {
10655
10801
  onClick: props.onToggleAssigned
10656
10802
  }
10657
10803
  ),
10658
- /* @__PURE__ */ React28.createElement(
10804
+ /* @__PURE__ */ React29.createElement(
10659
10805
  MineChip,
10660
10806
  {
10661
10807
  testId: "mine-created",
@@ -10665,7 +10811,7 @@ function MyTicketsBar(props) {
10665
10811
  onClick: props.onToggleCreated
10666
10812
  }
10667
10813
  ),
10668
- props.assignedToMe || props.createdByMe ? /* @__PURE__ */ React28.createElement(
10814
+ props.assignedToMe || props.createdByMe ? /* @__PURE__ */ React29.createElement(
10669
10815
  "button",
10670
10816
  {
10671
10817
  type: "button",
@@ -10676,7 +10822,7 @@ function MyTicketsBar(props) {
10676
10822
  },
10677
10823
  t2("mine.clear")
10678
10824
  ) : null,
10679
- /* @__PURE__ */ React28.createElement(
10825
+ /* @__PURE__ */ React29.createElement(
10680
10826
  "span",
10681
10827
  {
10682
10828
  "data-testid": "mine-viewer",
@@ -10689,7 +10835,7 @@ function MyTicketsBar(props) {
10689
10835
  }
10690
10836
  function MineChip(props) {
10691
10837
  const { t: t2 } = useI18n();
10692
- return /* @__PURE__ */ React28.createElement(
10838
+ return /* @__PURE__ */ React29.createElement(
10693
10839
  "button",
10694
10840
  {
10695
10841
  type: "button",
@@ -10704,7 +10850,7 @@ function MineChip(props) {
10704
10850
  }
10705
10851
  },
10706
10852
  props.label,
10707
- /* @__PURE__ */ React28.createElement(
10853
+ /* @__PURE__ */ React29.createElement(
10708
10854
  "span",
10709
10855
  {
10710
10856
  style: {
@@ -10718,7 +10864,7 @@ function MineChip(props) {
10718
10864
  }
10719
10865
 
10720
10866
  // src/client/ticket-list.tsx
10721
- var React31 = __toESM(require("react"), 1);
10867
+ var React32 = __toESM(require("react"), 1);
10722
10868
 
10723
10869
  // src/client/author-text.ts
10724
10870
  function authorName(author) {
@@ -10729,7 +10875,7 @@ function authorTitle(author, t2) {
10729
10875
  }
10730
10876
 
10731
10877
  // src/client/ticket-avatar.tsx
10732
- var React29 = __toESM(require("react"), 1);
10878
+ var React30 = __toESM(require("react"), 1);
10733
10879
 
10734
10880
  // src/client/ticket-row-styles.ts
10735
10881
  var CARD_META_STYLE = {
@@ -10892,13 +11038,13 @@ var NUMBER_MARK_STYLE = {
10892
11038
  // src/client/ticket-avatar.tsx
10893
11039
  function TicketAvatar(props) {
10894
11040
  const { t: t2 } = useI18n();
10895
- const [failedSrc, setFailedSrc] = React29.useState(null);
11041
+ const [failedSrc, setFailedSrc] = React30.useState(null);
10896
11042
  const { author } = props;
10897
11043
  const label = t2("ticket.avatar.label", { name: authorName(author) });
10898
11044
  const hint = authorTitle(author, t2);
10899
11045
  const src = usableAvatarUrl(author.avatarUrl);
10900
11046
  if (src !== null && src !== failedSrc) {
10901
- return /* @__PURE__ */ React29.createElement(
11047
+ return /* @__PURE__ */ React30.createElement(
10902
11048
  "img",
10903
11049
  {
10904
11050
  "data-testid": "ticket-avatar",
@@ -10913,7 +11059,7 @@ function TicketAvatar(props) {
10913
11059
  }
10914
11060
  );
10915
11061
  }
10916
- return /* @__PURE__ */ React29.createElement(
11062
+ return /* @__PURE__ */ React30.createElement(
10917
11063
  "span",
10918
11064
  {
10919
11065
  "data-testid": "ticket-avatar",
@@ -10952,24 +11098,24 @@ function initialOf(login) {
10952
11098
  }
10953
11099
 
10954
11100
  // src/client/ticket-number.tsx
10955
- var React30 = __toESM(require("react"), 1);
11101
+ var React31 = __toESM(require("react"), 1);
10956
11102
  var REF_DISPLAY_LIMIT = 40;
10957
11103
  function TicketNumber(props) {
10958
11104
  const { ticket } = props;
10959
11105
  const url = ticket.url ?? null;
10960
11106
  if (url === null || ticket.number === null) {
10961
11107
  const display = refDisplay(ticket);
10962
- return /* @__PURE__ */ React30.createElement(
11108
+ return /* @__PURE__ */ React31.createElement(
10963
11109
  "span",
10964
11110
  {
10965
11111
  "data-testid": "ticket-ref",
10966
11112
  style: ticket.number === null ? LOCAL_REF_STYLE : NUMBER_BADGE_STYLE,
10967
11113
  ...display.full === void 0 ? {} : { title: display.full }
10968
11114
  },
10969
- ticket.number === null ? display.text : /* @__PURE__ */ React30.createElement(NumberText, { number: ticket.number })
11115
+ ticket.number === null ? display.text : /* @__PURE__ */ React31.createElement(NumberText, { number: ticket.number })
10970
11116
  );
10971
11117
  }
10972
- return /* @__PURE__ */ React30.createElement(CopyableNumber, { number: ticket.number, url });
11118
+ return /* @__PURE__ */ React31.createElement(CopyableNumber, { number: ticket.number, url });
10973
11119
  }
10974
11120
  function CopyableNumber(props) {
10975
11121
  const { t: t2 } = useI18n();
@@ -10977,7 +11123,7 @@ function CopyableNumber(props) {
10977
11123
  const copied = copy.status === "copied";
10978
11124
  const failed = copy.status === "failed";
10979
11125
  const color = copied ? COLORS.success : failed ? COLORS.error : void 0;
10980
- return /* @__PURE__ */ React30.createElement(React30.Fragment, null, /* @__PURE__ */ React30.createElement(
11126
+ return /* @__PURE__ */ React31.createElement(React31.Fragment, null, /* @__PURE__ */ React31.createElement(
10981
11127
  "button",
10982
11128
  {
10983
11129
  type: "button",
@@ -10992,11 +11138,11 @@ function CopyableNumber(props) {
10992
11138
  },
10993
11139
  style: color === void 0 ? NUMBER_BUTTON_STYLE : { ...NUMBER_BUTTON_STYLE, color }
10994
11140
  },
10995
- /* @__PURE__ */ React30.createElement(NumberText, { number: props.number, copied })
10996
- ), copied ? /* @__PURE__ */ React30.createElement("span", { role: "status", style: VISUALLY_HIDDEN_STYLE }, t2("ticket.number.copiedNotice")) : null);
11141
+ /* @__PURE__ */ React31.createElement(NumberText, { number: props.number, copied })
11142
+ ), copied ? /* @__PURE__ */ React31.createElement("span", { role: "status", style: VISUALLY_HIDDEN_STYLE }, t2("ticket.number.copiedNotice")) : null);
10997
11143
  }
10998
11144
  function NumberText(props) {
10999
- return /* @__PURE__ */ React30.createElement(React30.Fragment, null, /* @__PURE__ */ React30.createElement("span", { style: NUMBER_MARK_STYLE }, props.copied === true ? /* @__PURE__ */ React30.createElement(CheckIcon, null) : "#"), String(props.number));
11145
+ return /* @__PURE__ */ React31.createElement(React31.Fragment, null, /* @__PURE__ */ React31.createElement("span", { style: NUMBER_MARK_STYLE }, props.copied === true ? /* @__PURE__ */ React31.createElement(CheckIcon, null) : "#"), String(props.number));
11000
11146
  }
11001
11147
  function refDisplay(ticket) {
11002
11148
  if (ticket.ref.length <= REF_DISPLAY_LIMIT) return { text: ticket.ref };
@@ -11023,9 +11169,9 @@ var ROWS_STYLE = {
11023
11169
  };
11024
11170
  function TicketList(props) {
11025
11171
  if (props.tickets.length === 0) {
11026
- return /* @__PURE__ */ React31.createElement("div", { "data-testid": "empty", style: EMPTY_STYLE }, props.emptyText);
11172
+ return /* @__PURE__ */ React32.createElement("div", { "data-testid": "empty", style: EMPTY_STYLE }, props.emptyText);
11027
11173
  }
11028
- return /* @__PURE__ */ React31.createElement("div", { "data-testid": "ticket-scroll", style: LIST_STYLE }, /* @__PURE__ */ React31.createElement("div", { role: "list", "data-testid": "ticket-list", style: ROWS_STYLE }, props.rows === void 0 ? props.tickets.map((ticket) => /* @__PURE__ */ React31.createElement(
11174
+ return /* @__PURE__ */ React32.createElement("div", { "data-testid": "ticket-scroll", style: LIST_STYLE }, /* @__PURE__ */ React32.createElement("div", { role: "list", "data-testid": "ticket-list", style: ROWS_STYLE }, props.rows === void 0 ? props.tickets.map((ticket) => /* @__PURE__ */ React32.createElement(
11029
11175
  TicketRow,
11030
11176
  {
11031
11177
  key: ticket.ref,
@@ -11037,7 +11183,7 @@ function TicketList(props) {
11037
11183
  onPick: props.onPick,
11038
11184
  onSkillAction: props.onSkillAction
11039
11185
  }
11040
- )) : props.rows.map((row) => /* @__PURE__ */ React31.createElement(
11186
+ )) : props.rows.map((row) => /* @__PURE__ */ React32.createElement(
11041
11187
  TicketRow,
11042
11188
  {
11043
11189
  key: row.ticket.ref,
@@ -11056,7 +11202,7 @@ function TicketList(props) {
11056
11202
  function TicketRow(props) {
11057
11203
  const { t: t2 } = useI18n();
11058
11204
  const { ticket } = props;
11059
- return /* @__PURE__ */ React31.createElement(
11205
+ return /* @__PURE__ */ React32.createElement(
11060
11206
  "div",
11061
11207
  {
11062
11208
  role: "listitem",
@@ -11070,7 +11216,7 @@ function TicketRow(props) {
11070
11216
  ...props.row === void 0 ? {} : { marginLeft: props.row.depth * TREE_INDENT }
11071
11217
  }
11072
11218
  },
11073
- /* @__PURE__ */ React31.createElement(
11219
+ /* @__PURE__ */ React32.createElement(
11074
11220
  "div",
11075
11221
  {
11076
11222
  "data-testid": "ticket-row",
@@ -11079,7 +11225,7 @@ function TicketRow(props) {
11079
11225
  "data-focused": props.focused ? "true" : void 0,
11080
11226
  style: CARD_CONTENT_STYLE
11081
11227
  },
11082
- /* @__PURE__ */ React31.createElement(
11228
+ /* @__PURE__ */ React32.createElement(
11083
11229
  "button",
11084
11230
  {
11085
11231
  type: "button",
@@ -11088,7 +11234,7 @@ function TicketRow(props) {
11088
11234
  style: CARD_OPEN_STYLE
11089
11235
  }
11090
11236
  ),
11091
- /* @__PURE__ */ React31.createElement("span", { style: CARD_TITLE_STYLE }, props.row?.hasChildren === true ? /* @__PURE__ */ React31.createElement(
11237
+ /* @__PURE__ */ React32.createElement("span", { style: CARD_TITLE_STYLE }, props.row?.hasChildren === true ? /* @__PURE__ */ React32.createElement(
11092
11238
  "button",
11093
11239
  {
11094
11240
  type: "button",
@@ -11104,11 +11250,11 @@ function TicketRow(props) {
11104
11250
  },
11105
11251
  style: TREE_TOGGLE_STYLE
11106
11252
  },
11107
- /* @__PURE__ */ React31.createElement("span", { "aria-hidden": "true" }, props.row.expanded ? "\u25BE" : "\u25B8")
11108
- ) : null, /* @__PURE__ */ React31.createElement(TicketNumber, { ticket }), ticket.title),
11109
- /* @__PURE__ */ React31.createElement(MetaRow, { ticket, row: props.row, now: props.now })
11253
+ /* @__PURE__ */ React32.createElement("span", { "aria-hidden": "true" }, props.row.expanded ? "\u25BE" : "\u25B8")
11254
+ ) : null, /* @__PURE__ */ React32.createElement(TicketNumber, { ticket }), ticket.title),
11255
+ /* @__PURE__ */ React32.createElement(MetaRow, { ticket, row: props.row, now: props.now })
11110
11256
  ),
11111
- /* @__PURE__ */ React31.createElement(
11257
+ /* @__PURE__ */ React32.createElement(
11112
11258
  SkillActionBadge,
11113
11259
  {
11114
11260
  ticket,
@@ -11125,7 +11271,7 @@ function MetaRow(props) {
11125
11271
  const { ticket, row } = props;
11126
11272
  const extra = ticket.labels.filter((label) => label !== ticket.category);
11127
11273
  const { shown, hidden } = pickRowLabels(extra, MAX_EXTRA_LABELS);
11128
- return /* @__PURE__ */ React31.createElement("span", { style: CARD_META_STYLE }, /* @__PURE__ */ React31.createElement("span", { style: STATUS_BADGES[ticket.status] }, /* @__PURE__ */ React31.createElement("span", { style: STATUS_DOT_STYLE }), t2(STATUS_KEYS2[ticket.status])), ticket.category === null ? null : /* @__PURE__ */ React31.createElement("span", { style: CATEGORY_BADGES[ticket.category] }, ticket.category), row?.hasChildren === true ? /* @__PURE__ */ React31.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__ */ React31.createElement(
11274
+ return /* @__PURE__ */ React32.createElement("span", { style: CARD_META_STYLE }, /* @__PURE__ */ React32.createElement("span", { style: STATUS_BADGES[ticket.status] }, /* @__PURE__ */ React32.createElement("span", { style: STATUS_DOT_STYLE }), t2(STATUS_KEYS2[ticket.status])), ticket.category === null ? null : /* @__PURE__ */ React32.createElement("span", { style: CATEGORY_BADGES[ticket.category] }, ticket.category), row?.hasChildren === true ? /* @__PURE__ */ React32.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__ */ React32.createElement(
11129
11275
  "span",
11130
11276
  {
11131
11277
  "data-testid": "parent-badge",
@@ -11133,7 +11279,7 @@ function MetaRow(props) {
11133
11279
  style: PARENT_BADGE_STYLE
11134
11280
  },
11135
11281
  t2("tree.parentBadge", { parent: ticket.parent })
11136
- ) : null, shown.map((label) => /* @__PURE__ */ React31.createElement("span", { key: label, "data-testid": "ticket-label", style: LABEL_BADGE_STYLE }, label)), hidden > 0 ? /* @__PURE__ */ React31.createElement("span", { "data-testid": "ticket-label-more", style: LABEL_BADGE_STYLE }, "+", String(hidden)) : null, ticket.author === null ? null : /* @__PURE__ */ React31.createElement(
11282
+ ) : null, shown.map((label) => /* @__PURE__ */ React32.createElement("span", { key: label, "data-testid": "ticket-label", style: LABEL_BADGE_STYLE }, label)), hidden > 0 ? /* @__PURE__ */ React32.createElement("span", { "data-testid": "ticket-label-more", style: LABEL_BADGE_STYLE }, "+", String(hidden)) : null, ticket.author === null ? null : /* @__PURE__ */ React32.createElement(
11137
11283
  AuthorMeta,
11138
11284
  {
11139
11285
  author: ticket.author,
@@ -11149,7 +11295,7 @@ function AuthorMeta(props) {
11149
11295
  const name = authorName(author);
11150
11296
  const full = authorTitle(author, t2);
11151
11297
  const age = formatRelativeTime(props.createdAt, props.now, t2);
11152
- return /* @__PURE__ */ React31.createElement(React31.Fragment, null, /* @__PURE__ */ React31.createElement(TicketAvatar, { author }), /* @__PURE__ */ React31.createElement("span", { "data-testid": "ticket-author", title: full, style: AUTHOR_NAME_STYLE }, name), age.length === 0 ? null : /* @__PURE__ */ React31.createElement(
11298
+ return /* @__PURE__ */ React32.createElement(React32.Fragment, null, /* @__PURE__ */ React32.createElement(TicketAvatar, { author }), /* @__PURE__ */ React32.createElement("span", { "data-testid": "ticket-author", title: full, style: AUTHOR_NAME_STYLE }, name), age.length === 0 ? null : /* @__PURE__ */ React32.createElement(
11153
11299
  "span",
11154
11300
  {
11155
11301
  "data-testid": "ticket-age",
@@ -11175,11 +11321,11 @@ function pickRowLabels(labels, limit) {
11175
11321
  }
11176
11322
 
11177
11323
  // src/client/tickets-view-footer.tsx
11178
- var React32 = __toESM(require("react"), 1);
11324
+ var React33 = __toESM(require("react"), 1);
11179
11325
  function Footer(props) {
11180
11326
  const { t: t2 } = useI18n();
11181
11327
  if (props.injection.canInjectCurrent && props.notice === null) return null;
11182
- return /* @__PURE__ */ React32.createElement(
11328
+ return /* @__PURE__ */ React33.createElement(
11183
11329
  "footer",
11184
11330
  {
11185
11331
  style: {
@@ -11190,10 +11336,10 @@ function Footer(props) {
11190
11336
  borderTop: `1px solid ${COLORS.border}`
11191
11337
  }
11192
11338
  },
11193
- props.injection.canInjectCurrent ? null : /* @__PURE__ */ React32.createElement("div", { "data-testid": "no-session-hint", style: { color: COLORS.secondary, fontSize: 12 } }, t2(
11339
+ props.injection.canInjectCurrent ? null : /* @__PURE__ */ React33.createElement("div", { "data-testid": "no-session-hint", style: { color: COLORS.secondary, fontSize: 12 } }, t2(
11194
11340
  props.injection.canStartNewSession ? "injection.footerNewSession" : "injection.footerUnavailable"
11195
11341
  )),
11196
- props.notice === null ? null : /* @__PURE__ */ React32.createElement(
11342
+ props.notice === null ? null : /* @__PURE__ */ React33.createElement(
11197
11343
  "div",
11198
11344
  {
11199
11345
  role: "status",
@@ -11206,7 +11352,7 @@ function Footer(props) {
11206
11352
  }
11207
11353
 
11208
11354
  // src/client/tickets-header.tsx
11209
- var React33 = __toESM(require("react"), 1);
11355
+ var React34 = __toESM(require("react"), 1);
11210
11356
  var SECONDARY_BUTTON_STYLE = {
11211
11357
  ...BUTTON_STYLE,
11212
11358
  padding: "2px 6px",
@@ -11223,7 +11369,7 @@ var REFRESH_ERROR_STYLE2 = {
11223
11369
  };
11224
11370
  function TicketsHeader(props) {
11225
11371
  const { t: t2 } = useI18n();
11226
- return /* @__PURE__ */ React33.createElement("header", { style: HEADER_STYLE }, /* @__PURE__ */ React33.createElement("div", { style: { display: "flex", alignItems: "center", gap: 8, minWidth: 0 } }, /* @__PURE__ */ React33.createElement("div", { style: REPO_CHIP_STYLE }, /* @__PURE__ */ React33.createElement(FolderIcon, null), /* @__PURE__ */ React33.createElement(
11372
+ return /* @__PURE__ */ React34.createElement("header", { style: HEADER_STYLE }, /* @__PURE__ */ React34.createElement("div", { style: { display: "flex", alignItems: "center", gap: 8, minWidth: 0 } }, /* @__PURE__ */ React34.createElement("div", { style: REPO_CHIP_STYLE }, /* @__PURE__ */ React34.createElement(FolderIcon, null), /* @__PURE__ */ React34.createElement(
11227
11373
  "span",
11228
11374
  {
11229
11375
  "data-testid": "repo-name",
@@ -11231,7 +11377,7 @@ function TicketsHeader(props) {
11231
11377
  ...props.snapshot === null ? {} : { title: props.snapshot.repository }
11232
11378
  },
11233
11379
  props.snapshot?.repository ?? (props.loading ? t2("repo.identifying") : t2("repo.unidentified"))
11234
- )), props.snapshot === null ? null : /* @__PURE__ */ React33.createElement("span", { "data-testid": "backend-badge", style: BACKEND_BADGE_STYLE }, backendLabel(props.snapshot.backend, t2)), props.snapshot === null ? null : /* @__PURE__ */ React33.createElement(SourceBadge2, { source: props.snapshot.source }), props.snapshot?.backend === "gitea" && props.snapshot.repositoryHost !== null ? /* @__PURE__ */ React33.createElement(
11380
+ )), props.snapshot === null ? null : /* @__PURE__ */ React34.createElement("span", { "data-testid": "backend-badge", style: BACKEND_BADGE_STYLE }, backendLabel(props.snapshot.backend, t2)), props.snapshot === null ? null : /* @__PURE__ */ React34.createElement(SourceBadge2, { source: props.snapshot.source }), props.snapshot?.backend === "gitea" && props.snapshot.repositoryHost !== null ? /* @__PURE__ */ React34.createElement(
11235
11381
  "span",
11236
11382
  {
11237
11383
  "data-testid": "repo-host",
@@ -11239,7 +11385,7 @@ function TicketsHeader(props) {
11239
11385
  style: REPO_HOST_STYLE
11240
11386
  },
11241
11387
  props.snapshot.repositoryHost
11242
- ) : null), /* @__PURE__ */ React33.createElement("div", { style: { display: "flex", alignItems: "center", gap: 4, flex: "none" } }, /* @__PURE__ */ React33.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__ */ React33.createElement("span", { "data-testid": "refresh-error", title: props.notice, style: REFRESH_ERROR_STYLE2 }, props.notice), /* @__PURE__ */ React33.createElement(
11388
+ ) : null), /* @__PURE__ */ React34.createElement("div", { style: { display: "flex", alignItems: "center", gap: 4, flex: "none" } }, /* @__PURE__ */ React34.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__ */ React34.createElement("span", { "data-testid": "refresh-error", title: props.notice, style: REFRESH_ERROR_STYLE2 }, props.notice), /* @__PURE__ */ React34.createElement(
11243
11389
  "button",
11244
11390
  {
11245
11391
  type: "button",
@@ -11249,9 +11395,9 @@ function TicketsHeader(props) {
11249
11395
  onClick: props.onRefresh,
11250
11396
  style: { ...REFRESH_BUTTON_STYLE, opacity: props.busy ? 0.6 : 1 }
11251
11397
  },
11252
- /* @__PURE__ */ React33.createElement(RefreshIcon, null),
11398
+ /* @__PURE__ */ React34.createElement(RefreshIcon, null),
11253
11399
  props.busy ? t2("refresh.busy") : t2("refresh.action")
11254
- ), /* @__PURE__ */ React33.createElement(
11400
+ ), /* @__PURE__ */ React34.createElement(
11255
11401
  "button",
11256
11402
  {
11257
11403
  type: "button",
@@ -11266,7 +11412,7 @@ function TicketsHeader(props) {
11266
11412
  }
11267
11413
  function SourceBadge2(props) {
11268
11414
  const { t: t2 } = useI18n();
11269
- return /* @__PURE__ */ React33.createElement(
11415
+ return /* @__PURE__ */ React34.createElement(
11270
11416
  "span",
11271
11417
  {
11272
11418
  "data-testid": "snapshot-source",
@@ -11280,7 +11426,7 @@ function SourceBadge2(props) {
11280
11426
  }
11281
11427
 
11282
11428
  // src/client/tickets-more.tsx
11283
- var React34 = __toESM(require("react"), 1);
11429
+ var React35 = __toESM(require("react"), 1);
11284
11430
  var MORE_STYLE = {
11285
11431
  display: "flex",
11286
11432
  alignItems: "center",
@@ -11312,7 +11458,7 @@ function moreStateOf(snapshot) {
11312
11458
  function MoreFooter(props) {
11313
11459
  const { t: t2 } = useI18n();
11314
11460
  const { state } = props;
11315
- return /* @__PURE__ */ React34.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__ */ React34.createElement(
11461
+ return /* @__PURE__ */ React35.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__ */ React35.createElement(
11316
11462
  "button",
11317
11463
  {
11318
11464
  type: "button",
@@ -11324,8 +11470,8 @@ function MoreFooter(props) {
11324
11470
  ));
11325
11471
  }
11326
11472
  function useMoreSentinel(active, onVisible) {
11327
- const node = React34.useRef(null);
11328
- React34.useEffect(() => {
11473
+ const node = React35.useRef(null);
11474
+ React35.useEffect(() => {
11329
11475
  if (!active) return;
11330
11476
  const target = node.current;
11331
11477
  if (target === null || typeof IntersectionObserver === "undefined") return;
@@ -11433,7 +11579,7 @@ function ancestorRefs(byRef, ref) {
11433
11579
  }
11434
11580
 
11435
11581
  // src/client/tickets-tree-controls.tsx
11436
- var React35 = __toESM(require("react"), 1);
11582
+ var React36 = __toESM(require("react"), 1);
11437
11583
  function hierarchyHintKey(snapshot) {
11438
11584
  if (snapshot.hierarchy === "none") {
11439
11585
  if (snapshot.backend === "gitea") return "layout.giteaUnavailable";
@@ -11446,7 +11592,7 @@ function hierarchyHintKey(snapshot) {
11446
11592
  }
11447
11593
  function LayoutControl(props) {
11448
11594
  const { t: t2 } = useI18n();
11449
- return /* @__PURE__ */ React35.createElement("div", { role: "group", "aria-label": t2("layout.group"), style: ICON_SEGMENTED_STYLE }, /* @__PURE__ */ React35.createElement(
11595
+ return /* @__PURE__ */ React36.createElement("div", { role: "group", "aria-label": t2("layout.group"), style: ICON_SEGMENTED_STYLE }, /* @__PURE__ */ React36.createElement(
11450
11596
  "button",
11451
11597
  {
11452
11598
  type: "button",
@@ -11464,8 +11610,8 @@ function LayoutControl(props) {
11464
11610
  ...props.layout === "flat" ? CHIP_ACTIVE_STYLE : void 0
11465
11611
  }
11466
11612
  },
11467
- /* @__PURE__ */ React35.createElement(FlatListIcon, null)
11468
- ), /* @__PURE__ */ React35.createElement(
11613
+ /* @__PURE__ */ React36.createElement(FlatListIcon, null)
11614
+ ), /* @__PURE__ */ React36.createElement(
11469
11615
  "button",
11470
11616
  {
11471
11617
  type: "button",
@@ -11484,15 +11630,15 @@ function LayoutControl(props) {
11484
11630
  ...props.layout === "tree" ? CHIP_ACTIVE_STYLE : void 0
11485
11631
  }
11486
11632
  },
11487
- /* @__PURE__ */ React35.createElement(TreeListIcon, null)
11633
+ /* @__PURE__ */ React36.createElement(TreeListIcon, null)
11488
11634
  ));
11489
11635
  }
11490
11636
 
11491
11637
  // src/client/tickets-toolbar.tsx
11492
- var React37 = __toESM(require("react"), 1);
11638
+ var React38 = __toESM(require("react"), 1);
11493
11639
 
11494
11640
  // src/client/sort-control.tsx
11495
- var React36 = __toESM(require("react"), 1);
11641
+ var React37 = __toESM(require("react"), 1);
11496
11642
  var GROUP_STYLE2 = {
11497
11643
  ...SEGMENTED_STYLE,
11498
11644
  flexWrap: "nowrap",
@@ -11558,7 +11704,7 @@ function SortControl(props) {
11558
11704
  const next = props.direction === "asc" ? "desc" : "asc";
11559
11705
  const currentLabel = t2(DIRECTION_KEYS[props.direction]);
11560
11706
  const nextLabel = t2(DIRECTION_KEYS[next]);
11561
- return /* @__PURE__ */ React36.createElement("div", { role: "group", "aria-label": t2("sort.group"), style: GROUP_STYLE2 }, /* @__PURE__ */ React36.createElement("span", { style: SELECT_WRAP_STYLE }, /* @__PURE__ */ React36.createElement(
11707
+ return /* @__PURE__ */ React37.createElement("div", { role: "group", "aria-label": t2("sort.group"), style: GROUP_STYLE2 }, /* @__PURE__ */ React37.createElement("span", { style: SELECT_WRAP_STYLE }, /* @__PURE__ */ React37.createElement(
11562
11708
  "select",
11563
11709
  {
11564
11710
  "data-testid": "sort-key",
@@ -11570,8 +11716,8 @@ function SortControl(props) {
11570
11716
  },
11571
11717
  style: SELECT_STYLE
11572
11718
  },
11573
- TICKET_SORT_KEYS.map((key) => /* @__PURE__ */ React36.createElement("option", { key, value: key }, t2(SORT_KEYS[key])))
11574
- ), /* @__PURE__ */ React36.createElement("span", { style: CARET_STYLE }, /* @__PURE__ */ React36.createElement(CaretIcon, null))), /* @__PURE__ */ React36.createElement(
11719
+ TICKET_SORT_KEYS.map((key) => /* @__PURE__ */ React37.createElement("option", { key, value: key }, t2(SORT_KEYS[key])))
11720
+ ), /* @__PURE__ */ React37.createElement("span", { style: CARET_STYLE }, /* @__PURE__ */ React37.createElement(CaretIcon, null))), /* @__PURE__ */ React37.createElement(
11575
11721
  "button",
11576
11722
  {
11577
11723
  type: "button",
@@ -11587,7 +11733,7 @@ function SortControl(props) {
11587
11733
  ));
11588
11734
  }
11589
11735
  function CaretIcon() {
11590
- return /* @__PURE__ */ React36.createElement("svg", { width: "8", height: "8", viewBox: "0 0 8 8", "aria-hidden": "true" }, /* @__PURE__ */ React36.createElement("path", { d: "M0.5 2h7L4 6.5z", fill: "currentColor" }));
11736
+ return /* @__PURE__ */ React37.createElement("svg", { width: "8", height: "8", viewBox: "0 0 8 8", "aria-hidden": "true" }, /* @__PURE__ */ React37.createElement("path", { d: "M0.5 2h7L4 6.5z", fill: "currentColor" }));
11591
11737
  }
11592
11738
 
11593
11739
  // src/client/tickets-toolbar.tsx
@@ -11605,7 +11751,7 @@ var CHIP_STATS = {
11605
11751
  };
11606
11752
  function Toolbar(props) {
11607
11753
  const { t: t2 } = useI18n();
11608
- return /* @__PURE__ */ React37.createElement("div", { style: TOOLBAR_STYLE }, /* @__PURE__ */ React37.createElement("div", { role: "group", "aria-label": t2("filter.group"), style: SEGMENTED_STYLE }, TICKET_FILTERS.map((value) => /* @__PURE__ */ React37.createElement(
11754
+ return /* @__PURE__ */ React38.createElement("div", { style: TOOLBAR_STYLE }, /* @__PURE__ */ React38.createElement("div", { role: "group", "aria-label": t2("filter.group"), style: SEGMENTED_STYLE }, TICKET_FILTERS.map((value) => /* @__PURE__ */ React38.createElement(
11609
11755
  Chip,
11610
11756
  {
11611
11757
  key: value,
@@ -11618,7 +11764,7 @@ function Toolbar(props) {
11618
11764
  props.onFilter(value);
11619
11765
  }
11620
11766
  }
11621
- ))), /* @__PURE__ */ React37.createElement(
11767
+ ))), /* @__PURE__ */ React38.createElement(
11622
11768
  SortControl,
11623
11769
  {
11624
11770
  sortKey: props.sortKey,
@@ -11632,7 +11778,7 @@ function Toolbar(props) {
11632
11778
  }
11633
11779
  function Chip(props) {
11634
11780
  const stat = props.stat;
11635
- return /* @__PURE__ */ React37.createElement(
11781
+ return /* @__PURE__ */ React38.createElement(
11636
11782
  "button",
11637
11783
  {
11638
11784
  type: "button",
@@ -11642,19 +11788,19 @@ function Chip(props) {
11642
11788
  onClick: props.onClick,
11643
11789
  style: { ...CHIP_STYLE, ...props.active ? CHIP_ACTIVE_STYLE : void 0 }
11644
11790
  },
11645
- stat === void 0 ? null : /* @__PURE__ */ React37.createElement("span", { "aria-hidden": "true", style: { ...CHIP_DOT_STYLE, background: stat.color } }),
11791
+ stat === void 0 ? null : /* @__PURE__ */ React38.createElement("span", { "aria-hidden": "true", style: { ...CHIP_DOT_STYLE, background: stat.color } }),
11646
11792
  props.label,
11647
- stat === void 0 ? null : /* @__PURE__ */ React37.createElement("span", { "data-testid": `stat-${stat.key}`, style: CHIP_COUNT_STYLE }, props.count[stat.key])
11793
+ stat === void 0 ? null : /* @__PURE__ */ React38.createElement("span", { "data-testid": `stat-${stat.key}`, style: CHIP_COUNT_STYLE }, props.count[stat.key])
11648
11794
  );
11649
11795
  }
11650
11796
 
11651
11797
  // src/client/use-collapsed-tickets.ts
11652
- var React38 = __toESM(require("react"), 1);
11798
+ var React39 = __toESM(require("react"), 1);
11653
11799
  function useCollapsedTickets(workspaceRoot, focused, visible) {
11654
11800
  const session = useTicketTreeSession();
11655
- const [localCollapsed, setLocalCollapsed] = React38.useState(() => /* @__PURE__ */ new Set());
11656
- const previousRoot = React38.useRef(workspaceRoot);
11657
- const expandedFor = React38.useRef(null);
11801
+ const [localCollapsed, setLocalCollapsed] = React39.useState(() => /* @__PURE__ */ new Set());
11802
+ const previousRoot = React39.useRef(workspaceRoot);
11803
+ const expandedFor = React39.useRef(null);
11658
11804
  if (previousRoot.current !== workspaceRoot) {
11659
11805
  previousRoot.current = workspaceRoot;
11660
11806
  expandedFor.current = null;
@@ -11662,7 +11808,7 @@ function useCollapsedTickets(workspaceRoot, focused, visible) {
11662
11808
  }
11663
11809
  const collapsed = session?.collapsed ?? localCollapsed;
11664
11810
  const setCollapsed = session?.setCollapsed ?? setLocalCollapsed;
11665
- React38.useEffect(() => {
11811
+ React39.useEffect(() => {
11666
11812
  if (focused === null || visible.length === 0 || expandedFor.current === focused) return;
11667
11813
  expandedFor.current = focused;
11668
11814
  setCollapsed((current) => expandAncestors(visible, current, focused));
@@ -11779,7 +11925,7 @@ function timestamp(value) {
11779
11925
  }
11780
11926
 
11781
11927
  // src/client/use-view-preference.ts
11782
- var React39 = __toESM(require("react"), 1);
11928
+ var React40 = __toESM(require("react"), 1);
11783
11929
 
11784
11930
  // src/client/view-preference.ts
11785
11931
  var DEFAULT_VIEW = {
@@ -11902,8 +12048,8 @@ function isLayout(value) {
11902
12048
 
11903
12049
  // src/client/use-view-preference.ts
11904
12050
  function useViewPreference(workspaceRoot) {
11905
- const storage = React39.useMemo(resolvePreferenceStorage, []);
11906
- const [viewState, setViewState] = React39.useState(() => ({
12051
+ const storage = React40.useMemo(resolvePreferenceStorage, []);
12052
+ const [viewState, setViewState] = React40.useState(() => ({
11907
12053
  workspaceRoot,
11908
12054
  preference: readViewPreference(storage, workspaceRoot)
11909
12055
  }));
@@ -12027,13 +12173,13 @@ function useTicketsViewState(props) {
12027
12173
  function TicketsView(props) {
12028
12174
  const { t: t2 } = useI18n();
12029
12175
  const state = useTicketsViewState(props);
12030
- return /* @__PURE__ */ React40.createElement(
12176
+ return /* @__PURE__ */ React41.createElement(
12031
12177
  "div",
12032
12178
  {
12033
12179
  "data-testid": "tickets-view",
12034
12180
  style: { display: "flex", flexDirection: "column", flex: 1, minHeight: 0 }
12035
12181
  },
12036
- /* @__PURE__ */ React40.createElement(
12182
+ /* @__PURE__ */ React41.createElement(
12037
12183
  TicketsHeader,
12038
12184
  {
12039
12185
  snapshot: state.snapshot,
@@ -12045,9 +12191,9 @@ function TicketsView(props) {
12045
12191
  onRefreshFull: state.refreshFull
12046
12192
  }
12047
12193
  ),
12048
- props.actions === void 0 ? /* @__PURE__ */ React40.createElement("div", { style: ACTION_BAR_STYLE }, /* @__PURE__ */ React40.createElement(ActionBar, { injection: props.injection, onInject: state.inject })) : null,
12049
- state.error !== null ? /* @__PURE__ */ React40.createElement(ErrorBanner, { error: state.error, onOpenEnvCheck: props.onOpenEnvCheck }) : null,
12050
- state.snapshot !== null ? /* @__PURE__ */ React40.createElement(
12194
+ props.actions === void 0 ? /* @__PURE__ */ React41.createElement("div", { style: ACTION_BAR_STYLE }, /* @__PURE__ */ React41.createElement(ActionBar, { injection: props.injection, onInject: state.inject })) : null,
12195
+ state.error !== null ? /* @__PURE__ */ React41.createElement(ErrorBanner, { error: state.error, onOpenEnvCheck: props.onOpenEnvCheck }) : null,
12196
+ state.snapshot !== null ? /* @__PURE__ */ React41.createElement(
12051
12197
  SnapshotContent,
12052
12198
  {
12053
12199
  snapshot: state.snapshot,
@@ -12084,13 +12230,13 @@ function TicketsView(props) {
12084
12230
  onPick: props.onOpenTicket,
12085
12231
  onSkillAction: state.onSkillAction
12086
12232
  }
12087
- ) : state.phase === "loading" ? /* @__PURE__ */ React40.createElement("div", { "data-testid": "loading", style: EMPTY_STYLE }, t2("snapshot.loading")) : null,
12088
- /* @__PURE__ */ React40.createElement(Footer, { injection: props.injection, notice: state.notice, tone: state.noticeTone })
12233
+ ) : state.phase === "loading" ? /* @__PURE__ */ React41.createElement("div", { "data-testid": "loading", style: EMPTY_STYLE }, t2("snapshot.loading")) : null,
12234
+ /* @__PURE__ */ React41.createElement(Footer, { injection: props.injection, notice: state.notice, tone: state.noticeTone })
12089
12235
  );
12090
12236
  }
12091
12237
  function SnapshotContent(props) {
12092
12238
  const { t: t2 } = useI18n();
12093
- return /* @__PURE__ */ React40.createElement(React40.Fragment, null, /* @__PURE__ */ React40.createElement(
12239
+ return /* @__PURE__ */ React41.createElement(React41.Fragment, null, /* @__PURE__ */ React41.createElement(
12094
12240
  Toolbar,
12095
12241
  {
12096
12242
  filter: props.filter,
@@ -12100,7 +12246,7 @@ function SnapshotContent(props) {
12100
12246
  onFilter: props.onFilter,
12101
12247
  onSort: props.onSort
12102
12248
  }
12103
- ), props.snapshot.viewer === null ? null : /* @__PURE__ */ React40.createElement(
12249
+ ), props.snapshot.viewer === null ? null : /* @__PURE__ */ React41.createElement(
12104
12250
  MyTicketsBar,
12105
12251
  {
12106
12252
  viewer: props.snapshot.viewer,
@@ -12111,10 +12257,10 @@ function SnapshotContent(props) {
12111
12257
  onToggleCreated: props.onToggleCreated,
12112
12258
  onClear: props.onClearMyTickets
12113
12259
  }
12114
- ), /* @__PURE__ */ React40.createElement(
12260
+ ), /* @__PURE__ */ React41.createElement(
12115
12261
  TicketRows,
12116
12262
  {
12117
- layoutControl: /* @__PURE__ */ React40.createElement(
12263
+ layoutControl: /* @__PURE__ */ React41.createElement(
12118
12264
  LayoutControl,
12119
12265
  {
12120
12266
  layout: props.preferenceLayout,
@@ -12123,7 +12269,7 @@ function SnapshotContent(props) {
12123
12269
  onLayout: props.onLayout
12124
12270
  }
12125
12271
  ),
12126
- notes: /* @__PURE__ */ React40.createElement(TreeNotes, { ...props }),
12272
+ notes: /* @__PURE__ */ React41.createElement(TreeNotes, { ...props }),
12127
12273
  snapshot: props.snapshot,
12128
12274
  visible: props.visible,
12129
12275
  rows: props.rows,
@@ -12141,17 +12287,17 @@ function SnapshotContent(props) {
12141
12287
  }
12142
12288
  function TreeNotes(props) {
12143
12289
  const { t: t2 } = useI18n();
12144
- return /* @__PURE__ */ React40.createElement(React40.Fragment, null, props.layout === "tree" && props.snapshot.total > props.snapshot.loaded ? /* @__PURE__ */ React40.createElement("div", { "data-testid": "tree-coverage", style: TREE_NOTE_STYLE }, t2("tree.coverage", { loaded: props.snapshot.loaded })) : null, props.preferenceLayout === "tree" && !props.hierarchyAvailable ? /* @__PURE__ */ React40.createElement("div", { "data-testid": "tree-degraded", style: TREE_DEGRADED_STYLE }, t2("tree.degraded")) : null, props.preferenceLayout !== "tree" && !props.hierarchyAvailable ? /* @__PURE__ */ React40.createElement("div", { "data-testid": "tree-unavailable", style: TREE_NOTE_STYLE }, t2(hierarchyHintKey(props.snapshot))) : null);
12290
+ return /* @__PURE__ */ React41.createElement(React41.Fragment, null, props.layout === "tree" && props.snapshot.total > props.snapshot.loaded ? /* @__PURE__ */ React41.createElement("div", { "data-testid": "tree-coverage", style: TREE_NOTE_STYLE }, t2("tree.coverage", { loaded: props.snapshot.loaded })) : null, props.preferenceLayout === "tree" && !props.hierarchyAvailable ? /* @__PURE__ */ React41.createElement("div", { "data-testid": "tree-degraded", style: TREE_DEGRADED_STYLE }, t2("tree.degraded")) : null, props.preferenceLayout !== "tree" && !props.hierarchyAvailable ? /* @__PURE__ */ React41.createElement("div", { "data-testid": "tree-unavailable", style: TREE_NOTE_STYLE }, t2(hierarchyHintKey(props.snapshot))) : null);
12145
12291
  }
12146
12292
  function useFocusedTicket(focusRef, onFocusHandled, workspaceRoot) {
12147
- const [focused, setFocused] = React40.useState(null);
12148
- React40.useEffect(() => {
12293
+ const [focused, setFocused] = React41.useState(null);
12294
+ React41.useEffect(() => {
12149
12295
  if (focusRef === null || focusRef === void 0) return;
12150
12296
  setFocused(focusRef);
12151
12297
  onFocusHandled?.();
12152
12298
  }, [focusRef, onFocusHandled]);
12153
- const previousRoot = React40.useRef(workspaceRoot);
12154
- React40.useEffect(() => {
12299
+ const previousRoot = React41.useRef(workspaceRoot);
12300
+ React41.useEffect(() => {
12155
12301
  if (previousRoot.current === workspaceRoot) return;
12156
12302
  previousRoot.current = workspaceRoot;
12157
12303
  setFocused(null);
@@ -12165,7 +12311,7 @@ function TicketRows(props) {
12165
12311
  more.available && more.error === null && !more.loading,
12166
12312
  more.onLoadMore
12167
12313
  );
12168
- return /* @__PURE__ */ React40.createElement(React40.Fragment, null, /* @__PURE__ */ React40.createElement("div", { style: LIST_HEADER_STYLE }, /* @__PURE__ */ React40.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__ */ React40.createElement(
12314
+ return /* @__PURE__ */ React41.createElement(React41.Fragment, null, /* @__PURE__ */ React41.createElement("div", { style: LIST_HEADER_STYLE }, /* @__PURE__ */ React41.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__ */ React41.createElement(
12169
12315
  TicketList,
12170
12316
  {
12171
12317
  tickets: props.visible,
@@ -12178,7 +12324,7 @@ function TicketRows(props) {
12178
12324
  now: props.now,
12179
12325
  onPick: props.onPick,
12180
12326
  onSkillAction: props.onSkillAction,
12181
- footer: more.available ? /* @__PURE__ */ React40.createElement(MoreFooter, { state: more, sentinel }) : null
12327
+ footer: more.available ? /* @__PURE__ */ React41.createElement(MoreFooter, { state: more, sentinel }) : null
12182
12328
  }
12183
12329
  ));
12184
12330
  }
@@ -12186,11 +12332,11 @@ function TicketRows(props) {
12186
12332
  // src/client/task-panel.tsx
12187
12333
  var NO_CAPABILITIES = () => [];
12188
12334
  function TaskPanel(props) {
12189
- const [view, setView] = React41.useState("tickets");
12190
- const [focusBackend, setFocusBackend] = React41.useState(null);
12191
- const [openTicket, setOpenTicket] = React41.useState(null);
12192
- const [focusTicket, setFocusTicket] = React41.useState(null);
12193
- const previousView = React41.useRef("tickets");
12335
+ const [view, setView] = React42.useState("tickets");
12336
+ const [focusBackend, setFocusBackend] = React42.useState(null);
12337
+ const [openTicket, setOpenTicket] = React42.useState(null);
12338
+ const [focusTicket, setFocusTicket] = React42.useState(null);
12339
+ const previousView = React42.useRef("tickets");
12194
12340
  const actions = useTicketActions(props.workspaceRoot, props.injection);
12195
12341
  const clientCapabilities = props.clientCapabilities ?? NO_CAPABILITIES;
12196
12342
  const request = useSnapshotRequest(props.client, props.workspaceRoot, {
@@ -12201,7 +12347,7 @@ function TaskPanel(props) {
12201
12347
  if (view !== "help") previousView.current = view;
12202
12348
  setView("help");
12203
12349
  };
12204
- return /* @__PURE__ */ React41.createElement("div", { "data-testid": "task-panel", "data-anvil-panel": "", style: PANEL_STYLE }, /* @__PURE__ */ React41.createElement("style", null, PANEL_SHEET), /* @__PURE__ */ React41.createElement(
12350
+ return /* @__PURE__ */ React42.createElement("div", { "data-testid": "task-panel", "data-anvil-panel": "", style: PANEL_STYLE }, /* @__PURE__ */ React42.createElement("style", null, PANEL_SHEET), /* @__PURE__ */ React42.createElement(
12205
12351
  ViewTabs,
12206
12352
  {
12207
12353
  view,
@@ -12218,9 +12364,9 @@ function TaskPanel(props) {
12218
12364
  setView("env");
12219
12365
  },
12220
12366
  onOpenHelp: openHelp,
12221
- actions: view === "tickets" && open === null ? /* @__PURE__ */ React41.createElement(ActionBar, { injection: props.injection, onInject: actions.inject }) : null
12367
+ actions: view === "tickets" && open === null ? /* @__PURE__ */ React42.createElement(ActionBar, { injection: props.injection, onInject: actions.inject }) : null
12222
12368
  }
12223
- ), /* @__PURE__ */ React41.createElement(TicketTreeSessionProvider, { workspaceRoot: props.workspaceRoot }, /* @__PURE__ */ React41.createElement(
12369
+ ), /* @__PURE__ */ React42.createElement(TicketTreeSessionProvider, { workspaceRoot: props.workspaceRoot }, /* @__PURE__ */ React42.createElement(
12224
12370
  PanelContent,
12225
12371
  {
12226
12372
  panel: props,
@@ -12259,7 +12405,7 @@ function TaskPanel(props) {
12259
12405
  function PanelContent(props) {
12260
12406
  const panel = props.panel;
12261
12407
  if (props.view === "tickets") {
12262
- return /* @__PURE__ */ React41.createElement(
12408
+ return /* @__PURE__ */ React42.createElement(
12263
12409
  TicketsPane,
12264
12410
  {
12265
12411
  client: panel.client,
@@ -12278,7 +12424,7 @@ function PanelContent(props) {
12278
12424
  );
12279
12425
  }
12280
12426
  if (props.view === "overview") {
12281
- return /* @__PURE__ */ React41.createElement(
12427
+ return /* @__PURE__ */ React42.createElement(
12282
12428
  OverviewPane,
12283
12429
  {
12284
12430
  request: props.request,
@@ -12290,7 +12436,7 @@ function PanelContent(props) {
12290
12436
  );
12291
12437
  }
12292
12438
  if (props.view === "env") {
12293
- return /* @__PURE__ */ React41.createElement(
12439
+ return /* @__PURE__ */ React42.createElement(
12294
12440
  EnvCheckView,
12295
12441
  {
12296
12442
  client: panel.client,
@@ -12301,10 +12447,10 @@ function PanelContent(props) {
12301
12447
  }
12302
12448
  );
12303
12449
  }
12304
- return /* @__PURE__ */ React41.createElement(HelpView, { onBack: props.onBack });
12450
+ return /* @__PURE__ */ React42.createElement(HelpView, { onBack: props.onBack });
12305
12451
  }
12306
12452
  function OverviewPane(props) {
12307
- return /* @__PURE__ */ React41.createElement(
12453
+ return /* @__PURE__ */ React42.createElement(
12308
12454
  OverviewView,
12309
12455
  {
12310
12456
  request: props.request,
@@ -12317,18 +12463,21 @@ function OverviewPane(props) {
12317
12463
  }
12318
12464
  function TicketsPane(props) {
12319
12465
  if (props.workspaceRoot !== void 0 && props.open !== null) {
12320
- return /* @__PURE__ */ React41.createElement(
12466
+ const open = props.open;
12467
+ const current = props.request.snapshot?.tickets.find((item) => item.ref === open.ticket.ref) ?? open.ticket;
12468
+ return /* @__PURE__ */ React42.createElement(
12321
12469
  TicketDetailView,
12322
12470
  {
12323
12471
  client: props.client,
12324
12472
  workspaceRoot: props.workspaceRoot,
12325
- ticket: props.open.ticket,
12473
+ ticket: current,
12326
12474
  injection: props.injection,
12327
- onBack: props.onCloseDetail
12475
+ onBack: props.onCloseDetail,
12476
+ onRefreshSnapshot: props.request.refresh
12328
12477
  }
12329
12478
  );
12330
12479
  }
12331
- return /* @__PURE__ */ React41.createElement(
12480
+ return /* @__PURE__ */ React42.createElement(
12332
12481
  TicketsView,
12333
12482
  {
12334
12483
  request: props.request,
@@ -12345,7 +12494,7 @@ function TicketsPane(props) {
12345
12494
  }
12346
12495
  function ViewTabs(props) {
12347
12496
  const { t: t2 } = useI18n();
12348
- return /* @__PURE__ */ React41.createElement("div", { style: VIEW_BAR_STYLE }, /* @__PURE__ */ React41.createElement("div", { role: "group", "aria-label": t2("view.group"), style: VIEW_TABS_STYLE }, /* @__PURE__ */ React41.createElement(
12497
+ return /* @__PURE__ */ React42.createElement("div", { style: VIEW_BAR_STYLE }, /* @__PURE__ */ React42.createElement("div", { role: "group", "aria-label": t2("view.group"), style: VIEW_TABS_STYLE }, /* @__PURE__ */ React42.createElement(
12349
12498
  ViewChip,
12350
12499
  {
12351
12500
  testId: "view-tickets",
@@ -12353,7 +12502,7 @@ function ViewTabs(props) {
12353
12502
  active: props.view === "tickets",
12354
12503
  onClick: props.onOpenTickets
12355
12504
  }
12356
- ), /* @__PURE__ */ React41.createElement(
12505
+ ), /* @__PURE__ */ React42.createElement(
12357
12506
  ViewChip,
12358
12507
  {
12359
12508
  testId: "view-overview",
@@ -12361,7 +12510,7 @@ function ViewTabs(props) {
12361
12510
  active: props.view === "overview",
12362
12511
  onClick: props.onOpenOverview
12363
12512
  }
12364
- ), /* @__PURE__ */ React41.createElement(
12513
+ ), /* @__PURE__ */ React42.createElement(
12365
12514
  ViewChip,
12366
12515
  {
12367
12516
  testId: "view-env",
@@ -12369,10 +12518,10 @@ function ViewTabs(props) {
12369
12518
  active: props.view === "env",
12370
12519
  onClick: props.onOpenEnvCheck
12371
12520
  }
12372
- )), /* @__PURE__ */ React41.createElement("div", { style: VIEW_BAR_END_STYLE }, props.actions, /* @__PURE__ */ React41.createElement(TipsButton, { onClick: props.onOpenHelp })));
12521
+ )), /* @__PURE__ */ React42.createElement("div", { style: VIEW_BAR_END_STYLE }, props.actions, /* @__PURE__ */ React42.createElement(TipsButton, { onClick: props.onOpenHelp })));
12373
12522
  }
12374
12523
  function ViewChip(props) {
12375
- return /* @__PURE__ */ React41.createElement(
12524
+ return /* @__PURE__ */ React42.createElement(
12376
12525
  "button",
12377
12526
  {
12378
12527
  type: "button",
@@ -12387,7 +12536,7 @@ function ViewChip(props) {
12387
12536
  }
12388
12537
  function TipsButton(props) {
12389
12538
  const { t: t2 } = useI18n();
12390
- return /* @__PURE__ */ React41.createElement(
12539
+ return /* @__PURE__ */ React42.createElement(
12391
12540
  "button",
12392
12541
  {
12393
12542
  type: "button",
@@ -12397,11 +12546,11 @@ function TipsButton(props) {
12397
12546
  onClick: props.onClick,
12398
12547
  style: ICON_BUTTON_STYLE
12399
12548
  },
12400
- /* @__PURE__ */ React41.createElement(TipsIcon, null)
12549
+ /* @__PURE__ */ React42.createElement(TipsIcon, null)
12401
12550
  );
12402
12551
  }
12403
12552
  function TipsIcon() {
12404
- return /* @__PURE__ */ React41.createElement(
12553
+ return /* @__PURE__ */ React42.createElement(
12405
12554
  "svg",
12406
12555
  {
12407
12556
  width: 14,
@@ -12414,9 +12563,9 @@ function TipsIcon() {
12414
12563
  strokeLinecap: "round",
12415
12564
  strokeLinejoin: "round"
12416
12565
  },
12417
- /* @__PURE__ */ React41.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" }),
12418
- /* @__PURE__ */ React41.createElement("path", { d: "M6.4 12.6h3.2" }),
12419
- /* @__PURE__ */ React41.createElement("path", { d: "M7.2 14.4h1.6" })
12566
+ /* @__PURE__ */ React42.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" }),
12567
+ /* @__PURE__ */ React42.createElement("path", { d: "M6.4 12.6h3.2" }),
12568
+ /* @__PURE__ */ React42.createElement("path", { d: "M7.2 14.4h1.6" })
12420
12569
  );
12421
12570
  }
12422
12571
 
@@ -12538,7 +12687,7 @@ function registerInjection(scope, injectionRef, capabilities) {
12538
12687
  });
12539
12688
  }
12540
12689
  function TaskTabTitle() {
12541
- return /* @__PURE__ */ React42.createElement("span", null, "MattWorkflow");
12690
+ return /* @__PURE__ */ React43.createElement("span", null, "MattWorkflow");
12542
12691
  }
12543
12692
  function createTaskTab(client, injectionRef, capabilities, i18n) {
12544
12693
  return function TaskTab(props) {
@@ -12549,7 +12698,7 @@ function createTaskTab(client, injectionRef, capabilities, i18n) {
12549
12698
  );
12550
12699
  const readiness = useInjectionReadiness(injectionRef);
12551
12700
  const refreshSignal = useAgentActivitySignal(useSessions, sessionId);
12552
- const injection = React42.useMemo(
12701
+ const injection = React43.useMemo(
12553
12702
  () => ({
12554
12703
  canInjectCurrent: sessionId !== void 0 && readiness.current,
12555
12704
  canStartNewSession: readiness.newSession,
@@ -12557,7 +12706,7 @@ function createTaskTab(client, injectionRef, capabilities, i18n) {
12557
12706
  }),
12558
12707
  [injectionRef, sessionId, readiness.current, readiness.newSession]
12559
12708
  );
12560
- return /* @__PURE__ */ React42.createElement(I18nProvider, { i18n }, /* @__PURE__ */ React42.createElement(
12709
+ return /* @__PURE__ */ React43.createElement(I18nProvider, { i18n }, /* @__PURE__ */ React43.createElement(
12561
12710
  TaskPanel,
12562
12711
  {
12563
12712
  client,
@@ -12581,8 +12730,8 @@ function notify(ref) {
12581
12730
  for (const listener of ref.listeners) listener();
12582
12731
  }
12583
12732
  function useInjectionReadiness(ref) {
12584
- const [readiness, setReadiness] = React42.useState(() => readReadiness(ref));
12585
- React42.useEffect(() => {
12733
+ const [readiness, setReadiness] = React43.useState(() => readReadiness(ref));
12734
+ React43.useEffect(() => {
12586
12735
  const update = () => {
12587
12736
  setReadiness(readReadiness(ref));
12588
12737
  };