Landing v2: icon switchers, ephemeral theme, channel link, drop browser CTA
CI / changes (pull_request) Successful in 1s
CI / unit (pull_request) Successful in 7s
CI / integration (pull_request) Successful in 10s
CI / ui (pull_request) Successful in 32s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m6s

Owner review-pass rework of the landing page:
- Rename the per-language Telegram link build var
  VITE_TELEGRAM_LINK_EN/_RU -> VITE_TELEGRAM_GAME_CHANNEL_NAME_EN/_RU
  (it carries a channel username; the landing builds https://t.me/<name> --
  the same channels the connector posts to via TELEGRAM_GAME_CHANNEL_ID_*).
- Language switcher -> a globe icon dropdown (flags + names), saved + synced
  to the app prefs.
- Theme switcher -> a sun/moon icon toggle, ephemeral (follows the system
  scheme, no auto, never persisted) -- galaxy-game style.
- Drop the "Play in browser" CTA (no standalone-web onboarding yet).

Docs: FUNCTIONAL(+ru), PLAN, deploy + ui READMEs.
This commit is contained in:
Ilia Denisov
2026-06-08 16:40:07 +02:00
parent 5928be40b0
commit 3fd279cf8c
15 changed files with 167 additions and 136 deletions
+14 -7
View File
@@ -1,14 +1,21 @@
import { expect, test } from './fixtures';
// The landing page is a separate Vite entry (landing.html), served at "/" in production while
// the game SPA moves to /app/ and /telegram/ (Stage 17). In dev it is reachable at /landing.html.
test('landing shows the pitch, a browser CTA to /app/, and switches language', async ({ page }) => {
// the game SPA lives at /app/ and /telegram/ (Stage 17). In dev it is reachable at /landing.html.
test('landing shows the pitch, switches language via the dropdown, and toggles theme', async ({ page }) => {
await page.goto('/landing.html');
// The primary call to action opens the web app mount.
await expect(page.getByRole('link', { name: /Play in browser/i })).toHaveAttribute('href', '/app/');
// The tagline renders (English in the default test browser).
await expect(page.getByText(/Play Scrabble/i)).toBeVisible();
// The language switch flips the copy to Russian (reusing the app i18n).
await page.getByRole('button', { name: 'Русский' }).click();
await expect(page.getByRole('link', { name: /Играть в браузере/ })).toBeVisible();
// The language dropdown switches the copy to Russian.
await page.getByRole('button', { name: 'Language' }).click();
await page.getByRole('menuitem', { name: /Русский/ }).click();
await expect(page.getByText(/Играй в Скрэббл/)).toBeVisible();
// The theme toggle flips the document theme (ephemeral, light<->dark).
const before = await page.evaluate(() => document.documentElement.getAttribute('data-theme'));
await page.getByRole('button', { name: 'Theme' }).click();
const after = await page.evaluate(() => document.documentElement.getAttribute('data-theme'));
expect(after).not.toBe(before);
});