Skip to content

[codex] fix 2026 SCC showcase locale and theme toggles#36

Closed
zongen01 wants to merge 3 commits into
moonbitlang:mainfrom
zongen01:codex/fix-showcase-locale-switches
Closed

[codex] fix 2026 SCC showcase locale and theme toggles#36
zongen01 wants to merge 3 commits into
moonbitlang:mainfrom
zongen01:codex/fix-showcase-locale-switches

Conversation

@zongen01
Copy link
Copy Markdown
Contributor

@zongen01 zongen01 commented Apr 22, 2026

What changed

  • fixed the in-page language switch on the 2026 SCC showcase so the English page switches to the correct Chinese route instead of the stale /zh/... path
  • made the active locale button non-clickable and kept preview routing consistent between the local English (3002) and Chinese (3004) preview servers
  • aligned the contest layout dark background and showcase switch styling with the showcase hero blue tone instead of the previous gray-black background
  • added explicit redirects for stale English-site /zh/2026-scc and /zh/2026-scc/showcase URLs to the Chinese production site

Why

Two follow-up issues remained on the showcase pages:

  1. clicking 中文 from the English showcase page could still land on an outdated URL pattern and show a 404
  2. the dark-mode content background and switch chrome did not visually match the showcase hero section

Impact

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

  • ran pnpm rabbita-showcase:build
  • verified http://127.0.0.1:3002/2026-scc/showcase/ returns 200 OK
  • verified http://127.0.0.1:3004/2026-scc/showcase/ returns 200 OK
  • pnpm typecheck still exhausts Node heap in this repository (JavaScript heap out of memory), which appears unrelated to this page-only diff

Open in Devin Review

Copy link
Copy Markdown
Contributor

@bobzhang @peter-jerry-ye @Yoorkin @tonyfettes @myfreess @bzy-debug 这次补的是 2026 SCC 展示页的中英文切换、暗色样式和旧 /zh/... 链接兜底修复。页面侧本地预览和展示墙构建都已验证,请帮忙看一下这版。

Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +33 to +35
if (hostname === '127.0.0.1' || hostname === 'localhost') {
const previewPort = locale === 'zh' ? '3004' : '3002'
return `${protocol}//${hostname}:${previewPort}/2026-scc/showcase/${suffix}`
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Contributor

已按最新要求收口这条 PR:把展示页之外的改动都恢复了。现在这条 PR 相对 main 只剩 4 个展示页相关文件:中英文 showcase 页面、RabbitaShowcaseMount 和 showcase 自己的样式文件,不再改赛事章程页、共享 ContestLayout 或站点配置。

Copy link
Copy Markdown
Contributor

已再次收口这条 PR。现在相对 main 只剩 4 个展示页文件:

  • src/pages/2026-scc/showcase/index.tsx
  • i18n/zh/docusaurus-plugin-content-pages/2026-scc/showcase/index.tsx
  • src/pages/2026-scc/showcase/ShowcaseMount.tsx
  • src/pages/2026-scc/showcase/wrapper.module.css

原来放在 src/components 的切换组件也已经挪到展示页目录下,不再碰共享组件。

Copy link
Copy Markdown
Contributor

@bobzhang @peter-jerry-ye @Yoorkin @tonyfettes @myfreess @bzy-debug 这版已经再次收口确认过了:PR 相对 main 只剩赛事展示页面相关的 4 个文件,不再包含章程页、共享组件或站点配置改动。最新提交已经推上来,烦请审核这一版。

@bzy-debug bzy-debug closed this Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants