Repository navigation
fix(platform): stop the task dialog's close flash and board re-renders - #3948
Conversation
The board drives its task dialog from one value, the open task's id: `open` is `id !== null`, and a close clears the id in the same update (X, Escape, the backdrop, and browser Back through the `?task=` sync). Radix and vaul keep the content mounted for the exit animation, so the closing dialog read `taskId === null`, switched to the create form at the create form's height, and mounted that form's reads on every close. TaskModal now keeps the body it was open with while it closes, by render-time state adjustment. The browser suite pins a longer exit and checks every close path on desktop and on the phone's drawer, a move to another task, and the not-found state of a deleted or forbidden task. Refs #3939
Every open and every close of a task re-rendered all cards twice: once for the workspace's own open state, once for the route handing new props when `?task=` changed. React commit counting on a production build put that at about 117 components per card (82,000 per open at 350 tasks); at 2,000 tasks a click spent about 17 s of main thread before the task showed, on a 2-vCPU host. The board and the list are memoized, the workspace's open handler keeps one identity (the route's callback is read through a ref), the review refs the board context takes are memoized, and the board reads answer one stable empty array while pending or failed. Refs #3939
An open task's dependency picker read every task of the project under a key of its own, a second copy of the board's read (2.6 MB at 2,000 tasks), and looked up each option's candidate with a linear search on every render, open or not. It now reads with the board's statuses, which keys the unfiltered board's own read, and indexes its candidates once. Refs #3939
TASK-F53 closes a task every way, on desktop and in the drawer, and judges that the task (never the create form) leaves. TASK-P4 opens and closes a task on a 2,000-task board with the Performance panel and the React Profiler. Their pins, the automated halves in the register, and the tasks row of the readme move with them. Refs #3939
The Preconditions called a local backend "self-hosted Convex at :3210", and the guide, PERF-P1 and the trace's own comment still listed the `convex-preauth` and `convex-authenticated` labels. A production build prints `module-load`, `router-loaded`, `session-resolved`, `member-context` and `account-bootstrap`. The Preconditions now name the platform's backend, add the build as a third axis, and say how to serve a production build locally (`TALE_E2E_SERVE_BUILD=1`). Refs #3939
|
Independent review at Final acceptance remains pending the exact-head local performance/visual receipt: the PR still has an unfinished evidence placeholder, while manual pins contain latency numbers. Please complete the interleaved base/head production-build table with identical local fixture sizes, warm/cold definitions, sample counts/distributions, trace locations and remaining costs. The earlier Bun helper baseline does not measure React, layout or HTTP and cannot support those numbers. A residual 2.1 s measurement would not satisfy a documented under-one-second target; report the remaining work separately. React Doctor is also not green: the new render-time ref write at All independent tests were local. No merge or production testing performed by this review. |
# Conflicts: # services/platform/tests/manual/readme.md # services/platform/tests/manual/reference/pins.md
The workspace read the route's `?task=` callback through a ref it wrote during render (React Doctor: no-ref-current-in-render). A render React discards could leave its callback for a later click. The ref now follows the committed props in a layout effect, as useFocusHandoff and the recurrence picker do. A new test holds that a click reaches the latest committed callback and that a new callback alone re-renders no card. The component suite's Back case is named for what it drives, the id clearing that Back ends in; the native Back stays the probe's. Refs #3939
|
Follow-up source/evidence review at The expanded production-build timing report is useful and discloses the constrained VM, baseline OOM, sample counts and residual costs. Please close the remaining evidence gap proportionally: its “exact head” section names measured predecessor The final type-check log contains only the two known main |
|
Thanks for the review. Here is what changed at
|
…-flash # Conflicts: # services/platform/tests/manual/readme.md
|
Review of Two small documentation corrections remain: the manual README still says 1,016 boxes, 90 chat and 108 settings; the independent parser inventory is 1,018, 91 and 109 respectively (104 tasks). The PR summary still calls the new close box Please finish the existing run with the raw measurement/runner/build receipts, traces, source identities and retained failed/OOM cases visible in TALE-362’s Deliverables. Root has read the progress panel and sees the additional |
|
Final state at
|
|
Landing reconciliation at
|
|
Independent agent review accepts source and delivered evidence at All seven downloaded archive hashes, 568 top-level manifest entries and 443 nested entries verify. Recomputed final 10+10 medians and flash-frame counts match the raw data. Desktop/mobile native Back and other exit paths retain the task during the fade. The six reviewed product blobs remain unchanged by the final main/count reconciliation; the manual inventory is 1,019 across 21 suites. I corrected the timing footnote to the actual 2k B5/A5/A5/B5 order and scoped its load figures to the correct samples. Measured-source labels and limitations are retained: the corrected runtime receipt is at Exact-head attempt1 CI now completed: Build36683332282, Checks36683332050, E2E36683331912, SAST36683332539 and Commitlint36683332181. Rollup48 success,11 intended skips,1 advisory Trivy neutral; no failed/pending check. Relevant platform Unit/UI/Browser/typecheck tasks actually executed, and all16 E2E shards, Smoke, Validate images and Scan platform passed. CI used synthetic merge4cc651f76c80038e1aafb702c5eff69631b75fbe. Normal expected-head squash follows; a later release candidate still needs its own full gates. |
Summary
Fixes both halves of #3939 on the task board's dialog.
open. Radix and vaul keep the content mounted through the exit animation, so every close (X, Escape, the backdrop, browser Back through the?task=sync) played out on the empty Create task form, at that form's height.TaskModalnow keeps the body it was open with while it closes. This is a render-time state adjustment, the patterntasks-workspace.tsxalready uses for?task=.?task=. The board and the list are now memoized, and the workspace's open handler keeps one identity. The board context's review refs are memoized, and the board reads answer one stable empty array while they are pending or failed. The handler reads the route's callback through a ref that follows the committed props in a layout effect (the pattern ofuseFocusHandoffand the recurrence picker), so a render React discards never hands its callback to a click.TASK-F54, a close by every way on desktop and in the drawer (renumbered fromTASK-F53, which main's feat(platform): let a schedule or another agent start a project agent #3942 took for its own box), andTASK-P4, a 2,000-task board, each with a pin and a register row. The README counts match the parser on the merge with current main: 1,019 boxes across 21 suites (tasks 104, chat 91, settings 109, governance 73). The governance suite's header now also counts main'sGOV-F47(fix(sandbox): move the model gateway to Bifrost v2.2.4 #3961). The performance guide's Preconditions drop the retired Convex runtime: they name the platform backend, add the build as an axis, and say how to serve a production build locally. PERF-P1 and the trace's comment list the labels a production build prints.Closes #3939. The remaining open/close cost on a big board is tracked in #3974.
Checklist
bun run check: not run whole on the 4 GiB agent host (the contract forbids it there); CI runs it. At the merge with main (856a7c738), on the files this PR changes:oxfmt --check, type-awareoxlint, and a scopedtsc. Also the tasks feature's jsdom suites with the chat's create-task suites and the project route (66 files, 492 tests), the tasks browser suites (3 files, 41 tests, 23 of them intask-modal.browser.test.tsx), andapp/lib/backend/tasks.test.ts(server project, 21 tests). Thenbun run lint:manual,check-guide.tson both suites, and React Doctor 0.9.14 on the changed components: 0 errors and the same 13 existing warnings (it had 1 error atf37124f18:no-ref-current-in-render,tasks-workspace.tsx:223).bun run lint:saston the changed files: 0 findings.docs/. The behaviour matches the tasks page; the manual layer changed (see above).Test plan
task-modal.browser.test.tsx(component, real Chromium). A harness drives the dialog the way the board does (open={id !== null},taskId={id}) and pins an 800 ms exit. For the X, Escape, the backdrop and the id clearing that Back ends in, it checks that the closing dialog keeps its name and height and never holds the create form. The harness has no router, so it clears the id as the?task=sync does. The checks run on desktop and in the 390 px drawer, after a move to another task, and on the not-found state of a deleted or forbidden task, and focus returns to the card. On main'stask-modal.tsx, the 13 new tests fail and the 10 existing ones pass. The native browser Back (history, router, the?task=sync) belongs to the production-build probe below.tasks-workspace.renders.test.tsx: the real board and list, with counting title buttons. Opening and closing a task renders no other card, including the route's?task=round trip and new callbacks. A click reaches the latest committed route callback, not the first render's, and a new callback alone re-renders no card. The test fails on main, with either half of the memo change reverted, and with the ref never updated (a stale callback).queries.test.ts: the board reads keep one empty array per field while pending or failed (fails on main).task-dependencies.test.tsx/tasks.test.ts: the picker asks for the board's statuses, which keys the unfiltered board's read (fails on main).Local evidence at the final head
Revisions. Every run served two production builds (
bun --bun vite build) from one backend and one database on an isolated localhost stack. The fixtures were synthetic: one org, with projects of 50, 350 and 2,000 tasks created throughcreateTask. Headless Chromium 145.0.7632.6 ran at 1440×900, with a fresh context per sample. The host was a 2-vCPU, 4 GiB sandbox on a shared VM.ad6e62759→010af46cf1e4ad7ffd→f37124f18, a merge of main1e4ad7ffd→9d1d1e3dbtasks-workspace.tsx, +7/−3)b5ff70447→856a7c738, a merge of main9d1d1e3db62f4a14ecTASK-P4pin text and the README counts. Its production bundle is byte-identical to856a7c738's (408 files; onlysw.js.mapdiffers, by a temporary path)b58676e3788259afe5, plus the README and governance counts. The PR's product files are byte-identical to9d1d1e3db's. This head was not rebuilt or measured (see below)The merge of main
b5ff70447changed the head's bundle through main's own runtime changes (the project page's memory, the navigation rail, the dropdown menu, the timeline). The head was therefore measured again once, with receipt 1's protocol. Receipt 1's samples are kept as they were.Main since the measured merge. The last merge brings in main
88259afe5, 8 commits pastb5ff70447(#3961, #3962, #3965, #3966, #3967, #3972, #3973, #3975). None of them touches a file of the tasks feature orpackages/ui.device-command.ts), which now uses the sharedlib/shared/release-version.ts.brace-expansion,fast-uriandnodemailer.The figures here are
856a7c738's; this head was not measured.Correction: the earlier "task shows" and "dialog gone" times ran early. Until the last run, the probe stamped a change with its 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 by the whole task. The last run now stamps the frame that shows the change once it is produced:
performance.now()in a message posted from that rAF callback. On the same samples the two stamps differ as follows:Timings at the final head (main
b5ff70447→ PR856a7c738, corrected stamps, 10 + 10 samples per size and no crashed sample; median, 95 % bootstrap CI of the median):¹ At 2,000 tasks the actual block order was PR5 → main5 → main5 → PR5. Main ran one open/close pair per page, while the PR ran three; the PR preview was stopped during main’s blocks (see the attempts below). The 50- and 350-task samples used A,B then B,A per iteration. This counterbalancing reduces drift but cannot remove shared-host load effects. Across all 60 final samples the 1-min load average was 2.35–13.16 (median 4.87); for the 2,000-task samples alone, the medians were main 4.44, PR 2.655 and pooled 3.01. The p90 of Escape at 2,000 tasks is 29.59 s → 3.23 s, and main’s worst sample, a 116 s close at load 13.2, is kept.
page.goBack(), popping the?task=entry the open pushed) 60/61 → 0/66.?task=.GET /tasks/:id: 368 → 113 ms, 1.49 s → 226 ms, 8.59 s → 910 ms.ad6e62759vs010af46cf; since then the PR's product files changed only by the callback change). After 20 open/close cycles (50 and 350 tasks) or 6 (2,000), with GC forced, the heap grew +5.0 / +6.0 / +9.3 MB on main and +4.4 / +4.0 / +3.1 MB on the PR. That growth is the opened tasks' cached reads, not a leak.Attempts that failed or were invalid, all kept in the raw data:
crashed: true, and a top-up block, A-9b, replaced them.What this PR does not reach is tracked in #3974. On this host, at 2,000 tasks,
TASK-P4misses both halves of its target: the task shows after 2.11 s, not under 1 s, and the page renders again about 1.6 s after the fade ends. On this VM the residual cold open read 2.29 s atf37124f18(3 samples), 2.21 s in receipt 1 (old stamp) and 2.11 s in the final run (corrected stamp). No laptop was measured, so none of these figures is a sub-second or a laptop result. The Bun helper baseline on #3939 timed list helpers only, and none of these numbers rests on it. What remains:pointer-events: noneon<body>makes every element recompute its style. The open forces that twice. Measured alone, it costs 105 ms at 9,324 elements and 625 ms at 48,199.current-user. Adding or removing one scans an array, which accounts for most of the close's script time at 2,000 tasks.?task=change: 488 components.Raw data. TALE-362's deliverables hold seven archives,
tale362-evidence-1…7-*.tar.gz, with their checksums inARCHIVES.sha256and an index inARCHIVES.md. Together they holdresults/<run>/for each run above, each with arunner.md(builds with full SHAs, host, versions, commands) and aMANIFEST.sha256. That covers every sample's JSON, the gzipped Chrome traces, commit counts, probe frames and screenshots, screen recordings, logs and the scripts. The build logs and the rebuild comparison are underbuilds/.CI note: at
9d1d1e3dbthe Type check failed on main'snavRestoreerrors (#3959), because PR checks test the merge with main. #3964 fixed main, and the final head's checks run on the fixed main.