feat(profile): THI-344 — éditer le display_name dans Mon Profil#372
Merged
Conversation
The Profile Hub shell (THI-42 #255) was read-only. Make the display_name editable inline: - Section Identité: "Modifier" button → Input (shadcn) + Enregistrer/Annuler. - Zod validation (trim, 1–50 chars) before calling supabase.auth.updateUser ({ data: { full_name } }). updateUser acts on the caller's own JWT (no cross-user surface); the emitted USER_UPDATED event refreshes the user via AuthContext, so the name re-renders without a manual refetch. - Error surfaced inline (role=alert), stays in edit mode to retry. - Enter saves, Escape cancels. Hooks hoisted above the auth guard (rules-of-hooks). 6 new tests (enter/save/trim/empty-reject/cancel/error). 2065 tests pass, type-check + lint clean. Export + account deletion (RGPD danger zone) = THI-345. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- H1: link the error <p role=alert> via id + aria-describedby on the Input
(WCAG 1.3.1/4.1.3 — screen readers announce the error in form mode).
- H2: inline-edit buttons min-h-9 → min-h-11 (44px, aligns with the project's
touch-target convention instead of 36px).
- W2/W3: autoComplete="name" + spellCheck={false} on the name Input.
Kept variant="ghost" (W1 — consistent with UserMenu, className overrides cover it).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…nv (THI-344) - code-reviewer: resolve supabase client + guard BEFORE setSaving(true) so the spinner can't get stuck if the early return path is taken (was correct via finally but fragile to refactor). - @Thierry visual review: the shadcn Input shipped light-mode tokens (white field on the GitHub-dark theme). Override bg/text/border with --github-* vars to match the other fields (cf. SupportTicketModal). Contrast fixed. - @Thierry visual review: the "Environnement actif" card used a right-aligned shrink-0 hint that collided with the wrapped shell/prompt text at 390px. Stack it under the prompt (break-words) + reword "barre latérale" (the sidebar is a drawer on mobile). Desktop unaffected (overflow 0 both viewports). Voie A validated: edit save persists (USER_UPDATED refresh), dark contrast + env layout clean on desktop + mobile 390px. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Sorry @thierryvm, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
THI-344 — Mon Profil : édition du display_name (reliquat THI-42 PR-A)
Le Profile Hub (THI-42 #255) était read-only. Cette PR rend le nom affiché éditable + corrige 2 défauts visuels remontés en revue.
Édition
Input(shadcn) + Enregistrer / Annuler (Enter sauve, Escape annule).supabase.auth.updateUser({ data: { full_name } }). Mutation self-scoped (JWT du caller, 0 surface cross-user). L'eventUSER_UPDATEDrafraîchit le user viaAuthContext→ le nom se met à jour partout (ProfilePage et menu avatar sidebar) sans refetch.role=alert+aria-describedby), reste en édition pour réessayer.Fixs revue visuelle (@Thierry)
Inputshadcn embarquait des tokens light (champ blanc sur thème GitHub-dark) → override--github-*(cohérent SupportTicketModal). Fondrgb(1,4,9)+ texte clair.shrink-0à droite qui chevauchait le texte shell/prompt wrappé à 390px → empilé sous le prompt (break-words) + reformulé « barre latérale ».Gates — tous passés
security-auditor: 9.5/10, 0 CRITICAL/HIGH (mutation self-scoped, rendu React-escaped).ui-auditor: H1 aria-describedby + H2 touch targets 44px + autoComplete/spellCheck corrigés.feature-dev:code-reviewer: guard!supabaseremonté avantsetSaving(anti-spinner-bloqué).Voie A (Chrome MCP, compte test student, desktop + mobile 390px)
22 tests profilePage (16) + suite 2065 pass. type-check + lint clean. Export + suppression de compte (RGPD danger zone) = THI-345.
🤖 Generated with Claude Code