Bug
Selecting "All languages" on the discovery page always reverts to English. PR #273 fixed part of this but PR #274 (custom dropdown) was based on an older branch and reverted the fix. Additionally, the filter component itself has a logic gap.
Root Cause — two issues
1. page.tsx fallback was reverted
PR #273 changed the lang fallback to allow "all", but PR #274 overwrote it back to:
const lang = rawLang && (LANGUAGES as readonly string[]).includes(rawLang) ? rawLang : "English";
"all" is not in LANGUAGES, so it's rejected → falls back to "English".
Fix: Re-apply the PR #273 fix:
const lang = rawLang === "all" ? "all" : rawLang && (LANGUAGES as readonly string[]).includes(rawLang) ? rawLang : "English";
2. LanguageFilter omits lang param when "all" is selected
In src/components/GenreLanguageFilter.tsx:
if (value !== "all") params.set("lang", value);
When "All languages" is selected, lang is not included in the URL. The page then loads with no lang param → defaults to English.
Fix: Always include lang when it's explicitly "all":
if (value !== "all") params.set("lang", value);
else params.set("lang", "all");
Or simplify to always set it: params.set("lang", value);
Files to modify
src/app/page.tsx — line 36: allow "all" as valid lang value
src/components/GenreLanguageFilter.tsx — always pass lang=all in URL when selected
Acceptance criteria
Bug
Selecting "All languages" on the discovery page always reverts to English. PR #273 fixed part of this but PR #274 (custom dropdown) was based on an older branch and reverted the fix. Additionally, the filter component itself has a logic gap.
Root Cause — two issues
1.
page.tsxfallback was revertedPR #273 changed the lang fallback to allow
"all", but PR #274 overwrote it back to:"all"is not inLANGUAGES, so it's rejected → falls back to"English".Fix: Re-apply the PR #273 fix:
2.
LanguageFilteromitslangparam when "all" is selectedIn
src/components/GenreLanguageFilter.tsx:When "All languages" is selected,
langis not included in the URL. The page then loads with nolangparam → defaults to English.Fix: Always include
langwhen it's explicitly"all":Or simplify to always set it:
params.set("lang", value);Files to modify
src/app/page.tsx— line 36: allow"all"as valid lang valuesrc/components/GenreLanguageFilter.tsx— always passlang=allin URL when selectedAcceptance criteria
npm run typecheckpasses