fix(ui): Android Telegram nav — windowed mode, no close guard #128

Merged
developer merged 6 commits from feature/telegram-android-nav-fixes into development 2026-06-23 13:14:05 +00:00
2 changed files with 6 additions and 20 deletions
Showing only changes of commit 53d6883ffd - Show all commits
+2 -15
View File
@@ -2,9 +2,9 @@
import { onMount } from 'svelte';
import { cubicOut } from 'svelte/easing';
import { app, bootstrap } from './lib/app.svelte';
import { navigate, router, type RouteName } from './lib/router.svelte';
import { router, type RouteName } from './lib/router.svelte';
import { t } from './lib/i18n/index.svelte';
import { insideTelegram, telegramBackButton, telegramChromeDiag } from './lib/telegram';
import { insideTelegram, telegramChromeDiag } from './lib/telegram';
import Toast from './components/Toast.svelte';
import Splash from './components/Splash.svelte';
import StaleInviteModal from './components/StaleInviteModal.svelte';
@@ -30,19 +30,6 @@
// another screen is not covered.
const routeIsLobby = $derived(router.route.name === 'lobby');
// Inside Telegram, drive its native header back button: show it on any sub-screen
// (everything returns to the lobby root), hide it on the lobby/login. The app's own
// back chevron is hidden in Telegram (Header.svelte) so only the native one shows.
$effect(() => {
if (!insideTelegram()) return;
const r = router.route;
// The chat / check sub-screens step back to their game; every other sub-screen to the lobby.
let target = '/';
if (r.name === 'gameChat' || r.name === 'gameCheck') target = `/game/${r.params.id}`;
else if (r.name === 'feedback') target = '/about'; // back to the Settings → Info tab
telegramBackButton(r.name !== 'lobby' && r.name !== 'login', () => navigate(target));
});
// Screen transitions: the lobby is the navigation root. Entering a screen from the
// lobby slides it in from the right (forward); returning to the lobby slides the
// screen out to the right and reveals the lobby (back). Transitions are local, so
+4 -5
View File
@@ -1,6 +1,5 @@
<script lang="ts">
import { navigate } from '../lib/router.svelte';
import { insideTelegram, isTelegramAndroid } from '../lib/telegram';
import { connection } from '../lib/connection.svelte';
import { t } from '../lib/i18n/index.svelte';
import { app } from '../lib/app.svelte';
@@ -9,10 +8,10 @@
let { title, back, grow = false }: { title: string; back?: string; grow?: boolean } = $props();
// Inside Telegram the native header back button (App.svelte) is the back control, so the app's
// own chevron is hidden to avoid two back affordances — except on Android, where the native
// BackButton does not render in the (non-fullscreen) presentation, so the app shows its own.
const showBack = $derived(!!back && (!insideTelegram() || isTelegramAndroid()));
// The app always shows its own back chevron when there is a back target — on every platform, in
// and out of Telegram. The native Telegram BackButton is not used: it does not render reliably in
// the windowed Mini App (relying on it would lose back navigation there).
const showBack = $derived(!!back);
</script>
<header class="nav" class:grow>