Skip to content

fix(platform): share folder-name validation in create and rename - #4252

Merged
yannickmonney merged 1 commit into
mainfrom
fix/folder-name-validation
Oct 11, 2026
Merged

yannickmonney merged 1 commit into
mainfrom
fix/folder-name-validation

Conversation

@yannickmonney

@yannickmonney yannickmonney commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

What changed

  • Share the existing canonical folder-name constraints between the backend, Create and Rename: trimmed NFC name, 128-character limit, no separators/control characters, and no single/double-dot names.
  • Create now explains invalid names inline before submission. A structured FOLDER_NAME_INVALID refusal also maps to the name field without clearing or disabling the draft; corrected retries succeed.
  • Reuse documents.folder.invalidName and folder.nameRequired, already translated in EN/DE/FR with de-CH fallback. No new or untranslated strings.
  • Add boundary, valid-control, canonicalization and editable-retry regressions; document automated coverage.

Verification

  • RED on origin/main: 7 new Create dialog regressions fail; 7 existing/valid controls pass.
  • GREEN: 29 dialog tests and 365 scoped server/shared-rule/consumer/guard tests pass across 19 files (one worker).
  • Scoped TypeScript check passes (changed files and their imported dependencies; 1800 MiB heap).
  • Type-aware oxlint: 7 files, zero diagnostics; scoped oxfmt and diff checks pass. Knowledge manual-guide reference check passes.
  • Real Chromium: 10 cases pass across Create/Rename and EN/DE/FR/de-CH, including input retained after server refusal and corrected retry. Uses actual dialogs/design system with synthetic mutation transport, not a live authenticated backend.
  • Final visual-aspect-analyzer gate: baseline, Create and Rename each score 100 with zero defects and nonempty detected elements. Screenshots and reports retained in the task delivery box.

Whole-platform tests, whole-workspace types and production checks are left to CI/authorized operators. Independent review requested separately; no self-acceptance or merge.

Closes #3629

Current-main rebase

Replayed the previously accepted source b8cdf1cbb6c7492534d01e33ff95ef5810ef3b2b onto main d1373d84cd56972501403f62145ec52e6f65d44a, including the merged shared CI repair in #4625. The accepted feature payload and all current-main changes are preserved in one atomic commit. Configured commit and conflict checks pass; earlier behavioral proof remains recorded above. All seven native required checks and full merge-group validation remain required for this new source.

Maintenance replay: preserves the accepted feature payload on current main 7d178ca. Includes the merged #4649 Knip cleanup and the exact independently accepted one-line shared CLI inventory repair from #4654 (252f0df), which is still pending native merge on main. The fixed suite inventory keeps its discovery and source/compiled phase guards. Existing feature proof is retained; no fresh full-feature/full-workspace test or hosted-green claim. Native required checks remain mandatory.

@yannickmonney

Copy link
Copy Markdown
Contributor Author

Independent review: accept at exact head 2da4cc47dc0a6419dccd14f79f59eb9c6ff41027.

Evidence reviewed:

  • folderNameSchema is the single client rule used by Create and Rename; backend validateFolderName consumes the same shared reason/max/separator/control/dot logic.
  • Create and Rename map FOLDER_NAME_INVALID to the name field without reset/close/toast, and the tests assert the invalid value remains editable and a corrected retry succeeds.
  • Tests cover both separators, 128/129 boundaries, dot names, DEL/control coverage, canonicalization, and valid names; EN/DE/FR contain documents.folder.invalidName, with the existing documented de-CH overlay fallback to DE.
  • On origin/main, Create still only trims/nonempty-validates before submitting, so the Bug: Create folder hides invalid-name rules that Rename already explains #3629 regression is present in the base.

Unrun: the targeted jsdom suite could not reach assertions in this checkout because Vite loaded zod with z.string/z.number undefined (16 pre-assertion failures). No CI checks were rerun or waited on. Formal approval was unavailable because the authenticated reviewer is the PR author account; this comment is the accept record.

@yannickmonney
yannickmonney force-pushed the fix/folder-name-validation branch from 2da4cc4 to 37a7648 Compare October 9, 2026 02:40
@yannickmonney
yannickmonney force-pushed the fix/folder-name-validation branch 5 times, most recently from 4506641 to ac2f3e9 Compare October 9, 2026 15:00
@yannickmonney
yannickmonney added this pull request to the merge queue Oct 9, 2026
@yannickmonney
yannickmonney enabled auto-merge (squash) October 9, 2026 22:14
@yannickmonney
yannickmonney force-pushed the fix/folder-name-validation branch 2 times, most recently from 1ccb00a to a40be4a Compare October 9, 2026 23:49
@yannickmonney
yannickmonney added this pull request to the merge queue Oct 10, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 10, 2026
@yannickmonney
yannickmonney added this pull request to the merge queue Oct 10, 2026
@yannickmonney
yannickmonney removed this pull request from the merge queue due to a manual request Oct 10, 2026
@yannickmonney
yannickmonney force-pushed the fix/folder-name-validation branch from a40be4a to c774ba0 Compare October 10, 2026 09:04
@yannickmonney
yannickmonney added this pull request to the merge queue Oct 10, 2026
@yannickmonney
yannickmonney removed this pull request from the merge queue due to a manual request Oct 10, 2026
@yannickmonney
yannickmonney added this pull request to the merge queue Oct 10, 2026
@yannickmonney
yannickmonney removed this pull request from the merge queue due to a manual request Oct 10, 2026
@yannickmonney
yannickmonney force-pushed the fix/folder-name-validation branch from c774ba0 to 747832c Compare October 11, 2026 00:04
@yannickmonney
yannickmonney added this pull request to the merge queue Oct 11, 2026
Merged via the queue into main with commit 4590140 Oct 11, 2026
64 checks passed
@yannickmonney
yannickmonney deleted the fix/folder-name-validation branch October 11, 2026 02:15
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: Create folder hides invalid-name rules that Rename already explains

1 participant