doc/plans/2026-04-06-subissue-creation-on-issue-detail.md
Status: Proposed Date: 2026-04-06 Audience: Product and engineering Related:
ui/src/pages/IssueDetail.tsxui/src/components/IssueProperties.tsxui/src/components/NewIssueDialog.tsxui/src/context/DialogContext.tsxpackages/shared/src/validators/issue.tsserver/src/services/issues.tsThis document defines the implementation plan for adding manual sub-issue creation from the issue detail page.
Requested UX:
Sub-issues tab should always show an Add sub-issue action, even when there are no children yetSub-issues section with the same Add sub-issue entry pointThis is a UI-first change. The backend already supports child issue creation with parentId.
ui/src/pages/IssueDetail.tsx already derives childIssues by filtering the company issue list on parentId === issue.id.
Current limitation:
Sub-issues tab only renders the empty state or the child issue listui/src/components/IssueProperties.tsx shows Blocked by, Blocking, and Parent, but it has no sub-issue section or child issue affordance.
ui/src/context/DialogContext.tsx can open the global new-issue dialog with defaults such as status, priority, project, assignee, title, and description.
Current limitation:
parentIdui/src/components/NewIssueDialog.tsx therefore cannot submit a child issue or render parent-specific contextThe create-issue validator already accepts parentId.
server/src/services/issues.ts already uses:
parentId for parent-child issue relationshipsparentId as the default workspace inheritance source when inheritExecutionWorkspaceFromIssueId is not providedThat means the required API and workspace inheritance behavior already exist. No server or schema change is required for the first pass.
Extend NewIssueDefaults in ui/src/context/DialogContext.tsx with:
parentId?: stringparentIdentifier?: stringparentTitle?: stringThis keeps the dialog self-contained and avoids re-fetching parent context purely for presentation.
Use openNewIssue(...) from ui/src/pages/IssueDetail.tsx in two places:
Sub-issues tabIssuePropertiesBoth entry points should pass:
parentId: issue.idparentIdentifier: issue.identifier ?? issue.idparentTitle: issue.titleprojectId: issue.projectId ?? undefinedUsing the current issue's projectId preserves the common expectation that sub-issues stay inside the same project unless the operator changes it in the dialog.
No special assignee default should be forced in V1.
Extend IssueProperties to accept:
childIssues: Issue[]onCreateSubissue: () => voidRender a new Sub-issues section near Blocked by / Blocking:
Add sub-issue buttonThis keeps the child issue affordance visible in the property area without requiring a generic parent selector.
Refactor the Sub-issues tab in IssueDetail to render:
Add sub-issue buttonThis satisfies the requirement that the action is visible whether or not sub-issues already exist.
Update ui/src/components/NewIssueDialog.tsx so that when newIssueDefaults.parentId is present:
parentIdNew sub-issue / Create sub-issueParent: PAP-1150 add the ability...Important constraint:
That preserves the requested UX boundary: sub-issue creation is intentional, not part of the default create-issue surface.
No new data-fetch path is needed.
The existing create success handler in NewIssueDialog already invalidates:
queryKeys.issues.list(companyId)That should be enough for the parent IssueDetail view to recompute childIssues after creation because it derives children from the company issue list query.
If the detail page ever moves away from the full company issue list, this should be revisited, but it does not require additional work for the current architecture.
DialogContext issue defaults with sub-issue fields.IssueDetail to open the dialog in sub-issue mode from the Sub-issues tab.IssueProperties to display child issues and the Add sub-issue action.NewIssueDialog submission and header UI for sub-issue mode.Add focused UI tests covering:
IssueDetail
Sub-issues tab shows Add sub-issue when there are zero childrenIssueProperties
Add sub-issue remains available when there are no child issuesNewIssueDialog
parentId, submit payload includes parentIdNo backend test expansion is required unless implementation discovers a client/server contract gap.
Decision: pass parent label metadata through dialog defaults instead of making NewIssueDialog fetch the parent issue.
Reason:
Decision: prefill projectId from the parent issue, but keep it editable.
Reason:
Decision: do not add a freeform parent picker in this change.
Reason:
This plan is complete when an operator can:
Add sub-issue from either the Sub-issues tab or the properties pane