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:
@@ -159,18 +159,12 @@ export function AppHeader(
|
||||
<nav className="app-header-nav">
|
||||
{
|
||||
/* 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
|
||||
avatar's menu at every width. */
|
||||
unbroken to the "+": Playlists on wide screens, then the
|
||||
avatar's menu, which leads to their profile, at every width. */
|
||||
}
|
||||
{user && (
|
||||
<>
|
||||
<div className="nav-links">
|
||||
<Link
|
||||
to={userPath(user.username)}
|
||||
className="app-header-user"
|
||||
>
|
||||
{user.username}
|
||||
</Link>
|
||||
<Link
|
||||
to={userPath(user.username, "playlists")}
|
||||
className="app-header-user"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* 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
|
||||
* settings, the site's tools, and logging out.
|
||||
* holds the profile link, the playlists one (on small screens, the only one),
|
||||
* the settings, the site's tools, and logging out.
|
||||
*
|
||||
* @module
|
||||
*/
|
||||
|
||||
@@ -24,10 +24,12 @@ describe("AppHeader", () => {
|
||||
renderWithContexts(<AppHeader disableNew />, {
|
||||
session: makeSession({ username: "ann" }),
|
||||
});
|
||||
expect(screen.getByRole("link", { name: "ann" })).toHaveAttribute(
|
||||
expect(screen.getByRole("link", { name: "Playlists" })).toHaveAttribute(
|
||||
"href",
|
||||
"/@ann",
|
||||
"/@ann/playlists",
|
||||
);
|
||||
expect(screen.getByRole("button", { name: "User menu" }))
|
||||
.toBeInTheDocument();
|
||||
expect(screen.getByRole("button", { name: "Chat" })).toBeInTheDocument();
|
||||
expect(screen.getByRole("button", { name: "Notifications" }))
|
||||
.toBeInTheDocument();
|
||||
|
||||
Reference in New Issue
Block a user