From f1ecb3951c4393131e702149b68d0dc461991d28 Mon Sep 17 00:00:00 2001 From: IliesAllali Date: Sun, 18 Oct 2026 20:05:18 +0200 Subject: [PATCH] =?UTF-8?q?fix(entree):=20connexion=20visible,=20porte=20q?= =?UTF-8?q?ui=20reconna=C3=AEt=20le=20compte,=20libell=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Démo : le bouton « Se connecter » ouvre la connexion, plus l'inscription - Porte de l'arbre : quand la personne est connectée, un bandeau dit quel compte est ouvert et qu'il faut taper une fois le mot de passe reçu avec le lien. Il reste affiché au retour d'une connexion faite depuis la porte. - Landing : lien « Se connecter » dans la navigation et le pied de page (vers ?account=login, sans source, le rendu au build n'a pas de window) - Libellés de la porte et de l'inscription, en français et en anglais Vérifié : vitest 154/154, eslint frontend, vite build, landing (test et build). La landing n'a pas de configuration eslint dans le dépôt. Co-Authored-By: Claude Haiku 5.5 --- frontend/src/App.jsx | 2 ++ frontend/src/components/AccessGate.jsx | 31 ++++++++++++++----- frontend/src/components/AccountDashboard.jsx | 6 ++-- frontend/src/components/AccountScreens.css | 4 +++ .../components/navbar/ContextualNavbar.jsx | 2 +- frontend/src/i18n/en/compte.js | 12 +++++++ landing/src/App.jsx | 8 +++-- landing/src/i18n.js | 6 ++-- 8 files changed, 56 insertions(+), 15 deletions(-) diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 07f2d45..ec7b175 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -2751,6 +2751,8 @@ function App() { treeNotFound={treeNotFound} loading={tree.gateLoading} errorMessage={tree.gateError} + connected={Boolean(auth.userAuth.token)} + connectedName={accountUser?.firstName || ''} onSubmit={handleGateUnlock} onUseDemo={handleUseDemo} onUseAccount={handleUseAccount} diff --git a/frontend/src/components/AccessGate.jsx b/frontend/src/components/AccessGate.jsx index 7631818..623bb03 100644 --- a/frontend/src/components/AccessGate.jsx +++ b/frontend/src/components/AccessGate.jsx @@ -23,6 +23,8 @@ const AccessGate = ({ treeNotFound = false, loading, errorMessage, + connected = false, + connectedName = '', onSubmit, onUseAccount, }) => { @@ -86,6 +88,21 @@ const AccessGate = ({ {!treeNotFound && (
+ {connected && ( +
+ {connectedName ? ( + /^[aeiouyàâäéèêëîïôöùûüh]/i.test(connectedName) + ? t("Vous êtes sur le compte d'{name}", { name: connectedName }) + : t('Vous êtes sur le compte de {name}', { name: connectedName }) + ) : ( + t('Vous êtes sur votre compte.') + )} + + {t("Tapez une fois le mot de passe reçu avec le lien. Ensuite, l'arbre s'ouvrira directement.")} + +
+ )} + {!initialTreeId && (
@@ -103,7 +120,7 @@ const AccessGate = ({ )}
- + -

{t("Facultatif. Il sert à savoir qui est venu voir l'arbre.")}

+

{t("Il sert à savoir qui est venu voir l'arbre.")}

- + - {t("Ouvrir l'arbre")} + {t("Voir l'arbre")} )} {treeNotFound && onUseAccount && ( )} @@ -149,10 +166,10 @@ const AccessGate = ({ {onUseAccount && !treeNotFound && (
)} diff --git a/frontend/src/components/AccountDashboard.jsx b/frontend/src/components/AccountDashboard.jsx index 6271e33..e1ee503 100644 --- a/frontend/src/components/AccountDashboard.jsx +++ b/frontend/src/components/AccountDashboard.jsx @@ -203,19 +203,19 @@ const AccountDashboard = ({ disabled={loading} >

- {isRegister ? t('Vous avez déjà un compte ?') : t('Pas encore de compte ?')}{' '} + {isRegister ? t('Déjà inscrit ?') : t('Pas encore de compte ?')}{' '}

diff --git a/frontend/src/components/AccountScreens.css b/frontend/src/components/AccountScreens.css index 0058537..9b5f6aa 100644 --- a/frontend/src/components/AccountScreens.css +++ b/frontend/src/components/AccountScreens.css @@ -41,6 +41,10 @@ .pz-gate-owner-text { display: grid; gap: 2px; min-width: 0; } .pz-gate-owner-text strong { color: var(--pz-ink); font-weight: 500; } +/* Porte, personne déjà connectée : dit quel compte est ouvert et ce qu'il faut faire une fois */ +.access-gate-session { display: grid; gap: 4px; padding: 12px 14px; border-radius: var(--pz-r-m); background: var(--pz-a50); border: 1px solid var(--pz-a100); color: var(--pz-ink); font: 400 14px/1.45 var(--pz-sans); } +.access-gate-session-step { color: var(--pz-ink-2); } + /* Fenêtre « Mon compte » (personne liée) */ .ap-linked { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--pz-r-m); background: var(--pz-a50); border: 1px solid var(--pz-a100); } .ap-avatar { width: 44px; height: 44px; flex: none; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--pz-a100); color: var(--pz-a700); font: 400 20px/1 var(--pz-serif); } diff --git a/frontend/src/components/navbar/ContextualNavbar.jsx b/frontend/src/components/navbar/ContextualNavbar.jsx index eee10eb..fa18e99 100644 --- a/frontend/src/components/navbar/ContextualNavbar.jsx +++ b/frontend/src/components/navbar/ContextualNavbar.jsx @@ -307,7 +307,7 @@ function ContextualNavbar({ } label={authenticated ? t('Mon compte') : t('Se connecter')} - onClick={() => onProfileClick?.(authenticated ? 'login' : 'register')} + onClick={() => onProfileClick?.('login')} /> ) diff --git a/frontend/src/i18n/en/compte.js b/frontend/src/i18n/en/compte.js index 90ea2bf..38ed6cc 100644 --- a/frontend/src/i18n/en/compte.js +++ b/frontend/src/i18n/en/compte.js @@ -205,4 +205,16 @@ export default { "Visiteur": "Visitor", "Exemple": "Example", "Arbre exemple": "Sample tree", + "Votre prénom (facultatif)": "Your first name (optional)", + "Il sert à savoir qui est venu voir l'arbre.": "It shows who came to see the tree.", + "Mot de passe reçu avec le lien": "Password received with the link", + "Créer mon propre arbre": "Create my own tree", + "J'ai déjà un compte": "I already have an account", + "Je n'ai pas de compte": "I don't have an account", + "J'ai reçu un lien de famille": "I received a family link", + "Déjà inscrit ?": "Already signed up?", + "Vous êtes sur le compte d'{name}": "You are signed in as {name}", + "Vous êtes sur le compte de {name}": "You are signed in as {name}", + "Vous êtes sur votre compte.": "You are signed in to your account.", + "Tapez une fois le mot de passe reçu avec le lien. Ensuite, l'arbre s'ouvrira directement.": "Enter the password you received with the link once. After that, the tree opens directly.", } diff --git a/landing/src/App.jsx b/landing/src/App.jsx index a81c5b7..b316f59 100644 --- a/landing/src/App.jsx +++ b/landing/src/App.jsx @@ -769,7 +769,7 @@ function HeroGraph({ className = '', label }) { // ─── Header ─────────────────────────────────────────────────────────────────── -function Header({ t, onCta, elevated }) { +function Header({ t, onCta, loginHref, elevated }) { return (
@@ -778,6 +778,7 @@ function Header({ t, onCta, elevated }) { {t.nav.how} {t.nav.demo} {t.nav.privacy && {t.nav.privacy}} + {t.nav.login}
@@ -910,6 +911,8 @@ const appSource = () => { // Les CTA mènent à la création de compte dans l'app const appSignupUrl = () => `https://app.parenthese.io/?account=register&source=${appSource()}` +// Un compte déjà créé : la connexion, pas l'inscription (sans source : rendu au build, pas de window) +const appLoginUrl = () => 'https://app.parenthese.io/?account=login' export default function App({ locale = 'fr' }) { const t = COPY[locale] @@ -985,7 +988,7 @@ export default function App({ locale = 'fr' }) { return (
-
goToSignup('header')} elevated={headerElevated} /> +
goToSignup('header')} loginHref={withAppQuery(appLoginUrl(), locale)} elevated={headerElevated} />
{/* ─── HERO ────────────────────────────────────────────────────── */} @@ -1122,6 +1125,7 @@ export default function App({ locale = 'fr' }) {