@cnzgray/dsh-mattpocock-workflow 0.5.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/lib/client.js +363 -87
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,6 +25,13 @@
|
|
|
25
25
|
默认只看未关闭工单,并按“可接 → 阻塞 → 其他开放 → 已关闭”排序;筛选、人员开关、排序键、布局与方向按工作区记住,
|
|
26
26
|
重新打开面板或切回该工作区时恢复。偏好只存在浏览器本地存储里,不随工作区删除而清理,最多保留 50 个工作区条目;
|
|
27
27
|
存储不可用时静默退回默认视图;
|
|
28
|
+
工具栏右侧有一个「行内显示」图标(滑杆),点开浮层后是四个开关:创建人、创建时间、更新时间与分配人;
|
|
29
|
+
创建人与创建时间默认打开(与加入开关前的行内信息一致),更新时间与分配人默认关闭,四个开关都按工作区记住。
|
|
30
|
+
创建时间不再依附创建人:没有创建人的行(本地 Markdown)也显示「创建 X」,关掉创建人时时间照常显示;
|
|
31
|
+
只在创建人与创建时间同排时保留裸露的相对创建时间。
|
|
32
|
+
打开「更新时间」后,时间区追加「更新 Y」,与创建时间并排时两段都带前缀;
|
|
33
|
+
打开「分配人」后,标签之后显示远端登录名(与详情里的写法一致,最多两个,其余折成 `+N`,悬停可看完整名单),
|
|
34
|
+
没有分配人的行不渲染图标或占位;本地 Markdown 后端不提供分配人开关;
|
|
28
35
|
列表支持**平铺**与**父子**两种布局,默认平铺:父子布局用已加载且通过当前筛选的票建树,子票逐层缩进,
|
|
29
36
|
父行可收起整棵子树并显示可见子票数;父票被筛掉、还没加载、在别的仓库或是 GitLab epic 时,子票升到顶层并显示父级引用徽标,
|
|
30
37
|
不伪造父行。GitHub 用原生子工单,GitLab 用工作项层级(列表返回后按每批最多 100 张票用一次 GraphQL 补齐,失败时只禁用父子布局、列表照常),
|
package/lib/client.js
CHANGED
|
@@ -39,7 +39,7 @@ __export(index_exports, {
|
|
|
39
39
|
inject: () => inject
|
|
40
40
|
});
|
|
41
41
|
module.exports = __toCommonJS(index_exports);
|
|
42
|
-
var
|
|
42
|
+
var React46 = __toESM(require("react"), 1);
|
|
43
43
|
|
|
44
44
|
// src/client/agent-activity.ts
|
|
45
45
|
var React = __toESM(require("react"), 1);
|
|
@@ -191,6 +191,19 @@ var zh = {
|
|
|
191
191
|
"tickets.emptyFilter": "\u6CA1\u6709\u7B26\u5408\u7B5B\u9009\u6761\u4EF6\u7684\u5DE5\u5355\u3002",
|
|
192
192
|
"tickets.a11y.open": "\u6253\u5F00 {ref}\uFF1A{title}",
|
|
193
193
|
"tickets.age.title": "\u521B\u5EFA\uFF1A{created}\uFF1B\u66F4\u65B0\uFF1A{updated}",
|
|
194
|
+
"row.displayGroup": "\u884C\u5185\u663E\u793A",
|
|
195
|
+
"row.displayGroupHint": "\u9009\u62E9\u5217\u8868\u884C\u663E\u793A\u54EA\u4E9B\u4FE1\u606F",
|
|
196
|
+
"row.showAuthor": "\u521B\u5EFA\u4EBA",
|
|
197
|
+
"row.showCreatedAt": "\u521B\u5EFA\u65F6\u95F4",
|
|
198
|
+
"row.showUpdatedAt": "\u66F4\u65B0\u65F6\u95F4",
|
|
199
|
+
"row.showAssignees": "\u5206\u914D\u4EBA",
|
|
200
|
+
"row.time.created": "\u521B\u5EFA {age}",
|
|
201
|
+
"row.time.updated": "\u66F4\u65B0 {age}",
|
|
202
|
+
"row.time.separator": " \xB7 ",
|
|
203
|
+
"row.assigneesA11y": "\u5206\u914D\u4EBA\uFF1A{names}",
|
|
204
|
+
"row.assigneesTitle": "\u5206\u914D\u4EBA\uFF1A{names}",
|
|
205
|
+
"row.assigneesSeparator": ", ",
|
|
206
|
+
"row.assigneesMoreTitle": "\u8FD8\u6709 {count} \u4E2A\u5206\u914D\u4EBA\uFF1A{names}",
|
|
194
207
|
"tickets.more.loading": "\u6B63\u5728\u52A0\u8F7D\u66F4\u591A\u2026",
|
|
195
208
|
"tickets.more.scroll": "\u7EE7\u7EED\u5411\u4E0B\u6EDA\u52A8\u52A0\u8F7D\u66F4\u591A",
|
|
196
209
|
"tickets.more.failed": "\u52A0\u8F7D\u66F4\u591A\u5931\u8D25\uFF1A{message}",
|
|
@@ -665,6 +678,19 @@ var en = {
|
|
|
665
678
|
"tickets.emptyFilter": "No tickets match the filter.",
|
|
666
679
|
"tickets.a11y.open": "Open {ref}: {title}",
|
|
667
680
|
"tickets.age.title": "Created: {created}; updated: {updated}",
|
|
681
|
+
"row.displayGroup": "Row details",
|
|
682
|
+
"row.displayGroupHint": "Choose which fields each row shows",
|
|
683
|
+
"row.showAuthor": "Author",
|
|
684
|
+
"row.showCreatedAt": "Created time",
|
|
685
|
+
"row.showUpdatedAt": "Updated time",
|
|
686
|
+
"row.showAssignees": "Assignees",
|
|
687
|
+
"row.time.created": "Created {age}",
|
|
688
|
+
"row.time.updated": "Updated {age}",
|
|
689
|
+
"row.time.separator": " \xB7 ",
|
|
690
|
+
"row.assigneesA11y": "Assignees: {names}",
|
|
691
|
+
"row.assigneesTitle": "Assignees: {names}",
|
|
692
|
+
"row.assigneesSeparator": ", ",
|
|
693
|
+
"row.assigneesMoreTitle": "{count} more assignees: {names}",
|
|
668
694
|
"tickets.more.loading": "Loading more\u2026",
|
|
669
695
|
"tickets.more.scroll": "Scroll down to load more",
|
|
670
696
|
"tickets.more.failed": "Failed to load more: {message}",
|
|
@@ -1776,7 +1802,7 @@ function disposerOf(handle) {
|
|
|
1776
1802
|
}
|
|
1777
1803
|
|
|
1778
1804
|
// src/client/task-panel.tsx
|
|
1779
|
-
var
|
|
1805
|
+
var React45 = __toESM(require("react"), 1);
|
|
1780
1806
|
|
|
1781
1807
|
// src/client/action-bar.tsx
|
|
1782
1808
|
var React5 = __toESM(require("react"), 1);
|
|
@@ -1972,6 +1998,17 @@ function TrashIcon() {
|
|
|
1972
1998
|
}
|
|
1973
1999
|
));
|
|
1974
2000
|
}
|
|
2001
|
+
function DisplaySettingsIcon() {
|
|
2002
|
+
return /* @__PURE__ */ React3.createElement("svg", { width: "13", height: "13", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true" }, /* @__PURE__ */ React3.createElement(
|
|
2003
|
+
"path",
|
|
2004
|
+
{
|
|
2005
|
+
d: "M2.5 5h2M7.5 5h6M2.5 11h6M11.5 11h2",
|
|
2006
|
+
stroke: "currentColor",
|
|
2007
|
+
strokeWidth: "1.2",
|
|
2008
|
+
strokeLinecap: "round"
|
|
2009
|
+
}
|
|
2010
|
+
), /* @__PURE__ */ React3.createElement("circle", { cx: "6", cy: "5", r: "1.6", stroke: "currentColor", strokeWidth: "1.2" }), /* @__PURE__ */ React3.createElement("circle", { cx: "10", cy: "11", r: "1.6", stroke: "currentColor", strokeWidth: "1.2" }));
|
|
2011
|
+
}
|
|
1975
2012
|
function FlatListIcon() {
|
|
1976
2013
|
return /* @__PURE__ */ React3.createElement("svg", { width: "12", height: "12", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true" }, /* @__PURE__ */ React3.createElement(
|
|
1977
2014
|
"path",
|
|
@@ -11266,7 +11303,7 @@ function useTicketTreeSession() {
|
|
|
11266
11303
|
}
|
|
11267
11304
|
|
|
11268
11305
|
// src/client/tickets-view.tsx
|
|
11269
|
-
var
|
|
11306
|
+
var React44 = __toESM(require("react"), 1);
|
|
11270
11307
|
|
|
11271
11308
|
// src/client/my-tickets-bar.tsx
|
|
11272
11309
|
var React31 = __toESM(require("react"), 1);
|
|
@@ -11543,6 +11580,32 @@ var ROW_AGE_STYLE = {
|
|
|
11543
11580
|
lineHeight: "18px",
|
|
11544
11581
|
whiteSpace: "nowrap"
|
|
11545
11582
|
};
|
|
11583
|
+
var ASSIGNEE_GROUP_STYLE = {
|
|
11584
|
+
display: "inline-flex",
|
|
11585
|
+
alignItems: "center",
|
|
11586
|
+
gap: 4,
|
|
11587
|
+
minWidth: 0
|
|
11588
|
+
};
|
|
11589
|
+
var ASSIGNEE_ICON_STYLE = {
|
|
11590
|
+
display: "inline-flex",
|
|
11591
|
+
alignItems: "center",
|
|
11592
|
+
flex: "none",
|
|
11593
|
+
color: COLORS.tertiary,
|
|
11594
|
+
lineHeight: "18px"
|
|
11595
|
+
};
|
|
11596
|
+
var ASSIGNEE_NAME_STYLE = {
|
|
11597
|
+
color: COLORS.secondary,
|
|
11598
|
+
fontSize: 11,
|
|
11599
|
+
lineHeight: "18px",
|
|
11600
|
+
whiteSpace: "nowrap"
|
|
11601
|
+
};
|
|
11602
|
+
var ASSIGNEE_MORE_STYLE = {
|
|
11603
|
+
color: COLORS.tertiary,
|
|
11604
|
+
fontSize: 11,
|
|
11605
|
+
lineHeight: "18px",
|
|
11606
|
+
whiteSpace: "nowrap",
|
|
11607
|
+
cursor: "default"
|
|
11608
|
+
};
|
|
11546
11609
|
var CARD_CONTENT_STYLE = {
|
|
11547
11610
|
position: "relative",
|
|
11548
11611
|
display: "flex",
|
|
@@ -11593,6 +11656,50 @@ var NUMBER_MARK_STYLE = {
|
|
|
11593
11656
|
width: "0.6em",
|
|
11594
11657
|
verticalAlign: "-1px"
|
|
11595
11658
|
};
|
|
11659
|
+
var DISPLAY_MENU_WRAP_STYLE = {
|
|
11660
|
+
position: "relative",
|
|
11661
|
+
display: "inline-flex"
|
|
11662
|
+
};
|
|
11663
|
+
var DISPLAY_MENU_TRIGGER_STYLE = {
|
|
11664
|
+
display: "inline-flex",
|
|
11665
|
+
alignItems: "center",
|
|
11666
|
+
justifyContent: "center",
|
|
11667
|
+
border: `1px solid ${COLORS.border}`,
|
|
11668
|
+
borderRadius: 6,
|
|
11669
|
+
padding: "1px 6px",
|
|
11670
|
+
color: COLORS.secondary,
|
|
11671
|
+
background: COLORS.surfaceRaised,
|
|
11672
|
+
cursor: "pointer",
|
|
11673
|
+
font: "inherit",
|
|
11674
|
+
lineHeight: "20px"
|
|
11675
|
+
};
|
|
11676
|
+
var DISPLAY_MENU_PANEL_STYLE = {
|
|
11677
|
+
position: "absolute",
|
|
11678
|
+
top: "calc(100% + 4px)",
|
|
11679
|
+
right: 0,
|
|
11680
|
+
zIndex: 20,
|
|
11681
|
+
display: "flex",
|
|
11682
|
+
flexDirection: "column",
|
|
11683
|
+
gap: 2,
|
|
11684
|
+
minWidth: 132,
|
|
11685
|
+
padding: 4,
|
|
11686
|
+
border: `1px solid ${COLORS.border}`,
|
|
11687
|
+
borderRadius: 8,
|
|
11688
|
+
background: COLORS.surfaceRaised,
|
|
11689
|
+
boxShadow: "0 6px 18px rgba(0, 0, 0, 0.16), 0 0 0 0.5px rgba(0, 0, 0, 0.08)"
|
|
11690
|
+
};
|
|
11691
|
+
var DISPLAY_MENU_ITEM_STYLE = {
|
|
11692
|
+
...CHIP_STYLE,
|
|
11693
|
+
display: "flex",
|
|
11694
|
+
alignItems: "center",
|
|
11695
|
+
justifyContent: "space-between",
|
|
11696
|
+
gap: 12,
|
|
11697
|
+
width: "100%",
|
|
11698
|
+
borderRadius: 5,
|
|
11699
|
+
// 浏览器默认按钮底色会在浮层里显成灰块;开启项才用抬起来的底色。
|
|
11700
|
+
background: "transparent",
|
|
11701
|
+
textAlign: "left"
|
|
11702
|
+
};
|
|
11596
11703
|
|
|
11597
11704
|
// src/client/ticket-avatar.tsx
|
|
11598
11705
|
function TicketAvatar(props) {
|
|
@@ -11715,6 +11822,7 @@ function refDisplay(ticket) {
|
|
|
11715
11822
|
|
|
11716
11823
|
// src/client/ticket-list.tsx
|
|
11717
11824
|
var MAX_EXTRA_LABELS = 3;
|
|
11825
|
+
var MAX_ROW_ASSIGNEES = 2;
|
|
11718
11826
|
var STATUS_KEYS2 = {
|
|
11719
11827
|
ready: "status.ready",
|
|
11720
11828
|
blocked: "status.blocked",
|
|
@@ -11739,6 +11847,7 @@ function TicketList(props) {
|
|
|
11739
11847
|
injection: props.injection,
|
|
11740
11848
|
focused: ticket.ref === props.focused,
|
|
11741
11849
|
now: props.now,
|
|
11850
|
+
fields: props.fields,
|
|
11742
11851
|
onPick: props.onPick,
|
|
11743
11852
|
onSkillAction: props.onSkillAction
|
|
11744
11853
|
}
|
|
@@ -11752,6 +11861,7 @@ function TicketList(props) {
|
|
|
11752
11861
|
injection: props.injection,
|
|
11753
11862
|
focused: row.ticket.ref === props.focused,
|
|
11754
11863
|
now: props.now,
|
|
11864
|
+
fields: props.fields,
|
|
11755
11865
|
onPick: props.onPick,
|
|
11756
11866
|
onSkillAction: props.onSkillAction,
|
|
11757
11867
|
...props.onToggleTree === void 0 ? {} : { onToggleTree: props.onToggleTree }
|
|
@@ -11811,7 +11921,7 @@ function TicketRow(props) {
|
|
|
11811
11921
|
},
|
|
11812
11922
|
/* @__PURE__ */ React34.createElement("span", { "aria-hidden": "true" }, props.row.expanded ? "\u25BE" : "\u25B8")
|
|
11813
11923
|
) : null, /* @__PURE__ */ React34.createElement(TicketNumber, { ticket }), ticket.title),
|
|
11814
|
-
/* @__PURE__ */ React34.createElement(MetaRow, { ticket, row: props.row, now: props.now })
|
|
11924
|
+
/* @__PURE__ */ React34.createElement(MetaRow, { ticket, row: props.row, now: props.now, fields: props.fields })
|
|
11815
11925
|
),
|
|
11816
11926
|
/* @__PURE__ */ React34.createElement(
|
|
11817
11927
|
SkillActionBadge,
|
|
@@ -11838,31 +11948,73 @@ function MetaRow(props) {
|
|
|
11838
11948
|
style: PARENT_BADGE_STYLE
|
|
11839
11949
|
},
|
|
11840
11950
|
t2("tree.parentBadge", { parent: ticket.parent })
|
|
11841
|
-
) : null, shown.map((label) => /* @__PURE__ */ React34.createElement("span", { key: label, "data-testid": "ticket-label", style: LABEL_BADGE_STYLE }, label)), hidden > 0 ? /* @__PURE__ */ React34.createElement("span", { "data-testid": "ticket-label-more", style: LABEL_BADGE_STYLE }, "+", String(hidden)) : null, ticket.author
|
|
11842
|
-
|
|
11951
|
+
) : null, shown.map((label) => /* @__PURE__ */ React34.createElement("span", { key: label, "data-testid": "ticket-label", style: LABEL_BADGE_STYLE }, label)), hidden > 0 ? /* @__PURE__ */ React34.createElement("span", { "data-testid": "ticket-label-more", style: LABEL_BADGE_STYLE }, "+", String(hidden)) : null, props.fields.showAssignees && ticket.assignees.length > 0 ? /* @__PURE__ */ React34.createElement(AssigneeMeta, { assignees: ticket.assignees }) : null, props.fields.showAuthor && ticket.author !== null ? /* @__PURE__ */ React34.createElement(AuthorMeta, { author: ticket.author }) : null, /* @__PURE__ */ React34.createElement(
|
|
11952
|
+
TimeMeta,
|
|
11843
11953
|
{
|
|
11844
|
-
author: ticket.author,
|
|
11845
11954
|
createdAt: ticket.createdAt,
|
|
11846
11955
|
updatedAt: ticket.updatedAt,
|
|
11847
|
-
now: props.now
|
|
11956
|
+
now: props.now,
|
|
11957
|
+
fields: props.fields,
|
|
11958
|
+
authorShown: props.fields.showAuthor && ticket.author !== null
|
|
11848
11959
|
}
|
|
11849
11960
|
));
|
|
11850
11961
|
}
|
|
11962
|
+
function AssigneeMeta(props) {
|
|
11963
|
+
const { t: t2 } = useI18n();
|
|
11964
|
+
const separator = t2("row.assigneesSeparator");
|
|
11965
|
+
const all = props.assignees.join(separator);
|
|
11966
|
+
const shown = props.assignees.slice(0, MAX_ROW_ASSIGNEES);
|
|
11967
|
+
const hidden = props.assignees.length - shown.length;
|
|
11968
|
+
return /* @__PURE__ */ React34.createElement(
|
|
11969
|
+
"span",
|
|
11970
|
+
{
|
|
11971
|
+
role: "group",
|
|
11972
|
+
"data-testid": "ticket-assignees",
|
|
11973
|
+
"aria-label": t2("row.assigneesA11y", { names: all }),
|
|
11974
|
+
title: t2("row.assigneesTitle", { names: all }),
|
|
11975
|
+
style: ASSIGNEE_GROUP_STYLE
|
|
11976
|
+
},
|
|
11977
|
+
/* @__PURE__ */ React34.createElement("span", { "aria-hidden": "true", style: ASSIGNEE_ICON_STYLE }, /* @__PURE__ */ React34.createElement(PersonIcon, null)),
|
|
11978
|
+
/* @__PURE__ */ React34.createElement("span", { "data-testid": "ticket-assignee", style: ASSIGNEE_NAME_STYLE }, shown.join(separator)),
|
|
11979
|
+
hidden > 0 ? /* @__PURE__ */ React34.createElement(
|
|
11980
|
+
"span",
|
|
11981
|
+
{
|
|
11982
|
+
"data-testid": "ticket-assignee-more",
|
|
11983
|
+
title: t2("row.assigneesMoreTitle", { count: hidden, names: all }),
|
|
11984
|
+
style: ASSIGNEE_MORE_STYLE
|
|
11985
|
+
},
|
|
11986
|
+
"+",
|
|
11987
|
+
String(hidden)
|
|
11988
|
+
) : null
|
|
11989
|
+
);
|
|
11990
|
+
}
|
|
11851
11991
|
function AuthorMeta(props) {
|
|
11852
11992
|
const { t: t2 } = useI18n();
|
|
11853
11993
|
const { author } = props;
|
|
11854
11994
|
const name = authorName(author);
|
|
11855
11995
|
const full = authorTitle(author, t2);
|
|
11856
|
-
|
|
11857
|
-
|
|
11996
|
+
return /* @__PURE__ */ React34.createElement(React34.Fragment, null, /* @__PURE__ */ React34.createElement(TicketAvatar, { author }), /* @__PURE__ */ React34.createElement("span", { "data-testid": "ticket-author", title: full, style: AUTHOR_NAME_STYLE }, name));
|
|
11997
|
+
}
|
|
11998
|
+
function TimeMeta(props) {
|
|
11999
|
+
const { t: t2 } = useI18n();
|
|
12000
|
+
const createdAge = props.fields.showCreatedAt ? formatRelativeTime(props.createdAt, props.now, t2) : "";
|
|
12001
|
+
const updatedAge = props.fields.showUpdatedAt ? formatRelativeTime(props.updatedAt, props.now, t2) : "";
|
|
12002
|
+
const segments = [];
|
|
12003
|
+
if (createdAge.length > 0) {
|
|
12004
|
+
const bare = !props.fields.showUpdatedAt && props.authorShown;
|
|
12005
|
+
segments.push(bare ? createdAge : t2("row.time.created", { age: createdAge }));
|
|
12006
|
+
}
|
|
12007
|
+
if (updatedAge.length > 0) segments.push(t2("row.time.updated", { age: updatedAge }));
|
|
12008
|
+
if (segments.length === 0) return null;
|
|
12009
|
+
return /* @__PURE__ */ React34.createElement(
|
|
11858
12010
|
"span",
|
|
11859
12011
|
{
|
|
11860
12012
|
"data-testid": "ticket-age",
|
|
11861
12013
|
title: t2("tickets.age.title", { created: props.createdAt, updated: props.updatedAt }),
|
|
11862
12014
|
style: ROW_AGE_STYLE
|
|
11863
12015
|
},
|
|
11864
|
-
|
|
11865
|
-
)
|
|
12016
|
+
segments.join(t2("row.time.separator"))
|
|
12017
|
+
);
|
|
11866
12018
|
}
|
|
11867
12019
|
function pickRowLabels(labels, limit) {
|
|
11868
12020
|
const isTriageLabel = (label) => TRIAGE_LABELS.includes(label);
|
|
@@ -12184,10 +12336,96 @@ function LayoutControl(props) {
|
|
|
12184
12336
|
}
|
|
12185
12337
|
|
|
12186
12338
|
// src/client/tickets-toolbar.tsx
|
|
12187
|
-
var
|
|
12339
|
+
var React41 = __toESM(require("react"), 1);
|
|
12188
12340
|
|
|
12189
|
-
// src/client/
|
|
12341
|
+
// src/client/row-display-control.tsx
|
|
12190
12342
|
var React39 = __toESM(require("react"), 1);
|
|
12343
|
+
var CHECK_STYLE = {
|
|
12344
|
+
display: "inline-flex",
|
|
12345
|
+
color: COLORS.accent
|
|
12346
|
+
};
|
|
12347
|
+
var CHECK_OFF_STYLE = { ...CHECK_STYLE, visibility: "hidden" };
|
|
12348
|
+
var DISPLAY_ITEMS = [
|
|
12349
|
+
{ field: "showAuthor", testId: "display-author", key: "row.showAuthor" },
|
|
12350
|
+
{ field: "showCreatedAt", testId: "display-created", key: "row.showCreatedAt" },
|
|
12351
|
+
{ field: "showUpdatedAt", testId: "display-updated", key: "row.showUpdatedAt" },
|
|
12352
|
+
{ field: "showAssignees", testId: "display-assignees", key: "row.showAssignees" }
|
|
12353
|
+
];
|
|
12354
|
+
function RowDisplayControl(props) {
|
|
12355
|
+
const { t: t2 } = useI18n();
|
|
12356
|
+
const [open, setOpen] = React39.useState(false);
|
|
12357
|
+
const wrapRef = React39.useRef(null);
|
|
12358
|
+
const triggerRef = React39.useRef(null);
|
|
12359
|
+
React39.useEffect(() => {
|
|
12360
|
+
if (!open) return void 0;
|
|
12361
|
+
const onPointerDown = (event) => {
|
|
12362
|
+
if (wrapRef.current?.contains(event.target) === true) return;
|
|
12363
|
+
setOpen(false);
|
|
12364
|
+
};
|
|
12365
|
+
const onKeyDown = (event) => {
|
|
12366
|
+
if (event.key !== "Escape") return;
|
|
12367
|
+
setOpen(false);
|
|
12368
|
+
triggerRef.current?.focus();
|
|
12369
|
+
};
|
|
12370
|
+
document.addEventListener("pointerdown", onPointerDown);
|
|
12371
|
+
document.addEventListener("keydown", onKeyDown);
|
|
12372
|
+
return () => {
|
|
12373
|
+
document.removeEventListener("pointerdown", onPointerDown);
|
|
12374
|
+
document.removeEventListener("keydown", onKeyDown);
|
|
12375
|
+
};
|
|
12376
|
+
}, [open]);
|
|
12377
|
+
return /* @__PURE__ */ React39.createElement("div", { ref: wrapRef, style: DISPLAY_MENU_WRAP_STYLE }, /* @__PURE__ */ React39.createElement(
|
|
12378
|
+
"button",
|
|
12379
|
+
{
|
|
12380
|
+
ref: triggerRef,
|
|
12381
|
+
type: "button",
|
|
12382
|
+
"data-testid": "display-settings",
|
|
12383
|
+
"aria-expanded": open,
|
|
12384
|
+
"aria-label": t2("row.displayGroup"),
|
|
12385
|
+
title: t2("row.displayGroupHint"),
|
|
12386
|
+
"data-hover": "soft",
|
|
12387
|
+
onClick: () => {
|
|
12388
|
+
setOpen((value) => !value);
|
|
12389
|
+
},
|
|
12390
|
+
style: {
|
|
12391
|
+
...DISPLAY_MENU_TRIGGER_STYLE,
|
|
12392
|
+
...open ? { background: COLORS.surfaceActive, color: COLORS.text } : void 0
|
|
12393
|
+
}
|
|
12394
|
+
},
|
|
12395
|
+
/* @__PURE__ */ React39.createElement(DisplaySettingsIcon, null)
|
|
12396
|
+
), open ? /* @__PURE__ */ React39.createElement("div", { role: "group", "aria-label": t2("row.displayGroup"), style: DISPLAY_MENU_PANEL_STYLE }, DISPLAY_ITEMS.filter(
|
|
12397
|
+
(item) => item.field !== "showAssignees" || props.assigneesAvailable
|
|
12398
|
+
).map((item) => /* @__PURE__ */ React39.createElement(
|
|
12399
|
+
MenuItem,
|
|
12400
|
+
{
|
|
12401
|
+
key: item.field,
|
|
12402
|
+
testId: item.testId,
|
|
12403
|
+
label: t2(item.key),
|
|
12404
|
+
pressed: props.fields[item.field],
|
|
12405
|
+
onToggle: () => {
|
|
12406
|
+
props.onToggleField(item.field);
|
|
12407
|
+
}
|
|
12408
|
+
}
|
|
12409
|
+
))) : null);
|
|
12410
|
+
}
|
|
12411
|
+
function MenuItem(props) {
|
|
12412
|
+
return /* @__PURE__ */ React39.createElement(
|
|
12413
|
+
"button",
|
|
12414
|
+
{
|
|
12415
|
+
type: "button",
|
|
12416
|
+
"data-testid": props.testId,
|
|
12417
|
+
"aria-pressed": props.pressed,
|
|
12418
|
+
"data-hover": "soft",
|
|
12419
|
+
onClick: props.onToggle,
|
|
12420
|
+
style: DISPLAY_MENU_ITEM_STYLE
|
|
12421
|
+
},
|
|
12422
|
+
props.label,
|
|
12423
|
+
/* @__PURE__ */ React39.createElement("span", { "aria-hidden": "true", style: props.pressed ? CHECK_STYLE : CHECK_OFF_STYLE }, /* @__PURE__ */ React39.createElement(CheckIcon, null))
|
|
12424
|
+
);
|
|
12425
|
+
}
|
|
12426
|
+
|
|
12427
|
+
// src/client/sort-control.tsx
|
|
12428
|
+
var React40 = __toESM(require("react"), 1);
|
|
12191
12429
|
var GROUP_STYLE2 = {
|
|
12192
12430
|
...SEGMENTED_STYLE,
|
|
12193
12431
|
flexWrap: "nowrap",
|
|
@@ -12253,7 +12491,7 @@ function SortControl(props) {
|
|
|
12253
12491
|
const next = props.direction === "asc" ? "desc" : "asc";
|
|
12254
12492
|
const currentLabel = t2(DIRECTION_KEYS[props.direction]);
|
|
12255
12493
|
const nextLabel = t2(DIRECTION_KEYS[next]);
|
|
12256
|
-
return /* @__PURE__ */
|
|
12494
|
+
return /* @__PURE__ */ React40.createElement("div", { role: "group", "aria-label": t2("sort.group"), style: GROUP_STYLE2 }, /* @__PURE__ */ React40.createElement("span", { style: SELECT_WRAP_STYLE }, /* @__PURE__ */ React40.createElement(
|
|
12257
12495
|
"select",
|
|
12258
12496
|
{
|
|
12259
12497
|
"data-testid": "sort-key",
|
|
@@ -12265,8 +12503,8 @@ function SortControl(props) {
|
|
|
12265
12503
|
},
|
|
12266
12504
|
style: SELECT_STYLE
|
|
12267
12505
|
},
|
|
12268
|
-
TICKET_SORT_KEYS.map((key) => /* @__PURE__ */
|
|
12269
|
-
), /* @__PURE__ */
|
|
12506
|
+
TICKET_SORT_KEYS.map((key) => /* @__PURE__ */ React40.createElement("option", { key, value: key }, t2(SORT_KEYS[key])))
|
|
12507
|
+
), /* @__PURE__ */ React40.createElement("span", { style: CARET_STYLE }, /* @__PURE__ */ React40.createElement(CaretIcon, null))), /* @__PURE__ */ React40.createElement(
|
|
12270
12508
|
"button",
|
|
12271
12509
|
{
|
|
12272
12510
|
type: "button",
|
|
@@ -12282,7 +12520,7 @@ function SortControl(props) {
|
|
|
12282
12520
|
));
|
|
12283
12521
|
}
|
|
12284
12522
|
function CaretIcon() {
|
|
12285
|
-
return /* @__PURE__ */
|
|
12523
|
+
return /* @__PURE__ */ React40.createElement("svg", { width: "8", height: "8", viewBox: "0 0 8 8", "aria-hidden": "true" }, /* @__PURE__ */ React40.createElement("path", { d: "M0.5 2h7L4 6.5z", fill: "currentColor" }));
|
|
12286
12524
|
}
|
|
12287
12525
|
|
|
12288
12526
|
// src/client/tickets-toolbar.tsx
|
|
@@ -12300,7 +12538,7 @@ var CHIP_STATS = {
|
|
|
12300
12538
|
};
|
|
12301
12539
|
function Toolbar(props) {
|
|
12302
12540
|
const { t: t2 } = useI18n();
|
|
12303
|
-
return /* @__PURE__ */
|
|
12541
|
+
return /* @__PURE__ */ React41.createElement("div", { style: TOOLBAR_STYLE }, /* @__PURE__ */ React41.createElement("div", { role: "group", "aria-label": t2("filter.group"), style: SEGMENTED_STYLE }, TICKET_FILTERS.map((value) => /* @__PURE__ */ React41.createElement(
|
|
12304
12542
|
Chip,
|
|
12305
12543
|
{
|
|
12306
12544
|
key: value,
|
|
@@ -12313,7 +12551,7 @@ function Toolbar(props) {
|
|
|
12313
12551
|
props.onFilter(value);
|
|
12314
12552
|
}
|
|
12315
12553
|
}
|
|
12316
|
-
))), /* @__PURE__ */
|
|
12554
|
+
))), /* @__PURE__ */ React41.createElement(
|
|
12317
12555
|
SortControl,
|
|
12318
12556
|
{
|
|
12319
12557
|
sortKey: props.sortKey,
|
|
@@ -12323,11 +12561,17 @@ function Toolbar(props) {
|
|
|
12323
12561
|
props.onSort(props.sortKey);
|
|
12324
12562
|
}
|
|
12325
12563
|
}
|
|
12564
|
+
), /* @__PURE__ */ React41.createElement(
|
|
12565
|
+
RowDisplayControl,
|
|
12566
|
+
{
|
|
12567
|
+
fields: props.fields,
|
|
12568
|
+
assigneesAvailable: props.assigneesAvailable,
|
|
12569
|
+
onToggleField: props.onToggleField
|
|
12570
|
+
}
|
|
12326
12571
|
));
|
|
12327
12572
|
}
|
|
12328
|
-
function
|
|
12329
|
-
|
|
12330
|
-
return /* @__PURE__ */ React40.createElement(
|
|
12573
|
+
function ChipButton(props) {
|
|
12574
|
+
return /* @__PURE__ */ React41.createElement(
|
|
12331
12575
|
"button",
|
|
12332
12576
|
{
|
|
12333
12577
|
type: "button",
|
|
@@ -12337,19 +12581,21 @@ function Chip(props) {
|
|
|
12337
12581
|
onClick: props.onClick,
|
|
12338
12582
|
style: { ...CHIP_STYLE, ...props.active ? CHIP_ACTIVE_STYLE : void 0 }
|
|
12339
12583
|
},
|
|
12340
|
-
|
|
12341
|
-
props.label,
|
|
12342
|
-
stat === void 0 ? null : /* @__PURE__ */ React40.createElement("span", { "data-testid": `stat-${stat.key}`, style: CHIP_COUNT_STYLE }, props.count[stat.key])
|
|
12584
|
+
props.children
|
|
12343
12585
|
);
|
|
12344
12586
|
}
|
|
12587
|
+
function Chip(props) {
|
|
12588
|
+
const stat = props.stat;
|
|
12589
|
+
return /* @__PURE__ */ React41.createElement(ChipButton, { testId: props.testId, active: props.active, onClick: props.onClick }, stat === void 0 ? null : /* @__PURE__ */ React41.createElement("span", { "aria-hidden": "true", style: { ...CHIP_DOT_STYLE, background: stat.color } }), props.label, stat === void 0 ? null : /* @__PURE__ */ React41.createElement("span", { "data-testid": `stat-${stat.key}`, style: CHIP_COUNT_STYLE }, props.count[stat.key]));
|
|
12590
|
+
}
|
|
12345
12591
|
|
|
12346
12592
|
// src/client/use-collapsed-tickets.ts
|
|
12347
|
-
var
|
|
12593
|
+
var React42 = __toESM(require("react"), 1);
|
|
12348
12594
|
function useCollapsedTickets(workspaceRoot, focused, visible) {
|
|
12349
12595
|
const session = useTicketTreeSession();
|
|
12350
|
-
const [localCollapsed, setLocalCollapsed] =
|
|
12351
|
-
const previousRoot =
|
|
12352
|
-
const expandedFor =
|
|
12596
|
+
const [localCollapsed, setLocalCollapsed] = React42.useState(() => /* @__PURE__ */ new Set());
|
|
12597
|
+
const previousRoot = React42.useRef(workspaceRoot);
|
|
12598
|
+
const expandedFor = React42.useRef(null);
|
|
12353
12599
|
if (previousRoot.current !== workspaceRoot) {
|
|
12354
12600
|
previousRoot.current = workspaceRoot;
|
|
12355
12601
|
expandedFor.current = null;
|
|
@@ -12357,7 +12603,7 @@ function useCollapsedTickets(workspaceRoot, focused, visible) {
|
|
|
12357
12603
|
}
|
|
12358
12604
|
const collapsed = session?.collapsed ?? localCollapsed;
|
|
12359
12605
|
const setCollapsed = session?.setCollapsed ?? setLocalCollapsed;
|
|
12360
|
-
|
|
12606
|
+
React42.useEffect(() => {
|
|
12361
12607
|
if (focused === null || visible.length === 0 || expandedFor.current === focused) return;
|
|
12362
12608
|
expandedFor.current = focused;
|
|
12363
12609
|
setCollapsed((current) => expandAncestors(visible, current, focused));
|
|
@@ -12474,7 +12720,7 @@ function timestamp(value) {
|
|
|
12474
12720
|
}
|
|
12475
12721
|
|
|
12476
12722
|
// src/client/use-view-preference.ts
|
|
12477
|
-
var
|
|
12723
|
+
var React43 = __toESM(require("react"), 1);
|
|
12478
12724
|
|
|
12479
12725
|
// src/client/view-preference.ts
|
|
12480
12726
|
var DEFAULT_VIEW = {
|
|
@@ -12483,7 +12729,11 @@ var DEFAULT_VIEW = {
|
|
|
12483
12729
|
direction: "asc",
|
|
12484
12730
|
assignedToMe: false,
|
|
12485
12731
|
createdByMe: false,
|
|
12486
|
-
layout: "flat"
|
|
12732
|
+
layout: "flat",
|
|
12733
|
+
showAuthor: true,
|
|
12734
|
+
showCreatedAt: true,
|
|
12735
|
+
showUpdatedAt: false,
|
|
12736
|
+
showAssignees: false
|
|
12487
12737
|
};
|
|
12488
12738
|
var KEY_PREFIX = "dsh-mattpocock-workflow:view:";
|
|
12489
12739
|
var STORAGE_VERSION = 1;
|
|
@@ -12521,7 +12771,11 @@ function readViewPreference(storage, workspaceRoot) {
|
|
|
12521
12771
|
direction: isDirection(stored.direction) ? stored.direction : DEFAULT_VIEW.direction,
|
|
12522
12772
|
assignedToMe: isBoolean(stored.assignedToMe) ? stored.assignedToMe : DEFAULT_VIEW.assignedToMe,
|
|
12523
12773
|
createdByMe: isBoolean(stored.createdByMe) ? stored.createdByMe : DEFAULT_VIEW.createdByMe,
|
|
12524
|
-
layout: isLayout(stored.layout) ? stored.layout : DEFAULT_VIEW.layout
|
|
12774
|
+
layout: isLayout(stored.layout) ? stored.layout : DEFAULT_VIEW.layout,
|
|
12775
|
+
showAuthor: isBoolean(stored.showAuthor) ? stored.showAuthor : DEFAULT_VIEW.showAuthor,
|
|
12776
|
+
showCreatedAt: isBoolean(stored.showCreatedAt) ? stored.showCreatedAt : DEFAULT_VIEW.showCreatedAt,
|
|
12777
|
+
showUpdatedAt: isBoolean(stored.showUpdatedAt) ? stored.showUpdatedAt : DEFAULT_VIEW.showUpdatedAt,
|
|
12778
|
+
showAssignees: isBoolean(stored.showAssignees) ? stored.showAssignees : DEFAULT_VIEW.showAssignees
|
|
12525
12779
|
};
|
|
12526
12780
|
}
|
|
12527
12781
|
function writeViewPreference(storage, workspaceRoot, preference, now = Date.now) {
|
|
@@ -12536,6 +12790,10 @@ function writeViewPreference(storage, workspaceRoot, preference, now = Date.now)
|
|
|
12536
12790
|
assignedToMe: preference.assignedToMe,
|
|
12537
12791
|
createdByMe: preference.createdByMe,
|
|
12538
12792
|
layout: preference.layout,
|
|
12793
|
+
showAuthor: preference.showAuthor,
|
|
12794
|
+
showCreatedAt: preference.showCreatedAt,
|
|
12795
|
+
showUpdatedAt: preference.showUpdatedAt,
|
|
12796
|
+
showAssignees: preference.showAssignees,
|
|
12539
12797
|
savedAt: now(),
|
|
12540
12798
|
version: STORAGE_VERSION
|
|
12541
12799
|
})
|
|
@@ -12597,8 +12855,8 @@ function isLayout(value) {
|
|
|
12597
12855
|
|
|
12598
12856
|
// src/client/use-view-preference.ts
|
|
12599
12857
|
function useViewPreference(workspaceRoot) {
|
|
12600
|
-
const storage =
|
|
12601
|
-
const [viewState, setViewState] =
|
|
12858
|
+
const storage = React43.useMemo(resolvePreferenceStorage, []);
|
|
12859
|
+
const [viewState, setViewState] = React43.useState(() => ({
|
|
12602
12860
|
workspaceRoot,
|
|
12603
12861
|
preference: readViewPreference(storage, workspaceRoot)
|
|
12604
12862
|
}));
|
|
@@ -12638,6 +12896,9 @@ function useViewPreference(workspaceRoot) {
|
|
|
12638
12896
|
},
|
|
12639
12897
|
setLayout: (layout) => {
|
|
12640
12898
|
apply2({ ...preference, layout });
|
|
12899
|
+
},
|
|
12900
|
+
toggleRowField: (field) => {
|
|
12901
|
+
apply2({ ...preference, [field]: !preference[field] });
|
|
12641
12902
|
}
|
|
12642
12903
|
};
|
|
12643
12904
|
}
|
|
@@ -12661,7 +12922,8 @@ function useTicketsViewState(props) {
|
|
|
12661
12922
|
setLayout,
|
|
12662
12923
|
toggleAssignedToMe,
|
|
12663
12924
|
toggleCreatedByMe,
|
|
12664
|
-
clearMyTickets
|
|
12925
|
+
clearMyTickets,
|
|
12926
|
+
toggleRowField
|
|
12665
12927
|
} = useViewPreference(props.workspaceRoot);
|
|
12666
12928
|
const now = useNow(props.now ?? Date.now);
|
|
12667
12929
|
const ownActions = useTicketActions(props.workspaceRoot, props.injection);
|
|
@@ -12695,12 +12957,19 @@ function useTicketsViewState(props) {
|
|
|
12695
12957
|
moreError,
|
|
12696
12958
|
moreLoading,
|
|
12697
12959
|
preference,
|
|
12960
|
+
rowFields: {
|
|
12961
|
+
showAuthor: preference.showAuthor,
|
|
12962
|
+
showCreatedAt: preference.showCreatedAt,
|
|
12963
|
+
showUpdatedAt: preference.showUpdatedAt,
|
|
12964
|
+
showAssignees: preference.showAssignees
|
|
12965
|
+
},
|
|
12698
12966
|
setFilter,
|
|
12699
12967
|
toggleSort,
|
|
12700
12968
|
setLayout,
|
|
12701
12969
|
toggleAssignedToMe,
|
|
12702
12970
|
toggleCreatedByMe,
|
|
12703
12971
|
clearMyTickets,
|
|
12972
|
+
toggleRowField,
|
|
12704
12973
|
tickets,
|
|
12705
12974
|
counts,
|
|
12706
12975
|
myCounts,
|
|
@@ -12722,13 +12991,13 @@ function useTicketsViewState(props) {
|
|
|
12722
12991
|
function TicketsView(props) {
|
|
12723
12992
|
const { t: t2 } = useI18n();
|
|
12724
12993
|
const state = useTicketsViewState(props);
|
|
12725
|
-
return /* @__PURE__ */
|
|
12994
|
+
return /* @__PURE__ */ React44.createElement(
|
|
12726
12995
|
"div",
|
|
12727
12996
|
{
|
|
12728
12997
|
"data-testid": "tickets-view",
|
|
12729
12998
|
style: { display: "flex", flexDirection: "column", flex: 1, minHeight: 0 }
|
|
12730
12999
|
},
|
|
12731
|
-
/* @__PURE__ */
|
|
13000
|
+
/* @__PURE__ */ React44.createElement(
|
|
12732
13001
|
TicketsHeader,
|
|
12733
13002
|
{
|
|
12734
13003
|
snapshot: state.snapshot,
|
|
@@ -12740,9 +13009,9 @@ function TicketsView(props) {
|
|
|
12740
13009
|
onRefreshFull: state.refreshFull
|
|
12741
13010
|
}
|
|
12742
13011
|
),
|
|
12743
|
-
props.actions === void 0 ? /* @__PURE__ */
|
|
12744
|
-
state.error !== null ? /* @__PURE__ */
|
|
12745
|
-
state.snapshot !== null ? /* @__PURE__ */
|
|
13012
|
+
props.actions === void 0 ? /* @__PURE__ */ React44.createElement("div", { style: ACTION_BAR_STYLE }, /* @__PURE__ */ React44.createElement(ActionBar, { injection: props.injection, onInject: state.inject })) : null,
|
|
13013
|
+
state.error !== null ? /* @__PURE__ */ React44.createElement(ErrorBanner, { error: state.error, onOpenEnvCheck: props.onOpenEnvCheck }) : null,
|
|
13014
|
+
state.snapshot !== null ? /* @__PURE__ */ React44.createElement(
|
|
12746
13015
|
SnapshotContent,
|
|
12747
13016
|
{
|
|
12748
13017
|
snapshot: state.snapshot,
|
|
@@ -12758,6 +13027,7 @@ function TicketsView(props) {
|
|
|
12758
13027
|
myCounts: state.myCounts,
|
|
12759
13028
|
assignedToMe: state.preference.assignedToMe,
|
|
12760
13029
|
createdByMe: state.preference.createdByMe,
|
|
13030
|
+
rowFields: state.rowFields,
|
|
12761
13031
|
ticketCount: state.tickets.length,
|
|
12762
13032
|
injected: state.injected,
|
|
12763
13033
|
injection: props.injection,
|
|
@@ -12774,28 +13044,32 @@ function TicketsView(props) {
|
|
|
12774
13044
|
onLayout: state.setLayout,
|
|
12775
13045
|
onToggleAssigned: state.toggleAssignedToMe,
|
|
12776
13046
|
onToggleCreated: state.toggleCreatedByMe,
|
|
13047
|
+
onToggleRowField: state.toggleRowField,
|
|
12777
13048
|
onClearMyTickets: state.clearMyTickets,
|
|
12778
13049
|
onToggleTree: state.toggleTree,
|
|
12779
13050
|
onPick: props.onOpenTicket,
|
|
12780
13051
|
onSkillAction: state.onSkillAction
|
|
12781
13052
|
}
|
|
12782
|
-
) : state.phase === "loading" ? /* @__PURE__ */
|
|
12783
|
-
/* @__PURE__ */
|
|
13053
|
+
) : state.phase === "loading" ? /* @__PURE__ */ React44.createElement("div", { "data-testid": "loading", style: EMPTY_STYLE }, t2("snapshot.loading")) : null,
|
|
13054
|
+
/* @__PURE__ */ React44.createElement(Footer, { injection: props.injection, notice: state.notice, tone: state.noticeTone })
|
|
12784
13055
|
);
|
|
12785
13056
|
}
|
|
12786
13057
|
function SnapshotContent(props) {
|
|
12787
13058
|
const { t: t2 } = useI18n();
|
|
12788
|
-
return /* @__PURE__ */
|
|
13059
|
+
return /* @__PURE__ */ React44.createElement(React44.Fragment, null, /* @__PURE__ */ React44.createElement(
|
|
12789
13060
|
Toolbar,
|
|
12790
13061
|
{
|
|
12791
13062
|
filter: props.filter,
|
|
12792
13063
|
sortKey: props.sortKey,
|
|
12793
13064
|
direction: props.direction,
|
|
12794
13065
|
counts: props.counts,
|
|
13066
|
+
fields: props.rowFields,
|
|
13067
|
+
assigneesAvailable: props.snapshot.backend !== "markdown",
|
|
12795
13068
|
onFilter: props.onFilter,
|
|
12796
|
-
onSort: props.onSort
|
|
13069
|
+
onSort: props.onSort,
|
|
13070
|
+
onToggleField: props.onToggleRowField
|
|
12797
13071
|
}
|
|
12798
|
-
), props.snapshot.viewer === null ? null : /* @__PURE__ */
|
|
13072
|
+
), props.snapshot.viewer === null ? null : /* @__PURE__ */ React44.createElement(
|
|
12799
13073
|
MyTicketsBar,
|
|
12800
13074
|
{
|
|
12801
13075
|
viewer: props.snapshot.viewer,
|
|
@@ -12806,10 +13080,10 @@ function SnapshotContent(props) {
|
|
|
12806
13080
|
onToggleCreated: props.onToggleCreated,
|
|
12807
13081
|
onClear: props.onClearMyTickets
|
|
12808
13082
|
}
|
|
12809
|
-
), /* @__PURE__ */
|
|
13083
|
+
), /* @__PURE__ */ React44.createElement(
|
|
12810
13084
|
TicketRows,
|
|
12811
13085
|
{
|
|
12812
|
-
layoutControl: /* @__PURE__ */
|
|
13086
|
+
layoutControl: /* @__PURE__ */ React44.createElement(
|
|
12813
13087
|
LayoutControl,
|
|
12814
13088
|
{
|
|
12815
13089
|
layout: props.preferenceLayout,
|
|
@@ -12818,7 +13092,7 @@ function SnapshotContent(props) {
|
|
|
12818
13092
|
onLayout: props.onLayout
|
|
12819
13093
|
}
|
|
12820
13094
|
),
|
|
12821
|
-
notes: /* @__PURE__ */
|
|
13095
|
+
notes: /* @__PURE__ */ React44.createElement(TreeNotes, { ...props }),
|
|
12822
13096
|
snapshot: props.snapshot,
|
|
12823
13097
|
visible: props.visible,
|
|
12824
13098
|
rows: props.rows,
|
|
@@ -12828,6 +13102,7 @@ function SnapshotContent(props) {
|
|
|
12828
13102
|
injection: props.injection,
|
|
12829
13103
|
focused: props.focused,
|
|
12830
13104
|
now: props.now,
|
|
13105
|
+
fields: props.rowFields,
|
|
12831
13106
|
more: props.more,
|
|
12832
13107
|
onPick: props.onPick,
|
|
12833
13108
|
onSkillAction: props.onSkillAction
|
|
@@ -12836,17 +13111,17 @@ function SnapshotContent(props) {
|
|
|
12836
13111
|
}
|
|
12837
13112
|
function TreeNotes(props) {
|
|
12838
13113
|
const { t: t2 } = useI18n();
|
|
12839
|
-
return /* @__PURE__ */
|
|
13114
|
+
return /* @__PURE__ */ React44.createElement(React44.Fragment, null, props.layout === "tree" && props.snapshot.total > props.snapshot.loaded ? /* @__PURE__ */ React44.createElement("div", { "data-testid": "tree-coverage", style: TREE_NOTE_STYLE }, t2("tree.coverage", { loaded: props.snapshot.loaded })) : null, props.preferenceLayout === "tree" && !props.hierarchyAvailable ? /* @__PURE__ */ React44.createElement("div", { "data-testid": "tree-degraded", style: TREE_DEGRADED_STYLE }, t2("tree.degraded")) : null, props.preferenceLayout !== "tree" && !props.hierarchyAvailable ? /* @__PURE__ */ React44.createElement("div", { "data-testid": "tree-unavailable", style: TREE_NOTE_STYLE }, t2(hierarchyHintKey(props.snapshot))) : null);
|
|
12840
13115
|
}
|
|
12841
13116
|
function useFocusedTicket(focusRef, onFocusHandled, workspaceRoot) {
|
|
12842
|
-
const [focused, setFocused] =
|
|
12843
|
-
|
|
13117
|
+
const [focused, setFocused] = React44.useState(null);
|
|
13118
|
+
React44.useEffect(() => {
|
|
12844
13119
|
if (focusRef === null || focusRef === void 0) return;
|
|
12845
13120
|
setFocused(focusRef);
|
|
12846
13121
|
onFocusHandled?.();
|
|
12847
13122
|
}, [focusRef, onFocusHandled]);
|
|
12848
|
-
const previousRoot =
|
|
12849
|
-
|
|
13123
|
+
const previousRoot = React44.useRef(workspaceRoot);
|
|
13124
|
+
React44.useEffect(() => {
|
|
12850
13125
|
if (previousRoot.current === workspaceRoot) return;
|
|
12851
13126
|
previousRoot.current = workspaceRoot;
|
|
12852
13127
|
setFocused(null);
|
|
@@ -12860,7 +13135,7 @@ function TicketRows(props) {
|
|
|
12860
13135
|
more.available && more.error === null && !more.loading,
|
|
12861
13136
|
more.onLoadMore
|
|
12862
13137
|
);
|
|
12863
|
-
return /* @__PURE__ */
|
|
13138
|
+
return /* @__PURE__ */ React44.createElement(React44.Fragment, null, /* @__PURE__ */ React44.createElement("div", { style: LIST_HEADER_STYLE }, /* @__PURE__ */ React44.createElement("span", { "data-testid": "loaded-total", style: LOADED_STYLE }, t2("tickets.loaded", { loaded: props.snapshot.loaded, total: props.snapshot.total }), more.capped ? t2("tickets.loadedCapped") : ""), props.layoutControl), props.notes, /* @__PURE__ */ React44.createElement(
|
|
12864
13139
|
TicketList,
|
|
12865
13140
|
{
|
|
12866
13141
|
tickets: props.visible,
|
|
@@ -12871,9 +13146,10 @@ function TicketRows(props) {
|
|
|
12871
13146
|
injection: props.injection,
|
|
12872
13147
|
focused: props.focused,
|
|
12873
13148
|
now: props.now,
|
|
13149
|
+
fields: props.fields,
|
|
12874
13150
|
onPick: props.onPick,
|
|
12875
13151
|
onSkillAction: props.onSkillAction,
|
|
12876
|
-
footer: more.available ? /* @__PURE__ */
|
|
13152
|
+
footer: more.available ? /* @__PURE__ */ React44.createElement(MoreFooter, { state: more, sentinel }) : null
|
|
12877
13153
|
}
|
|
12878
13154
|
));
|
|
12879
13155
|
}
|
|
@@ -12881,11 +13157,11 @@ function TicketRows(props) {
|
|
|
12881
13157
|
// src/client/task-panel.tsx
|
|
12882
13158
|
var NO_CAPABILITIES = () => [];
|
|
12883
13159
|
function TaskPanel(props) {
|
|
12884
|
-
const [view, setView] =
|
|
12885
|
-
const [focusBackend, setFocusBackend] =
|
|
13160
|
+
const [view, setView] = React45.useState("tickets");
|
|
13161
|
+
const [focusBackend, setFocusBackend] = React45.useState(null);
|
|
12886
13162
|
const navigation = useDetailNavigation(props.workspaceRoot);
|
|
12887
|
-
const [focusTicket, setFocusTicket] =
|
|
12888
|
-
const previousView =
|
|
13163
|
+
const [focusTicket, setFocusTicket] = React45.useState(null);
|
|
13164
|
+
const previousView = React45.useRef("tickets");
|
|
12889
13165
|
const actions = useTicketActions(props.workspaceRoot, props.injection);
|
|
12890
13166
|
const clientCapabilities = props.clientCapabilities ?? NO_CAPABILITIES;
|
|
12891
13167
|
const request = useSnapshotRequest(props.client, props.workspaceRoot, {
|
|
@@ -12896,7 +13172,7 @@ function TaskPanel(props) {
|
|
|
12896
13172
|
if (view !== "help") previousView.current = view;
|
|
12897
13173
|
setView("help");
|
|
12898
13174
|
};
|
|
12899
|
-
return /* @__PURE__ */
|
|
13175
|
+
return /* @__PURE__ */ React45.createElement("div", { "data-testid": "task-panel", "data-anvil-panel": "", style: PANEL_STYLE }, /* @__PURE__ */ React45.createElement("style", null, PANEL_SHEET), /* @__PURE__ */ React45.createElement(
|
|
12900
13176
|
ViewTabs,
|
|
12901
13177
|
{
|
|
12902
13178
|
view,
|
|
@@ -12913,9 +13189,9 @@ function TaskPanel(props) {
|
|
|
12913
13189
|
setView("env");
|
|
12914
13190
|
},
|
|
12915
13191
|
onOpenHelp: openHelp,
|
|
12916
|
-
actions: view === "tickets" && open === null ? /* @__PURE__ */
|
|
13192
|
+
actions: view === "tickets" && open === null ? /* @__PURE__ */ React45.createElement(ActionBar, { injection: props.injection, onInject: actions.inject }) : null
|
|
12917
13193
|
}
|
|
12918
|
-
), /* @__PURE__ */
|
|
13194
|
+
), /* @__PURE__ */ React45.createElement(TicketTreeSessionProvider, { workspaceRoot: props.workspaceRoot }, /* @__PURE__ */ React45.createElement(
|
|
12919
13195
|
PanelContent,
|
|
12920
13196
|
{
|
|
12921
13197
|
panel: props,
|
|
@@ -12955,7 +13231,7 @@ function TaskPanel(props) {
|
|
|
12955
13231
|
function PanelContent(props) {
|
|
12956
13232
|
const panel = props.panel;
|
|
12957
13233
|
if (props.view === "tickets") {
|
|
12958
|
-
return /* @__PURE__ */
|
|
13234
|
+
return /* @__PURE__ */ React45.createElement(
|
|
12959
13235
|
TicketsPane,
|
|
12960
13236
|
{
|
|
12961
13237
|
client: panel.client,
|
|
@@ -12976,7 +13252,7 @@ function PanelContent(props) {
|
|
|
12976
13252
|
);
|
|
12977
13253
|
}
|
|
12978
13254
|
if (props.view === "overview") {
|
|
12979
|
-
return /* @__PURE__ */
|
|
13255
|
+
return /* @__PURE__ */ React45.createElement(
|
|
12980
13256
|
OverviewPane,
|
|
12981
13257
|
{
|
|
12982
13258
|
request: props.request,
|
|
@@ -12988,7 +13264,7 @@ function PanelContent(props) {
|
|
|
12988
13264
|
);
|
|
12989
13265
|
}
|
|
12990
13266
|
if (props.view === "env") {
|
|
12991
|
-
return /* @__PURE__ */
|
|
13267
|
+
return /* @__PURE__ */ React45.createElement(
|
|
12992
13268
|
EnvCheckView,
|
|
12993
13269
|
{
|
|
12994
13270
|
client: panel.client,
|
|
@@ -12999,10 +13275,10 @@ function PanelContent(props) {
|
|
|
12999
13275
|
}
|
|
13000
13276
|
);
|
|
13001
13277
|
}
|
|
13002
|
-
return /* @__PURE__ */
|
|
13278
|
+
return /* @__PURE__ */ React45.createElement(HelpView, { onBack: props.onBack });
|
|
13003
13279
|
}
|
|
13004
13280
|
function OverviewPane(props) {
|
|
13005
|
-
return /* @__PURE__ */
|
|
13281
|
+
return /* @__PURE__ */ React45.createElement(
|
|
13006
13282
|
OverviewView,
|
|
13007
13283
|
{
|
|
13008
13284
|
request: props.request,
|
|
@@ -13018,7 +13294,7 @@ function TicketsPane(props) {
|
|
|
13018
13294
|
const open = props.open;
|
|
13019
13295
|
const snapshot = props.request.snapshot;
|
|
13020
13296
|
const current = findSnapshotTicket(snapshot?.tickets, open.target.ref) ?? open.target.ticket;
|
|
13021
|
-
return /* @__PURE__ */
|
|
13297
|
+
return /* @__PURE__ */ React45.createElement(
|
|
13022
13298
|
TicketDetailView,
|
|
13023
13299
|
{
|
|
13024
13300
|
key: open.target.ref,
|
|
@@ -13034,7 +13310,7 @@ function TicketsPane(props) {
|
|
|
13034
13310
|
}
|
|
13035
13311
|
);
|
|
13036
13312
|
}
|
|
13037
|
-
return /* @__PURE__ */
|
|
13313
|
+
return /* @__PURE__ */ React45.createElement(
|
|
13038
13314
|
TicketsView,
|
|
13039
13315
|
{
|
|
13040
13316
|
request: props.request,
|
|
@@ -13051,7 +13327,7 @@ function TicketsPane(props) {
|
|
|
13051
13327
|
}
|
|
13052
13328
|
function ViewTabs(props) {
|
|
13053
13329
|
const { t: t2 } = useI18n();
|
|
13054
|
-
return /* @__PURE__ */
|
|
13330
|
+
return /* @__PURE__ */ React45.createElement("div", { style: VIEW_BAR_STYLE }, /* @__PURE__ */ React45.createElement("div", { role: "group", "aria-label": t2("view.group"), style: VIEW_TABS_STYLE }, /* @__PURE__ */ React45.createElement(
|
|
13055
13331
|
ViewChip,
|
|
13056
13332
|
{
|
|
13057
13333
|
testId: "view-tickets",
|
|
@@ -13059,7 +13335,7 @@ function ViewTabs(props) {
|
|
|
13059
13335
|
active: props.view === "tickets",
|
|
13060
13336
|
onClick: props.onOpenTickets
|
|
13061
13337
|
}
|
|
13062
|
-
), /* @__PURE__ */
|
|
13338
|
+
), /* @__PURE__ */ React45.createElement(
|
|
13063
13339
|
ViewChip,
|
|
13064
13340
|
{
|
|
13065
13341
|
testId: "view-overview",
|
|
@@ -13067,7 +13343,7 @@ function ViewTabs(props) {
|
|
|
13067
13343
|
active: props.view === "overview",
|
|
13068
13344
|
onClick: props.onOpenOverview
|
|
13069
13345
|
}
|
|
13070
|
-
), /* @__PURE__ */
|
|
13346
|
+
), /* @__PURE__ */ React45.createElement(
|
|
13071
13347
|
ViewChip,
|
|
13072
13348
|
{
|
|
13073
13349
|
testId: "view-env",
|
|
@@ -13075,10 +13351,10 @@ function ViewTabs(props) {
|
|
|
13075
13351
|
active: props.view === "env",
|
|
13076
13352
|
onClick: props.onOpenEnvCheck
|
|
13077
13353
|
}
|
|
13078
|
-
)), /* @__PURE__ */
|
|
13354
|
+
)), /* @__PURE__ */ React45.createElement("div", { style: VIEW_BAR_END_STYLE }, props.actions, /* @__PURE__ */ React45.createElement(TipsButton, { onClick: props.onOpenHelp })));
|
|
13079
13355
|
}
|
|
13080
13356
|
function ViewChip(props) {
|
|
13081
|
-
return /* @__PURE__ */
|
|
13357
|
+
return /* @__PURE__ */ React45.createElement(
|
|
13082
13358
|
"button",
|
|
13083
13359
|
{
|
|
13084
13360
|
type: "button",
|
|
@@ -13093,7 +13369,7 @@ function ViewChip(props) {
|
|
|
13093
13369
|
}
|
|
13094
13370
|
function TipsButton(props) {
|
|
13095
13371
|
const { t: t2 } = useI18n();
|
|
13096
|
-
return /* @__PURE__ */
|
|
13372
|
+
return /* @__PURE__ */ React45.createElement(
|
|
13097
13373
|
"button",
|
|
13098
13374
|
{
|
|
13099
13375
|
type: "button",
|
|
@@ -13103,11 +13379,11 @@ function TipsButton(props) {
|
|
|
13103
13379
|
onClick: props.onClick,
|
|
13104
13380
|
style: ICON_BUTTON_STYLE
|
|
13105
13381
|
},
|
|
13106
|
-
/* @__PURE__ */
|
|
13382
|
+
/* @__PURE__ */ React45.createElement(TipsIcon, null)
|
|
13107
13383
|
);
|
|
13108
13384
|
}
|
|
13109
13385
|
function TipsIcon() {
|
|
13110
|
-
return /* @__PURE__ */
|
|
13386
|
+
return /* @__PURE__ */ React45.createElement(
|
|
13111
13387
|
"svg",
|
|
13112
13388
|
{
|
|
13113
13389
|
width: 14,
|
|
@@ -13120,9 +13396,9 @@ function TipsIcon() {
|
|
|
13120
13396
|
strokeLinecap: "round",
|
|
13121
13397
|
strokeLinejoin: "round"
|
|
13122
13398
|
},
|
|
13123
|
-
/* @__PURE__ */
|
|
13124
|
-
/* @__PURE__ */
|
|
13125
|
-
/* @__PURE__ */
|
|
13399
|
+
/* @__PURE__ */ React45.createElement("path", { d: "M8 1.8a4.1 4.1 0 0 0-2.5 7.4c.3.2.5.5.5.9v.4h4v-.4c0-.4.2-.7.5-.9A4.1 4.1 0 0 0 8 1.8Z" }),
|
|
13400
|
+
/* @__PURE__ */ React45.createElement("path", { d: "M6.4 12.6h3.2" }),
|
|
13401
|
+
/* @__PURE__ */ React45.createElement("path", { d: "M7.2 14.4h1.6" })
|
|
13126
13402
|
);
|
|
13127
13403
|
}
|
|
13128
13404
|
|
|
@@ -13244,7 +13520,7 @@ function registerInjection(scope, injectionRef, capabilities) {
|
|
|
13244
13520
|
});
|
|
13245
13521
|
}
|
|
13246
13522
|
function TaskTabTitle() {
|
|
13247
|
-
return /* @__PURE__ */
|
|
13523
|
+
return /* @__PURE__ */ React46.createElement("span", null, "MattWorkflow");
|
|
13248
13524
|
}
|
|
13249
13525
|
function createTaskTab(client, injectionRef, capabilities, i18n) {
|
|
13250
13526
|
return function TaskTab(props) {
|
|
@@ -13255,7 +13531,7 @@ function createTaskTab(client, injectionRef, capabilities, i18n) {
|
|
|
13255
13531
|
);
|
|
13256
13532
|
const readiness = useInjectionReadiness(injectionRef);
|
|
13257
13533
|
const refreshSignal = useAgentActivitySignal(useSessions, sessionId);
|
|
13258
|
-
const injection =
|
|
13534
|
+
const injection = React46.useMemo(
|
|
13259
13535
|
() => ({
|
|
13260
13536
|
canInjectCurrent: sessionId !== void 0 && readiness.current,
|
|
13261
13537
|
canStartNewSession: readiness.newSession,
|
|
@@ -13263,7 +13539,7 @@ function createTaskTab(client, injectionRef, capabilities, i18n) {
|
|
|
13263
13539
|
}),
|
|
13264
13540
|
[injectionRef, sessionId, readiness.current, readiness.newSession]
|
|
13265
13541
|
);
|
|
13266
|
-
return /* @__PURE__ */
|
|
13542
|
+
return /* @__PURE__ */ React46.createElement(I18nProvider, { i18n }, /* @__PURE__ */ React46.createElement(
|
|
13267
13543
|
TaskPanel,
|
|
13268
13544
|
{
|
|
13269
13545
|
client,
|
|
@@ -13287,8 +13563,8 @@ function notify(ref) {
|
|
|
13287
13563
|
for (const listener of ref.listeners) listener();
|
|
13288
13564
|
}
|
|
13289
13565
|
function useInjectionReadiness(ref) {
|
|
13290
|
-
const [readiness, setReadiness] =
|
|
13291
|
-
|
|
13566
|
+
const [readiness, setReadiness] = React46.useState(() => readReadiness(ref));
|
|
13567
|
+
React46.useEffect(() => {
|
|
13292
13568
|
const update = () => {
|
|
13293
13569
|
setReadiness(readReadiness(ref));
|
|
13294
13570
|
};
|