release: v1.4.1 — Telegram nav (windowed, own back button, debug panel) #129
+2
-15
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user