Repository navigation
fix(platform): keep an unsaved project rename draft on a live rename - #4363
Conversation
The Rename project dialog reset its field on every change of the row's live project name while it was open, so a rename made in another session replaced an unsaved draft with no save, no discard and no notice. The draft now starts when the dialog opens or turns to another project. While it is open, a live rename moves the field only while it is untouched: a typed draft keeps its value, its validation message and an in-flight save's busy state, and an untouched field still follows the new name, so Save never writes the old one back. Cover a typed draft through a live rename (and saving it), the same-name re-render control, an untouched field following a live rename, and a fresh start on re-open or on a change of project with component regressions. Closes #3916
|
ACCEPT — independent exact-head review of PR #4363 / TALE-332 / #3916 Head: Reviewer: Codex #4, agent No actionable finding in this slice. The open/project-identity boundary initializes a draft; a dirty field survives live name changes; a pristine field follows them. Explicit Save submits the retained draft, while unchanged Save closes without writing. Cancel closes without a mutation, and reopening uses the latest live name. Empty dirty drafts survive repeated live renames and remain subject to required-field validation; a rejected save retains its draft through a subsequent live rename. Restoring the original field value makes it pristine again, so a later live rename follows normally. There is no conflict cue or concurrency check: explicit Save retains existing last-writer-wins behavior. Preserving the draft satisfies the issue's stated alternative to explicit conflict resolution. No new strings or markup; existing EN/DE/FR field, dialog, Save/Cancel and validation copy remain in use. Reviewed shared FormDialog/Input semantics and accessible-name/error assertions; no new accessibility or security surface was found. The row passes the live name to a stable project-keyed dialog; production propagation was source-reviewed, not exercised through two live sessions. Observed local checks, existing dependencies only, Node 24.21.0 / Vitest 4.1.11, one worker:
Passive exact-head CI settled: 50 SUCCESS, 27 conditional SKIPPED, 1 advisory NEUTRAL; zero failures or pending checks. Read-only watch, no reruns. Snapshot retains check/job URLs, including Checks run Not run: dependency installation, whole-platform suite, whole-workspace tsc or full check, local SAST, browser/visual analyzer, E2E/backend/database stack, real multi-session rename, screen-reader/contrast/layout checks, or rendered DE/FR probes. Author's Chromium/mutant evidence was read as author evidence, not claimed as reviewer execution. No push, merge, CI rerun, task status change or native-review decision. Next owner: fleet manager / authorized independent merge lane. Review evidence and supplemental probe are in |
What changed
The Rename project dialog (
project-rename-dialog.tsx) reset its field every time the row's live project name changed while it was open. The row passes the liveprojectNameascurrentName, so a rename made in another session replaced an unsaved draft, with no save, no discard and no notice (#3916).getFieldState('name').isDirty, react-hook-form's own dirty tracking).New
project-rename-dialog.test.tsxcovers this with the realFormDialog, react-hook-form andInput. Only the mutation hook and the toast are mocked:How it was verified
At publication (run
3b889655, 2026-10-05):3450d6703is one commit on4653d3e3b.origin/mainis now907abc093, 33 commits later. None of those commits touch the two changed files, andgit merge-tree --write-tree origin/main 3450d6703is clean. Main was not merged into the branch.project-rename-dialog.test.tsxand the dependentprojects-table.test.tsxpass 23/23 (jsdom,vitest.ui.config.ts, Node 24, one worker), both at the head and on the merged tree. The merged tree is907abc093with the two changed files from this head; its tree41bc381eeequals the merge-tree result, and no commit was made.At implementation (run
6f510835):Unfinished local renameand receivedOther user renamed this.browserproject. The fix passes 5/5. Main fails 1 and passes 4, on the same assertion.oxlintis clean on both files;lint-stagedran its conflict-marker check,oxfmtand opengrep;tscover a 2,680-file program that includes both files exits 0;Not run locally:
tsc;Notes
documents/components/rename-folder-dialog.tsxhas the same reset effect on main. No issue is filed for it, and it is not changed here.projects.create.successToast, so it reads "Project created". That is a separate copy bug, not changed here.Implementation run
6f510835(manager dispatche49ae7a6). Publication run3b889655(TALE-837, manager pass0ea77f29).Closes #3916