Skip to content

feat(profile): THI-344 — éditer le display_name dans Mon Profil#372

Merged
thierryvm merged 3 commits into
mainfrom
feat/THI-344-profile-edit-displayname
Jun 4, 2026
Merged

feat(profile): THI-344 — éditer le display_name dans Mon Profil#372
thierryvm merged 3 commits into
mainfrom
feat/THI-344-profile-edit-displayname

Conversation

@thierryvm

Copy link
Copy Markdown
Owner

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

  • Section Identité : bouton ModifierInput (shadcn) + Enregistrer / Annuler (Enter sauve, Escape annule).
  • Validation Zod (trim, 1–50) avant supabase.auth.updateUser({ data: { full_name } }). Mutation self-scoped (JWT du caller, 0 surface cross-user). L'event USER_UPDATED rafraîchit le user via AuthContext → le nom se met à jour partout (ProfilePage et menu avatar sidebar) sans refetch.
  • Erreur inline (role=alert + aria-describedby), reste en édition pour réessayer.

Fixs revue visuelle (@Thierry)

  • Contraste : l'Input shadcn embarquait des tokens light (champ blanc sur thème GitHub-dark) → override --github-* (cohérent SupportTicketModal). Fond rgb(1,4,9) + texte clair.
  • Responsive : la carte « Environnement actif » (code existant THI-42) avait un hint 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 !supabase remonté avant setSaving (anti-spinner-bloqué).

Voie A (Chrome MCP, compte test student, desktop + mobile 390px)

Check Résultat
Édition → save persiste (USER_UPDATED) ✅ « Thierry Test E2E » propagé ProfilePage + sidebar
Contraste input (bg sombre + texte clair) ✅ rgb(1,4,9)
Section env empilée propre, hint sous le prompt
Touch targets 44px, overflow horizontal ✅ 0 (desktop + mobile)
Nom du compte test reverté à l'état d'origine ✅ + JWT révoqué

22 tests profilePage (16) + suite 2065 pass. type-check + lint clean. Export + suppression de compte (RGPD danger zone) = THI-345.

🤖 Generated with Claude Code

thierryvm and others added 3 commits June 4, 2026 18:59
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>
@vercel

vercel Bot commented Jun 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
terminal-learning Ready Ready Preview, Comment Jun 4, 2026 5:14pm

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @thierryvm, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@thierryvm thierryvm merged commit 62bdd40 into main Jun 4, 2026
4 checks passed
@thierryvm thierryvm deleted the feat/THI-344-profile-edit-displayname branch June 4, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant