v4: the header drops the username link — on wide screens it stood beside the avatar, which leads to the same profile, so only Playlists stays there. The avatar's menu still opens with @username first. 670 frontend tests pass, and tsc, eslint, deno fmt and i18n:compile --strict are clean; checked in a screenshot in Smooth dark at 1400px.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
khannurien
2026-10-08 22:23:46 +00:00
parent 886216749e
commit 2c031b0102
5 changed files with 22 additions and 26 deletions

View File

@@ -607,7 +607,7 @@ msgstr "Cancel removal"
msgid "Cancel reply" msgid "Cancel reply"
msgstr "Cancel reply" msgstr "Cancel reply"
#: src/components/layout/AppHeader.tsx:188 #: src/components/layout/AppHeader.tsx:182
msgid "Cancel search" msgid "Cancel search"
msgstr "Cancel search" msgstr "Cancel search"
@@ -869,7 +869,7 @@ msgstr "Drop a file here, or paste one"
msgid "Drop a replacement here" msgid "Drop a replacement here"
msgstr "Drop a replacement here" msgstr "Drop a replacement here"
#: src/components/layout/AppHeader.tsx:207 #: src/components/layout/AppHeader.tsx:201
msgid "Dump" msgid "Dump"
msgstr "Dump" msgstr "Dump"
@@ -1176,7 +1176,7 @@ msgstr "Link or file"
msgid "Live updates are temporarily disconnected. Trying to reconnect…" msgid "Live updates are temporarily disconnected. Trying to reconnect…"
msgstr "Live updates are temporarily disconnected. Trying to reconnect…" msgstr "Live updates are temporarily disconnected. Trying to reconnect…"
#: src/components/layout/AppHeader.tsx:240 #: src/components/layout/AppHeader.tsx:234
msgid "Live updates unavailable." msgid "Live updates unavailable."
msgstr "Live updates unavailable." msgstr "Live updates unavailable."
@@ -1219,7 +1219,7 @@ msgstr "Loading profile…"
msgid "Loading…" msgid "Loading…"
msgstr "Loading…" msgstr "Loading…"
#: src/components/layout/AppHeader.tsx:214 #: src/components/layout/AppHeader.tsx:208
#: src/pages/UserLogin.tsx:41 #: src/pages/UserLogin.tsx:41
#: src/pages/UserLogin.tsx:67 #: src/pages/UserLogin.tsx:67
#: src/pages/UserLogin.tsx:86 #: src/pages/UserLogin.tsx:86
@@ -1463,7 +1463,7 @@ msgid "Play"
msgstr "Play" msgstr "Play"
#: src/components/dump/create/StepIndicator.tsx:21 #: src/components/dump/create/StepIndicator.tsx:21
#: src/components/layout/AppHeader.tsx:178 #: src/components/layout/AppHeader.tsx:172
#: src/components/layout/UserMenu.tsx:85 #: src/components/layout/UserMenu.tsx:85
#: src/components/profile/ProfileFollowTab.tsx:167 #: src/components/profile/ProfileFollowTab.tsx:167
#: src/components/profile/ProfilePlaylistsTab.tsx:118 #: src/components/profile/ProfilePlaylistsTab.tsx:118
@@ -1633,7 +1633,7 @@ msgstr "Save"
msgid "Saving…" msgid "Saving…"
msgstr "Saving…" msgstr "Saving…"
#: src/components/layout/AppHeader.tsx:188 #: src/components/layout/AppHeader.tsx:182
#: src/components/layout/SearchBar.tsx:83 #: src/components/layout/SearchBar.tsx:83
#: src/pages/Search.tsx:69 #: src/pages/Search.tsx:69
msgid "Search" msgid "Search"
@@ -1676,7 +1676,7 @@ msgstr "Send reset link"
msgid "Sending…" msgid "Sending…"
msgstr "Sending…" msgstr "Sending…"
#: src/components/layout/AppHeader.tsx:204 #: src/components/layout/AppHeader.tsx:198
msgid "Server unreachable" msgid "Server unreachable"
msgstr "Server unreachable" msgstr "Server unreachable"

View File

