Skip to content

fix(platform): keep an unsaved project rename draft on a live rename - #4363

Merged
yannickmonney merged 1 commit into
mainfrom
fix/project-rename-live-draft
Oct 5, 2026
Merged

yannickmonney merged 1 commit into
mainfrom
fix/project-rename-live-draft

Conversation

@yannickmonney

@yannickmonney yannickmonney commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

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 live projectName as currentName, so a rename made in another session replaced an unsaved draft, with no save, no discard and no notice (#3916).

  • The draft now starts when the dialog opens, or when it turns to another project.
  • While the dialog is open, a live rename moves the field only while the field is untouched (getFieldState('name').isDirty, react-hook-form's own dirty tracking).
  • A typed draft is left alone. Its value, its validation message and an in-flight save's busy state all stay.
  • An untouched field still follows the new name, so Save never writes the old name back over the other session's rename.
  • No conflict notice was added. If the user saves a kept draft, it replaces the other session's name, as any explicit save does today. No new copy, so the locales are unchanged.

New project-rename-dialog.test.tsx covers this with the real FormDialog, react-hook-form and Input. Only the mutation hook and the toast are mocked:

  1. A typed draft survives a live rename, and Save sends the draft.
  2. Control: a re-render with the same name keeps the draft.
  3. An untouched field follows a live rename, and Save closes without a write.
  4. Re-opening starts fresh, for the same project and for another one. The fresh field then follows a live rename.
  5. A change of project while the dialog is open starts fresh, even over a typed draft.

How it was verified

At publication (run 3b889655, 2026-10-05):

  • The head 3450d6703 is one commit on 4653d3e3b. origin/main is now 907abc093, 33 commits later. None of those commits touch the two changed files, and git merge-tree --write-tree origin/main 3450d6703 is clean. Main was not merged into the branch.
  • project-rename-dialog.test.tsx and the dependent projects-table.test.tsx pass 23/23 (jsdom, vitest.ui.config.ts, Node 24, one worker), both at the head and on the merged tree. The merged tree is 907abc093 with the two changed files from this head; its tree 41bc381ee equals the merge-tree result, and no commit was made.

At implementation (run 6f510835):

  • The new file passes 5/5. Against main's dialog it fails 1 and passes 4: test 1 expected Unfinished local rename and received Other user renamed this.
  • Mutants, each killed:
    • "never follow a live rename": tests 3 and 4 fail;
    • "don't reset on close": test 4 fails;
    • "ignore the project identity": test 5 fails.
  • Real Chromium: the same tests in a temporary, uncommitted probe in the platform browser project. The fix passes 5/5. Main fails 1 and passes 4, on the same assertion.
  • Static checks:
    • type-aware oxlint is clean on both files;
    • lint-staged ran its conflict-marker check, oxfmt and opengrep;
    • a scoped tsc over a 2,680-file program that includes both files exits 0;
    • commitlint passes.

Not run locally:

  • the whole platform suites and a whole-workspace tsc;
  • the mutants and the Chromium probe again at publication (they ran at implementation on this same commit);
  • a native two-session app run;
  • the visual analyzer (there is no visual change).

Notes

  • Sibling: documents/components/rename-folder-dialog.tsx has the same reset effect on main. No issue is filed for it, and it is not changed here.
  • Side observation: the rename success toast reuses projects.create.successToast, so it reads "Project created". That is a separate copy bug, not changed here.

Implementation run 6f510835 (manager dispatch e49ae7a6). Publication run 3b889655 (TALE-837, manager pass 0ea77f29).

Closes #3916

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
@yannickmonney

Copy link
Copy Markdown
Contributor Author

ACCEPT — independent exact-head review of PR #4363 / TALE-332 / #3916

Head: 3450d6703a1ed0bb8e5c9cbb62b2161d2bc3a7d4, tree 5e992dde6feb45e71bb89fb7ec63b6ef197ace1c, parent 4653d3e3ba2fc224aaf3a437c1b8d853fe096a4a. GitHub head re-read before publication and unchanged.

Reviewer: Codex #4, agent dce9fe1e-9749-4181-8df8-464a4176ed56, TALE-852 run f6ae28bf-261d-41fc-aad2-cdeabd966ce0. Implementer: agent #5 718fc56b-b13d-42a9-8543-78297f0272ed, fix run 6f510835-8d77-458c-b8a8-03bf28bf646f, publication run 3b889655 (TALE-359 receipt 7db3854c). Reviewer is distinct from implementation/publication.

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:

  • New dialog spec plus projects-table: 2 files, 23/23 passed; final repeat after restoring exact-head source also 23/23 passed.
  • Four independent delivery-only probes: cancel/reopen, repeated live renames with an empty draft, rejected Save plus live rename, edit reverted to original: 4/4 passed.
  • Negative control: exact-head spec against the parent dialog implementation fails only draft preservation (1 failed, 4 passed), receiving the remote name instead of the unsaved draft.
  • Scoped Oxlint and type-aware Oxlint on both changed files: exit 0; one lint thread for type-aware run. Oxfmt check: both files pass.
  • Scoped TypeScript syntactic/semantic diagnostics for dialog/spec, table/spec and row-actions: 0 across five roots, using repository options and resolved imports (3,307 source files); not a whole-workspace diagnostic check.
  • Initial dependency-path/font collection failure was fixed with a delivery-only Vite fs-allow config extending the unchanged UI config. Repository and PR source were not changed; dependency versions were not installed or updated.

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 37316019303, E2E 37316019288, Build 37316019129. Skipped/neutral checks are not successful executions; no claim that every successful Turbo result was uncached. No failing CI log needed causal attribution.

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 /agent/output/dd977b68-bcdc-4ab1-800b-020f9e30594a/.

@yannickmonney
yannickmonney merged commit ca3519f into main Oct 5, 2026
@yannickmonney
yannickmonney deleted the fix/project-rename-live-draft branch October 5, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: a live project rename overwrites an unsaved rename draft

1 participant