Skip to content

feat: IP-based locale initialization, model-list parser fix, and mobile viewport refinements-2#145

Draft
kkgs-32 wants to merge 2 commits intou14app:mainfrom
kkgs-32:main
Draft

feat: IP-based locale initialization, model-list parser fix, and mobile viewport refinements-2#145
kkgs-32 wants to merge 2 commits intou14app:mainfrom
kkgs-32:main

Conversation

@kkgs-32
Copy link
Copy Markdown

@kkgs-32 kkgs-32 commented Mar 13, 2026

The commit message says IP-based initial locale (@kkgs-32), which refers to my request, but the actual changes only modify the Gemini model list. It doesn’t seem related to my requested change.

Summary

This PR includes three updates:

  1. Add IP/country-based initial language selection with en-US fallback.
  2. Fix and unify custom model list parsing (all, +, -, -all, @).
  3. Refine mobile viewport-height behavior: keep Android improvements and rollback iOS-specific runtime override after regression.

Changes

1) IP-based initial locale

  • Updated /api/env to return countryCode and localeFromIp.
  • Country is inferred from common edge/platform headers.
  • Unsupported or unmapped regions fall back to en-US.
  • Client now applies initial language only after env is loaded.
  • Added guard to avoid i18n.changeLanguage('').

2) Model list parsing fix and unification

  • Added shared parser: utils/modelList.ts.
  • Replaced duplicated parsing logic in:
    • components/Setting.tsx
    • components/ModelSelect.tsx
  • Fixed -all behavior so default models are actually removed.
  • Standardized @model handling for default-model preference.

3) Mobile viewport-height handling

  • Introduced/kept .app-viewport-height strategy in app/globals.css (vh/svh/dvh + CSS variable fallback).
  • Kept runtime viewport syncing in app/page.tsx for non-iOS.
  • Disabled iOS runtime viewport override path after regression.
  • Removed iOS-specific -webkit-fill-available fallback block.
  • Reverted temporary mobile fixed/inset layout on normal chat mode.

Files Changed

  • utils/modelList.ts (new)
  • components/Setting.tsx
  • components/ModelSelect.tsx
  • app/globals.css
  • app/page.tsx
  • components/TalkWithVoice.tsx
  • components/MultimodalLive/index.tsx
  • store/setting.ts
  • components/StoreProvider.tsx
  • app/api/env/route.ts
  • components/I18nProvider.tsx

Verification

  • Lint/build could not be executed in this environment because dependencies were not installed (next: command not found).

Notes

  • Voice mode height remains stable on both iOS and Android.
  • iOS normal-mode height override was intentionally rolled back due to regression.

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.

1 participant