@@ -607,7 +607,7 @@ msgstr "Annuler la suppression"
msgid "Cancel reply" msgid "Cancel reply"
msgstr "Annuler la réponse" msgstr "Annuler la réponse"
#: src/components/layout/AppHeader.tsx:188 #: src/components/layout/AppHeader.tsx:182
msgid "Cancel search" msgid "Cancel search"
msgstr "Annuler la recherche" msgstr "Annuler la recherche"
@@ -869,7 +869,7 @@ msgstr "Déposez un fichier ici, ou collez-en un"
msgid "Drop a replacement here" msgid "Drop a replacement here"
msgstr "Déposez un fichier de remplacement ici" msgstr "Déposez un fichier de remplacement ici"
#: src/components/layout/AppHeader.tsx:207 #: src/components/layout/AppHeader.tsx:201
msgid "Dump" msgid "Dump"
msgstr "Reco" msgstr "Reco"
@@ -1176,7 +1176,7 @@ msgstr "Lien ou fichier"
msgid "Live updates are temporarily disconnected. Trying to reconnect…" msgid "Live updates are temporarily disconnected. Trying to reconnect…"
msgstr "Les mises à jour en direct sont temporairement interrompues. Tentative de reconnexion…" msgstr "Les mises à jour en direct sont temporairement interrompues. Tentative de reconnexion…"
#: src/components/layout/AppHeader.tsx:240 #: src/components/layout/AppHeader.tsx:234
msgid "Live updates unavailable." msgid "Live updates unavailable."
msgstr "Mises à jour en direct indisponibles." msgstr "Mises à jour en direct indisponibles."
@@ -1219,7 +1219,7 @@ msgstr "Chargement du profil…"
msgid "Loading…" msgid "Loading…"
msgstr "Chargement…" msgstr "Chargement…"
#: src/components/layout/AppHeader.tsx:214 #: src/components/layout/AppHeader.tsx:208
#: src/pages/UserLogin.tsx:41 #: src/pages/UserLogin.tsx:41
#: src/pages/UserLogin.tsx:67 #: src/pages/UserLogin.tsx:67
#: src/pages/UserLogin.tsx:86 #: src/pages/UserLogin.tsx:86
@@ -1463,7 +1463,7 @@ msgid "Play"
msgstr "Lecture" msgstr "Lecture"
#: src/components/dump/create/StepIndicator.tsx:21 #: src/components/dump/create/StepIndicator.tsx:21
#: src/components/layout/AppHeader.tsx:178 #: src/components/layout/AppHeader.tsx:172
#: src/components/layout/UserMenu.tsx:85 #: src/components/layout/UserMenu.tsx:85
#: src/components/profile/ProfileFollowTab.tsx:167 #: src/components/profile/ProfileFollowTab.tsx:167
#: src/components/profile/ProfilePlaylistsTab.tsx:118 #: src/components/profile/ProfilePlaylistsTab.tsx:118
@@ -1633,7 +1633,7 @@ msgstr "Enregistrer"
msgid "Saving…" msgid "Saving…"
msgstr "Enregistrement…" msgstr "Enregistrement…"
#: src/components/layout/AppHeader.tsx:188 #: src/components/layout/AppHeader.tsx:182
#: src/components/layout/SearchBar.tsx:83 #: src/components/layout/SearchBar.tsx:83
#: src/pages/Search.tsx:69 #: src/pages/Search.tsx:69
msgid "Search" msgid "Search"
@@ -1676,7 +1676,7 @@ msgstr "Envoyer le lien de réinitialisation"
msgid "Sending…" msgid "Sending…"
msgstr "Envoi…" msgstr "Envoi…"
#: src/components/layout/AppHeader.tsx:204 #: src/components/layout/AppHeader.tsx:198
msgid "Server unreachable" msgid "Server unreachable"
msgstr "Serveur inaccessible" msgstr "Serveur inaccessible"

View File

@@ -159,18 +159,12 @@ export function AppHeader(
<nav className="app-header-nav"> <nav className="app-header-nav">
{ {
/* The user's own links lead the row, so the icons after them run /* The user's own links lead the row, so the icons after them run
unbroken to the "+": the text links on wide screens, then the unbroken to the "+": Playlists on wide screens, then the
avatar's menu at every width. */ avatar's menu, which leads to their profile, at every width. */
} }
{user && ( {user && (
<> <>
<div className="nav-links"> <div className="nav-links">
<Link
to={userPath(user.username)}
className="app-header-user"
>
{user.username}
</Link>
<Link <Link
to={userPath(user.username, "playlists")} to={userPath(user.username, "playlists")}
className="app-header-user" className="app-header-user"

View File

@@ -1,7 +1,7 @@
/** /**
* Renders the avatar menu that leads the header's icon row at every width: it * Renders the avatar menu that leads the header's icon row at every width: it
* holds the profile and playlists links (on small screens, the only ones), the * holds the profile link, the playlists one (on small screens, the only one),
* settings, the site's tools, and logging out. * the settings, the site's tools, and logging out.
* *
* @module * @module
*/ */

View File

@@ -24,10 +24,12 @@ describe("AppHeader", () => {
renderWithContexts(<AppHeader disableNew />, { renderWithContexts(<AppHeader disableNew />, {
session: makeSession({ username: "ann" }), session: makeSession({ username: "ann" }),
}); });
expect(screen.getByRole("link", { name: "ann" })).toHaveAttribute( expect(screen.getByRole("link", { name: "Playlists" })).toHaveAttribute(
"href", "href",
"/@ann", "/@ann/playlists",
); );
expect(screen.getByRole("button", { name: "User menu" }))
.toBeInTheDocument();
expect(screen.getByRole("button", { name: "Chat" })).toBeInTheDocument(); expect(screen.getByRole("button", { name: "Chat" })).toBeInTheDocument();
expect(screen.getByRole("button", { name: "Notifications" })) expect(screen.getByRole("button", { name: "Notifications" }))
.toBeInTheDocument(); .toBeInTheDocument();