feat(ui): настоящий share friend-code + ссылка по текущему боту (service_language) #66

Merged
developer merged 6 commits from feat/friend-invite-share into development 2026-06-15 15:42:19 +00:00
Owner

Делает кнопку «Поделиться» (friend-code) настоящим share и ведёт ссылку на текущий бот.

Было

«Поделиться через Telegram» — это <a href="t.me/<bot>/<app>?startapp=…">, который просто открывал бот (всегда один, зашитый в сборку), а не диалог «поделиться»; URL нельзя было ни скопировать, ни отправить.

Стало

  • Настоящий share: в Telegram — нативный пикер «поделиться в чат» (openTelegramLink + t.me/share/url); на вебе — системное share-меню (navigator.share); если ничего недоступно — копирование ссылки.
  • Ссылка ведёт на тот же бот, в котором сидит игрок: service_language теперь едет в Session по проводу (backend→gateway→FlatBuffers→UI), и UI выбирает VITE_TELEGRAM_LINK_EN/_RU, с фолбэком на единственную VITE_TELEGRAM_LINK.
  • Deploy-обвязка: новые build-args VITE_TELEGRAM_LINK_EN/_RU в Dockerfile / compose / ci.yaml / .env.example / доках. BOT_ID не разбивался (для Login Widget, бот-агностичен). PLAN TODO-5 обновлён.

Проверки локально

Go build/vet/gofmt, unit + полный -tags=integration (auth/session затронуты), gateway transcode-тест подтверждает service_language в Session; UI pnpm check 0 ошибок, unit 226 (deeplink-выбор языка покрыт), build.

⚠️ Реальный pinch/Telegram-пикер в Playwright не воспроизводим — финально проверяется вживую на контуре (по практике проекта): друг открывает ссылку → запускается Mini App с startapp=f<код> → код гасится, вы в друзьях.

Делает кнопку «Поделиться» (friend-code) настоящим share и ведёт ссылку на текущий бот. ### Было «Поделиться через Telegram» — это `<a href="t.me/<bot>/<app>?startapp=…">`, который просто **открывал бот** (всегда один, зашитый в сборку), а не диалог «поделиться»; URL нельзя было ни скопировать, ни отправить. ### Стало - **Настоящий share:** в Telegram — нативный пикер «поделиться в чат» (`openTelegramLink` + `t.me/share/url`); на вебе — системное share-меню (`navigator.share`); если ничего недоступно — копирование ссылки. - **Ссылка ведёт на тот же бот**, в котором сидит игрок: `service_language` теперь едет в `Session` по проводу (backend→gateway→FlatBuffers→UI), и UI выбирает `VITE_TELEGRAM_LINK_EN/_RU`, с фолбэком на единственную `VITE_TELEGRAM_LINK`. - **Deploy-обвязка:** новые build-args `VITE_TELEGRAM_LINK_EN/_RU` в Dockerfile / compose / ci.yaml / `.env.example` / доках. `BOT_ID` не разбивался (для Login Widget, бот-агностичен). PLAN TODO-5 обновлён. ### Проверки локально Go build/vet/gofmt, unit + **полный** `-tags=integration` (auth/session затронуты), gateway transcode-тест подтверждает `service_language` в Session; UI `pnpm check` 0 ошибок, unit 226 (deeplink-выбор языка покрыт), build. ⚠️ Реальный pinch/Telegram-пикер в Playwright не воспроизводим — финально проверяется вживую на контуре (по практике проекта): друг открывает ссылку → запускается Mini App с `startapp=f<код>` → код гасится, вы в друзьях.
developer added 2 commits 2026-06-15 13:50:01 +00:00
Thread the Telegram bot's service language (en/ru) from the session mint response
through the gateway into the FlatBuffers Session, so the UI knows which bot the
player signed in through. handleTelegramAuth refreshes the account's service
language onto the response before minting (it was set after the fetched copy).
Empty for a non-Telegram login.
feat(ui): real friend-invite share with a per-bot link
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 9s
CI / integration (pull_request) Successful in 15s
CI / ui (pull_request) Successful in 47s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m12s
03eb8044ff
The friend-code 'share' was an <a> that just opened the bot. Make it a real share:
Telegram's native share-to-chat picker inside the Mini App (openTelegramLink +
t.me/share/url), the system share sheet (navigator.share) on the web, else copy the
link. The shared deep link points at the same bot the player is in — it picks
VITE_TELEGRAM_LINK_EN/_RU by the session's service language, falling back to the
single VITE_TELEGRAM_LINK. Adds the per-bot build args across Dockerfile / compose /
ci.yaml / .env / docs; PLAN TODO-5 updated.
developer added 1 commit 2026-06-15 14:09:12 +00:00
fix(ui): per-bot invite caption + friendly self-redeem note
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 9s
CI / integration (pull_request) Successful in 12s
CI / ui (pull_request) Successful in 47s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 57s
01d2d1f368
- The share caption is now in the bot's language: 'Давай играть в Эрудит!' (ru bot),
  "Let's play Scrabble!" (en bot) — picked by the session service language, not the
  interface language.
