Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

feat(views): promote Create sub-issue to the top level of the issue actions menu (MUL-8181) (#9450)

Jiayuan Zhangb7d92dd5145e
diff --git a/packages/views/issues/actions/__tests__/issue-actions-menu.test.tsx b/packages/views/issues/actions/__tests__/issue-actions-menu.test.tsx
index 9333f3c4fd..e7f416d937 100644
--- a/packages/views/issues/actions/__tests__/issue-actions-menu.test.tsx
+++ b/packages/views/issues/actions/__tests__/issue-actions-menu.test.tsx
@@ -214,10 +214,10 @@ describe("IssueActionsDropdown", () => {
expect(screen.getByText("Rename issue")).toBeInTheDocument();
expect(screen.getByText("Open in new tab")).toBeInTheDocument();
expect(screen.getByText("Copy link")).toBeInTheDocument();
+ expect(screen.getByText("Create sub-issue")).toBeInTheDocument();
expect(screen.getByText("Relations")).toBeInTheDocument();
expect(screen.getByText("Delete issue")).toBeInTheDocument();
- // Relationship actions are hidden inside the "Relations" submenu by default.
- expect(screen.queryByText("Create sub-issue")).not.toBeInTheDocument();
+ // Linking to existing issues stays inside the "Relations" submenu.
expect(screen.queryByText("Set parent issue...")).not.toBeInTheDocument();
expect(screen.queryByText("Add sub-issue...")).not.toBeInTheDocument();
});
@@ -302,6 +302,28 @@ describe("IssueActionsDropdown", () => {
});
});
+ it("clicking Create sub-issue opens the create modal parented to this issue", async () => {
+ render(
+ wrap(
+ <IssueActionsDropdown
+ issue={mockIssue}
+ trigger={<button data-testid="trigger">Menu</button>}
+ />,
+ ),
+ );
+
+ fireEvent.click(screen.getByTestId("trigger"));
+ fireEvent.click(await screen.findByText("Create sub-issue"));
+
+ expect(mockOpenModal).toHaveBeenCalledWith(
+ "create-issue",
+ expect.objectContaining({
+ parent_issue_id: "issue-1",
+ parent_issue_identifier: "TES-1",
+ }),
+ );
+ });
+
it("clicking Rename issue opens the rename modal with the current title", async () => {
render(
wrap(
diff --git a/packages/views/issues/actions/issue-actions-menu-items.tsx b/packages/views/issues/actions/issue-actions-menu-items.tsx
index a9ec3d220c..6bacabbf85 100644
--- a/packages/views/issues/actions/issue-actions-menu-items.tsx
+++ b/packages/views/issues/actions/issue-actions-menu-items.tsx
@@ -351,6 +351,14 @@ export function IssueActionsMenuItems({
<P.Separator />
+ {/* Top level rather than under Relations: on a long issue the
+ sub-issues section's own "+" is scrolled far out of reach, and this
+ menu is pinned in the header. */}
+ <P.Item onClick={openCreateSubIssue}>
+ <Plus className="h-3.5 w-3.5" />
+ {t(($) => $.actions.create_sub_issue)}
+ </P.Item>
+
{/* Relationship actions live under "Relations" — a semantically explicit
label (unlike the old "More") so the first level tells you what the
submenu does. Holds parent/sub-issue links today, and will grow
@@ -361,10 +369,6 @@ export function IssueActionsMenuItems({
{t(($) => $.actions.relations)}
</P.SubTrigger>
<P.SubContent>
- <P.Item onClick={openCreateSubIssue}>
- <Plus className="h-3.5 w-3.5" />
- {t(($) => $.actions.create_sub_issue)}
- </P.Item>
<P.Item onClick={openSetParent}>
<ArrowUp className="h-3.5 w-3.5" />
{t(($) => $.actions.set_parent_issue)}