From b3c4a606301a8c76c1bc546b93d8b2abdca7bf4a Mon Sep 17 00:00:00 2001 From: irrlicht Date: Fri, 13 Nov 2026 21:00:42 +0100 Subject: [PATCH] Darstellung: Anzeigename und Handle zweizeilig in der Byline Mit "Anzeigename @handle" in einer Zeile wurde die Meta-Zeile lang und unruhig. Jetzt steht neben dem Avatar oben der Anzeigename, darunter @handle mit der Zeit; die Namen sind nicht mehr unterstrichen. Co-Authored-By: Claude Opus 5.5 --- frontend/src/app.css | 5 +++++ frontend/src/components/EntryCard.tsx | 11 ++++++----- frontend/src/docs/info.html | 1 + frontend/src/format.tsx | 16 +++++++++++++--- frontend/src/pages/ChatsPage.tsx | 11 ++++++----- 5 files changed, 31 insertions(+), 13 deletions(-) diff --git a/frontend/src/app.css b/frontend/src/app.css index 0357d97..e0de8f4 100644 --- a/frontend/src/app.css +++ b/frontend/src/app.css @@ -557,6 +557,11 @@ img.avatar-sm { width: var(--avatar-sm); height: var(--avatar-sm); } auf 1rem liegt). Hier explizit angleichen -> ganze Meta-Zeile gleich groß. */ .byline span { font-size: 1rem; } +/* Name neben dem Avatar: Anzeigename oben, @handle (+ Zeit) darunter, ohne + Unterstreichung. */ +.byline .author { display: flex; flex-direction: column; line-height: 1.25; } +.byline .author a { text-decoration: none; } + /* Melden steht rechts in der Byline. */ .byline .report { margin-left: auto; } diff --git a/frontend/src/components/EntryCard.tsx b/frontend/src/components/EntryCard.tsx index 23fe2ef..389b4ea 100644 --- a/frontend/src/components/EntryCard.tsx +++ b/frontend/src/components/EntryCard.tsx @@ -1,7 +1,7 @@ import type { MouseEvent } from "react"; import { Link, useNavigate } from "react-router"; import type { Entry, LinkPreview } from "../types"; -import { avatarUrl, formatTime, linkify, userName } from "../format"; +import { AuthorName, avatarUrl, formatTime, linkify } from "../format"; import { Votes } from "./Votes"; import { useBump } from "./Bump"; import { useReport } from "./Report"; @@ -64,10 +64,11 @@ function LiveCard({ entry: e }: { entry: Entry }) { - - {userName(e)} · {formatTime(e.created_at)} - {bump.cooldown} - + · {formatTime(e.created_at)}{bump.cooldown}} + /> {!own && report.button}
diff --git a/frontend/src/docs/info.html b/frontend/src/docs/info.html index 4a44e5e..1ac9499 100644 --- a/frontend/src/docs/info.html +++ b/frontend/src/docs/info.html @@ -19,6 +19,7 @@
  • Abschicken jetzt mit Strg + Enter (Mac: Cmd + Enter) statt Shift + Enter
  • Helles Design: Hintergrund in warmem Off-White statt reinem Weiß, angenehmer zu lesen
  • +
  • Beiträge und Chats: Anzeigename und @handle stehen zweizeilig neben dem Profilbild

07.11.2026

    diff --git a/frontend/src/format.tsx b/frontend/src/format.tsx index a374eaa..4583989 100644 --- a/frontend/src/format.tsx +++ b/frontend/src/format.tsx @@ -10,9 +10,19 @@ export function avatarUrl(path: string): string { // '' = keiner. export type Author = { handle: string; display_name: string }; -// userName zeigt "Anzeigename @handle", ohne Anzeigenamen nur "@handle". -export function userName(u: Author): string { - return u.display_name ? `${u.display_name} @${u.handle}` : `@${u.handle}`; +// AuthorName steht in der Byline neben dem Avatar, zweizeilig: oben der +// Anzeigename (ohne einen der Handle), darunter "@handle" und meta, etwa die +// Zeit. Beide Zeilen verlinken auf to. +export function AuthorName({ u, to, meta }: { u: Author; to: string; meta?: ReactNode }) { + return ( + + {u.display_name || u.handle} + + @{u.handle} + {meta} + + + ); } export function formatTime(unix: number): string { diff --git a/frontend/src/pages/ChatsPage.tsx b/frontend/src/pages/ChatsPage.tsx index 2d829e1..2d2f426 100644 --- a/frontend/src/pages/ChatsPage.tsx +++ b/frontend/src/pages/ChatsPage.tsx @@ -4,7 +4,7 @@ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; import { api, errMsg } from "../api"; import { useMe } from "../auth"; import { AuthBox } from "../components/AuthBox"; -import { avatarUrl, formatTime, linkify, userName } from "../format"; +import { AuthorName, avatarUrl, formatTime, linkify } from "../format"; import { submitOnCtrlEnter } from "../keys"; import { hasRememberedPassphrase, @@ -64,10 +64,11 @@ function ChatList({ handle }: { handle: string }) { {chats.data?.map((c) => (
  • - - {userName(c)} · {formatTime(c.last_at)} - {c.unread > 0 && · {c.unread} neu} - + · {formatTime(c.last_at)}{c.unread > 0 && · {c.unread} neu}} + />
  • ))}