Public signup pages always say lang="en", whatever the signup's language
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- next.js, react, typescript
调研方向
Read src/services/signups.ts, src/services/signups.cached.ts, and the signup layout and page files named in the issue; check prerequisites #621 and #625 first. Trace how the row is loaded and how locale reaches metadata and the preview, then run the query-budget test and the named unit, database, and accessibility checks. Done means Swedish renders lang="sv" and sv_SE, English remains unchanged, and the public page stays within five statements.
由索引模型根据 Issue 内容生成。
描述
Needs your OK: this marks a signup's pages, and its organizer preview, with the signup's language, for screen readers and link previews. Until Swedish ships every signup is English, so nothing changes yet. Swap pipeline:proposed for pipeline:ready to have it built.
What happens
After #621 the participant pages have their own root layout, but it still says lang="en". Screen readers read Swedish content with English pronunciation, and browsers offer to translate it "from English".
Fix, in outline
- One cached read, shared by the layout and the page.
- Split a pure
getSignupRowBySlug(db, slug)(one statement, skipping deleted rows) out ofgetPublicSignupinsrc/services/signups.ts. - Have
getPublicSignupaccept the row it already read rather than reading it again. It's also called with a rawdbby/api/public/signups/[slug]. - Its
cache()wrapper,loadSignupRowBySlug, lives insrc/services/signups.cached.ts. - Both the layout and
loadPublicSignupgo through it, so React dedupes it within a request andGET /s/[slug]stays at 5 statements.
- Split a pure
- The layout sets
<html lang>and next-intl's request language from the signup:resolveLocale(settings.locale, defaultFor('participant', instanceDefaultLocale()))(#625). An unknown or deleted slug gets the default. - Every page passes its own language too. A soft navigation renders a page without its layout; the "Edit" links on the signup page are
<Link>s. - Not-found pages get no params. The middleware (
src/middleware.ts) copies/s/:path*paths into the request header it already sets for/app.src/i18n/request.tsthen resolves the slug's language from it, or the participant default when there's no live signup. og:locale. Set it in the page's owngenerateMetadataopenGraph, because Next replaces a parent'sopenGraphper segment. Set it in the layout's for the edit and unsubscribe pages, which set none.- The organizer's Preview (
src/app/app/signups/[id]/preview/page.tsx) wraps the participant view inlang={signupLocale}.
Watch for
- The query-budget test (
src/app/query-budget.db.test.ts) callsPublicSignupPage()directly under vitest, wherecache()does nothing and there's no layout. Keep it counting the page alone, with a comment saying why. Add a unit test (a spy) thatloadPublicSignupgets its row throughloadSignupRowBySlug, so a second read can't creep back. - The edit and unsubscribe pages load by token, so the layout's read is one extra statement there. They have no statement budget.
- A deleted signup is gone to every service (CLAUDE.md), so the new read must skip deleted rows.
- The middleware change goes to the owner as high risk.
Order
After #621 and #625: the layout comes from #621, and the signup's language and defaultFor from #625.
Done when
- A signup with
settings.locale = 'sv'(set directly in a test) renderslang="sv"andog:localesv_SE, and an English signup is unchanged. GET /s/[slug]stays within its 5-statement budget, and the spy test passes.pnpm lint && pnpm typecheck && pnpm knip && pnpm test,pnpm test:dband the a11y e2e spec pass.
Planned with the owner in https://claude.ai/code/session_01EFKmj716ZY3b3SwR8TV8Y2 and checked against the code on main at 35288fa. The full plan is private to the owner's account: https://claude.ai/artifact/VgQH6U2s2EVx3LX991fJi8 (a Claude session on that account can open it with the Artifact tool's read action). This is part of step 1.1 there.
- 主要语言
- TypeScript
- 星标
- 19
- 派生
- 4
- 平均合并
- 19 小时 34 分钟
- 30 天内合并 PR
- 165
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
richshaw/OpenSignup 的其他 Issue
-
enhancement pipeline:proposed pipeline:ux
难度 2/5 1-3 小时 新手友好度 72/100
richshaw/OpenSignup#654 ·
维护者通常 1 天内回复
-
The help pages never say "pause", so organizers looking for it miss Close or reopen a signup可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭enhancement pipeline:proposed pipeline:ux
难度 2/5 1-3 小时 新手友好度 82/100
richshaw/OpenSignup#653 ·
维护者通常 1 天内回复
-
enhancement pipeline:proposed pipeline:ux
难度 2/5 1-3 小时 新手友好度 78/100
richshaw/OpenSignup#652 ·
维护者通常 1 天内回复
-
SMTP timeout notes in smtp.ts and the changelog describe nodemailer 10.0, not 10.1可能已有人在做 @agammann 于 1 天前认领。 未关闭enhancement good first issue pipeline:ready
难度 2/5 1-3 小时 新手友好度 82/100
richshaw/OpenSignup#645 ·
维护者通常 1 天内回复
-
A signup page's first Tab skips the header and lands on the next tab可能已有人在做 @richshaw 于 1 天前认领。 未关闭bug good first issue pipeline:building pipeline:ux
难度 2/5 1-3 小时 新手友好度 88/100
richshaw/OpenSignup#644 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 richshaw/OpenSignup 的全部 Issue
相似的 Issue
-
category::task code priority::normal
难度 2/5 1-3 小时 新手友好度 78/100
e0ipso/strikethroo#145 ·
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 85/100
cocos/cocos-docs#3333 ·
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
RevenueCat/react-native-purchases#2079 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
RevenueCat/purchases-hybrid-common#2039 ·
维护者通常 1 天内回复
-
agent-reported area/react bug
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复