fix(ui): use the guest stubs' "sign in" wording, and link it in Stats
CI / changes (pull_request) Successful in 3s
CI / unit (pull_request) Successful in 11s
CI / integration (pull_request) Successful in 21s
CI / ui (pull_request) Successful in 1m15s
CI / conformance (pull_request) Successful in 10s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m57s

The New Game hint said "Register" where the Stats and Profile guest stubs say
"Sign in". Move the shared word into common.signInLink so the two screens
cannot drift, and turn the Stats stub's opening word into the same link to the
profile screen.
This commit is contained in:
Ilia Denisov
2026-07-27 20:45:10 +02:00
parent b6d88da78c
commit c3d36dda2d
9 changed files with 39 additions and 19 deletions
+4 -3
View File
@@ -396,11 +396,12 @@
</button>
{/each}
</div>
<!-- A guest is offered Erudit alone; registering widens the account to both Russian games
(and Settings then offers English), so point them at the profile screen. -->
<!-- A guest is offered Erudit alone; signing in widens the account to both Russian games
(and Settings then offers English), so point them at the profile screen — the same
wording and link the Stats guest stub uses. -->
{#if showRegisterHint(guest, variants.length, offlineMode.active)}
<p class="guesthint">
<button class="hintlink" onclick={() => navigate('/profile')}>{t('new.guestVariantHintLink')}</button>{t('new.guestVariantHint')}
<button class="hintlink" onclick={() => navigate('/profile')}>{t('common.signInLink')}</button>{t('new.guestVariantHint')}
</p>
{/if}
{#if variants.some((v) => supportsMultipleWordsToggle(v.id))}
+16 -1
View File
@@ -4,6 +4,7 @@
import WordTiles from '../components/WordTiles.svelte';
import { app, handleError } from '../lib/app.svelte';
import { gateway } from '../lib/gateway';
import { navigate } from '../lib/router.svelte';
import { t, i18n, type MessageKey } from '../lib/i18n/index.svelte';
import { gamesPlayed, hintSharePercent, winRate } from '../lib/stats';
import { ALL_VARIANTS, variantNameKey } from '../lib/variants';
@@ -56,7 +57,11 @@
<Screen title={t('stats.title')} back="/">
<div class="page">
{#if app.profile?.isGuest}
<p class="muted">{t('stats.guestHint')}</p>
<!-- The opening word links to the profile screen, where a guest signs in (the same wording
and link New Game shows a guest under its lone variant). -->
<p class="muted">
<button class="hintlink" onclick={() => navigate('/profile')}>{t('common.signInLink')}</button>{t('stats.guestHint')}
</p>
{:else if stats}
<div class="grid">
{#each cards as c (c.key)}
@@ -89,6 +94,16 @@
.muted {
color: var(--text-muted);
}
/* The inline link-styled button opening the guest stub (mirrors New Game's .hintlink). */
.hintlink {
background: none;
border: none;
padding: 0;
color: var(--accent);
font: inherit;
text-decoration: underline;
cursor: pointer;
}
.grid {
display: grid;
grid-template-columns: repeat(2, 1fr);