Repository: VTuber-Rally/stamp-rally-app
Pull request #59: Nouvelle page settings + nom d'utilisateur changeable
Author: login: luclu7
Created: 2025-03-29T23:37:35Z | Merged: 2025-03-30T19:39:36Z

Closes #57 

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Introduced an interactive username update form on the settings page, complete with immediate success and error notifications and a loading indicator.
  - Enhanced button actions to offer a more responsive and flexible experience.
  - Updated localised messages in English and French, including a new "Account" label and clear feedback on username updates.

- **Style**
  - Refined the presentation of French localisation strings with improved spacing and punctuation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Linked issue #57: Que les rallyistes puissent modifier leur pseudo

Diff:
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 61311ef9..2daa59f4 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -64,6 +64,9 @@ importers:
       '@fontsource-variable/comfortaa':
         specifier: ^5.1.1
         version: 5.1.1
+      '@hookform/resolvers':
+        specifier: ^4.1.3
+        version: 4.1.3(react-hook-form@7.54.2(react@18.3.1))
       '@radix-ui/react-checkbox':
         specifier: ^1.1.3
         version: 1.1.3(@types/react-dom@18.3.5(@types/react@18.3.18))(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
@@ -1229,6 +1232,11 @@ packages:
   '@fontsource-variable/comfortaa@5.1.1':
     resolution: {integrity: sha512-ZuwxmA5ccVvTwl1bByhVHyxbROtg0Lk/cCB+f41LgKB/9dUAPj8wFFxN+oCWy702tsnzORtL86aSX6VVMYt12g==}
 
+  '@hookform/resolvers@4.1.3':
+    resolution: {integrity: sha512-Jsv6UOWYTrEFJ/01ZrnwVXs7KDvP8XIo115i++5PWvNkNvkrsTfGiLS6w+eJ57CYtUtDQalUWovCZDHFJ8u1VQ==}
+    peerDependencies:
+      react-hook-form: ^7.0.0
+
   '@humanfs/core@0.19.1':
     resolution: {integrity: sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==}
     engines: {node: '>=18.18.0'}
@@ -1867,6 +1875,9 @@ packages:
     resolution: {integrity: sha512-E2elyHjP3Wqnk2uXr9C17jHRQBKX8jEOpzOnEOiXYDI2FBfehs9ttj9yX1I7H8ofCiqO2EsTu5r2a0C26ZWi+w==}
     engines: {node: '>= 14'}
 
+  '@standard-schema/utils@0.3.0':
+    resolution: {integrity: sha512-e7Mew686owMaPJVNNLs55PUvgz371nKgwsc4vxE49zsODpJEnxgxRo2y/OKrqueavXgZNMDVj3DdHFlaSAeU8g==}
+
   '@stevent-team/react-party@0.3.3':
     resolution: {integrity: sha512-gua3gLxmmqatENBgyXxoMY3SPRP5TSn2Rbn5ojXGYaZ+lAiBFeMCs6UK3fMF3nZEZZWZpzxssL6s6x/ufak5PQ==}
     peerDependencies:
@@ -5974,6 +5985,11 @@ snapshots:
 
   '@fontsource-variable/comfortaa@5.1.1': {}
 
+  '@hookform/resolvers@4.1.3(react-hook-form@7.54.2(react@18.3.1))':
+    dependencies:
+      '@standard-schema/utils': 0.3.0
+      react-hook-form: 7.54.2(react@18.3.1)
+
   '@humanfs/core@0.19.1': {}
 
   '@humanfs/node@0.16.6':
@@ -6581,6 +6597,8 @@ snapshots:
       - encoding
       - supports-color
 
+  '@standard-schema/utils@0.3.0': {}
+
   '@stevent-team/react-party@0.3.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1)':
     dependencies:
       react: 18.3.1
diff --git a/web/package.json b/web/package.json
index d511870c..0d1f78bb 100644
--- a/web/package.json
+++ b/web/package.json
@@ -17,6 +17,7 @@
   },
   "dependencies": {
     "@fontsource-variable/comfortaa": "^5.1.1",
+    "@hookform/resolvers": "^4.1.3",
     "@radix-ui/react-checkbox": "^1.1.3",
     "@radix-ui/react-dialog": "^1.1.4",
     "@radix-ui/react-switch": "^1.1.2",
diff --git a/web/src/components/controls/ButtonLink.tsx b/web/src/components/controls/ButtonLink.tsx
index 3e8be3fd..abdab845 100644
--- a/web/src/components/controls/ButtonLink.tsx
+++ b/web/src/components/controls/ButtonLink.tsx
@@ -2,31 +2,38 @@ import { Link } from "@tanstack/react-router";
 import clsx from "clsx";
 import type { FC, MouseEventHandler, ReactNode } from "react";
 
-export type ButtonLinkProps = {
+type BaseButtonLinkProps = {
   children: ReactNode;
-  href: string;
-  onClick?: never;
   size?: "small" | "medium" | "big";
   bg?: "secondary" | "tertiary" | "success-orange" | "dangerous";
-  type?: "link";
   disabled?: boolean;
-  target?: string;
   className?: string;
 };
 
-export type ButtonLinkButtonProps = {
-  children: ReactNode;
+export type ButtonLinkProps = BaseButtonLinkProps & {
+  href: string;
+  onClick?: never;
+  type?: "link";
+  target?: string;
+};
+
+export type ButtonLinkButtonProps = BaseButtonLinkProps & {
   href?: never;
   onClick: MouseEventHandler<HTMLButtonElement>;
-  size?: "small" | "medium" | "big";
-  bg?: "secondary" | "tertiary" | "success-orange" | "dangerous";
   type: "button";
-  disabled?: boolean;
   target?: never;
-  className?: string;
 };
 
-export const ButtonLink: FC<ButtonLinkProps | ButtonLinkButtonProps> = ({
+export type ButtonLinkSubmitProps = BaseButtonLinkProps & {
+  href?: never;
+  onClick?: never;
+  type: "submit";
+  target?: never;
+};
+
+export const ButtonLink: FC<
+  ButtonLinkProps | ButtonLinkButtonProps | ButtonLinkSubmitProps
+> = ({
   children,
   href,
   onClick,
@@ -50,12 +57,13 @@ export const ButtonLink: FC<ButtonLinkProps | ButtonLinkButtonProps> = ({
     className,
   );
 
-  if (type === "button") {
+  if (type === "button" || type === "submit") {
     return (
       <button
         className={combinedClassName}
         onClick={onClick}
         disabled={disabled}
+        type={type}
       >
         {children}
       </button>
diff --git a/web/src/i18n/en.json b/web/src/i18n/en.json
index a36a0069..4b85d8ee 100644
--- a/web/src/i18n/en.json
+++ b/web/src/i18n/en.json
@@ -6,6 +6,7 @@
   },
   "QRRenewNotice": "This QR renews itself automatically.",
   "aboutText": "Built with ❤️ by <1>Leon</1> and <2>Lucie</2>",
+  "account": "Account",
   "alreadyHaveAccount": "Already have an account?",
   "alreadySubmitted": "Submitted on {{date}}",
   "anonymousLogoutButton": "Log out (warning, you will lose your submission history!)",
@@ -102,7 +103,11 @@
   },
   "scanThisQR": "Scan this QR code to get the stamp!",
   "settings": {
-    "title": "Settings"
+    "title": "Settings",
+    "usernameEmpty": "Your username can't be empty",
+    "usernameTooLong": "Your username can't be more than 50 characters long",
+    "usernameUpdateFailed": "Failed to update username",
+    "usernameUpdated": "Your username has been successfully updated"
   },
   "showThisQRCodeToSubmit": "Show this QR Code to Sedeto's staff (in Hall 6, Q652) to get your reward!",
   "staffSpace": "Staff space",
diff --git a/web/src/i18n/fr.json b/web/src/i18n/fr.json
index 29abf3f2..eb56cc17 100644
--- a/web/src/i18n/fr.json
+++ b/web/src/i18n/fr.json
@@ -6,7 +6,8 @@
   },
   "QRRenewNotice": "Ce QR se renouvelle automatiquement.",
   "aboutText": "Développé avec le ❤️ par <1>Leon</1> et <2>Lucie</2>",
-  "alreadyHaveAccount": "Vous avez déjà créé compte ?",
+  "account": "Compte",
+  "alreadyHaveAccount": "Vous avez déjà créé compte ?",
   "alreadySubmitted": "Soumis le {{date}}",
   "anonymousLogoutButton": "Se déconnecter (attention, vous perdrez votre historique de soumissions !)",
   "anonymousLogoutWarning": "Vous êtes connecté·e en tant qu'<1>utilisateur anonyme</1>. Vous perdrez vos anciennes soumissions si vous vous déconnectez.",
@@ -18,11 +19,11 @@
   "artists": "Artistes",
   "checkSubmit": "Vérifier un rally",
   "close": "Fermer",
-  "consentToSaveEmail": "Je veux être au courant des prochains rallys !",
+  "consentToSaveEmail": "Je veux être au courant des prochains rallys !",
   "description": "Description",
   "email": "Email",
   "error": "Une erreur est survenue",
-  "errorCreatingAccount": "Erreur lors de la création du compte. Est-ce que l'email est déjà utilisé ?",
+  "errorCreatingAccount": "Erreur lors de la création du compte. Est-ce que l'email est déjà utilisé ?",
   "errors": {
     "notAStandist": "Vous ne semblez pas être standiste. Si vous l'êtes, cela signifie qu'il y a une erreur quelque part. Contactez le staff si c'est le cas !"
   },
@@ -76,10 +77,10 @@
   "qrcode": "QR Code",
   "rally.1": "17 artistes participent à ce rallye autour des VTubers",
   "rally.2": "Après un achat (minimum 2€) chez un artiste, vous pourrez scanner un QR code",
-  "rally.3": "Une fois {{minimumStampsCount}} tampons obtenus, rendez-vous au stand de Sedeto pour récupérer une récompense !",
+  "rally.3": "Une fois {{minimumStampsCount}} tampons obtenus, rendez-vous au stand de Sedeto pour récupérer une récompense !",
   "rally.4": "Dès que vous avec une participation validée, participez au concours pour gagner un shikishi de Sedeto !",
-  "rally.5": "Vous pouvez rejouer autant de fois que vous le souhaitez !",
-  "rally.6": "Vous pouvez étaler votre rally sur plusieurs jours de la convention !",
+  "rally.5": "Vous pouvez rejouer autant de fois que vous le souhaitez !",
+  "rally.6": "Vous pouvez étaler votre rally sur plusieurs jours de la convention !",
   "redeemedSubmissions": "Soumissions déjà validées",
   "requestYourReward": "Demandez votre récompense !",
   "rules": "Règles",
@@ -93,16 +94,20 @@
   "rules.8": "Vous pouvez recommencer plusieurs fois le rally :)",
   "rules.9": "Si nous rencontrons de gros soucis, ces règles peuvent être ajustées pour que le rally puisse continuer de fonctionner de la façon la plus plaisante et équitable pour toustes.",
   "save": "Enregistrer",
-  "saveSubmissionQuestion": "Souhaitez-vous sauvegarder vos soumissions ?",
+  "saveSubmissionQuestion": "Souhaitez-vous sauvegarder vos soumissions ?",
   "scanQRCode": "Scanner un QR code",
   "scanQRDrawer": {
     "description": "Ajoutez un tampon dans votre collection en scannant le code fourni par l'artiste !",
     "title": "Scannez un QR Code",
     "nativeCameraHint": "En cas de difficultés, vous pouvez utiliser l'application Caméra de votre appareil pour tenter de scanner le QR code."
   },
-  "scanThisQR": "Scannez ce QR pour récupérer le tampon !",
+  "scanThisQR": "Scannez ce QR pour récupérer le tampon !",
   "settings": {
-    "title": "Paramètres"
+    "title": "Paramètres",
+    "usernameEmpty": "Votre nom d'utilisateur ne peut pas être vide",
+    "usernameTooLong": "Votre nom d'utilisateur ne peut pas faire plus de 50 caractères",
+    "usernameUpdateFailed": "Le changement de nom d'utilisateur a échoué",
+    "usernameUpdated": "Votre nom d'utilisateur a été mis à jour avec succès"
   },
   "showThisQRCodeToSubmit": "Montrez ce QR code au staff du stand de Sedeto (dans le Hall 6, Q652) pour pouvoir récupérer votre récompense !",
   "staffSpace": "Espace staff",
@@ -114,15 +119,15 @@
     "summary": "Détails du tampon"
   },
   "stampValidated": "Tampon validé !",
-  "stampsCount_one": "{{count}} tampon collecté sur {{maxCount}} !",
-  "stampsCount_other": "{{count}} tampons collectés sur {{maxCount}} !",
+  "stampsCount_one": "{{count}} tampon collecté sur {{maxCount}} !",
+  "stampsCount_other": "{{count}} tampons collectés sur {{maxCount}} !",
   "stand": "Stand de {{name}}",
   "standistSpace": "Espace standistes",
   "submission": "Soumission {{id}}",
   "submissions": "Soumissions",
   "submit": "Soumission",
   "submitNotAllowed": "Vous devez scanner au moins {{stamps}} tampons.",
-  "submitStamps": "Soumettez vos tampons collectés ici !",
+  "submitStamps": "Soumettez vos tampons collectés ici !",
   "submitTerms": "Ce code ne périme pas, vous pouvez récupérer votre récompense n'importe quel jour de la convention pour récupérer des cartes qui ne sont plus en stock pour la journée.",
   "submittedAgo": "Soumis {{time}}",
   "submitting": "Soumission en cours…",
diff --git a/web/src/lib/hooks/useUpdateUsername.ts b/web/src/lib/hooks/useUpdateUsername.ts
new file mode 100644
index 00000000..91a410e3
--- /dev/null
+++ b/web/src/lib/hooks/useUpdateUsername.ts
@@ -0,0 +1,33 @@
+import { useMutation } from "@tanstack/react-query";
+import { useTranslation } from "react-i18next";
+
+import { useToast } from "@/lib/hooks/useToast";
+import { useUser } from "@/lib/hooks/useUser";
+
+export function useUpdateUsername() {
+  const { user, setName } = useUser();
+  const { t } = useTranslation();
+  const { toast } = useToast();
+
+  const { mutate, isPending } = useMutation({
+    mutationFn: async (username: string) => {
+      if (!user) {
+        throw new Error("User not found");
+      }
+
+      await setName(username);
+    },
+    onSuccess: () => {
+      toast({
+        title: t("settings.usernameUpdated"),
+      });
+    },
+    onError: () => {
+      toast({
+        title: t("settings.usernameUpdateFailed"),
+      });
+    },
+  });
+
+  return { updateUsername: mutate, isPending };
+}
diff --git a/web/src/routes/_rallyists/_withUserProviderNoAutoAnonymous/settings.tsx b/web/src/routes/_rallyists/_withUserProviderNoAutoAnonymous/settings.tsx
index c89db165..ebc2b997 100644
--- a/web/src/routes/_rallyists/_withUserProviderNoAutoAnonymous/settings.tsx
+++ b/web/src/routes/_rallyists/_withUserProviderNoAutoAnonymous/settings.tsx
@@ -1,17 +1,23 @@
+import { zodResolver } from "@hookform/resolvers/zod";
 import { createFileRoute } from "@tanstack/react-router";
 import i18n from "i18next";
 import { useState } from "react";
+import { useForm } from "react-hook-form";
 import { useTranslation } from "react-i18next";
+import { z } from "zod";
 
 import enFlag from "@/assets/languages/en.svg";
 import frFlag from "@/assets/languages/fr.svg";
+import Loader from "@/components/Loader";
 import { ButtonLink } from "@/components/controls/ButtonLink.tsx";
 import { CreateAccountForm } from "@/components/forms/CreateAccountForm.tsx";
 import { Checkbox } from "@/components/inputs/Checkbox.tsx";
+import InputField from "@/components/inputs/InputField";
 import { Header } from "@/components/layout/Header.tsx";
 import { AnalyticsOptOut } from "@/components/routes/AnalyticsOptOut.tsx";
 import { getPrefs, setPref } from "@/lib/appwrite.ts";
 import { useLogout } from "@/lib/hooks/useLogout.ts";
+import { useUpdateUsername } from "@/lib/hooks/useUpdateUsername";
 import { useUser } from "@/lib/hooks/useUser.ts";
 
 export const Route = createFileRoute(
@@ -32,6 +38,7 @@ function SettingsPage() {
   const { user } = useUser();
   const { mutate } = useLogout();
   const { t } = useTranslation();
+  const { updateUsername, isPending } = useUpdateUsername();
 
   const { consent } = Route.useLoaderData();
 
@@ -52,88 +59,150 @@ function SettingsPage() {
   const isStaff = user?.labels.includes("staff");
   const isStandist = user?.labels.includes("standist");
 
+  const {
+    register,
+    handleSubmit,
+    formState: { errors },
+  } = useForm({
+    defaultValues: {
+      username: user?.name ?? "",
+    },
+    resolver: zodResolver(
+      z.object({
+        username: z
+          .string()
+          .trim()
+          .min(1, t("settings.usernameEmpty"))
+          .max(50, t("settings.usernameTooLong")),
+      }),
+    ),
+  });
+
+  function onSubmit({ username }: { username: string }) {
+    if (!user) {
+      throw new Error("Error is not logged in");
+    }
+
+    updateUsername(username);
+  }
+
   return (
-    <div className={"flex grow flex-col items-center"}>
+    <div className={"flex grow flex-col items-center gap-2"}>
       <Header>{t("settings.title")}</Header>
       {isUserLoggedIn ? (
-        <div>
-          <p className={"text-lg"}>
-            {user?.name && t("hi_username", { name: user.name })}{" "}
-            {user?.email && `(${user?.email})`}
-          </p>
-          <div className={"flex items-center"}>
-            <Checkbox
-              id={"consent"}
-              checked={consentChecked}
-              onCheckedChange={() => {
-                setPref("consent", !consentChecked);
-                setConsentChecked(!consentChecked);
-              }}
-            />
-            <label className={"ml-2"} htmlFor={"consent"}>
-              {t("consentToSaveEmail")}
-            </label>
-          </div>
-
-          {isStaff && (
-            <ButtonLink size={"small"} href="/staff">
-              {t("staffSpace")}
-            </ButtonLink>
-          )}
-
-          {isStandist && (
-            <ButtonLink size={"small"} href="/standists">
-              {t("standistSpace")}
+        <>
+          <div className="w-full max-w-md rounded-lg bg-white p-6 shadow-md">
+            <h1 className="mb-4 text-2xl">{t("account")}</h1>
+            <form
+              onSubmit={handleSubmit(onSubmit)}
+              className="flex w-full flex-col gap-2"
+            >
+              <div className="flex flex-col">
+                <label htmlFor="username" className="text-lg">
+                  {t("name")}
+                </label>
+                <InputField
+                  name="username"
+                  placeholder={t("name")}
+                  errors={errors["username"]}
+                  register={register}
+                  required={true}
+                  type="text"
+                />
+              </div>
+
+              <div className="flex flex-col">
+                <p className={"text-lg"}>Email:</p>
+                <pre>{user?.email}</pre>
+              </div>
+
+              <div className={"flex items-center"}>
+                <Checkbox
+                  id={"consent"}
+                  checked={consentChecked}
+                  onCheckedChange={() => {
+                    setPref("consent", !consentChecked);
+                    setConsentChecked(!consentChecked);
+                  }}
+                />
+                <label className={"ml-2"} htmlFor={"consent"}>
+                  {t("consentToSaveEmail")}
+                </label>
+              </div>
+
+              <ButtonLink
+                type="submit"
+                size={"medium"}
+                bg={"secondary"}
+                disabled={isPending}
+              >
+                {isPending ? <Loader /> : t("save")}
+              </ButtonLink>
+            </form>
+
+            {isStaff && (
+              <ButtonLink size={"small"} href="/staff" className="mt-4">
+                {t("staffSpace")}
+              </ButtonLink>
+            )}
+
+            {isStandist && (
+              <ButtonLink size={"small"} href="/standists" className="mt-4">
+                {t("standistSpace")}
+              </ButtonLink>
+            )}
+
+            <ButtonLink
+              type={"button"}
+              size={"small"}
+              bg={"dangerous"}
+              onClick={() => mutate()}
+              className={"mt-4 text-lg"}
+            >
+              {t(i18nKeyButton)}
             </ButtonLink>
-          )}
-
-          <ButtonLink
-            type={"button"}
-            size={"medium"}
-            bg={"dangerous"}
-            onClick={() => mutate()}
-            className={"text-lg"}
-          >
-            {t(i18nKeyButton)}
-          </ButtonLink>
-        </div>
+          </div>
+        </>
       ) : (
         <>
-          <CreateAccountForm />
-          <hr className={"my-2 w-full"} />
-
-          <p>{t("alreadyHaveAccount")}</p>
-          <ButtonLink size={"small"} href="/login">
-            {t("loginThere")}
-          </ButtonLink>
+          <div className="w-full max-w-md rounded-lg bg-white p-6 shadow-md">
+            <CreateAccountForm />
+            <p className="mt-4">{t("alreadyHaveAccount")}</p>
+            <ButtonLink size={"small"} href="/login" className="mt-2">
+              {t("loginThere")}
+            </ButtonLink>
+          </div>
         </>
       )}
-      <hr className={"my-2 w-full"} />
-
-      <div className={"flex flex-col items-center"}>
-        <h1 className={"text-2xl"}>{t("language.title")}</h1>
-        <h1 className={"text-xl"}>{t("language.description")}</h1>
-        <div className={"flex flex-row gap-2 pt-2"}>
-          <button onClick={() => changeLanguage("en")}>
-            <img
-              src={enFlag}
-              alt={"english flag"}
-              className={"h-10 w-16 rounded-sm"}
-            />
-          </button>
-          <button onClick={() => changeLanguage("fr")}>
-            <img
-              src={frFlag}
-              alt={"french flag"}
-              className={"h-10 w-16 rounded-sm"}
-            />
-          </button>
+
+      <div className="w-full max-w-md rounded-lg bg-white p-6 shadow-md">
+        <div className={"flex flex-col items-center"}>
+          <h1 className={"text-2xl"}>{t("language.title")}</h1>
+          <h1 className={"text-xl"}>{t("language.description")}</h1>
+          <div className={"flex flex-row gap-2 pt-2"}>
+            <button onClick={() => changeLanguage("en")}>
+              <img
+                src={enFlag}
+                alt={"english flag"}
+                className={`h-10 w-16 rounded-sm ${
+                  i18n.language === "en" ? "border-2 border-blue-500" : ""
+                }`}
+              />
+            </button>
+            <button onClick={() => changeLanguage("fr")}>
+              <img
+                src={frFlag}
+                alt={"french flag"}
+                className={`h-10 w-16 rounded-sm ${
+                  i18n.language === "fr" ? "border-2 border-blue-500" : ""
+                }`}
+              />
+            </button>
+          </div>
         </div>
       </div>
 
-      <hr className={"my-2 w-full"} />
-
-      <div>
+      <div className="w-full max-w-md rounded-lg bg-white p-6 shadow-md">
         <h1 className={"text-center text-2xl"}>{t("analyticsOptOut.title")}</h1>
         <p className={"py-2 text-sm text-gray-700"}>
           {t("analyticsOptOut.description")}


Reviews:
user: login: coderabbitai[bot]
body: **Actionable comments posted: 2**

<details>
<summary>🧹 Nitpick comments (4)</summary><blockquote>

<details>
<summary>web/src/lib/hooks/useUpdateUsername.ts (1)</summary><blockquote>

`12-28`: **Consider returning a value from the mutation function**

While not critical, it's a good practice to return something from the mutation function for better chaining and error handling.


```diff
  mutationFn: async (username: string) => {
    if (user) {
      await setName(username);
+     return { success: true };
    }
+   return { success: false };
  },
```

</blockquote></details>
<details>
<summary>web/src/routes/_rallyists/_withUserProviderNoAutoAnonymous/settings.tsx (2)</summary><blockquote>

`100-102`: **Email display could be more kawaii~**

Using a `<pre>` tag for email display is a bit unusual and might render the email in a monospace font, which isn't typical for user interface elements.


```diff
- <p className={"text-lg"}>
-   Email: <pre>{user?.email}</pre>
- </p>
+ <p className={"text-lg"}>
+   Email: <span className="font-medium">{user?.email}</span>
+ </p>
```

---

`77-197`: **Overall layout looks sugoi, but consider adding better section organization!**

The settings page layout with cards is nice, but it would be better to extract each section (account, language, analytics) into separate components for better maintainability.


Consider creating separate components for each settings section, like:
- `AccountSettings.tsx`
- `LanguageSettings.tsx` 
- `AnalyticsSettings.tsx`

This would make the main settings page much cleaner and more maintainable as features grow!

</blockquote></details>
<details>
<summary>web/src/components/controls/ButtonLink.tsx (1)</summary><blockquote>

`60-71`: **Update the condition to handle both button types correctly**

The implementation looks good, but there's a small improvement for handling onClick with type safety:


```diff
  if (type === "button" || type === "submit") {
    return (
      <button
        className={combinedClassName}
-       onClick={onClick}
+       onClick={type === "button" ? onClick : undefined}
        disabled={disabled}
        type={type}
      >
        {children}
      </button>
    );
  }
```

This ensures we only pass the onClick handler when it's actually defined in the type.

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between f3b6240e60d8edf0ac23f7f744eddd12430bfb08 and 60392ae8dccaae94bdb92f883ff21d9206c808df.

</details>

<details>
<summary>📒 Files selected for processing (5)</summary>

* `web/src/components/controls/ButtonLink.tsx` (2 hunks)
* `web/src/i18n/en.json` (2 hunks)
* `web/src/i18n/fr.json` (5 hunks)
* `web/src/lib/hooks/useUpdateUsername.ts` (1 hunks)
* `web/src/routes/_rallyists/_withUserProviderNoAutoAnonymous/settings.tsx` (3 hunks)

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🧬 Code Definitions (1)</summary>

<details>
<summary>web/src/routes/_rallyists/_withUserProviderNoAutoAnonymous/settings.tsx (5)</summary><blockquote>

<details>
<summary>web/src/lib/hooks/useUpdateUsername.ts (1)</summary>

* `useUpdateUsername` (7-31)

</details>
<details>
<summary>web/src/components/layout/Header.tsx (1)</summary>

* `Header` (9-22)

</details>
<details>
<summary>web/src/components/inputs/Checkbox.tsx (1)</summary>

* `Checkbox` (27-27)

</details>
<details>
<summary>web/src/components/controls/ButtonLink.tsx (1)</summary>

* `ButtonLink` (34-83)

</details>
<details>
<summary>web/src/components/forms/CreateAccountForm.tsx (1)</summary>

* `CreateAccountForm` (15-101)

</details>

</blockquote></details>

</details>

</details>

<details>
<summary>🔇 Additional comments (14)</summary><blockquote>

<details>
<summary>web/src/i18n/en.json (2)</summary>

`9-9`: **Nice addition for the new account section!**

The new "account" translation key aligns perfectly with the settings page enhancement being implemented.

---

`106-108`: **Looks good, username notifications properly implemented!**

These new translation strings provide appropriate feedback messages for the username update functionality. The trailing comma after "title" is also a nice touch for easier additions in the future.

</details>
<details>
<summary>web/src/components/controls/ButtonLink.tsx (2)</summary>

`5-11`: **Great base type extraction, very sugoi!**

Extracting common props into a base type improves code organization and type safety. This is a clean approach!

---

`27-32`: **Nice addition of submit button type!**

Adding support for form submission buttons is important for the new username update functionality. Well implemented!

</details>
<details>
<summary>web/src/i18n/fr.json (10)</summary>

`9-10`: **Chill update on account messages!**  
The adjustments to the `"account"` and `"alreadyHaveAccount"` keys give them a crisp, consistent look—just like a perfectly synced VTuber dance move!

---

`22-22`: **Sweet fix on the consent line!**  
The spacing update in `"consentToSaveEmail"` smooths out the message flawlessly, much like a well-timed emote during a live show.

---

`26-26`: **Brilliant punctuation update in error message!**  
The corrected spacing in `"errorCreatingAccount"` ensures clarity, making the message as clear as a high-definition VTuber stream.

---

`80-80`: **Ace update on rally.3 message!**  
Refining the spacing and punctuation in `"rally.3"` makes these rally instructions super clear—almost as clear as those prompt VTuber alerts during a collab!

---

`82-83`: **Consistent rally messaging!**  
The updated `"rally.5"` and `"rally.6"` strings now sport a clean, uniform style. This consistency is as satisfying as a flawless VTuber performance drop.

---

`97-97`: **Polished saveSubmissionQuestion string!**  
The refined spacing in `"saveSubmissionQuestion"` makes the prompt easier to read—just like a perfectly timed fan interaction during a live stream.

---

`104-104`: **Clean 'scanThisQR' message!**  
The improved spacing in `"scanThisQR"` ensures the instruction is clear and engaging—much like the smooth overlays of your favourite VTuber stream.

---

`106-108`: **Spot on settings update!**  
The addition of `"title"`, `"usernameUpdated"`, and `"usernameUpdateFailed"` under the `"settings"` key is essential for the new username update functionality. These new entries clarify interactions on the settings page—elevating the user experience like an epic VTuber collab event!

---

`120-121`: **Tidy stamps count messages!**  
The spacing corrections in `"stampsCount_one"` and `"stampsCount_other"` enhance readability and ensure consistency throughout—similar to a neatly arranged VTuber channel layout.

---

`128-128`: **Smooth submitStamps update!**  
The updated spacing and punctuation in `"submitStamps"` provide a clear call-to-action, making the message as sharp as a perfectly executed VTuber dance routine.

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: COMMENTED
author_association: NONE
submitted_at: 2025-03-29T23:41:10Z
user: login: coderabbitai[bot]
body: **Actionable comments posted: 0**

<details>
<summary>♻️ Duplicate comments (1)</summary><blockquote>

<details>
<summary>web/src/routes/_rallyists/_withUserProviderNoAutoAnonymous/settings.tsx (1)</summary><blockquote>

`60-68`: _🛠️ Refactor suggestion_

**Add validation to protect your username, senpai!**

The form setup is good, but lacks validation for the username input. Without validation, users could submit empty usernames or extremely long ones that might break UI layouts.



Apply this enhancement:

```diff
  } = useForm({
    defaultValues: {
      username: user?.name ?? "",
    },
+   rules: {
+     username: {
+       required: "Username cannot be empty",
+       maxLength: {
+         value: 50,
+         message: "Username too long (max 50 characters)"
+       }
+     }
+   }
  });
```

Better implementation would be using the `register` function with validation:

```diff
<InputField
  name="username"
  placeholder={t("name")}
  errors={errors["username"]}
-  register={register}
+  register={register("username", {
+    required: "Username cannot be empty",
+    maxLength: {
+      value: 50,
+      message: "Username too long (max 50 characters)"
+    }
+  })}
  type="text"
/>
```

</blockquote></details>

</blockquote></details>

<details>
<summary>🧹 Nitpick comments (2)</summary><blockquote>

<details>
<summary>web/src/routes/_rallyists/_withUserProviderNoAutoAnonymous/settings.tsx (2)</summary><blockquote>

`70-74`: **Onegai check for empty usernames!**

While the `onSubmit` function works correctly, consider adding a client-side check to prevent updates with empty usernames before making the API call. This would provide better UX by not attempting updates with invalid data.


```diff
function onSubmit(data: { username: string }) {
  if (user) {
+   const trimmedUsername = data.username.trim();
+   if (!trimmedUsername) {
+     return;
+   }
-   updateUsername(data.username);
+   updateUsername(trimmedUsername);
  }
}
```

---

`91-97`: **Consider using label's 'for' attribute instead of nesting, senpai!**

While nesting the input inside the label works, using the HTML 'for' attribute is more accessible and follows best practices.


```diff
-<label htmlFor="username" className="text-lg">
+<label htmlFor="username" className="text-lg">
  {t("name")}
</label>
<InputField
  name="username"
+  id="username"
  placeholder={t("name")}
  errors={errors["username"]}
  register={register}
  type="text"
/>
```

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 60392ae8dccaae94bdb92f883ff21d9206c808df and a9b96de7a2458e9b5abd494ac28ebdebae37c49f.

</details>

<details>
<summary>📒 Files selected for processing (2)</summary>

* `web/src/lib/hooks/useUpdateUsername.ts` (1 hunks)
* `web/src/routes/_rallyists/_withUserProviderNoAutoAnonymous/settings.tsx` (3 hunks)

</details>

<details>
<summary>🚧 Files skipped from review as they are similar to previous changes (1)</summary>

* web/src/lib/hooks/useUpdateUsername.ts

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🧬 Code Definitions (1)</summary>

<details>
<summary>web/src/routes/_rallyists/_withUserProviderNoAutoAnonymous/settings.tsx (5)</summary><blockquote>

<details>
<summary>web/src/lib/hooks/useUpdateUsername.ts (1)</summary>

* `useUpdateUsername` (7-33)

</details>
<details>
<summary>web/src/components/layout/Header.tsx (1)</summary>

* `Header` (9-22)

</details>
<details>
<summary>web/src/components/inputs/Checkbox.tsx (1)</summary>

* `Checkbox` (27-27)

</details>
<details>
<summary>web/src/components/controls/ButtonLink.tsx (1)</summary>

* `ButtonLink` (34-83)

</details>
<details>
<summary>web/src/components/forms/CreateAccountForm.tsx (1)</summary>

* `CreateAccountForm` (15-101)

</details>

</blockquote></details>

</details>

</details>

<details>
<summary>🔇 Additional comments (8)</summary><blockquote>

<details>
<summary>web/src/routes/_rallyists/_withUserProviderNoAutoAnonymous/settings.tsx (8)</summary>

`4-4`: **New imports are doki-doki good!** 

Nice work adding the necessary imports for the form functionality. The `useForm`, `Loader`, `InputField`, and `useUpdateUsername` imports align perfectly with the new username update feature.



Also applies to: 9-9, 13-13, 18-18

---

`39-39`: **Sugoi implementation of the username update hook!**

The `useUpdateUsername` hook is being properly destructured to get both the update function and loading state. This pattern makes your component much cleaner than handling all the update logic internally.

---

`77-78`: **Kawaii layout structure!**

The centered flex layout with gap spacing creates a nice visual hierarchy for the settings page elements.

---

`81-128`: **Sugoi form implementation!**

The account section is well-structured with appropriate labels, inputs, and a submit button. The form correctly uses `handleSubmit` from react-hook-form to process submissions.

I especially like:
1. The clear visual separation between sections
2. Using the same component styles as other parts of the app
3. The loading indicator during submission

---

`119-126`: **Subarashii loading indicator implementation!**

The button correctly shows a loading indicator when the update is in progress and disables itself to prevent multiple submissions. This is excellent UX design.

---

`129-149`: **Role-based conditional rendering is sugoi!**

Good use of role-based conditional rendering for staff and standist actions. This keeps the UI clean while providing role-specific functionality.

---

`164-189`: **Kawaii language selector section!**

The language selector is well-implemented with visual feedback for the currently selected language. The border highlighting is a nice touch!

---

`191-197`: **Consistent styling across sections is doki-doki nice!**

The analytics opt-out section maintains the same styling as the other sections, creating a cohesive and professional look throughout the settings page.

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: COMMENTED
author_association: NONE
submitted_at: 2025-03-30T17:41:33Z
user: login: luclu7
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-30T18:30:01Z
user: login: coderabbitai[bot]
state: COMMENTED
author_association: NONE
submitted_at: 2025-03-30T18:30:44Z
user: login: coderabbitai[bot]
body: **Actionable comments posted: 0**

<details>
<summary>🧹 Nitpick comments (2)</summary><blockquote>

<details>
<summary>web/src/routes/_rallyists/_withUserProviderNoAutoAnonymous/settings.tsx (2)</summary><blockquote>

`61-69`: **Form setup looks kawaii, but could be even better!**

While your form setup works well with default values, you could leverage React Hook Form's built-in validation instead of handling it manually in the onSubmit function.


```diff
  } = useForm({
    defaultValues: {
      username: user?.name ?? "",
    },
+   resolver: zodResolver(z.object({
+     username: z.string()
+       .min(1, t("settings.usernameEmpty"))
+       .max(50, t("settings.usernameTooLong"))
+       .trim()
+   }))
  });
```

This approach would prevent form submission for invalid inputs and display validation errors directly on the form. You would need to import `zodResolver` from `@hookform/resolvers/zod` and `z` from `zod` for this solution.

---

`112-119`: **Input field setup looks great!**

The InputField is properly configured with the right props. If you do implement form validation with React Hook Form's built-in features, you'd want to update this to use:

```tsx
register("username", {
  required: t("settings.usernameEmpty"),
  maxLength: {
    value: 50,
    message: t("settings.usernameTooLong")
  }
})
```

This would connect the validation directly to the field.

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 88c1ce4881f6474aad58d2f91825dab4f890baa8 and 0e66a6929de4ab0bf4147c93db954d63f76499dd.

</details>

<details>
<summary>📒 Files selected for processing (3)</summary>

* `web/src/i18n/en.json` (2 hunks)
* `web/src/i18n/fr.json` (5 hunks)
* `web/src/routes/_rallyists/_withUserProviderNoAutoAnonymous/settings.tsx` (3 hunks)

</details>

<details>
<summary>🚧 Files skipped from review as they are similar to previous changes (1)</summary>

* web/src/i18n/fr.json

</details>

<details>
<summary>🔇 Additional comments (7)</summary><blockquote>

<details>
<summary>web/src/i18n/en.json (2)</summary>

`9-9`: **Nice addition of the "account" localization key!**

This new key aligns perfectly with the settings page update. Looking forward to seeing how this enhances the user experience!

---

`106-110`: **Username validation messages look sugoi~!**

These localization strings provide clear feedback for different username update scenarios. The error messages are specific and helpful! Your users will appreciate knowing exactly what went wrong if their username changes fail.

</details>
<details>
<summary>web/src/routes/_rallyists/_withUserProviderNoAutoAnonymous/settings.tsx (5)</summary>

`4-4`: **Great job importing the necessary components!**

These imports provide all the tools needed for the username update functionality. The combination of `useForm`, `Loader`, `InputField`, `useToast`, and `useUpdateUsername` creates a solid foundation for your feature.



Also applies to: 9-9, 13-13, 18-19

---

`40-40`: **Perfect hook implementation, senpai!**

The `useUpdateUsername` hook with destructured `isPending` state will help provide good UX feedback during async operations.

---

`73-95`: **Your validation logic is on point!**

Nice job implementing validation in the onSubmit function! The trim check for empty strings and length validation protect against invalid usernames. The toast messages provide clear feedback to users when something goes wrong.


One small suggestion though - if you implement form validation as suggested earlier, this manual validation could be simplified or removed entirely!

---

`141-148`: **Button with loading state is sugoi desu ne~**

Great job adding the isPending state to disable the button and show a loader while the update is in progress! This prevents double submissions and gives users clear feedback that something is happening.

---

`98-172`: **Fantastic layout improvements!**

The redesigned settings page with separate cards for account, language, and analytics settings looks clean and organized. The rounded corners, shadow, and consistent padding create a polished user experience.



Also applies to: 175-183, 186-219

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: COMMENTED
author_association: NONE
submitted_at: 2025-03-30T18:43:47Z
user: login: coderabbitai[bot]
body: **Actionable comments posted: 0**

<details>
<summary>🧹 Nitpick comments (1)</summary><blockquote>

<details>
<summary>web/src/routes/_rallyists/_withUserProviderNoAutoAnonymous/settings.tsx (1)</summary><blockquote>

`81-87`: **Clean submit handler!**

Your onSubmit function looks good with proper error handling for logged-out users. The updateUsername call is nice and clean!


One small suggestion for a future enhancement - consider adding a try/catch block to handle any unexpected errors that might occur during the update process:

```diff
function onSubmit({ username }: { username: string }) {
  if (!user) {
    throw new Error("Error is not logged in");
  }

-  updateUsername(username);
+  try {
+    updateUsername(username);
+  } catch (error) {
+    console.error("Failed to update username:", error);
+    // Additional error handling if needed
+  }
}
```

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 0e66a6929de4ab0bf4147c93db954d63f76499dd and 719c13180fe8854d12dffe7f2568425c40c6a455.

</details>

<details>
<summary>⛔ Files ignored due to path filters (1)</summary>

* `pnpm-lock.yaml` is excluded by `!**/pnpm-lock.yaml`

</details>

<details>
<summary>📒 Files selected for processing (2)</summary>

* `web/package.json` (1 hunks)
* `web/src/routes/_rallyists/_withUserProviderNoAutoAnonymous/settings.tsx` (3 hunks)

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🧬 Code Definitions (1)</summary>

<details>
<summary>web/src/routes/_rallyists/_withUserProviderNoAutoAnonymous/settings.tsx (5)</summary><blockquote>

<details>
<summary>web/src/lib/hooks/useUpdateUsername.ts (1)</summary>

* `useUpdateUsername` (7-33)

</details>
<details>
<summary>web/src/components/layout/Header.tsx (1)</summary>

* `Header` (9-22)

</details>
<details>
<summary>web/src/components/inputs/Checkbox.tsx (1)</summary>

* `Checkbox` (27-27)

</details>
<details>
<summary>web/src/components/controls/ButtonLink.tsx (1)</summary>

* `ButtonLink` (34-83)

</details>
<details>
<summary>web/src/components/forms/CreateAccountForm.tsx (1)</summary>

* `CreateAccountForm` (15-101)

</details>

</blockquote></details>

</details>

</details>

<details>
<summary>⏰ Context from checks skipped due to timeout of 90000ms (1)</summary>

* GitHub Check: Cloudflare Pages: sedeto-vtube-stamp-rally

</details>

<details>
<summary>🔇 Additional comments (5)</summary><blockquote>

<details>
<summary>web/package.json (1)</summary>

`20-20`: **New Dependency Addition: @hookform/resolvers**

The new dependency `@hookform/resolvers` (version "^4.1.3") is a solid addition to empower your form validation, helping you rule the username update form like a true VTuber superstar! Just double-check that the version harmonises with your existing `react-hook-form` package for a flawless combo.

</details>
<details>
<summary>web/src/routes/_rallyists/_withUserProviderNoAutoAnonymous/settings.tsx (4)</summary>

`1-21`: **Love the fresh imports, senpai!** 

The addition of form validation libraries and components is well organized. Using Zod with react-hook-form is a kawaii combo for robust form handling! The custom `useUpdateUsername` hook is a clean approach for separating the update logic.

---

`62-80`: **Sugoi form validation implementation!** 

Your Zod schema is perfect for keeping usernames in check! I see you've addressed my previous feedback about validation - trimming whitespace, requiring at least 1 character, and capping at 50 characters. The translated error messages are a nice touch too!

---

`94-141`: **Kawaii form implementation!**

The form structure is clean and user-friendly with proper labeling and error handling. I really like how you've:
- Used proper form elements with react-hook-form bindings
- Added a loading indicator on the submit button
- Made the form feel cohesive with the rest of the UI

The button disable state during submission prevents multiple clicks - nice touch!

---

`90-212`: **Sugoi UI structure, senpai!**

The updated page layout with separate cards for different settings is much more organized and visually appealing! The consistent styling with shadow and rounded corners gives a modern look, while the clear section separation makes it easy for users to find what they need.

The language selection with highlighted current language is especially impressive - very user-friendly!

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: COMMENTED
author_association: NONE
submitted_at: 2025-03-30T19:00:50Z
user: login: coderabbitai[bot]
body: **Actionable comments posted: 0**

<details>
<summary>🧹 Nitpick comments (2)</summary><blockquote>

<details>
<summary>web/src/i18n/en.json (1)</summary><blockquote>

`106-111`: **Username management translations look great!**

All necessary translation keys for username management have been added. These translation keys match the functionality in the settings page for username updates.

Just a small note: "usernameTooLong" ends with a period while the other messages don't have ending punctuation. For kawaii consistency, consider standardizing the punctuation style across error messages!


```diff
- "usernameTooLong": "Your username can't be more than 50 characters long."
+ "usernameTooLong": "Your username can't be more than 50 characters long"
```

</blockquote></details>
<details>
<summary>web/src/routes/_rallyists/_withUserProviderNoAutoAnonymous/settings.tsx (1)</summary><blockquote>

`94-142`: **Beautiful username form implementation!**

The form layout looks great with proper labels, input validation, and user feedback. The loader during submission is a nice touch for UX.

Consider adding real-time validation feedback as the user types, rather than only on submission. This would give users immediate feedback on their username length constraints.


```diff
<InputField
  name="username"
  placeholder={t("name")}
  errors={errors["username"]}
  register={register}
  required={true}
  type="text"
+ onChange={(e) => {
+   // Add real-time feedback if needed
+ }}
/>
```

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 719c13180fe8854d12dffe7f2568425c40c6a455 and a13ed7fb62211ff08b15ca8f04ab35bf915665fd.

</details>

<details>
<summary>⛔ Files ignored due to path filters (1)</summary>

* `pnpm-lock.yaml` is excluded by `!**/pnpm-lock.yaml`

</details>

<details>
<summary>📒 Files selected for processing (5)</summary>

* `web/package.json` (1 hunks)
* `web/src/i18n/en.json` (2 hunks)
* `web/src/i18n/fr.json` (5 hunks)
* `web/src/lib/hooks/useUpdateUsername.ts` (1 hunks)
* `web/src/routes/_rallyists/_withUserProviderNoAutoAnonymous/settings.tsx` (3 hunks)

</details>

<details>
<summary>🚧 Files skipped from review as they are similar to previous changes (2)</summary>

* web/package.json
* web/src/lib/hooks/useUpdateUsername.ts

</details>

<details>
<summary>🔇 Additional comments (10)</summary><blockquote>

<details>
<summary>web/src/i18n/en.json (1)</summary>

`9-9`: **New account section added successfully!**

The new "account" key has been properly added to support the account section in the settings page.

</details>
<details>
<summary>web/src/routes/_rallyists/_withUserProviderNoAutoAnonymous/settings.tsx (6)</summary>

`1-20`: **All the right imports for our username adventure!**

Nice job adding all the necessary imports, especially the Zod validation and the custom hook for updating usernames. The foundation for our kawaii username change feature is set!

---

`41-41`: **useUpdateUsername hook integration looks perfect!**

The hook integration provides both the update function and loading state, making for a smooth user experience. Very sugoi implementation!

---

`62-79`: **Excellent form validation with Zod!**

The form setup with Zod validation is well implemented. I see you've addressed the validation concerns from the previous review by:
1. Preventing empty usernames
2. Limiting username length to 50 characters
3. Using translations for error messages

This is exactly what we needed to keep our usernames in check! (⌒▽⌒)

---

`81-87`: **Username update function is clean and effective!**

The error handling for non-logged-in users is a good defensive practice. The function is simple and focused on one responsibility - updating the username. Very clean implementation!

---

`143-164`: **Staff & standist options with proper conditional rendering!**

Good job maintaining the existing functionality for staff and standist roles, and placing the logout button in a logical position within the account management section.

---

`177-203`: **Language selection section looks kawaii!**

The language selection UI with flag visuals and highlighted selection is very user-friendly. Nice touch with the border highlighting the current language!

</details>
<details>
<summary>web/src/i18n/fr.json (3)</summary>

`9-9`: **French translation for Account added!**

The "Compte" translation for "Account" looks perfect.

---

`10-10`: **Nice typography corrections for French punctuation!**

You've fixed the spacing before punctuation marks (!, ?) in multiple French strings, which follows proper French typography rules. Très bien!



Also applies to: 22-22, 26-26, 80-80, 82-83, 97-97, 104-104, 122-123, 130-130

---

`106-110`: **Username-related translations in French look great!**

All the necessary translations for username management have been added with proper French phrasing. The validation messages are clear and match the functionality of the settings page.

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: COMMENTED
author_association: NONE
submitted_at: 2025-03-30T19:20:57Z
user: login: coderabbitai[bot]
body: **Actionable comments posted: 0**

<details>
<summary>🧹 Nitpick comments (2)</summary><blockquote>

<details>
<summary>web/src/routes/_rallyists/_withUserProviderNoAutoAnonymous/settings.tsx (2)</summary><blockquote>

`81-87`: **Consider adding graceful error handling for edge cases~**

Your error handling throws an exception if `user` is null during submission. For a super kawaii user experience, consider adding a more gentle approach:

```diff
function onSubmit({ username }: { username: string }) {
  if (!user) {
-   throw new Error("Error is not logged in");
+   toast({
+     title: t("error"),
+     description: t("userNotLoggedIn")
+   });
+   return;
  }

  updateUsername(username);
}
```

---

`114-117`: **Consider using a styled element instead of `<pre>` for email display**

Using a `<pre>` tag for displaying the email is a bit unusual and might not style consistently across browsers. For a more kawaii display:

```diff
<div className="flex flex-col">
  <p className={"text-lg"}>Email:</p>
-  <pre>{user?.email}</pre>
+  <p className="font-medium break-words">{user?.email}</p>
</div>
```

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between a13ed7fb62211ff08b15ca8f04ab35bf915665fd and 98d41165852324b2b0514947981c40acde8e2da8.

</details>

<details>
<summary>⛔ Files ignored due to path filters (1)</summary>

* `pnpm-lock.yaml` is excluded by `!**/pnpm-lock.yaml`

</details>

<details>
<summary>📒 Files selected for processing (5)</summary>

* `web/package.json` (1 hunks)
* `web/src/i18n/en.json` (2 hunks)
* `web/src/i18n/fr.json` (5 hunks)
* `web/src/lib/hooks/useUpdateUsername.ts` (1 hunks)
* `web/src/routes/_rallyists/_withUserProviderNoAutoAnonymous/settings.tsx` (3 hunks)

</details>

<details>
<summary>🚧 Files skipped from review as they are similar to previous changes (3)</summary>

* web/package.json
* web/src/lib/hooks/useUpdateUsername.ts
* web/src/i18n/en.json

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🧬 Code Definitions (1)</summary>

<details>
<summary>web/src/routes/_rallyists/_withUserProviderNoAutoAnonymous/settings.tsx (5)</summary><blockquote>

<details>
<summary>web/src/lib/hooks/useUpdateUsername.ts (1)</summary>

* `useUpdateUsername` (7-33)

</details>
<details>
<summary>web/src/components/layout/Header.tsx (1)</summary>

* `Header` (9-22)

</details>
<details>
<summary>web/src/components/inputs/Checkbox.tsx (1)</summary>

* `Checkbox` (27-27)

</details>
<details>
<summary>web/src/components/controls/ButtonLink.tsx (1)</summary>

* `ButtonLink` (34-83)

</details>
<details>
<summary>web/src/components/forms/CreateAccountForm.tsx (1)</summary>

* `CreateAccountForm` (15-101)

</details>

</blockquote></details>

</details>

</details>

<details>
<summary>🔇 Additional comments (6)</summary><blockquote>

<details>
<summary>web/src/routes/_rallyists/_withUserProviderNoAutoAnonymous/settings.tsx (3)</summary>

`62-79`: **Great form validation implementation, senpai!**

I'm loving the form setup with Zod validation for the username field! The minimum and maximum length restrictions will prevent empty usernames and those super long ones that might break our cute UI. Nice job implementing the feedback from our previous review too!

---

`133-140`: **Nicely implemented loading state for the form submission!**

The loading state implementation with the conditional rendering of the Loader component is super cute and provides excellent feedback to the user. Perfect UX design, senpai!

---

`93-142`: **Lovely UI organization and card-based layout!**

The new card-based layout for different sections looks so kawaii~ ✨ The clean separation of concerns between account management, language settings, and analytics makes for an excellent user experience!

</details>
<details>
<summary>web/src/i18n/fr.json (3)</summary>

`9-9`: **New translation for account section added correctly!**

Good job adding the "Compte" translation to match the new account section in the settings page!

---

`107-110`: **Complete username validation translations added!**

You've added all the necessary translations for the username functionality - great work, senpai! These friendly messages will help guide users when they're updating their username.

---

`10-10`: **Fixed spaces before punctuation marks in French text!**

Nice attention to detail! In French typography, you shouldn't have spaces before punctuation marks like "!", "?", etc. These fixes make the text more professional and properly formatted.




Also applies to: 22-22, 26-26, 80-80, 82-83, 97-97, 104-104, 122-123, 130-130

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: COMMENTED
author_association: NONE
submitted_at: 2025-03-30T19:27:46Z

Review comments:
diff_hunk: @@ -0,0 +1,31 @@
+import { useMutation } from "@tanstack/react-query";
+import { useTranslation } from "react-i18next";
+
+import { useToast } from "@/lib/hooks/useToast";
+import { useUser } from "@/lib/hooks/useUser";
+
+export function useUpdateUsername() {
+  const { user, setName } = useUser();
+  const { t } = useTranslation();
+  const { toast } = useToast();
+
+  const { mutate, isPending } = useMutation({
+    mutationFn: async (username: string) => {
+      if (user) {
+        setName(username);
+      }
+    },
+    onSuccess: () => {
+      toast({
+        title: t("settings.usernameUpdated"),
+      });
+    },
+    onError: () => {
+      toast({
+        title: t("settings.usernameUpdateFailed"),
+      });
+    },
+  });
+
+  return { updateUsername: mutate, isPending };
+}
path: web/src/lib/hooks/useUpdateUsername.ts
user: login: coderabbitai[bot]
body: _⚠️ Potential issue_

**Sugoi hook implementation, but needs to await the setName Promise!**

The hook looks well-structured with proper error handling and toast notifications, but there's a potential issue:


```diff
  mutationFn: async (username: string) => {
    if (user) {
-      setName(username);
+      await setName(username);
    }
  },
```

Without awaiting the Promise returned by `setName`, the `onSuccess` callback might fire before the operation completes, giving users a false sense of success. Let's make sure our kawaii users get accurate feedback!


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

`````suggestion
export function useUpdateUsername() {
  const { user, setName } = useUser();
  const { t } = useTranslation();
  const { toast } = useToast();

  const { mutate, isPending } = useMutation({
    mutationFn: async (username: string) => {
      if (user) {
        await setName(username);
      }
    },
    onSuccess: () => {
      toast({
        title: t("settings.usernameUpdated"),
      });
    },
    onError: () => {
      toast({
        title: t("settings.usernameUpdateFailed"),
      });
    },
  });

  return { updateUsername: mutate, isPending };
}
`````

</details>

<!-- suggestion_end -->

<!-- This is an auto-generated comment by CodeRabbit -->

✅ Addressed in commit a9b96de
created_at: 2025-03-29T23:41:09Z
author_association: NONE
diff_hunk: @@ -52,88 +57,137 @@ function SettingsPage() {
   const isStaff = user?.labels.includes("staff");
   const isStandist = user?.labels.includes("standist");
 
+  const {
+    register,
+    handleSubmit,
+    formState: { errors },
+  } = useForm({
+    defaultValues: {
+      username: user?.name ?? "",
+    },
+  });
+
+  function onSubmit(data: { username: string }) {
+    if (user) {
+      updateUsername(data.username);
+    }
+  }
path: web/src/routes/_rallyists/_withUserProviderNoAutoAnonymous/settings.tsx
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**Add validation to protect your username, senpai!**

The form setup is good, but lacks validation for the username input. Without validation, users could submit empty usernames or extremely long ones that might break UI layouts.


```diff
  } = useForm({
    defaultValues: {
      username: user?.name ?? "",
    },
+   rules: {
+     username: {
+       required: "Username cannot be empty",
+       maxLength: {
+         value: 50,
+         message: "Username too long (max 50 characters)"
+       }
+     }
+   }
  });
```

Better implementation would be using the `register` function with validation:

```diff
<InputField
  name="username"
  placeholder={t("name")}
  errors={errors["username"]}
-  register={register}
+  register={register("username", {
+    required: "Username cannot be empty",
+    maxLength: {
+      value: 50,
+      message: "Username too long (max 50 characters)"
+    }
+  })}
  type="text"
/>
```


> Committable suggestion skipped: line range outside the PR's diff.

<!-- This is an auto-generated reply by CodeRabbit -->

✅ Addressed in commit 719c131

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-03-29T23:41:10Z
author_association: NONE
diff_hunk: @@ -52,88 +57,137 @@ function SettingsPage() {
   const isStaff = user?.labels.includes("staff");
   const isStandist = user?.labels.includes("standist");
 
+  const {
+    register,
+    handleSubmit,
+    formState: { errors },
+  } = useForm({
+    defaultValues: {
+      username: user?.name ?? "",
+    },
+  });
+
+  function onSubmit(data: { username: string }) {
+    if (user) {
+      updateUsername(data.username);
+    }
+  }
path: web/src/routes/_rallyists/_withUserProviderNoAutoAnonymous/settings.tsx
user: login: luclu7
body: Done in 88c1ce4881f6474aad58d2f91825dab4f890baa8
created_at: 2025-03-30T18:30:01Z
author_association: MEMBER
diff_hunk: @@ -52,88 +57,137 @@ function SettingsPage() {
   const isStaff = user?.labels.includes("staff");
   const isStandist = user?.labels.includes("standist");
 
+  const {
+    register,
+    handleSubmit,
+    formState: { errors },
+  } = useForm({
+    defaultValues: {
+      username: user?.name ?? "",
+    },
+  });
+
+  function onSubmit(data: { username: string }) {
+    if (user) {
+      updateUsername(data.username);
+    }
+  }
path: web/src/routes/_rallyists/_withUserProviderNoAutoAnonymous/settings.tsx
user: login: coderabbitai[bot]
body: <details>
<summary>🧩 Analysis chain</summary>

@luclu7 Checked your commit and it looks fantastic! Nice job implementing the username validation to protect against empty fields and overly long names. Your code is now more robust and user-friendly! (ノ°ᴗ°)ノ*:･ﾟ✧

---

🏁 Script executed:
```
#!/bin/bash
# Get the details of the commit
git show 88c1ce4881f6474aad58d2f91825dab4f890baa8 -- web/src/routes/_rallyists/_withUserProviderNoAutoAnonymous/settings.tsx
```

Length of output: 7623

---



</details>

@luclu7 Nice implementation, senpai~! I see you've added validation for empty usernames with that toast message - super kawaii approach! ✨

While checking your commit, I noticed you implemented the empty username check in the `onSubmit` function with trimming - that's a smart touch! For future updates, you might also want to consider adding that max length validation (50 characters) we discussed to prevent any UI-breaking super long usernames. But this is already a great improvement! (≧◡≦)

<!-- This is an auto-generated reply by CodeRabbit -->
created_at: 2025-03-30T18:30:43Z
author_association: NONE

PR comments:
user: login: cloudflare-workers-and-pages[bot]
created_at: 2025-03-29T23:37:38Z
body: ## Deploying sedeto-vtube-stamp-rally with &nbsp;<a href="https://pages.dev"><img alt="Cloudflare Pages" src="https://user-images.githubusercontent.com/23264/106598434-9e719e00-654f-11eb-9e59-6167043cfa01.png" width="16"></a> &nbsp;Cloudflare Pages

<table><tr><td><strong>Latest commit:</strong> </td><td>
<code>98d4116</code>
</td></tr>
<tr><td><strong>Status:</strong></td><td>&nbsp;✅&nbsp; Deploy successful!</td></tr>
<tr><td><strong>Preview URL:</strong></td><td>
<a href='https://66ebcbff.sedeto-vtube-stamp-rally.pages.dev'>https://66ebcbff.sedeto-vtube-stamp-rally.pages.dev</a>
</td></tr>
<tr><td><strong>Branch Preview URL:</strong></td><td>
<a href='https://57-change-username.sedeto-vtube-stamp-rally.pages.dev'>https://57-change-username.sedeto-vtube-stamp-rally.pages.dev</a>
</td></tr>
</table>

[View logs](https://dash.cloudflare.com/5d09cfe4e8924d7271ed948a1479acb8/pages/view/sedeto-vtube-stamp-rally/66ebcbff-3127-4b4b-80e3-7615ff63c9d0)

author_association: NONE
user: login: coderabbitai[bot]
created_at: 2025-03-29T23:37:43Z
body: <!-- This is an auto-generated comment: summarize by coderabbit.ai -->
<!-- walkthrough_start -->

## Walkthrough
The changes enhance the ButtonLink component by introducing a shared base type for common properties and new type definitions for distinct button behaviours ("button" and "submit"). Updates to both English and French localisation files add new keys for account and username notifications alongside punctuation fixes. A new custom hook, `useUpdateUsername`, has been added to manage asynchronous username updates with toast notifications. The Settings page now integrates a form for modifying the username, utilising this hook along with react-hook-form for state and validation.

## Changes

| File(s) | Change Summary |
|---------|----------------|
| `web/src/components/controls/ButtonLink.tsx` | Introduced `BaseButtonLinkProps`; updated `ButtonLinkProps` and `ButtonLinkButtonProps` to extend it; added `ButtonLinkSubmitProps`; modified component signature to handle "button" and "submit" types with appropriate conditional rendering. |
| `web/src/i18n/en.json`<br>`web/src/i18n/fr.json` | **en.json:** Added `"account"`, `"usernameUpdated"`, and `"usernameUpdateFailed"` keys; modified `"title"`. <br> **fr.json:** Corrected spacing/punctuation in multiple strings; added keys for username updates. |
| `web/src/lib/hooks/useUpdateUsername.ts` | Added new custom hook `useUpdateUsername` that uses `useMutation` from react-query to update a user's username and dispatch toast notifications based on success or failure. |
| `web/src/routes/_rallyists/_withUserProviderNoAutoAnonymous/settings.tsx` | Integrated an interactive form for updating the username using react-hook-form; implemented `onSubmit` to call `updateUsername` from the new hook; conditionally displays a Loader and disables the submit button while updating. |

## Sequence Diagram(s)

```mermaid
sequenceDiagram
    participant Caller
    participant ButtonLink
    alt "href provided"
        Caller->>ButtonLink: Render with href prop
        ButtonLink-->>Caller: Render anchor element (<a>)
    else "type = button"
        Caller->>ButtonLink: Render with onClick handler
        ButtonLink-->>Caller: Render button with onClick
    else "type = submit"
        Caller->>ButtonLink: Render as submit button
        ButtonLink-->>Caller: Render button with type="submit"
    end
```

```mermaid
sequenceDiagram
    participant User
    participant SettingsPage
    participant useUpdateUsername
    participant API
    participant Toast
    User->>SettingsPage: Submits new username via form
    SettingsPage->>useUpdateUsername: Invoke updateUsername(data)
    useUpdateUsername->>API: Send update request
    API-->>useUpdateUsername: Return success/failure response
    alt Success
        useUpdateUsername->>Toast: Show success toast
    else Failure
        useUpdateUsername->>Toast: Show failure toast
    end
    useUpdateUsername-->>SettingsPage: Update isPending state
```

## Assessment against linked issues

| Objective                                           | Addressed | Explanation |
|-----------------------------------------------------|-----------|-------------|
| Enable rallyists to update their pseudo (#57)     | ✅        |             |

## Poem
> In a world of code and virtual streams,  
> Button tales and hooks ignite our dreams.  
> A username change with a VTuber twist,  
> New keys and flows none can resist.  
> Cheers to code that sparkles so bright –  
> CodeRabbit's magic dancing through the night!

<!-- walkthrough_end -->
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEYDEZyAAUASpADK2VmgqyjcEj2wAbb5AokAI7Y0riQ4rjedJAARABy+NhSvp7caKSQiCS44hhEyADUkBgskLQA5Hjw3kjUJNh8DLCYpCpRMZAA7mjIiNgCzOo09HLhsJ7YWXze2AwzAOzoGPSo8EoY4gBm8NE9xU4ClJAArACcGjDjPBTwzC7ym/gMk/ybY6i2KMi4V/AbFIpZuJ8Fh8G80MUSJ1MtlcvkeOkSAAaLoIJooDBzbBKZCbbCY4EYNA1XAPfCNZp5P5EMYTKZEtgXOCobDcWh1L4YmjLaIESBkSkMOlHEgAD24lB2mM8o2J3nwnWpkEmlG++EgzEU8E28h+JHgfBVFAZ0jKBtEkXkip+f1p6G43BqDGo8BBGiMAEFaLR1K6ib5ZCibchuD4/AFgqF0N6AogsshMPQ5vh418+p4MAcjsd5ii/j7nXCxtQUGFY/hvFIE9cSBJXZNvPI1uxtTt6LxBFFmPw+JsSNQGp4IyFEGWSN46vQ+XqYTlqchycr6Wg2JA8QS/cT1LJ3QYAGKLvEUPV8JS4bTeRBBq6h3z+IIjsLOrCHdAMIVx3ZhGePXwKpUAKo2AAMlwADasA5NwiAcAA9LBRDqLA/QaEwzCwQAatA/SUGANhyrIsGjiu3BgFQAZgGgDqwbe3iwWcAC6AAUkG4NBcEIUhKFoZh2GHBQeEEUR57MKR5GNpR1G0fRpwAJS7voxjgFAZD0GCOAEMQZDKMMCisOwXC8PwwgWpIpqjEwShUKo6haDoikmFAzLIKgmAaYQpDkFQuloWwGxcFQ0J9M4riQBZijKDZmjaLoYCGEppgGJ0JACERFAMLBaHcCC7CIJlIK4ACl6wQAQngBAYMBfwANYaLgiCihwBgxC1BgWJAHoAJJ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kbox_start -->

<details>
<summary>✨ Finishing Touches</summary>

- [ ] <!-- {"checkboxId": "7962f53c-55bc-4827-bfbf-6a18da830691"} --> 📝 Generate Docstrings

</details>

<!-- finishing_touch_checkbox_end -->
<!-- tips_start -->

---



<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=VTuber-Rally/stamp-rally-app&utm_content=59):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Generate unit testing code for this file.`
  - `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
  - `@coderabbitai generate unit testing code for this file.`
  -	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
  - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
  - `@coderabbitai read src/utils.ts and generate unit testing code.`
  - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

### CodeRabbit Commands (Invoked using PR comments)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai plan` to trigger planning for file edits and PR creation.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.

### Other keywords and placeholders

- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` anywhere in the PR title to generate the title automatically.

### CodeRabbit Configuration File (`.coderabbit.yaml`)

- You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository.
- Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json`

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->
author_association: NONE