Skip to content

fix: redirect root path to default locale#35

Closed
nb-sb wants to merge 3 commits intoshareAI-lab:mainfrom
nb-sb:fix/root-redirect-to-locale
Closed

fix: redirect root path to default locale#35
nb-sb wants to merge 3 commits intoshareAI-lab:mainfrom
nb-sb:fix/root-redirect-to-locale

Conversation

@nb-sb
Copy link

@nb-sb nb-sb commented Feb 26, 2026

fix issues: #32 README中web模块说明不足,默认页面404

CrazyBoyM and others added 3 commits February 21, 2026 17:02
- 11 sessions from basic agent loop to autonomous teams
- Python MVP implementations for each session
- Mental-model-first docs in en/zh/ja
- Interactive web platform with step-through visualizations
- Incremental architecture: each session adds one mechanism
Copilot AI review requested due to automatic review settings February 26, 2026 08:13
@vercel
Copy link

vercel bot commented Feb 26, 2026

Someone is attempting to deploy a commit to the crazyboym's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an App Router root page to redirect / to the default locale route, addressing the reported 404 when visiting http://localhost:3000 directly.

Changes:

  • Added web/src/app/page.tsx to redirect //en.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +3 to +4
export default function RootPage() {
redirect("/en");
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

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

The redirect target is hard-coded to "/en" here, while the supported locales are also defined elsewhere (e.g., in app/[locale]/layout.tsx and lib/i18n-server.ts). This can drift over time if the default locale changes. Consider introducing a shared DEFAULT_LOCALE (and possibly LOCALES) constant in a common module and importing it here (and from the other locale lists) so there’s a single source of truth.

Suggested change
export default function RootPage() {
redirect("/en");
const DEFAULT_LOCALE = process.env.NEXT_PUBLIC_DEFAULT_LOCALE || "en";
export default function RootPage() {
redirect(`/${DEFAULT_LOCALE}`);

Copilot uses AI. Check for mistakes.
Comment on lines +3 to +5
export default function RootPage() {
redirect("/en");
}
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

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

The PR description mentions that the README’s web-module instructions are insufficient, but this PR only adds a root redirect and does not update any README/docs. Either update the README as part of this PR or adjust the PR title/description to reflect the actual scope (root-path redirect only).

Copilot uses AI. Check for mistakes.
@CrazyBoyM
Copy link
Contributor

Correction: This PR was automatically closed by GitHub when we force-pushed after a git filter-repo operation. It was not reviewed and intentionally closed. Apologies.

The root redirect fix is a valid improvement -- localhost:3000 returning 404 is a real UX issue. We'll implement this and credit you. Thanks!


更正:这个 PR 是 git filter-repo 后 force push 时被 GitHub 自动关闭的。根路径重定向是有效的改进,我们会实现并注明贡献者。

CrazyBoyM added a commit that referenced this pull request Feb 27, 2026
@CrazyBoyM
Copy link
Contributor

Root redirect is now live in commit 14c7228. Credited in the commit message. Thanks again!

根路径重定向已合并,commit message 中注明了贡献者。

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