Stage 8 polish: profile validation, finished-game UI, badge + Safari fixes
Owner-review follow-up on the Stage 8 branch: - Friend code is copyable (📋 + toast). The lobby notification badge is fixed — it had inherited the hamburger-bar style — into a proper round count dot. - Safari: min-width:0 on flex text inputs (friend code, profile, chat) so they shrink instead of pushing the adjacent button off-screen. - Profile editing is validated on both the UI and the backend: display-name format (letters joined by single space/./_ separators, no leading/trailing/adjacent separators, <=32 runes), a UTC-offset timezone picker (account.ResolveZone parses ±HH:MM or a legacy IANA name), a 10-minute away grid capped at 12h (wrap-aware), and email format; Save is disabled and invalid fields red-bordered until valid. Language stays in Settings. - In a game, an "add to friends" menu item flips to a disabled "request sent"; chat send/nudge became ⬆️/🛎️ icon buttons. - A finished game drops its last-word highlight, hides Check word / Drop game, disables zoom, and draws an inert (greyed) footer instead of hiding it. Tests: account validators (name/away/zone), UI profileValidation, e2e for the finished-game footer/menu and the copy control. Docs (PLAN, ARCHITECTURE, FUNCTIONAL +ru, UI_DESIGN) updated for the display-name rule, UTC-offset timezone and the 12h away window.
This commit is contained in:
+14
-1
@@ -19,9 +19,10 @@ test('friends: issue a code, accept an incoming request, redeem a code', async (
|
||||
await loginLobby(page);
|
||||
await openFriends(page);
|
||||
|
||||
// Issue a one-time code — it is shown to share.
|
||||
// Issue a one-time code — it is shown to share, with a copy control.
|
||||
await page.getByRole('button', { name: /Show my code/i }).click();
|
||||
await expect(page.getByTestId('friend-code')).toContainText('246813');
|
||||
await expect(page.getByRole('button', { name: 'Copy' })).toBeVisible();
|
||||
|
||||
// The seeded incoming request (Rick) can be accepted; the requests section clears.
|
||||
await expect(page.getByText('Friend requests')).toBeVisible();
|
||||
@@ -73,3 +74,15 @@ test('GCG export is hidden for an active game', async ({ page }) => {
|
||||
await page.locator('.burger').first().click();
|
||||
await expect(page.getByRole('button', { name: /Export GCG/ })).toHaveCount(0);
|
||||
});
|
||||
|
||||
test('finished game draws an inert footer and trims the live-only menu', async ({ page }) => {
|
||||
await loginLobby(page);
|
||||
await page.getByRole('button', { name: /Kaya/ }).click(); // finished game vs Kaya
|
||||
await expect(page.locator('[data-cell]').first()).toBeVisible();
|
||||
// The footer (tab bar) is drawn but its controls are disabled in a finished game.
|
||||
await expect(page.locator('.tab').first()).toBeDisabled();
|
||||
// The menu drops Check word and Drop game once the game is over.
|
||||
await page.locator('.burger').first().click();
|
||||
await expect(page.getByRole('button', { name: 'Check word' })).toHaveCount(0);
|
||||
await expect(page.getByRole('button', { name: 'Drop game' })).toHaveCount(0);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user