fix: en-tête de la fiche en modification et bouton de connexion de la landing

- Fiche : pastille Édition retirée ; case « Je ne connais pas son prénom » sur une ligne pleine largeur ; badge caméra « Changer la photo » sur le portrait (même choix de source)
- Landing : « Se connecter » en bouton blanc sans contour, icône de profil ; sur téléphone, icône ronde seule avec aria-label

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
IliesAllaliandClaude Haiku 5.5 committed 2026-10-18 22:33:19 +02:00
1 parent 0f6ce774e7
commit 8e1b244a4a
5 files changed
+70 -55

No files matched your search

+16 -5
View File
@@ -35,8 +35,8 @@
.pc-hidden-input { display: none; }
/* ── En-tête ── */
.pc-head { display: flex; gap: 16px; align-items: flex-start; padding-right: 36px; }
.pc-photo-wrap { display: grid; gap: 8px; justify-items: center; flex: none; }
.pc-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px 16px; align-items: start; padding-right: 36px; }
.pc-photo-wrap { position: relative; display: grid; gap: 8px; justify-items: center; flex: none; }
.pc-photo {
width: 84px; height: 84px; border-radius: 24%; overflow: hidden;
background: var(--pz-a100); box-shadow: 0 0 0 1px rgba(42, 38, 34, .06), var(--pz-shadow);
@@ -54,15 +54,26 @@
.pc-photo--add:active:not(:disabled) { transform: scale(.97); }
.pc-photo--add:focus-visible { outline: 2px solid var(--pz-a500); outline-offset: 3px; }
.pc-photo--add:disabled { opacity: .6; cursor: default; }
.pc-photo-actions { display: grid; gap: 4px; justify-items: center; }
/* Menu du choix de source du portrait : au-dessus de la fiche (z-index 1000), sous la modale Immich (2200) */
.pc-source-backdrop { position: fixed; inset: 0; z-index: 1100; }
.pc-source-menu { position: fixed; z-index: 1150; min-width: 220px; }
.pc-photo-badge {
position: absolute; right: -6px; bottom: -6px; z-index: 1;
width: 30px; height: 30px; display: grid; place-items: center; padding: 0;
border: 0; border-radius: 50%; background: #fff; color: var(--pz-ink-2); cursor: pointer;
box-shadow: 0 0 0 1px rgba(42, 38, 34, .06), var(--pz-shadow);
transition: transform 140ms var(--pz-ease), background-color 160ms ease;
-webkit-tap-highlight-color: transparent;
}
@media (hover: hover) and (pointer: fine) { .pc-photo-badge:hover:not(:disabled) { background: var(--pz-a50); color: var(--pz-a700); } }
.pc-photo-badge:active:not(:disabled) { transform: scale(.94); }
.pc-photo-badge:focus-visible { outline: 2px solid var(--pz-a500); outline-offset: 2px; }
.pc-photo-badge:disabled { opacity: .5; cursor: default; }
.pc-photo-btn {
border: 0; background: none; padding: 2px 4px; cursor: pointer;
font: 500 12px var(--pz-sans); color: var(--pz-a700); text-decoration: underline; text-underline-offset: 2px;
}
.pc-photo-btn--danger { color: var(--pz-danger); }
.pc-photo-btn--danger { color: var(--pz-danger); justify-self: center; }
.pc-photo-btn:disabled { opacity: .5; cursor: default; }
.pc-id { display: grid; gap: 6px; min-width: 0; padding-top: 4px; }
@@ -256,6 +267,6 @@
/* Prénom inconnu (issue Anaïs, 18/10) : libellé en italique, case à cocher sous les champs de nom */
.pc-name-unknown { font-style: italic; font-weight: 300; }
.pc-unknown-first { display: inline-flex; align-items: center; gap: 7px; margin-top: 6px; font: 400 13px var(--pz-sans); color: var(--pz-ink-2); cursor: pointer; }
.pc-unknown-first { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin: -4px 0 0; font: 400 12.5px var(--pz-sans); color: var(--pz-ink-2); cursor: pointer; white-space: nowrap; }
.pc-unknown-first input { width: 15px; height: 15px; accent-color: var(--pz-a500); }
.pc-name-error { margin: 6px 0 0; font: 500 12.5px var(--pz-sans); color: var(--pz-danger); }
+39 -41
View File
@@ -1,6 +1,6 @@
import { useState, useEffect, useRef, forwardRef } from 'react'
import { createPortal } from 'react-dom'
import { Save, Trash2, Plus, X, Search, Check, Play, ImagePlus, Sparkles, ChevronLeft, ChevronRight } from 'lucide-react'
import { Save, Trash2, Plus, X, Search, Check, Play, ImagePlus, Camera, Sparkles, ChevronLeft, ChevronRight } from 'lucide-react'
import { getParents, getChildren, getPersonUnions, getPersonMedias, getDemoLife, filiations, persons, unions } from '../data/mockData'
import { fetchPersonLife } from '../api/treeApi.js'
import LifeTimeline from './LifeTimeline.jsx'
@@ -517,29 +517,29 @@ const PersonCard = ({
</div>
)}
{editMode && onAvatarUpload && (
<div className="pc-photo-actions">
<button
ref={sourceBtnRef}
type="button"
className="pc-photo-btn"
onClick={openAvatarPicker}
disabled={avatarActionLoading}
aria-haspopup="menu"
aria-expanded={showSourceMenu}
>
{person.photo ? t('Changer') : t('Ajouter une photo')}
</button>
{person.photo && (
<button
type="button"
className="pc-photo-btn pc-photo-btn--danger"
onClick={() => onAvatarDelete?.(person.id, person.avatarFromImmich)}
disabled={avatarActionLoading}
>
{t('Retirer')}
</button>
)}
</div>
<button
ref={sourceBtnRef}
type="button"
className="pc-photo-badge"
onClick={openAvatarPicker}
disabled={avatarActionLoading}
aria-label={t('Changer la photo')}
title={t('Changer la photo')}
aria-haspopup="menu"
aria-expanded={showSourceMenu}
>
<Camera size={14} strokeWidth={2} aria-hidden="true" />
</button>
)}
{editMode && onAvatarUpload && person.photo && (
<button
type="button"
className="pc-photo-btn pc-photo-btn--danger"
onClick={() => onAvatarDelete?.(person.id, person.avatarFromImmich)}
disabled={avatarActionLoading}
>
{t('Retirer')}
</button>
)}
</div>
@@ -570,22 +570,6 @@ const PersonCard = ({
placeholder={t('Nom')}
aria-label={t('Nom')}
/>
{/* Visible tant que le prénom est vide, et tant qu'elle est cochée (pour pouvoir la décocher) */}
{(unknownFirstName || !String(getEditValue('firstName', person.firstName) ?? '').trim()) && (
<label className="pc-unknown-first">
<input
type="checkbox"
checked={unknownFirstName}
onChange={(e) => {
setUnknownFirstName(e.target.checked)
setFirstNameMissing(false)
setLastNameMissing(false)
handleFieldChange('firstName', '')
}}
/>
{t('Je ne connais pas son prénom')}
</label>
)}
{firstNameMissing && <p className="pc-name-error">{t('Il faut au moins un prénom.')}</p>}
{lastNameMissing && <p className="pc-name-error">{t('Il faut au moins un nom si le prénom est inconnu.')}</p>}
</div>
@@ -606,7 +590,6 @@ const PersonCard = ({
</p>
)}
<div className="pc-chips">
{editMode && <span className="pz-tag pz-tag--accent pz-tag--dot">{t('Édition')}</span>}
{editMode && siblingPlace && (
<span className="pz-tag pc-order" role="group" aria-label={t('Place {n} sur {total} parmi les frères et sœurs', { n: siblingPlace.index + 1, total: siblingPlace.count })}>
<button type="button" className="pc-order-btn" onClick={() => onMoveSibling?.(-1)} disabled={siblingPlace.index === 0} aria-label={t('Déplacer à gauche')} title={t('Déplacer à gauche')}>
@@ -621,6 +604,21 @@ const PersonCard = ({
{!editMode && person.profession && <span className="pz-tag">{person.profession}</span>}
</div>
</div>
{editMode && ((unknownFirstName || !String(getEditValue('firstName', person.firstName) ?? '').trim())) && (
<label className="pc-unknown-first">
<input
type="checkbox"
checked={unknownFirstName}
onChange={(e) => {
setUnknownFirstName(e.target.checked)
setFirstNameMissing(false)
setLastNameMissing(false)
handleFieldChange('firstName', '')
}}
/>
{t('Je ne connais pas son prénom')}
</label>
)}
</header>
{avatarActionError && <div className="pz-error pc-inline-msg">{avatarActionError}</div>}
+1
View File
@@ -19,6 +19,7 @@ export default {
'Fermer la fiche': 'Close profile',
'Changer': 'Change',
'Ajouter une photo': 'Add a photo',
'Changer la photo': 'Change photo',
'Retirer': 'Remove',
'Prénom': 'First name',
'Nom': 'Last name',
+6 -7
View File
@@ -780,14 +780,13 @@ function Header({ t, onCta, loginHref, elevated }) {
{t.nav.privacy && <a href={t.privacyHref}>{t.nav.privacy}</a>}
</nav>
<div className="nav-cta">
{/* Icône « connexion » de Lucide (ISC), tracée à la main : la landing n'embarque pas la bibliothèque */}
<a href={loginHref} className="btn s sm nav-login">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
<path d="M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4" />
<polyline points="10 17 15 12 10 7" />
<line x1="15" x2="3" y1="12" y2="12" />
<a href={loginHref} className="btn s sm nav-login" aria-label={t.nav.login}>
{/* Silhouette de profil, icône « user » de Lucide (ISC), tracée à la main : la landing n'embarque pas la bibliothèque */}
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
<circle cx="12" cy="7" r="4" />
<path d="M4 21v-1a6 6 0 0 1 6-6h4a6 6 0 0 1 6 6v1" />
</svg>
{t.nav.login}
<span className="nav-login-text">{t.nav.login}</span>
</a>
<button type="button" onClick={onCta} className="btn p sm">{t.cta}</button>
</div>
+8 -2
View File
@@ -80,6 +80,9 @@ em.s { font-style: italic; font-weight: 300; }
.nav-in nav { display: flex; gap: 4px; }
.nav-cta { display: flex; align-items: center; gap: 8px; flex: none; }
.nav-login svg { flex: none; }
/* Connexion : fond blanc, sans contour, même hauteur que « Créer mon arbre » (btn sm) */
.btn.s.nav-login { background: #fff; color: var(--encre); box-shadow: none; }
@media (hover: hover) and (pointer: fine) { .btn.s.nav-login:hover { background: var(--a50); } }
.nav-in nav a {
font: 500 14px var(--sans); color: var(--encre2); text-decoration: none;
padding: 8px 12px; border-radius: 999px; transition: background-color 160ms ease;
@@ -239,8 +242,11 @@ html.logo-intro .lk-nom { animation: lk-nom 700ms var(--ease-out) 380ms both; }
@media (max-width: 820px) {
.steps, .promise, .guides { grid-template-columns: 1fr; }
.nav-in nav { display: none; }
/* Téléphone : la connexion reste au pied de page, l'en-tête garde la place du bouton de création */
.nav-login { display: none; }
/* Téléphone : icône de profil ronde à gauche de « Créer mon arbre », le texte passe en aria-label */
.btn.s.nav-login { width: 34px; height: 34px; padding: 0; border-radius: 50%; }
.nav-in { gap: 10px; }
.nav-cta { gap: 6px; }
.nav-login-text { display: none; }
}
@media (max-width: 560px) {
.hero { padding-top: 8px; }