Repository navigation
Description
Bug: Sub-work items list flashes then disappears in the work item detail pane
Repro:
- Open a work item that has existing sub-work items.
- The "Sub-work items" section header renders correctly (e.g. "4/7 Done"), and the list of sub-items briefly flashes into view.
- The list then disappears immediately, and the section is left empty.
- Collapsing and re-expanding the "Sub-work items" section does not bring the list back — it stays empty for the rest of that page view.
The header's progress count (4/7 Done) stays correct throughout; only the list body is affected.
Root cause
apps/web/app/entry.client.tsxwraps the app in<StrictMode>, which double-invokes mount effects in dev.SubIssuesCollapsibleContent's mount effect (apps/web/core/components/issues/issue-detail-widgets/sub-issues/content.tsx) callshandleFetchSubIssues(), which is guarded by a snapshot check onissue_visibilitytaken before theawait. Under the double-invoke, both invocations pass that guard concurrently, and both eventually callsetSubIssueHelpers(..., "issue_visibility", parentIssueId)once their own fetch resolves.setSubIssueHelpers(apps/web/core/store/issue/issue-details/sub_issues.store.ts) implements this as a toggle (add if absent, remove if present) — correct for its other call sites (bracketed loaders, and a genuine click-to-expand toggle for nested sub-issue rows), but wrong for this one, which is meant to be a one-way "now loaded" marker.- 1st completion: flag is empty → added → list renders (the "flash").
- 2nd completion: flag already contains the value → removed → list unmounts (the "disappear").
- Since
Collapsible's panel isDisclosure.Panel static(packages/ui/src/collapsible/collapsible.tsx), the content component is always mounted (just CSS-hidden when collapsed), so expanding/collapsing never re-runs the mount effect — the flag stays stuck off for the rest of the page view. - The header stays correct because it reads a separate, idempotently-overwritten id array (
subIssues[parentIssueId]), not this toggled flag.
This is a real bug independent of StrictMode (any duplicate invocation of the effect would trigger the same flip), but StrictMode-in-dev makes it reproduce on effectively every load.
Fix
Give setSubIssueHelpers an idempotent "add" mode (default remains "toggle", so all 12 other call sites — bracketed loaders in helper.ts/parent-select-root.tsx, and the nested-row expand toggle in issues-list/list-item.tsx — are unaffected), and use it for the one-way "loaded" marker in content.tsx.
Verified with tsc --noEmit and oxlint --deny-warnings (both clean) and manually in the browser — the list now stays populated across repeated reloads, and the nested-row expand/collapse toggle still works.
Branch with both commits: https://github.com/richardbraden/plane/tree/fix/sub-work-items-flash
diff --git a/apps/web/core/components/issues/issue-detail-widgets/sub-issues/content.tsx b/apps/web/core/components/issues/issue-detail-widgets/sub-issues/content.tsx
index 0dbf8c85ab..2eed1b92fa 100644
--- a/apps/web/core/components/issues/issue-detail-widgets/sub-issues/content.tsx
+++ b/apps/web/core/components/issues/issue-detail-widgets/sub-issues/content.tsx
@@ -89,7 +89,7 @@ export const SubIssuesCollapsibleContent = observer(function SubIssuesCollapsibl
try {
setSubIssueHelpers(`${parentIssueId}_root`, "preview_loader", parentIssueId);
await subIssueOperations.fetchSubIssues(workspaceSlug, projectId, parentIssueId);
- setSubIssueHelpers(`${parentIssueId}_root`, "issue_visibility", parentIssueId);
+ setSubIssueHelpers(`${parentIssueId}_root`, "issue_visibility", parentIssueId, "add");
} catch (error) {
console.error("Error fetching sub-work items:", error);
} finally {
diff --git a/apps/web/core/store/issue/issue-details/sub_issues.store.ts b/apps/web/core/store/issue/issue-details/sub_issues.store.ts
index 74ffad7aae..355b12539f 100644
--- a/apps/web/core/store/issue/issue-details/sub_issues.store.ts
+++ b/apps/web/core/store/issue/issue-details/sub_issues.store.ts
@@ -60,7 +60,12 @@ export interface IIssueSubIssuesStore extends IIssueSubIssuesStoreActions {
subIssueHelpersByIssueId: (issueId: string) => TSubIssueHelpers;
// actions
fetchOtherProjectProperties: (workspaceSlug: string, projectIds: string[]) => Promise<void>;
- setSubIssueHelpers: (parentIssueId: string, key: TSubIssueHelpersKeys, value: string) => void;
+ setSubIssueHelpers: (
+ parentIssueId: string,
+ key: TSubIssueHelpersKeys,
+ value: string,
+ mode?: "toggle" | "add"
+ ) => void;
}
export class IssueSubIssuesStore implements IIssueSubIssuesStore {
@@ -116,11 +121,16 @@ export class IssueSubIssuesStore implements IIssueSubIssuesStore {
});
// actions
- setSubIssueHelpers = (parentIssueId: string, key: TSubIssueHelpersKeys, value: string) => {
+ setSubIssueHelpers = (
+ parentIssueId: string,
+ key: TSubIssueHelpersKeys,
+ value: string,
+ mode: "toggle" | "add" = "toggle"
+ ) => {
if (!parentIssueId || !key || !value) return;
update(this.subIssueHelpers, [parentIssueId, key], (_subIssueHelpers: string[] = []) => {
- if (_subIssueHelpers.includes(value)) return pull(_subIssueHelpers, value);
+ if (_subIssueHelpers.includes(value)) return mode === "add" ? _subIssueHelpers : pull(_subIssueHelpers, value);
return concat(_subIssueHelpers, value);
});
};
@@ -186,10 +196,10 @@ export class IssueSubIssuesStore implements IIssueSubIssuesStore {
});
});
- const issueIds = subIssues.map((issue) => issue.id);
+ const newSubIssueIds = subIssues.map((issue) => issue.id);
update(this.subIssues, [parentIssueId], (issues) => {
- if (!issues) return issueIds;
- return concat(issues, issueIds);
+ if (!issues) return newSubIssueIds;
+ return concat(issues, newSubIssueIds);
});
});
Activity
richardbraden commentedon Sep 19, 2026
This was already fixed upstream in b494044 (fix(web): keep sub-work items visible after local fetch, #9804), merged the day before I opened this — same root cause (setSubIssueHelpers toggles membership + React Strict Mode's double mount effect), fixed via a different, self-contained approach in content.tsx.
My local base was 62 commits behind preview when I diagnosed this, so I hadn't seen the fix land yet. Verified after rebasing onto current upstream/preview that the list no longer flashes/disappears. Closing as already resolved.