feat(issues): show "Add sub-issues" button when no sub-issues exist (#511)

Previously the sub-issues section only rendered when child issues were
present. This adds a Linear-style "+ Add sub-issues" button below the
description area so users can create sub-issues from an empty state.
This commit is contained in:
Bohan Jiang 2026-04-08 18:51:03 +08:00 committed by GitHub
parent bd6731525e
commit aa770f2333
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -780,6 +780,23 @@ export function IssueDetail({ issueId, onDelete, defaultSidebarOpen = true, layo
</div>
{/* Sub-issues — Linear-style */}
{childIssues.length === 0 && (
<div className="mt-6">
<button
type="button"
className="inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors"
onClick={() =>
useModalStore.getState().open("create-issue", {
parent_issue_id: issue.id,
parent_issue_identifier: issue.identifier,
})
}
>
<Plus className="h-3.5 w-3.5" />
<span>Add sub-issues</span>
</button>
</div>
)}
{childIssues.length > 0 && (() => {
const doneCount = childIssues.filter((c) => c.status === "done").length;
return (