Skip to content

fix(members): flag a taken crewmate name on step 2 of the wizard - #19635

Closed
bolichen97 wants to merge 1 commit into
mainfrom
fix/crewmate-name-taken-step2-19380
Closed

bolichen97 wants to merge 1 commit into
mainfrom
fix/crewmate-name-taken-step2-19380

Conversation

@bolichen97

@bolichen97 bolichen97 commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: The new-crewmate wizard says a name is taken on step 2, where the user types it, instead of only after Create.

The wizard let a user type "Radar" when a crewmate named Radar already existed and go on to step 3. Only after clicking "Create Radar" did it bounce back to step 2 with "A crewmate named Radar already exists". That notice also sent the user to the "Crew Members page", an old name for the page the rail now calls Crewmates.

Why it matters

A first-time user fills in a whole step for a name that can never be saved, then gets sent back. The nightly GUI user test rated this a blocker. The old page name points at a page the user cannot find in the rail.

Not a goal

  • No change to how the server decides a name is taken (members.key_new_crew); its 409 stays the final word.
  • No change to the Crewmates page's own create dialog (NewCrewmateDialog), which already checks the roster.
  • No rename of "Crew Members" in code comments or other surfaces.

What changed (motivation → approach → change)

Before After
Step 2: a taken name looks fine, Next is on Step 2: a taken-name hint shows under the field, Next and Enter are off, the matching chip reads "already exists"
The taken name surfaces only as the server's 409 after Create The 409 still shows its error notice and also refreshes the roster
(no roster read) A roster that cannot be read shows "Could not load your crewmates." on step 2; the name is then left to Create
"Open the Crew Members page" "Open the Crewmates page" (every locale uses its own page title)

The wizard (website/src/components/MeetCrewmatesFlow.tsx) never read the roster, so it could not know a name was taken until the server said so. It now reads the same roster query the Crewmates page uses (membersRosterQuery) and checks the typed name against every key and label there, the same exact check NewCrewmateDialog.tsx already makes and the server's members.crew_showing applies. A roster match is a plain validation hint (nothing failed), while the server's 409 keeps its ErrorNotice. A failed roster read (first load or a refresh over cached rows) renders an inline ErrorNotice with no agent hand-off, since the typed draft is unsaved; the server's refusal stays the backstop.

The three wizard strings that named the old page (error_name_taken, error_create_unknown, open_crewmates) now name the Crewmates page in website/src/i18n/locales/en.manual.json and in every locale file, using each locale's pages.membersPage.title; en-XA.json is regenerated with npm run i18n:pseudo.

Backwards compatibility

Compatible: the wizard only refuses earlier a name the server would refuse anyway; every name that worked still works.

Removes nothing: no key, route or behaviour is taken away; three strings change wording.

