Repository navigation
Conversation
|
The The fix is #607, which pins Generated by Claude Code |
Tophat: passedRan b05a7e9 locally with
Not UX: nothing on screen or read aloud changes. The before and after screenshots are attached in the session. Screenshots are in https://claude.ai/code/session_01LrYa57fvbqWjZj89iH975K. Generated by Claude Code |
richshaw
left a comment
There was a problem hiding this comment.
Review: changes needed (round 1)
This PR turns the header's "this page closed it" flag into "this page asked for status X". What gets said comes from a table keyed on the old and new status, and HeaderAnnouncer moves up into the signup layout, around both headers and the closed banner.
The refactor holds up. For open → closed it does exactly what the base did: the base's own condition passes all seven new tests, and the new tests catch every rule-breaking change tried but one.
The lift changes nothing on screen:
- It adds only context providers and the same
sr-onlyline to thespace-y-6div. - The header stays the announcer's first child and the banner its second, so nothing remounts on close or publish.
ShareScopeandPublishButtonstill sit underSay.SignupHeaderandBannerrender on the server as children of a client component, andBannergets no function props.
One thing needs changing first. The hook this PR makes general still only works for an action shaped like Close, and its own comment names Publish as the case its from-and-to table is built for.
Blocking (1):
src/components/signup/HeaderAnnouncer.tsx:26-30:useAnnouncedStatusChangeaccepts anyStatusAction, but it drops theformand counts{ published: true }as a refusal. A Publish routed through it, as lines 35-38 expect, would break Publish anyway and never be announced, with no error. Narrow the signature, or make the hook handle Publish (see the inline comment).
Optional (5):
src/components/signup/HeaderAnnouncer.test.tsx:105: the "a draft published through the hook" row can't fail today.ANNOUNCEDhas noopentarget yet, so the row passes even with the table keyed on the new status alone. It becomes a real guard once PR 4 addsclosed → open. Say so in the row's comment.src/app/app/(chrome)/signups/[id]/layout.tsx:65-87: on a closed signup, thesr-onlystatus line now comes after the closed banner in the DOM, not before it. What gets announced and the spacing are both the same. But a screen reader moving down the page after a close now reads "Signup closed…" before "Closed. People can't sign up now." That's harmless and worth a word in the description, so "no behavioural change" is exact.src/components/signup/SignupHeader.test.tsx:12: "as the layout renders them" is no longer quite true, since the layout now putsHeaderAnnounceraround it.src/components/signup/HeaderAnnouncer.test.tsx:45:presssays it presses "from the keyboard", but it callsclick()afterfocus().- The PR body doesn't mention 1d77646, the port of #607 (the PR comment does).
Earlier threads: none. Copilot couldn't review b05a7e9 (quota used up).
Checks:
- CI on 1d77646 is green:
lint-type-test, ande2e(79 passed onubuntu-24.04). - Locally on 1d77646:
pnpm lint,pnpm typecheck,pnpm knipandpnpm test(1713) pass. The new tests were checked by breaking the code they guard, and the blocking finding by a throwaway proof test. - The tophat passed on b05a7e9 (
ux=no). 1d77646 touches only.github/workflows/ci.yml, byte-identical to #607.
Gate: owner. 1d77646 changes .github/workflows/ci.yml, which the pipeline counts as high-risk. Not UX: nothing on screen or read aloud changes.
https://claude.ai/code/session_01LrYa57fvbqWjZj89iH975K
Generated by Claude Code
Tophat: passed (d8901d0)Ran d8901d0 locally with
Not UX. https://claude.ai/code/session_01LrYa57fvbqWjZj89iH975K Generated by Claude Code |
Brings d8901d0. Its comments above ANNOUNCED and the test table conflicted with this branch's; they now say reaching open from a draft is a publish, not a reopen, and that the draft-to-open row is what keeps it from saying "Reopened", now that the table has words for reopening. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LrYa57fvbqWjZj89iH975K
A browser takes focus off a button while it's disabled and doesn't give it back, so after a refused Reopen (a viewer, a stale tab, no slots left) keyboard focus was left on the page body. Once a press comes back refused, the button now takes focus again, as Close's Not yet and the Remove dialog's Keep do. It's keyed on the refusal, so a closed signup's page takes no focus as it loads. AsyncSubmitButton takes a ref for it. Also from review: - ReopenButton takes the narrower StatusChangeAction from #606. - Banner takes an action only when it isn't a live region, by type, so a button's alert can't end up inside role="status". - "No other blue button" means the header's; Settings has a blue Save. - The CHANGELOG lists "This signup is no longer available." among the refusals, says focus comes back, and drops a sentence about wording that never shipped. /app/signups/[id]/build goes from 158.96 to just over 159 kB, so its budget rises to 160 kB. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LrYa57fvbqWjZj89iH975K
richshaw
left a comment
There was a problem hiding this comment.
Review: passed (round 2)
d8901d0 fixes the one blocking finding from round 1 the way it suggested:
useAnnouncedStatusChangenow takes aStatusChangeAction(() => Promise<{ error: string } | null>).- Close's
closeActionis typed to match fromSignupHeaderdown toMoreActionsMenuandMobileMoreMenuSheet, so an action shaped like Publish can't reach the hook. - The hook's body, the announcer and every component's markup are unchanged: d8901d0 changes only types, comments and tests.
- All five optional points from round 1 are done, including the PR body's note on 1d77646 and on where the
sr-onlyline now sits.
Blocking (0): none.
Optional (2):
src/components/signup/StatusActionForm.tsx:20: an action that answers like Close but takes an optional form,(form?: FormData) => Promise<{ error } | null>, still fitsStatusChangeActionand would be called without its form. TypeScript can't rule out an optional parameter against a() => …type, no such action exists, and the doc comment says "takes no form". Nothing to do.- The PR body's closing footer is rewritten by the server on save. Nothing to do from here.
Earlier threads: all resolved. The round-1 thread on HeaderAnnouncer.tsx:26-30 was answered with d8901d0 and resolved.
Checks:
- CI on d8901d0 is green:
lint-type-test, ande2e(79 passed onubuntu-24.04). - Locally on d8901d0:
pnpm lint,pnpm typecheck,pnpm knipandpnpm test(1714) pass. - Type probe: a throwaway probe offered Publish's bound action to the hook and to each
closeActionprop on the way down, and every one was rejected. Close's own bound action is accepted all the way. - Type-level test: widening the hook's parameter, or
StatusChangeActionitself, makespnpm typecheckfail on it. - The tophat passed on d8901d0 itself (
ux=no). - A trial merge into the Reopen branch (#608) needs only
ReopenButton's prop and test mocks typedStatusChangeAction, plus two comment-only conflicts. #608 has since taken both.
Gate: owner. 1d77646 changes .github/workflows/ci.yml, which the pipeline counts as high-risk. It's byte-identical to #607, pins only the e2e job to ubuntu-24.04, and becomes a no-op once #607 is in main and this stack's base has it. Not UX: nothing on screen or read aloud changes, which both tophats and the pixel comparison on b05a7e9 confirm.
https://claude.ai/code/session_01LrYa57fvbqWjZj89iH975K
Generated by Claude Code
…hold the closed banner too The header's live region only knew one thing to say: "Closed." after this page's own Close signup. It now remembers whichever status a button on the page asked for, and speaks only when the signup then changes to that status from one it has words for. For now that is open to closed, said and focused exactly as before. It goes by where the signup came from as well as where it went, so a publish (draft to open) routed through it later can't say what reopening a closed signup would. The announcer moves out of SignupHeader into the signup layout, round the headers and the closed banner both, so a button in the banner can use it. It adds nothing to the page but its sr-only status line, still last, so the layout's spacing and what's on screen are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LrYa57fvbqWjZj89iH975K
useAnnouncedStatusChange took any StatusAction, but it passes no form and counts any answer but null as a refusal. Both hold for Close signup, which the hook was written for, and not for Publish: a Publish routed through it would lose Publish anyway's form and never be announced, with no error. It now takes a StatusChangeAction (no form; null once the status has changed), and Close's props are typed to match from the header down, so a Publish can't be passed at all. A type-level test fails if the signature is widened again. Also from review: the draft-to-open test row says when it starts guarding anything, and two test comments say what they do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LrYa57fvbqWjZj89iH975K
d8901d0 to
dcb601b
Compare
#581 merged into main squashed, at 8f69aa5. Merging that head here first brings in the stack's last commits as history, so the merge of the rebased #606 and of main that follows meets the same files on both sides. Only CHANGELOG conflicted: it takes the stack's final Publish and share entry and keeps this branch's three reopen entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LrYa57fvbqWjZj89iH975K
#606 was rebased onto main after the "Publish and share" stack merged, so its commits came back with new hashes, and the same lines met here from both sides in sixteen files. Each conflict keeps this branch's side, which already had #606's change. The PR's diff against its new base is line for line the one it had against the old (38 files, 924 insertions, 96 deletions). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LrYa57fvbqWjZj89iH975K
Brings in main, the rebased #606, and Reopen signup moved beside Preview and into the phone's ⋯. Only CHANGELOG conflicted: it takes #608's new entry for the button and keeps this branch's help page entry, which the next commit brings up to date. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LrYa57fvbqWjZj89iH975K
Tophat: passed (dcb601b, after the rebase)After the "Publish and share" stack merged, this branch was rebased onto
Not UX. Generated by Claude Code |
richshaw
left a comment
There was a problem hiding this comment.
Review: passed (round 3)
This round covers the rebase only. Round 2 passed d8901d0. When the branch was rebased onto main (28373e1), its two commits came back as 0323252 and dcb601b. The CI-pin commit (1d77646) dropped out because main already has the pin through #614. I checked that the change itself didn't move:
- The added and removed lines of the two diffs are identical, all 356 of them:
git diff 4347ed5 d8901d0 -- . ':!.github'git diff 28373e1 dcb601b
- The two patches have the same
git patch-id --stable, and both change 12 files (+232 / −100). - The 12 files are byte-identical at d8901d0 and dcb601b, and identical in both bases (4347ed5 and 28373e1).
- What
mainadds between those bases (the #581 squash, #614 and others) touches none of them, and nothing in it uses the announcer.git grep useAnnouncedClosestill finds nothing.
So round 2's review and the tophats on b05a7e9 and d8901d0 still describe this code.
Blocking (0): none.
Optional (2):
- The description is out of date in two places.
- It still says the PR carries 1d77646 and that approving it approves a workflow change. Neither is true since the rebase.
- It still says the next PR puts Reopen signup inside the closed banner. #608 has since moved Reopen beside Preview, so lifting
HeaderAnnounceraround the banner (src/app/app/(chrome)/signups/[id]/layout.tsx:65-87) is no longer needed for that.
- The lift is harmless, and nothing needs undoing. It changes nothing on screen, and #608's banner comment ("closing or reopening it from this page is announced by the header's") relies on it. Undoing it would cost both PRs another round.
Earlier threads: all resolved. The round-1 thread on HeaderAnnouncer.tsx was resolved with d8901d0, and that commit's content is unchanged here.
Checks:
- CI on dcb601b is green:
lint-type-test,e2e, CodeQL and both Analyze jobs. - The tophat passed on dcb601b (comment,
ux=no). - This PR has commits of its own since d8901d0 only because the rebase rewrote them: their content is the same.
mainhas since moved on to 30f2ec7 (#601), and the branch merges with it cleanly.
Gate: owner, as in round 2. Round 2's reason was the workflow change, and the rebase removed it. On its own this PR is neither UX nor high-risk: nothing on screen or read aloud changes. It stays with you as the base of the Reopen stack: #608, which is UX, merges on top of it.
https://claude.ai/code/session_01LrYa57fvbqWjZj89iH975K
Generated by Claude Code
|
UX walkthrough on Every status change in today's run was announced once, and focus went to the title each time:
One small thing: nothing clears the message afterwards. The
Clearing it a few seconds after it's set would stop it being read twice. Polish. Worth watching, seen once: on the Settings tab, Next's route announcer ( Generated by Claude Code |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LrYa57fvbqWjZj89iH975K
|
Approved by the owner at Generated by Claude Code |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LrYa57fvbqWjZj89iH975K
Only CHANGELOG conflicted: it keeps this branch's reopen and web-app entries and its edit of #571's entry, and adds #602's entry from main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LrYa57fvbqWjZj89iH975K
|
Closing this to merge the same branch through a new PR. GitHub counts #606, #608 and #610 as a stack, and refuses to merge a stacked PR or change its base through the API ("Merging stacked PRs via this endpoint is not supported", and auto-merge isn't supported either). The new PR has the same branch and head (01e0ce5), which passed this PR's review (round 3), its tophat, CI and the owner's approval here. Generated by Claude Code |
#648 is #606's change, which this branch already holds, so this branch's files stay as they were. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LrYa57fvbqWjZj89iH975K
Part of #20. PR 3 of 5. It sits on
main, which now has the "Publish and share" stack. It doesn't need #604 or #605. The next PR, Reopen signup (#608), is stacked on this one.It was rebased onto
mainafter the stack merged. Its two commits came back as 0323252 and dcb601b, with the same change line for line. The CI-pin commit it used to carry dropped out becausemainhas the pin through #614, so it changes no workflow.This is a refactor that changes nothing on screen or in what's announced. It gets the header's announcer ready for a second status change.
The problem
Reopen signup (#608) should be announced the way Close signup is: after a reopen from this page, the header's live region says so and focus moves to the title. Today that machinery can't do it, because it only knows about closing.
HeaderAnnouncerkeeps aclosedHereflag set byuseAnnouncedClose, and its effect checksopen → closedby hand.The fix
HeaderAnnouncer.tsxuseAnnouncedStatusChange(action, to)recordstowhen the action succeeds.open → closed, "Closed. People can't sign up now."StatusChangeAction, new inStatusActionForm.tsx: no form, andnullonce the status has changed. Publish takes a form and answers{ published: true }, both of which the hook would mishandle, so Publish can't be passed. Close'scloseActionprops are typed to match fromSignupHeaderdown.MoreActionsMenu.tsxandMobileMoreMenuSheet.tsxcalluseAnnouncedStatusChange(closeAction, 'closed').<HeaderAnnouncer>around bothSignupHeaderand the closed banner, andSignupHeader's root becomesShareScope.sr-onlylive region (still last), so the layout'sspace-y-6children and their spacing don't change.ShareScopeandPublishButtonstill sit inside it, so Publish's "Published. Anyone with the link can sign up now." works as before.sr-onlyline now comes after the closed banner in the DOM rather than before it. What's announced is the same. A screen reader moving down the page reads "Signup closed…" before the announcement, which is harmless.Tests
HeaderAnnouncer.test.tsxhas eight tests:openand goesdraft → opensays nothing. This row only guards anything once the table has aclosed → openentry, which Add Reopen signup beside Preview, and to the phone's ⋯ #608 adds;closedand goesdraft → closedsays nothing, because the target matches but the pair isn't in the table;closedfollowed bydraft → open, and then a close from elsewhere, says nothing;@ts-expect-error). Widening the signature failspnpm typecheck.The behaviour tests were checked against deliberately broken versions of the code: keying on the new status alone, dropping the focus move, recording a refused ask, and ignoring the ask.
git grep useAnnouncedClosereturns nothing.CI is green on dcb601b: lint, typecheck, unit tests, e2e and CodeQL. Before the rebase, the same change passed
pnpm build && pnpm budgetswith first-load JavaScript within 0.1 kB of its base on every/app/signups/[id]route.🤖 Generated with Claude Code
https://claude.ai/code/session_01LrYa57fvbqWjZj89iH975K