Repository navigation
Description
What happened?
Two problems with the task dialog on a project's Tasks board or list (/dashboard/<org>/projects/<project>/tasks/board?task=<id>):
- Opening a task is slow. After you click a card, the dialog shows its skeleton for a noticeable time before the task appears.
- Closing a task briefly shows the Create task dialog. When the dialog closes (X, Esc, a click on the backdrop, or browser Back), it turns into the empty Create task form for the length of the close animation and shrinks to that form's height. Then it disappears.
Steps to reproduce
- Open a project → Tasks (board or list) with at least one task.
- Click a task card. The dialog opens on a skeleton and takes a while to fill in.
- Close the dialog with X, Esc, the backdrop, or browser Back. For about 200 ms the dialog shows the empty "Create task" form before it disappears.
Expected behavior
- A task opened from the board appears immediately, since the board already has that task's row.
- On close, the open task fades out. The Create task form appears only when someone presses Create task.
Root cause
Line references are on main @ 19f18f6cbb.
Create task flash (confirmed from the code)
The board's edit dialog takes both its open state and its task from one value, openTaskId (services/platform/app/features/tasks/components/tasks-workspace.tsx:531-541):
<TaskModal
taskId={openTaskId}
open={openTaskId !== null}
onOpenChange={(open) => { if (!open) setOpenTaskId(null); }}Closing sets openTaskId to null, which changes open and taskId in the same render. Radix keeps the dialog content mounted while it plays the exit animation (data-[state=closed]:animate-out … zoom-out-95 duration-[var(--duration-standard)], 200 ms; see packages/ui/src/components/overlays/responsive-dialog.tsx:225 and packages/ui/src/globals.css:171). During that animation TaskModal has taskId === null, so it switches to create mode: taskId ? <EditTaskBody> : <CreateTaskBody> (task-modal.tsx:222-238). It also drops the fixed h-[85dvh] height (task-modal.tsx:204). The result is that the closing dialog shows an empty Create task form at the create form's height.
Every way of closing hits this. X, Esc and the backdrop call setOpenTaskId(null). Browser Back clears ?task=, and the render-time sync resets openTaskId to null (tasks-workspace.tsx:199-207). The mobile drawer (vaul) also keeps its content mounted while it slides out, so it probably flashes too. Each close also mounts a new CreateTaskBody, which starts that form's data reads for no reason.
Possible fixes:
- Keep the last opened task id while the dialog closes: update the
taskIdprop only when a new non-null id arrives, and controlopenseparately. - Give each
TaskModalinstance a fixed mode. The workspace already renders a separate instance for creating, so the edit instance should never renderCreateTaskBody.
Slow open (suspected from the code, not yet profiled)
- The board doesn't prefill or prefetch the task. Clicking a card only sets local state and pushes
?task=.EditTaskBodythen runsuseTask(taskId)(task-modal.tsx:1190), which sends a newGET /tasks/:id(services/platform/app/lib/backend/tasks.ts:295). The dialog shows its skeleton until that returns (task-modal.tsx:1346). Board rows and the detail read use the sametaskViewprojection (tasks.ts:191,tasks.ts:310), so the card's row could fill the dialog immediately while the full read loads in the background. Home's task page already prefetchesgetTaskin its route loader (services/platform/app/routes/dashboard/$id/tasks/$taskId.tsx:17). The board prefetches nothing, not even on hover or pointerdown. - The reads run one after another. Several reads start only after the task arrives, even though the route already gives the org and project:
useProject(task?.projectId)(1198),useCurrentMemberContext(task?.organizationId)(1217),useActorDirectory(task?.organizationId, task?.projectId)(1222) anduseTaskSubjectContract(…, task)(1243).getLiveRunForTaskandgetLatestRunForTask(1249, 1261) then wait for the subject-contract result. The dialog fills in over at least three sequential network round trips. - The whole board re-renders on open and close. The local
openTaskIdchange re-rendersTasksWorkspace, and the?task=navigation re-rendersTasksBoardPage→TasksWorkspaceagain.KanbanBoard,BoardColumn,TaskCardandTasksListaren't memoized, so every card renders again, twice per open and twice per close. On a large board this can take noticeable main-thread time.
Before choosing a fix, profile one open (Network waterfall + React Profiler) to see which of these costs the most.
Affected service
Platform (web app)
Before submitting
- Searched existing issues (task dialog/modal, flash/flicker, Create task, slow open): no existing report.
Activity
yannickmonney commentedon Sep 29, 2026
Manual-cycle local baseline at main 3f9c3b4: I measured the actual task-list helpers with synthetic 50/350/2,000-task fixtures and 10,000-row stress controls. Across 84 cases (30 warmup + 100 measured batches each), the composed helper pass at the 2,000-task board cap was 0.44–0.84 ms median / 0.47–0.91 ms p95 across flat, mixed-subtask and wide-parent shapes. Twelve fixture correctness checks passed.
These are batch-average Bun/JSC CPU timings on an M2 Max, not individual browser interaction, API or rendering percentiles. They exclude React commits/layout, HTTP and SQL. No new helper performance defect was established; this does not validate or disprove the reported task-dialog latency.
The next local pass should measure a production-build dialog open/close: network waterfall, React commit duration, first meaningful content and exit animation at 50/350/2,000 rows. Prioritize that evidence before changing memoization or prefetching. Keep the confirmed close-mode flash and the still-unprofiled open cost as separate judgments, with keyboard/backdrop/Back/mobile and stale-data authorization controls.
yannickmonney commentedon Sep 29, 2026
Local round (TALE-362): the close flash is confirmed and fixed, and the slow open was the board re-rendering, not the detail read. Fix: #3948.
Production builds on an isolated localhost stack with synthetic fixtures, one backend, A =
main, B = the PR, interleaved. Full protocol onad6e62759vs010af46cf; the exact headf37124f18(after mergingmain@1e4ad7ffd) was checked again (below the tables).Verdicts
GET /tasks/:idtook ~30–60 ms. On main it started late (0.4 s / 1.8 s / 7.7 s after the click at 50 / 350 / 2,000 tasks), queued behind the click's synchronous re-render. The evidence does not support prefill.Main → PR (medians, 95 % bootstrap interval of the median)
12 + 12 samples per size. ¹ On main the renderer of the 2,000-task page was OOM-killed three times in the sandbox's 4 GiB within three open/close pairs, so main ran one pair per page there (the cold open and its Escape close), alone on the host. Retained heap after GC stayed flat on both (below); the crashes are transient peaks while 2,000 cards re-render.
React commits (production React through a devtools hook), components rendered per interaction, main → PR:
Main thread (Chrome traces, 350 tasks, cold open to settled): 3.44 s (script 2.49 s, style 0.34 s, GC 0.36 s) → 1.05 s (script 0.35 s, style 0.40 s, paint 0.16 s). Escape close: 3.54 s → 0.85 s.
Memory after 20 (50, 350) or 6 (2,000) open/close cycles, GC forced: heap +5.0 / +6.0 / +9.3 MB on main, +4.4 / +4.0 / +3.1 MB on the PR; DOM nodes +246 / +246 / +204 on main, +77 / +77 / +35 on the PR. No leak on either; the growth is the opened tasks' cached reads.
Exact head
f37124f18vsmain@1e4ad7ffd(6 + 6 samples at 50 and 350 tasks, 3 + 3 at 2,000, a quieter host): the task shows 692 ms → 319 ms, 3.70 s → 589 ms, 18.47 s → 2.29 s; Escape at 350 tasks 1.70 s → 392 ms; the create form in 41/41, 40/40, 6/6 closing frames on main and 0/102, 0/90, 0/34 on the head; the lifecycle probes (subtask, Back chain, missing, foreign-org, 403) 0 frames on the head against 100 % on main, and neither build ever showed the foreign-org or forbidden task's title.What the PR changes
TaskModalkeeps the body it was open with while it closes (render-time state adjustment, astasks-workspace.tsxalready does for?task=).FormDialogdoes); the board context's review refs are memoized; the board reads answer one stable empty array while pending or failed.TASK-F53andTASK-P4, and the performance guide no longer describes the retired Convex runtime.Measured, not fixed (follow-ups)
pointer-events: noneon<body>; the property is inherited, so every element recomputes, and the open forces it twice (Presence'sgetComputedStyle, then the dialog'sfocus()). That one change costs a forced recalculation of 105 ms at 350 tasks (9,324 elements) and 625 ms at 2,000 (48,199 elements) on this host;aria-hiddenon the app root anddata-scroll-lockedcost ~0 ms. It is most of the PR's remaining ~2.1 s at 2,000 tasks. Options: stop the inheritance at the app root (the full-screen overlay already takes outside presses),content-visibility: autoon cards, or virtualised lanes, judged across every modal.current-userand 26,057 onauth/session(4,608 each at 350). Query keeps observers in an array, so every observer the dialog adds or removes scans it: about 0.8 s of the Escape close at 2,000 tasks in a CPU profile. It is why the PR's Escape close there, gone after 0.4 s, still blocks the main thread ~1.7 s in all. Option: read the session and the user once per board.?task=change (useLocationfeeds a memo with a newlocationobject): 488 components here, 5,571 with ~750 assigned tasks.Setup and method
bun --bun vite buildper tree;bun scripts/dev.tswithTALE_E2E_SERVE_BUILD=1served A throughvite previewand ran the backend; a secondvite previewwith the same environment served B against it.createTask: status mix ≈ 20/25/15/10/22/8 %, ~15 % subtasks, ~55 % described, ~50 % labelled, ~25 % due; 43 % assigned to the member and 2 % to the owner. Twelve measured tasks per project (the first three cards of four lanes), two comments each.fix(platform): follow the committed open callback, not the render's
docs(manual): tie the TASK-P4 pin to the exact-head receipt
yannickmonney commentedon Sep 30, 2026
Exact-head receipt for #3948 (review follow-up). Production builds of
main@1e4ad7ffd(A) and the PR @9d1d1e3db(B) ran on one backend and one database, with the same fixtures as above. The current head,992e7f868, only adds pin text totests/manual/, outside the app bundle. There were 10 samples per variant per size, interleaved (alternating 5-sample blocks at 2,000 tasks), with no crashed sample. On the 2-vCPU sandbox the 1-min load average ranged 1.65–10.0 (median 3.46).At 2,000 tasks main ran one open/close pair per page: in 4 GiB its renderer was OOM-killed three times in the first protocol. The rows the PR adds there have no main counterpart.
Real-browser lifecycle on the PR, with the native Back.
page.goBack()pops the?task=entry the open pushed. Desktop: the X, Escape, the backdrop and native Back show the create form in 0 of 64–67 exit frames (main: 58–63 of 59–67). In the phone drawer: Escape, the backdrop and native Back show it in 0 of 299–301 (main: 266–281 of 267–282). Focus returns to the card after every close. Across a subtask, a Back chain, and a missing, foreign-org or forbidden (403) task, 0 exit frames show the create form, against every exit frame on main, and neither build shows the foreign or forbidden task's title. The component suite's own "Back" case is a harness that clears the id, which is what Back ends in; the native path is the probe's.Traces. At 350 tasks, a cold open to settled took 3.79 s on main (script 2.71 s) and 1.03 s on the PR (script 0.30 s, style 0.30 s). At 2,000 tasks the PR took 2.40 s, with style 1.46 s; main's 2,000-task traces were not taken (OOM risk). Raw traces are attached to TALE-362.
What the PR does not reach, reported apart from it.
TASK-P4's < 1 s target is missed on this host at 2,000 tasks (2.21 s median); no laptop was measured. Almost all of the rest is:pointer-events: noneon<body>during a Radix modal, an inherited property that makes every element recompute. The open forces that twice. Measured alone, it costs 105 ms at 9,324 elements and 625 ms at 48,199. This is a design-system question.current-useralone at 2,000 tasks. That is ~0.8 s of the Escape close there, which is why the PR's close, gone after 0.44 s, keeps the main thread busy ~1.2 s in all.?task=change: 488 components.The review's React Doctor finding (a ref written during render,
tasks-workspace.tsx:223) is fixed with the commit-phase patternuseFocusHandoffuses. React Doctor now reports 0 errors on the changed components, and a test holds that a click reaches the latest committed callback.The Bun helper baseline in the earlier comment timed list helpers only. None of these numbers rest on it.
yannickmonney commentedon Sep 30, 2026
Final local round for #3948, whose head is now
62f4a14ec. The head merges mainb5ff70447; its production bundle is byte-identical to the merge856a7c738's, which is the build measured here.Correction to the receipt above. My probe stamped "task shows" and "dialog gone" with the rAF callback's timestamp. That timestamp is the frame's begin time, and after a long task it can come before the change it stamps. The last run instead stamps the frame that shows the change, once it is produced, and records both stamps on each sample:
Final head, corrected stamps. Main
b5ff70447against the PR856a7c738, 10 + 10 samples per size, no crashed sample, with a 1-min load of 2.35–13.16 (median 4.87). Medians, main → PR:At 2,000 tasks main ran one open/close pair per page. The PR's reopen there takes 2.14 s, another task 2.10 s, and X and the backdrop 2.09 and 2.07 s. The real-browser probes on the final head show 0 create-form frames on the PR for every close, native Back included, on desktop and in the drawer, against 58–289 on main. They show the same for the subtask, the Back-chain, the missing, the foreign-org and the forbidden cases. Focus returns to the card, and neither build showed the foreign or forbidden task.
Revisions measured.
ad6e62759→010af46cf1e4ad7ffd→f37124f181e4ad7ffd→9d1d1e3dbb5ff70447→856a7c738The PR's own runtime changed only once after the first protocol:
9d1d1e3dbmoved the callback ref's write into a layout effect. The rest are main's changes or text.Failed or invalid attempts, all kept:
Still open, now tracked in #3974. On this 2-vCPU VM,
TASK-P4misses its < 1 s target at 2,000 tasks, and the page stays unresponsive about 1.6 s after the close's fade. This is not a laptop result. The four costs are:pointer-events: noneon<body>);?task=;Every run's raw samples, traces, commit counts, probe frames, screen recordings, runner receipt and sha256 manifest are in TALE-362's delivery box.
yannickmonney commentedon Sep 30, 2026
Independent acceptance is complete. PR #3948 at b58676e was normally squash-merged as 0e7cf2d at 2026-09-30 07:40:44 UTC. The lifecycle/flash fix and measured improvement are accepted after exact-head CI and verification of all seven evidence archives (568 manifest entries plus 443 nested entries). Review: #3948 (comment)
Closing this original repair report. The constrained 2-vCPU result at 2,000 tasks still misses the <1s target (~2.11s open/~2.05s Escape close), and the four residual costs remain open in #3974. Historical invalid timing, crashed/OOM attempts and original measurement-source labels are retained. This is not a laptop, newly measured final-head, production performance or deployment claim. Tale implementation task TALE-362 is Done; canonical intake TALE-374 is being completed against that independent acceptance.