Tests

  • website/src/components/MeetCrewmatesFlow.test.tsx: new test "a name the roster already lists is flagged on step 2 and Next stays off, before any create" (a label and a bare key on the roster are both taken; the hint is not an alert and is the field's description; Enter does not advance; a free name clears it and reaches step 3 with no create call). It fails on origin/main (nothing flagged on step 2) and passes here.
  • New test "a roster that cannot be read says so on step 2 and leaves the name to Create" (the notice has no hand-off button; Next stays on).
  • New test "a roster refresh that fails says so even while the earlier rows are cached" (fails when the notice is shown only with no cached rows).
  • The unanswered-create test reads the roster once at open and asserts it is not read again after the failed create; the old page name in two assertions now reads "Crewmates page".
  • Determinism: the file passed repeated runs (86/86). Under --sequence.shuffle one existing test ("a guided create waits for the guide to catch up") fails with any seed on clean origin/main too: a guideSave.sync call count leaks between tests. Not touched by this PR.
  • Frontend related set (run_scoped_tests.py --surface frontend, 26 files) green; tsc -p tsconfig.app.json, eslint, i18n:check and lint:i18n exit 0.

Manual verification

Built the SPA from origin/main and from this branch and drove the wizard from the Crewmates page in Playwright with a stubbed roster holding "Radar" and a stubbed 409 on create.

Screenshots / video

Before: step 2 with a taken name, Next is on.

before, step 2

Before: only after Create does the wizard bounce back, naming the "Crew Members page".

before, after Create

After: step 2 flags the taken name at once as a hint, Next is off, the hint names the Crewmates page.

after, step 2

After: a roster that cannot be read says so; the name is left to Create.

after, roster unreadable

Related Issues

Closes #19380

Pattern harvest

Not generalizable: one wizard skipped the roster check its sibling create dialog already makes; there is no shared create form to lint for.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners October 13, 2026 00:50
@bolichen97
bolichen97 requested a review from mbriones98 October 13, 2026 00:50
@bolichen97
bolichen97 enabled auto-merge (squash) October 13, 2026 00:51
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 13, 2026
@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 3167dde02bc4df5be8e8c4e15d4b2e2f564c6940 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Nothing to check.

[DESIGN-REVIEWED] 3167dde

Description read

[DESCRIPTION-READ] f9d4fde5d0a133c367ed16735bfd17370dbfbbb6b0b7926e563002439e13d1fa

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — 🟡 CONCERNS

Premise-level review of 3167dde02bc4df5be8e8c4e15d4b2e2f564c6940 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: CONCERNS

The roster-failure notice on step 2 rides along: if the roster read fails, the server's 409 already catches a taken name, so this notice prevents no failure.

Not justified as shipped

  • Item 4 — rides along / oversized: the description says a failed read means "the name is then left to Create". That is the same as base behaviour, and the server's 409 stays the backstop. So the notice prevents no failure. It only says a pre-check didn't happen, and no reported user was misled by its absence (ux(members): The wizard let me type "Radar" and go on to step 3, then only after I clicked "Create Rad… #19380 is about a name that is on the roster).
    Subtraction: delete the rosterFailed && <ErrorNotice … testId="meet-crewmates-roster-error"> block, the isError: rosterFailed destructure, and the two roster-failure tests. A failed read then flags nothing, as the code comment already says ("when it fails nothing is flagged").
    Clears when: the block is removed, or a report shows a user misled because a failed roster read showed no notice.

What this change ships

Inventory (6 items) — 5 justified

Intent: let a user see on step 2 that a crewmate name is taken, before filling in step 3 — FIX (#19380).

  1. Step 2 shows a "name taken" hint, and Next and Enter are off — justified
  2. A suggestion chip the roster already lists reads "already exists" — justified
  3. The wizard reads the crewmate roster when it opens — justified
  4. A failed roster read shows "Could not load your crewmates." on step 2 — rides along, not needed for the fix
  5. A 409 from Create refreshes the roster, so step 2 keeps flagging the name — justified
  6. Three wizard strings now name the "Crewmates page" in every locale — justified

[FIRST-PRINCIPLES-REVIEWED] 3167dde

Description read

[DESCRIPTION-READ] 73dc99e8a37c91b75d46220e0a18f0634257d893a4864605bdb5b483c2cfad0e

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — 🟡 CONCERNS

UX-level review of 3167dde02bc4df5be8e8c4e15d4b2e2f564c6940 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: CONCERNS

The taken-name hint, which blocks Next, is quiet grey text, while the roster error, which blocks nothing, is loud red. The reader called the hint "easy to miss."

Watch

  • The blocking hint is too quiet. nameTakenHint renders as plain text-[12px] text-warn-fg with no icon, and the field keeps its normal purple focus ring. In shot-03 the hint reads as muted grey. The blind reader said it was "easy to miss; I might only notice because 'Next' is dimmed." A user who reuses a suggested name will meet a dead Next button with no visible reason, and this repeats every time. Fix: give the hint a warning icon and a warn-toned field border so the field itself looks wrong.
  • The roster error gives no next step. pages.membersPage.roster_load_failed ("Could not load your crewmates.") shows in red with a warning icon, no retry, and Next still enabled. The reader's words: "no idea what I should do about it", and "may not be able to check whether 'Scout' is already taken". It sounds alarming but doesn't explain what it means for the user. Fix: use a wizard-specific string such as "Couldn't check whether this name is taken. Create will check it." and use the inline warn tone, not danger.
  • The link doesn't say it leaves the wizard. "Open the Crewmates page" calls finish('dismissed') and closes the wizard. The reader hesitated in both shot-02 and shot-03 for that reason: "might drop my half-finished setup." Fix: label it with the outcome, e.g. "Leave setup and open the Crewmates page".

Suggestions

  • error_name_taken says "…or open it from the Crewmates page." and the link right below says "Open the Crewmates page", so the same thing is said twice. Cut the sentence to "A crewmate named {{name}} already exists. Pick another name." and let the link carry the hand-off.

[UX-REVIEWED] 3167dde

Description read

[DESCRIPTION-READ] 68673e12b8717191ae977b43aa7a1ba2271a474a3227ecfe1d71c671f386432c

That sha256 names everything this verdict read: the PR description, plus the 7 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 3167dde02bc4df5be8e8c4e15d4b2e2f564c6940 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 3167dde

Verdict parsed from the review's SHA-scoped output markers for commit 3167dde02bc4df5be8e8c4e15d4b2e2f564c6940.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 3167dde02bc4df5be8e8c4e15d4b2e2f564c6940: <one-sentence reason>

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • Exact key/label match on step 2

rebutted: exact match is the server's own rule, not a gap. members.crew_showing compares the shown name exactly ("Exact comparison, the same one key_new_crew refuses a create on"), and key_new_crew refuses an id-shaped name only when that key exists.
So "radar" is refused only when a key radar exists (that key is in the roster set, so step 2 flags it), and "Radar" next to a key-only "radar" is accepted by the server (it derives radar-2). Flagging case variants would refuse names the server takes.
NewCrewmateDialog makes the same exact existingNames.includes(n) check over the same name+display_name set.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • Exact key/label match on step 2

rebutted: the step-2 check mirrors the server exactly. members.crew_showing refuses only an exact shown-name match, and key_new_crew refuses an id-shaped name only when its key exists; both sets are what step 2 reads (roster name + display_name).
"Issue Radar" typed while issue-radar exists is accepted by the server (it derives issue-radar-2), so step 2 must not flag it; a case variant is likewise a distinct name to the server. The 409 stays the backstop for any roster that is stale.

@bolichen97

bolichen97 commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor Author
  • span=cc3c8672ae35 The way out looks like it could lose work

rebutted (out of goal): the "Open the ... page" link and its leave-the-flow behaviour are on main unchanged (meet-crewmates-name-taken-open, finish('dismissed')); this PR only renames the page in its label and shows the notice one step earlier.
Whether that exit should keep the draft is a separate behaviour change; the user's way forward in this notice is picking another name, which keeps everything typed.

@bolichen97

bolichen97 commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor Author
  • span=030e4a85bf3d One word now points to two places

rebutted: both point to the same thing. "Crewmates" is the rail label and the page title (pages.membersPage.title), and the wizard's "CREWMATES · 2 OF 4" is the chapter of that same page. The issue asked to drop the stale "Crew Members" name precisely so there is one word, not two.

@bolichen97

bolichen97 commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor Author
  • span=db8bba9c7052 The marked chip hides what it was for

rebutted (out of goal): the taken-chip label ("Radar · already exists" via chip_taken) is main's existing rendering for a 409; this PR reuses it unchanged when the roster already lists the name. Redesigning the chip is not part of flagging the name on step 2.

@bolichen97

bolichen97 commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor Author
  • span=235c42e23e32 One changed string isn't in any screenshot

rebutted: error_create_unknown changes only the page name, the same "Crew Members" -> "Crewmates" swap the attached shots show; the unknown-create state itself is unchanged and covered by the unit test asserting its notice reads "Crewmates page".

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Stale verdict notice (2026-10-13 02:31 UTC): a later GPT 6.1 run did not produce a completed verdict for 3167dde02bc4df5be8e8c4e15d4b2e2f564c6940; the verdict below is from an earlier completed run. Inspect the GPT 6.1 Review job logs and re-run the workflow, or have a repository writer comment /ai-review override gpt 3167dde02bc4df5be8e8c4e15d4b2e2f564c6940: <one-sentence reason>.

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 1b9bd47dc86e306254eaa1906e654cb078bb5739 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 1b9bd47

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 1b9bd47dc86e306254eaa1906e654cb078bb5739: <one-sentence reason>

@bolichen97
bolichen97 force-pushed the fix/crewmate-name-taken-step2-19380 branch from 2882bb0 to 6f8fd4d Compare October 13, 2026 01:30
@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=33f7b000336f Roster validation is presented as a request failure

fixed in 6f8fd4d: a roster match now renders as a plain validation hint under the name field (meet-crewmates-name-taken-hint, no ErrorNotice, no role="alert"), still the field's aria-describedby and still holding Next. ErrorNotice stays only for the server's 409/400 refusal.
Roster-read failure is handled in the same commit: an inline ErrorNotice ("Could not load your crewmates.") with no hand-off, commented as protecting the unsaved name and job; the server's 409 stays the backstop. Both locked by tests in MeetCrewmatesFlow.test.tsx.

@bolichen97
bolichen97 force-pushed the fix/crewmate-name-taken-step2-19380 branch from 6f8fd4d to 1b9bd47 Compare October 13, 2026 01:56
@bolichen97

Copy link
Copy Markdown
Contributor Author
  • Cached roster suppresses refresh failures

fixed in 1b9bd47: the roster ErrorNotice now renders whenever rosterFailed is true, including when cached rows remain (the roster === undefined condition is gone), so a failed refresh is said on step 2 and a taken name falls back to Create's 409.
Locked by "a roster refresh that fails says so even while the earlier rows are cached" in MeetCrewmatesFlow.test.tsx, which fails with the old condition.
This verdict was never published on its head: that run's adjudication and comment steps hit a GitHub API rate limit (job 115085104354).

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • Case/spacing variants still reach the 409

rebutted: yes, by design. Step 2 flags only what the server refuses: members.crew_showing compares the shown name exactly and key_new_crew refuses an id-shaped name only when that key exists. A case or spacing variant ("Issue Radar" beside key issue-radar) is accepted by the server (it derives issue-radar-2), so it is not flagged; any name the roster missed still gets Create's 409 notice, unchanged from main.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=b680367224a0 Roster-read failure notice

rebutted: the notice is required, not optional scope. The repo's blocking rule errors-use-error-notice (website/AUTOSDE.yaml) covers any failed useQuery; the GPT lane flagged the silent roster ?? [] on 2882bb0 and the cached-refresh case on 6f8fd4d, and the adjudicator upheld it as rule-blocking. Removing the notice reintroduces a blocking violation the goal's own roster read creates.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=022a4954ba37 The hint that blocks the step looks like helper text

rebutted: the hint uses the wizard's established validation-hint style, the same text-warn-fg line the daily-time field shows when its value blocks Create; the field carries aria-invalid and the hint as its description. The blocking rule errors-use-error-notice forbids dressing a client-side check as an error, which is what the earlier red notice was flagged for.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=7aa940d9786b "Could not load your crewmates." gives no next step

rebutted (proportional): the next step is unchanged from main: Next stays enabled and Create's 409 still says if the name is taken. The query refetches on its own (30 s stale, on focus), clearing the notice. A new explanatory string would add a key to 13 locales for a rare state.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=d3b0de1eb94f "Open the Crewmates page" closes the wizard without warning

rebutted (out of goal): this link and its finish('dismissed') exit are on main unchanged (meet-crewmates-name-taken-open); this PR only renames the page in its label and shows the taken-name hint earlier. Keeping the draft on that exit is a separate behaviour change.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=37cef3df7acc Prefill the first suggestion not on the roster

rebutted (out of goal): the prefilled "Radar" is main's behaviour for the standalone flow; the embedded flow starts with an empty name. Changing the prefill is a new behaviour; the taken chip is now marked "already exists" so the user sees it at once.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Oct 13, 2026
The new-crewmate wizard let a name the roster already lists go on to
step 3, and only Create bounced the user back with the taken-name
notice. Step 2 now reads the members roster (the same names the
Crewmates page's own create dialog checks) and shows that notice under
the name field with Next off, before any request. The server's 409
stays the backstop and refreshes the roster.

The notice and the two other wizard strings named the page by an old
name, "Crew Members page"; they now say "Crewmates page" (each locale
uses its own page title).

Closes #19380
@bolichen97
bolichen97 force-pushed the fix/crewmate-name-taken-step2-19380 branch from 1b9bd47 to 3167dde Compare October 13, 2026 02:23
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in website/src/i18n/locales/*.json (13 files) since this head went green (365d87c -> 31d87f4); CI re-running.

@github-actions github-actions Bot added readiness: checking Automated validation is still running merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: passed Eligible automated validation passed for the current revision labels Oct 13, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

Closing as superseded by #18805 (merged 8635bc6): it removed the multi-step wizard this PR changes (website/src/components/MeetCrewmatesFlow.tsx and its strings, including every "Crew Members page" wording) and replaced it with the one-card create form in website/src/pages/members/NewCrewmateDialog.tsx, which already refuses a name the roster lists before any request (existingNames.includes(n)). There is no step 2 left to gate, so this diff no longer applies. The branch is kept.

@bolichen97 bolichen97 closed this Oct 13, 2026
auto-merge was automatically disabled October 13, 2026 02:32

Pull request was closed

@github-actions github-actions Bot removed the readiness: checking Automated validation is still running label Oct 13, 2026
@bolichen97
bolichen97 deleted the fix/crewmate-name-taken-step2-19380 branch November 20, 2026 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge conflict Branch has merge conflicts with its base — author must resolve before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ux(members): The wizard let me type "Radar" and go on to step 3, then only after I clicked "Create Rad…

1 participant