fix(ui): own back chevron in Telegram on all platforms; drop the native BackButton
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Has been skipped
CI / integration (pull_request) Has been skipped
CI / ui (pull_request) Successful in 55s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m30s

The Telegram native BackButton does not render in the windowed Mini App (the
owner's emulator + a fresh beta TG report backVisible=false on both iOS and
Android), so relying on it lost back navigation — iOS had no back affordance at
all. Show the app's own back chevron whenever there is a back target, on every
platform (Header showBack = !!back), and drop the now-dead native BackButton
effect (App.svelte). The native close control stays — a windowed Mini App
cannot hide it (no Telegram API).

WIP: the temp lobby diagnostic overlay and the requestFullscreen no-op remain
for the owner's emulator test; finalize after confirmation.
This commit is contained in:
Ilia Denisov
2026-06-23 14:37:43 +02:00
parent 93c57b3558
commit 53d6883ffd
2 changed files with 6 additions and 20 deletions
+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>