diff --git a/docs/UI_DESIGN.md b/docs/UI_DESIGN.md index 298f2d2..3ca2fd6 100644 --- a/docs/UI_DESIGN.md +++ b/docs/UI_DESIGN.md @@ -97,14 +97,16 @@ dismisses as soon as the lobby is ready. The pure layout and timing live in `lib which leaks into the Telegram Desktop webview and otherwise fights it) and the Settings theme switcher is hidden; the nav bar takes Telegram's background and `setHeaderColor` / `setBackgroundColor` / `setBottomBarColor` paint Telegram's own chrome to match; the - native header **BackButton** drives back-navigation (the app's chevron is hidden in - Telegram); **HapticFeedback** fires on tile placement / commit / error; on **mobile** - clients the app enters **immersive fullscreen** on launch (`requestFullscreen`, Bot API - 8.0+) like Telegram's own Mini Apps, while desktop keeps the bot's full-size window; - **closing confirmation** is enabled while a game is open **on mobile only** (on desktop - closing is deliberate and the "changes may not be saved" dialog is just noise — move drafts - auto-save); **vertical swipes** (swipe-to-minimise) - are disabled so they don't fight tile drag or the board scroll; **external links** (the word-check + app's **own back chevron** (Header) drives back-navigation on every platform — the native + Telegram BackButton is not used, as it does not render reliably in the windowed Mini App; + **HapticFeedback** fires on tile placement / commit / error; the app calls `expand()` for the + bot's full-size (max-height) window but **never `requestFullscreen`** — immersive fullscreen hid + the native header (and its BackButton) and the Android system swipe-back then minimised the app, + so it stays windowed with Telegram's thin native header (close) above the app's own header; move + drafts auto-save, so there is **no closing-confirmation guard**; a hidden **debug panel** (ten + quick taps on the header title) shows and shares a privacy-safe client diagnostic snapshot for + support; **vertical swipes** (swipe-to-minimise) are disabled so they don't fight tile drag or + the board scroll; **external links** (the word-check dictionary lookup, the rules link, operator-reply links) open through `Telegram.WebApp.openLink` so Telegram shows them in its in-app browser instead of the WebView's "open this link?" confirmation a plain `target=_blank` triggers; and a live stream dropped diff --git a/ui/src/App.svelte b/ui/src/App.svelte index 099dbe7..bba6053 100644 --- a/ui/src/App.svelte +++ b/ui/src/App.svelte @@ -2,13 +2,13 @@ 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 } from './lib/telegram'; import Toast from './components/Toast.svelte'; import Splash from './components/Splash.svelte'; import StaleInviteModal from './components/StaleInviteModal.svelte'; import WelcomeRedeemModal from './components/WelcomeRedeemModal.svelte'; + import DebugPanel from './components/DebugPanel.svelte'; import Login from './screens/Login.svelte'; import Lobby from './screens/Lobby.svelte'; import NewGame from './screens/NewGame.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 @@ -138,6 +125,10 @@ {/if} +{#if app.debugOpen} + +{/if} + diff --git a/ui/src/components/Header.svelte b/ui/src/components/Header.svelte index d050e83..6579946 100644 --- a/ui/src/components/Header.svelte +++ b/ui/src/components/Header.svelte @@ -1,17 +1,30 @@