- Redeeming your own invite (deep link or manual) no longer shows the scary
  'can't do that to yourself' error; it shows a friendly neutral note instead.
developer added 1 commit 2026-06-15 15:22:11 +00:00
feat(ui): refine Telegram invite & close UX
CI / changes (pull_request) Successful in 1s
CI / unit (pull_request) Successful in 9s
CI / integration (pull_request) Successful in 13s
CI / ui (pull_request) Successful in 47s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m2s
853730823b
- Shared invite links open the Mini App fullscreen (mode=fullscreen), so a
  shared link matches the bot's own fullscreen launch.
- A used or expired invite deep-link now lands the visitor in the lobby with a
  gentle notice pointing at the right bot (@<username>, by service language),
  instead of a red "code invalid/expired" error on the Friends screen.
- The in-game close confirmation is armed only on Telegram mobile clients; on
  desktop (tdesktop/macOS/web) it is skipped, where the "changes may not be
  saved" dialog is just noise (drafts auto-save).
developer added 1 commit 2026-06-15 15:34:08 +00:00
feat(ui): force Mini App fullscreen on mobile, not via the share link
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 9s
CI / integration (pull_request) Successful in 13s
CI / ui (pull_request) Successful in 47s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m15s
00129414e5
Replace the shared-link &mode=fullscreen (which would also force fullscreen on
desktop) with an imperative requestFullscreen() on launch, gated to mobile
clients (ios/android/android_x) — mirroring how Telegram's own Mini Apps go
immersive on phones while desktop keeps the bot's full-size window. It triggers
the existing fullscreenChanged -> safe-area resync; a no-op on clients predating
Bot API 8.0.
developer added 1 commit 2026-06-15 15:39:37 +00:00
docs: bake Telegram invite & launch refinements into ARCHITECTURE/UI_DESIGN
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 9s
CI / integration (pull_request) Successful in 13s
CI / ui (pull_request) Successful in 47s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 57s
8073971fca
- UI_DESIGN: mobile immersive fullscreen on launch (desktop keeps full-size); the
  close confirmation is now mobile-only; friend-code share-via-Telegram deep-link
  (per-bot, by service language), the friendly self-redeem note, and the
  outdated-link lobby notice.
- ARCHITECTURE: the service language rides the Session wire so the client builds
  the per-bot invite link; the friend code is shared as a startapp deep-link with
  graceful spent/expired handling.
owner approved these changes 2026-06-15 15:40:04 +00:00
developer merged commit 4d6df4bd8b into development 2026-06-15 15:42:19 +00:00
developer deleted branch feat/friend-invite-share 2026-06-15 15:42:19 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: developer/scrabble-game#66