Skip to content

[bug] Language filter 'All' option reverts to English #271

@realproject7

Description

@realproject7

Bug

When the user selects "All languages" from the language filter dropdown, the page reloads but reverts back to "English." Users cannot browse stories in all languages.

Root Cause

PR #270 changed the language fallback in src/app/page.tsx from "all" to "English":

const lang = rawLang && (LANGUAGES as readonly string[]).includes(rawLang) ? rawLang : "English";

The problem: when the user selects "All languages", the GenreLanguageFilter component sets lang to "all" in the URL params. But "all" is not in the LANGUAGES array, so the validation rejects it and falls back to "English".

Fix

In src/app/page.tsx, allow "all" as a valid lang value:

const lang = rawLang === "all" ? "all" : rawLang && (LANGUAGES as readonly string[]).includes(rawLang) ? rawLang : "English";

This preserves the default-to-English behavior (no lang param → English) while still allowing explicit ?lang=all to show all languages.

Files to modify

  • src/app/page.tsx — allow "all" as valid lang param

Acceptance criteria

  • No lang param in URL → defaults to English (existing behavior)
  • ?lang=all → shows all languages
  • Selecting "All languages" from dropdown works and persists
  • npm run typecheck passes

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/T3Assigned to T3 builder agentbugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions