[codex] fix 2026 SCC showcase locale and theme toggles#36
Conversation
|
@bobzhang @peter-jerry-ye @Yoorkin @tonyfettes @myfreess @bzy-debug 这次补的是 2026 SCC 展示页的中英文切换、暗色样式和旧 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 60f144f71a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (hostname === '127.0.0.1' || hostname === 'localhost') { | ||
| const previewPort = locale === 'zh' ? '3004' : '3002' | ||
| return `${protocol}//${hostname}:${previewPort}/2026-scc/showcase/${suffix}` |
There was a problem hiding this comment.
Recognize all preview hostnames for locale switching
The locale switcher only treats localhost and 127.0.0.1 as preview environments, so when the site is opened via another local preview hostname (for example a LAN IP while running with --host 0.0.0.0), the click path falls through to the hard-coded production domains. In that scenario, switching languages unexpectedly leaves the preview build and navigates to production, which breaks local QA of cross-locale behavior.
Useful? React with 👍 / 👎.
|
已按最新要求收口这条 PR:把展示页之外的改动都恢复了。现在这条 PR 相对 |
|
已再次收口这条 PR。现在相对
原来放在 |
|
@bobzhang @peter-jerry-ye @Yoorkin @tonyfettes @myfreess @bzy-debug 这版已经再次收口确认过了:PR 相对 |
What changed
/zh/...path3002) and Chinese (3004) preview servers/zh/2026-sccand/zh/2026-scc/showcaseURLs to the Chinese production siteWhy
Two follow-up issues remained on the showcase pages:
中文from the English showcase page could still land on an outdated URL pattern and show a 404Impact
Visitors can now switch between English and Chinese from the showcase page without falling into the broken legacy path, and older
/zh/...links on the English site are redirected to the correct Chinese site.Validation
pnpm rabbita-showcase:buildhttp://127.0.0.1:3002/2026-scc/showcase/returns200 OKhttp://127.0.0.1:3004/2026-scc/showcase/returns200 OKpnpm typecheckstill exhausts Node heap in this repository (JavaScript heap out of memory), which appears unrelated to this page-only diff