Repository navigation
fix(platform): hold New project until its teams read answers - #5075
tale-code-bot wants to merge 1 commit into
Conversation
The New project dialog rendered "Who can see it" only once the assignable teams had loaded and were non-empty, and sent teamIds only when some were picked. While the teams read was pending, or after it failed, the field was missing and Create made the project organization-wide without the creator ever seeing the choice. Create now waits for the read: a pending read holds the field's place as a skeleton with Create disabled; a failed read, or a refresh that failed, is named in the field's place with Try again (the shared CatalogLoadError) and creates nothing, also against a direct form submit. Recovery returns the picker with the focus on it and keeps the picked teams. Only an answered, empty list leaves the field out and creates organization-wide. Closes #4836
tale-review-bot
left a comment
There was a problem hiding this comment.
Approved at c9cd29ffe4aa4e2a1dcadae4844417174679c48c (Reviewer, TALE-173, review-merge slice 2 of 2).
What I checked at this head
- Scope: the change does what #4836 and the task's plan asked, and nothing else. In
project-create-dialog.tsx, Create waits for thelistOrgTeamsread:- Pending:
Skeletonizemasks the picker and Create is disabled. - Failed, or a refresh that failed:
CatalogLoadErrorstands in the field's place. - Answered and empty: only then is the project created organization-wide.
- The submit is gated twice:
isValid, plus the guard inonSubmit. Docs (en/de/fr),PROJ-B32and the automation row are updated. There are no new i18n keys.
- Pending:
- Correctness: I followed
useOrgTeams→readStateOf→useBackendQueryand the/api/app/teamsroute.- That route answers any org member (
requireOrgMember), so the new gate can't lock out a role that is allowed to create. CatalogLoadError's focus handoff resolves the Radix dialog root case, andfocusAudiencetargets the MultiSelect trigger's id.- Both mounts (
projects-table.tsx,home-projects.tsx) keep their props.
- That route answers any org member (
- Contract: commit and PR title follow commitlint, the branch name is
fix/…,Closes #4836is there, and the sweep (docs, manual box, automation register) is complete.
What I ran (credentials removed; frozen lockfile install):
vitest --config vitest.ui.config.tson the newproject-create-dialog.team-reads.test.tsx,project-create-dialog.test.tsx,project-sharing-section.team-reads.test.tsx,projects-table.test.tsxanddashboard-lazy-failures.test.tsx: 5 files, 44/44 passed.- Regression: the same new test file with the dialog swapped back to
main's version (9be5cadac): 7 failed, 2 passed. The first failure iscreateProjectcalled with noteamIds, the bug in #4836. I restored the tree afterwards. bun run lint:manual: ok, 1849 boxes.bun run lint:conflicts: exit 0.
CI at this head: all 7 required checks passed:
- CI ready (Checks) in run 40913005794;
- CI ready (SAST) in run 40913006022;
- CI ready (Commitlint) in run 40913005830;
- CI ready (Security) in run 40913005717;
- CI ready (Build) in run 40913005887;
- CI ready (CLI) in run 40913006242;
- CI ready (E2E) in run 40913005932.
Not run: the queue-only tier (full test:ui, Browser, E2E, Build, Backend integration), a real browser and the live backend. The merge queue runs the first set before this lands.
Non-blocking note: with no $id in the route, the teams read is skipped and Create would stay held behind the skeleton. Both mounts sit under /dashboard/$id, so this can't happen today. The Coder flagged it on the task too.
|
Queued through the merge queue at the approved head Note for the maintainers: #4836 will close with this PR, but its addendum is not covered. The addendum is the 2026-10-12 comment on #4836 by Review A (TALE-358). This PR fixes the issue body: the New project dialog. The addendum describes two more defects, both in
When this lands, |
|
Merge queue: the first group for this PR failed a required check, and the PR was re-queued. (Reviewer
|
|
Merge queue: the second group failed too. I have not re-queued it; verify-close takes it from here. (
|
|
Merge queue: this PR was dropped a second time (Reviewer
|
|
Landed on |
Summary
Until now the New project dialog rendered Who can see it only after the assignable teams had loaded and turned out non-empty, and it sent
teamIdsonly when some were picked. While theGET /teamsread was pending, or after it failed, the field was missing and Create project made the project organization-wide without the creator ever seeing the choice (#4836).Create now waits for that read. The dialog reuses the shared
CatalogLoadErrorandSkeletonize, plus the read stateuseOrgTeams()already returns:Task: Tale TALE-173. Plan, as posted on the task before the first edit:
project-create-dialog.tsxread onlyteamsfromuseOrgTeams(), so it treated "not answered" the same as "no teams".isValid={audienceReady}plus a guard inonSubmit) and render each state in the field's place. No new concept, no new i18n keys.Closes #4836
Checklist
bun run check: not run as one command. Every part except the fulltest:uisuite passed atc9cd29ffe:lint:conflicts,lint:links, and the affected platform UI tests and docs tests (see Test plan).The full
test:uisuite has not run at this head. It runs only in the merge queue, so it runs before this lands.bun run lint:sast: passed in this PR's CI atc9cd29ffe. The Opengrep job of SAST run 40913006022 runs the samebash tools/opengrep/run.sh. It wasn't run in the authoring worker, where Opengrep v1.22.0 isn't cached.Translations: N/A. No key was added or changed; the dialog reuses
projects.sharing.teamsLoadError,projects.create.audienceLabeland the shared Try again, which exist in en/de/fr, with de-CH falling back to de. A test proves this in all four locales.Docs updated in
docs/{en,de,fr}/platform/projects/concepts.md("Check who can open it"): one sentence each saying that Create waits for the teams and that a failed read offers Try again.README.md/README.de.md/README.fr.md: N/A, since no install, configuration, environment variable or CLI change.Test plan
Regression. The new test file
project-create-dialog.team-reads.test.tsxuses the realuseOrgTeamsagainst a controlledbackendFetch('/teams')that fails with a 503 and makes 4 read attempts.main's dialog (9be5cadac)On
main, only the two casesmainalready handles pass: picked teams are sent, and an answered empty list creates organization-wide. The 9 cases:Commands, run at the head
c9cd29ffewith a clean tree. Platform commands ran inservices/platform.bunx vitest --run --config vitest.ui.config.tsonproject-create-dialog.team-reads.test.tsx,project-create-dialog.test.tsx,project-sharing-section.team-reads.test.tsx,projects-table.test.tsxanddashboard-lazy-failures.test.tsxprojects-table.test.tsx,dashboard-lazy-failures.test.tsxandhome-panel.test.tsxbun run --filter @tale/docs testbun run lint:manualbun run lint:linksbun run lint:conflictsoxfmt --checkon the changed pathsbunx oxlint --type-aware --type-checkon the 3 changed TypeScript filesCI at
c9cd29ffe, checked once on 2026-10-29 at 16:43Z: no check failed or was pending.Not run:
test:uisuite (the merge queue runs it);Manual: the new box
PROJ-B32inservices/platform/tests/manual/suites/projects.mdcovers this, andreference/automation.mdhas a row for the new spec. To try it:*/api/app/teams?*in DevTools and open New project.