Repository navigation
fix(platform): block edits during project-agent saves - #4256
Conversation
yannickmonney
left a comment
There was a problem hiding this comment.
Independent verdict: ACCEPT — TALE-591 / TALE-198 / #3657
Exact reviewed head: 9d7b32fda17621874b48a7cb916796ad98ed00b1 (unchanged at final readback).
Reviewer: Codex #6, agent 8c78cac9-4b65-4630-b901-0a52f2317ff3, run 24ab7564-d227-48ae-8126-58ebd6b842ce; distinct from author Codex #14, agent c0c99cd0-557f-4830-a3f1-1ae4df0968f3, run 937ab019-bea1-4ea1-99af-5fcc9e7b0ff9.
Findings and evidence
No blocking finding in the reviewed scope. The five added disabled={isSubmitting} props reuse the existing dialog state and native/design-system disabling. Payload construction is unchanged. The handler guards repeated submission, sets pending before awaiting, closes only on success and restores editing in finally. Errors do not reset local state.
Independently executed targeted jsdom tests with one worker in an isolated exact-head snapshot:
- Unmodified PR dialog plus importing agents-tab tests: 20/20 passed (
head-ui.log). Held update rejects later typing, retains the submitted text, and closes only after successful completion. Duplicate-name refusal retains both drafts, displays the localized inline error and restores editing. Create also locks; empty Instructions remains omitted from the clearing payload. - Reviewer-added network-failure/accessibility probe: 1 passed, 16 skipped (
reviewer-ui.log). Native disabling blocks edits; Cancel, Close and Escape cannot dismiss during the pending mutation; another submit issues no duplicate request. The dialog's labelled Close control remains keyboard reachable. Axe reports zero violations for the blocked dialog (color contrast disabled because jsdom has no layout). Rejecting with a generic network error retains Instructions and enables all five changed controls plus Cancel/Save; subsequent typing works. Final combined run: 21/21 passed (final-ui.log), additionally checking Save'saria-busy=true. - Counterfactual: retain the PR tests but replace only production
project-agent-dialog.tsxwith maind29a3c8fe78cdba54d247fe82ea5195f702c0651. The pending-save group produces 2 failed / 1 passed / 14 skipped, specifically the enabled Instructions field in success and duplicate-refusal cases (main-regression.log). This proves the regression detects the missing main-side gate, not a test-only implementation. git diff --checkpasses. Shared checkout remains clean and unchanged.
Controls and proof boundaries
Read TALE-198 and #3657 as the contract. Source-inspected the unchanged service path: missing Instructions writes SQL null; the normalized identical-configuration early return precedes UPDATE/audit/stamp changes; duplicate-name detection throws before UPDATE. The PR retains tests asserting duplicate-name/no-write and no-op/no-UPDATE and adds a bound-SQL null-clearing assertion. These service tests were not rerun by this reviewer, because admission is targeted jsdom only. Their 22/22 pass is author-reported, not independent execution or real PostgreSQL proof.
UI tests use deferred mocked mutations, a synthetic model roster and a mocked secrets field. They do not prove HTTP routing, real storage, provider execution or the secrets widget's full interaction. Shared FormDialog/primitive source confirms existing pending dismissal/secret gates and submit aria-busy; labelled controls and error associations remain intact. Keyboard reachability is observed, not real-browser focus-trap/restoration proof: jsdom passes through body between tab cycles, and the repo deliberately tests the Radix trap in its browser tier. No browser defect is inferred from that simulator behavior. Manual box PROJ-B14 documents slow-save keyboard/pointer coverage and remains unexecuted here.
Unrun and handoff
Unrun: service/server and PostgreSQL tests; HTTP/UI-to-storage proof; browser, visual analyzer, real focus trapping/restoration, screen-reader announcements, contrast/layout and full-stack/manual PROJ-B14; lint/typecheck/format/manual/SAST reruns; whole-platform suites. Author's scoped static/manual-gate results are retained as author evidence, not claimed independently.
Passive CI readback at approximately 07:48Z showed five queued Candidate source / Resolve source checks. CI is not terminal/all green. No waiting, rerun or cancellation. Acceptance is independent source/jsdom acceptance only, not merge authorization, a protected/native approval or a task completion move. TALE-359 retains exact-head CI and authorized merge disposition; re-review if the head changes. No push, merge or card move. Disk remained above the 20 GiB floor (179 GiB at entry; 169 GiB on later readback).
This exact-commit COMMENT review records ACCEPT because the repository credential is a shared GitHub principal; the independence is the distinct implementation/reviewer agent and run, not a claim to a separate human approval identity.
What changed
Disable name, harness, model, equipment and Instructions while a project-agent create/update request is pending. Secrets and dialog dismissal already use the same pending-state gate. A successful save can now close without discarding accepted post-submit keystrokes; a refusal restores editing and keeps the submitted draft.
Add deferred-request regressions for update success, duplicate-name refusal and create, plus clearing-instructions controls at the UI payload and service SQL boundaries. Retain the existing duplicate-name/no-write and no-op/no-UPDATE service controls. Add manual box PROJ-B14 for keyboard/pointer behavior on slow saves.
Verification
d29a3c8fe: the new pending-save regression fails (2 failed / 14 passed), because Instructions is enabled.UI tests use deferred mocked mutations; service tests use synthetic SQL fixtures, not PostgreSQL integration. No browser/full-stack or whole-platform suite was run under this task's light-work limit. Existing design-system disabled states/labels are reused; no strings, EN/DE/FR catalogs, documentation promises, schema or backend behavior change.
Closes #3657