feat(ui): diagnostic screen on /telegram/ instead of the landing bounce #126
Reference in New Issue
Block a user
Delete Branch "feature/telegram-launch-diagnostic"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
On
/telegram/a Mini App launch without sign-in data (emptyinitData) didlocation.replace('/'), bouncing the visitor to the marketing landing. This destroyed any diagnosability and, on some Android clients that reach the entry with emptyinitData, looked like the app refusing to open while iOS worked.Change
Replace the bounce with a compact, privacy-safe launch-error screen (
screens/TelegramLaunchError.svelte) showing a one-screenshot diagnostic snapshot captured at the moment of failure:initDataempty?,tgWebAppDatapresent in the URL fragment?A Share button delivers the report through the OS share sheet (clipboard copy on desktop), reusing the GCG no-webview-strand guard. Retry re-checks in place to recover a late
initDatawithout a reload (which would discard the launch fragment).This is the instrument to root-cause the Android empty-
initDatafailure (not reproducible in Playwright). Hypotheses A (launch method) and B (redirect-drops-fragment) were excluded; the screen captures the state on the real device.Tests
collectTelegramDiag,shareText/pickTextShare/telegram/spec now asserts the diagnostic screen (Share + Retry), not a redirectpnpm checkclean, 321 unit pass, build clean, 154 e2e pass (4 pre-existing skips)ARCHITECTURE.md+UI_DESIGN.mdupdatedA Mini App launch on /telegram/ without sign-in data (empty initData) used to location.replace('/') — bouncing the visitor to the marketing landing. That destroyed all diagnosability and, on some Android clients that reach the entry with no initData, simply looked like the app refusing to open. Replace the bounce with a compact, privacy-safe launch-error screen (screens/TelegramLaunchError.svelte) that renders a one-screenshot diagnostic snapshot captured at the moment of failure: SDK/WebApp presence, Telegram platform/version, whether initData is empty, whether the URL fragment carried tgWebAppData, the initData field NAMES present/missing (never the signed values, never an IP), and OS/mobile/browser via User-Agent Client Hints plus the full User-Agent. A Share button delivers it through the OS share sheet (clipboard copy on desktop, reusing the GCG no-webview-strand guard); Retry re-checks in place to recover a late initData without a reload (which would discard the launch fragment). This is the instrument to root-cause the Android empty-initData failure, which is not reproducible in Playwright. Tests: collectTelegramDiag + shareText/pickTextShare unit tests; the /telegram/ e2e now asserts the diagnostic screen, not a redirect. Docs: ARCHITECTURE.md + UI_DESIGN.md updated.