37070c3cb7
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 56s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 2m13s
Finalises the Telegram Mini App navigation work after on-device testing (Pixel 10 / Android 17 + iOS, fresh beta clients): - Remove requestFullscreen entirely. Immersive fullscreen hid Telegram's native header (and its BackButton) and the Android system swipe-back minimised the app; the owner prefers the windowed full-size (expand) presentation, so the app never requests fullscreen on any platform now. - The app's own back chevron (Header, showBack = !!back) drives back-navigation on every platform; the native Telegram BackButton is dropped — it does not render in the windowed Mini App (backVisible=false on iOS and Android), so relying on it lost back navigation (notably none on iOS). - Replace the temporary always-on diagnostic overlay with a hidden debug panel (components/DebugPanel): ten quick taps on the header title open it; it shows a privacy-safe client diagnostic snapshot (app version, locale, online, userId, Telegram chrome / viewport / SDK state — no secrets, no IP) and shares it via the OS share sheet / clipboard; a tap anywhere except Share dismisses it. - Drop the now-dead telegramRequestFullscreen / telegramBackButton / isTelegramAndroid helpers and the iOS-fullscreen unit test. Telegram has no native non-modal notification API (only modal showPopup / showAlert), so in-app toasts stay ours. Docs: UI_DESIGN.md.
72 lines
2.5 KiB
Svelte
72 lines
2.5 KiB
Svelte
<script lang="ts">
|
|
// Hidden on-device debug panel, opened by tapping the header title ten times (Header.svelte) and
|
|
// closed by tapping anywhere except the Share control. It shows a privacy-safe client diagnostic
|
|
// snapshot (no secrets, no initData values, no IP) and shares it through the OS share sheet (or a
|
|
// clipboard copy on desktop) — a support aid for reproducing client-specific issues, e.g. the
|
|
// Telegram Android presentation quirks. Drawn from the top, just under the app header.
|
|
import { app, closeDebug } from '../lib/app.svelte';
|
|
import { connection } from '../lib/connection.svelte';
|
|
import { shareText } from '../lib/share';
|
|
import { telegramChromeDiag } from '../lib/telegram';
|
|
|
|
const report = [
|
|
`app: ${__APP_VERSION__}`,
|
|
`locale: ${app.locale} theme: ${app.theme} reduceMotion: ${app.reduceMotion}`,
|
|
`online: ${connection.online} streamAlive: ${app.streamAlive}`,
|
|
`userId: ${app.session?.userId ?? '—'} guest: ${app.profile?.isGuest ?? '—'}`,
|
|
telegramChromeDiag(),
|
|
].join('\n');
|
|
|
|
let label = $state('Share');
|
|
async function share(e: MouseEvent): Promise<void> {
|
|
e.stopPropagation(); // a tap on Share shares; it must not also close the panel
|
|
const r = await shareText(report, `Scrabble debug ${__APP_VERSION__}`);
|
|
if (r === 'copied') {
|
|
label = 'Copied';
|
|
setTimeout(() => (label = 'Share'), 1500);
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
<div class="overlay" onclick={closeDebug}>
|
|
<button class="share" onclick={share}>{label}</button>
|
|
<pre class="body">{report}</pre>
|
|
</div>
|
|
|
|
<style>
|
|
.overlay {
|
|
position: fixed;
|
|
inset: 0;
|
|
z-index: 10000;
|
|
/* Drawn from the top; the content clears the app header (~56px + the device safe-area). */
|
|
padding: calc(var(--tg-safe-top, 0px) + 56px) 12px 16px;
|
|
background: rgba(0, 0, 0, 0.82);
|
|
overflow: auto;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 10px;
|
|
align-items: flex-start;
|
|
}
|
|
.share {
|
|
flex: 0 0 auto;
|
|
padding: 7px 16px;
|
|
border: 1px solid var(--accent);
|
|
background: var(--accent);
|
|
color: var(--accent-text);
|
|
border-radius: var(--radius-sm);
|
|
font-size: 0.95rem;
|
|
}
|
|
.body {
|
|
margin: 0;
|
|
width: 100%;
|
|
white-space: pre-wrap;
|
|
overflow-wrap: anywhere;
|
|
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
font-size: 11px;
|
|
line-height: 1.45;
|
|
color: #d6e6ff;
|
|
}
|
|
</style>
|