From 0a2308c4918a837d859115ca09f83992a3892265 Mon Sep 17 00:00:00 2001 From: feco Date: Thu, 26 Nov 2026 12:20:17 +0000 Subject: [PATCH] Forum design: own reaction marks, compact posts, avatars for the light theme MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As on the approved canvas: reactions are the forum's own line marks (heart, lotus, two circles, star) with a count, the viewer's own filled; the big 2x2 boxes under the opening post are gone and the names live in the + menu and tooltips. A post's head is one line (avatar, name, rank, Sun/Moon/Ascendant as glyphs, time), on wide screens the text lines up under the name instead of the tall author column. "Válasz" is a small button; edit, delete, report and moderation sit in a ⋯ menu. The listening wish is a thin line under the title. In the light theme the avatars get a pale tint and a darker glyph (the night circle read as a black blot). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL --- services/frontend/src/app/forum/forum.css | 172 +++++--- .../src/components/forum/AuthorLine.tsx | 31 +- .../frontend/src/components/forum/Avatar.tsx | 20 +- .../src/components/forum/ReactionIcon.tsx | 49 +++ .../src/components/forum/ReportButton.tsx | 35 +- .../src/components/forum/ThreadView.tsx | 416 ++++++++++-------- 6 files changed, 436 insertions(+), 287 deletions(-) create mode 100644 services/frontend/src/components/forum/ReactionIcon.tsx diff --git a/services/frontend/src/app/forum/forum.css b/services/frontend/src/app/forum/forum.css index 662f371..874c15b 100644 --- a/services/frontend/src/app/forum/forum.css +++ b/services/frontend/src/app/forum/forum.css @@ -20,6 +20,10 @@ --f-orange-tint: rgba(240, 163, 94, 0.12); --f-red-tint: rgba(242, 160, 160, 0.08); --f-green-tint: rgba(159, 216, 176, 0.12); + --r-with_you: #e58aa6; + --r-thanks: #d9b46a; + --r-me_too: #7fb0e0; + --r-insight: #c3a6f0; color: var(--ink); } .forum[data-theme="light"] { @@ -49,6 +53,10 @@ --f-orange-tint: rgba(156, 82, 14, 0.09); --f-red-tint: rgba(176, 58, 58, 0.07); --f-green-tint: rgba(45, 122, 76, 0.1); + --r-with_you: #b4466a; + --r-thanks: #8a6a24; + --r-me_too: #2c66a0; + --r-insight: #6b4fa0; color-scheme: light; } /* The light forum takes the whole page between the (dark) header and footer @@ -117,11 +125,23 @@ body:has(.forum[data-theme="light"]) .site-footer { background: #0d1220; } } /* --- avatars and the author line --- */ -.av { position: relative; display: inline-flex; flex: none; } +.av { position: relative; display: inline-flex; flex: none; --av-bg: #1c2540; --av-ink: #d9b46a; } .av svg { display: block; } -/* The night-coloured avatars keep the bright gold in both themes. */ -.av-glyph { fill: none; stroke: #d9b46a; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; } -.av-glyph .av-fill { fill: #d9b46a; stroke: none; } +.av-lila { --av-bg: #2a2342; } +.av-tenger { --av-bg: #1d3038; } +.av-borostyan { --av-bg: #33291c; } +.av-rozsa { --av-bg: #3a2230; } +.av-erdo { --av-bg: #1f3326; } +/* Light theme: a pale tint and a darker glyph (a night circle read as a black blot). */ +.forum[data-theme="light"] .av-ejkek { --av-bg: #e4e8f3; --av-ink: #2f3d6b; } +.forum[data-theme="light"] .av-lila { --av-bg: #ece6f5; --av-ink: #5b4691; } +.forum[data-theme="light"] .av-tenger { --av-bg: #e0eff0; --av-ink: #2a6670; } +.forum[data-theme="light"] .av-borostyan { --av-bg: #f5ead7; --av-ink: #8a6a24; } +.forum[data-theme="light"] .av-rozsa { --av-bg: #f6e3ea; --av-ink: #9b3f5f; } +.forum[data-theme="light"] .av-erdo { --av-bg: #e2efe4; --av-ink: #3d6b47; } +.av-bg { fill: var(--av-bg); } +.av-glyph { fill: none; stroke: var(--av-ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; } +.av-glyph .av-fill { fill: var(--av-ink); stroke: none; } .av-online { position: absolute; right: -1px; bottom: -1px; width: 28%; height: 28%; min-width: 9px; min-height: 9px; border-radius: 50%; background: var(--f-online); border: 2px solid var(--panel); box-sizing: border-box; @@ -277,6 +297,8 @@ body:has(.forum[data-theme="light"]) .site-footer { background: #0d1220; } .ftv-intent-advice { background: var(--f-orange-tint); } .ftv-intent-advice strong { color: var(--square); } .ftv-title { font-size: 30px; line-height: 1.12; } +.ftv-intent-line { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: -4px; font-size: 14px; color: var(--muted); } +.ftv-intent-line .ft-intent { align-self: center; padding: 1px 10px; font-weight: 600; } .ftv-count { display: flex; justify-content: space-between; align-items: baseline; padding-top: 6px; } .ftv .ftv-count h2 { font-family: var(--font-body); font-size: 15px; color: var(--ink-2); } .ftv-branch { display: flex; flex-direction: column; } @@ -294,92 +316,106 @@ body:has(.forum[data-theme="light"]) .site-footer { background: #0d1220; } .ftv-replyto { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); } .ftv-gate { padding: 16px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); } -/* --- posts: author on top on phones, the old forums' author column on wide screens --- */ -.fp { display: flex; flex-direction: column; padding: 16px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 90px; } -.fp-content { display: flex; flex-direction: column; gap: 10px; min-width: 0; } -.fp-author, .fp-when { display: none; } +/* --- posts: a one-line head (avatar, name, rank, signs, time), the text, a + small action row; on wide screens the text lines up under the name --- */ +.fp { + display: grid; grid-template-columns: auto minmax(0, 1fr); + grid-template-areas: "av head" "body body" "actions actions" "report report"; + column-gap: 10px; row-gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 90px; +} +.fp-av { grid-area: av; display: inline-flex; align-self: center; } +.fp-av a { display: inline-flex; } +.fp-head { grid-area: head; display: flex; align-items: center; gap: 8px; min-width: 0; } +.fp-names { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 6px; flex: 1; min-width: 0; } +.fp-names .fa-name { font-size: 15px; } +.fp-signs { font-size: 13px; color: var(--muted); letter-spacing: 0.5px; } +.fp-time { flex: none; font-size: 13px; color: var(--muted); } +.fp-content { grid-area: body; min-width: 0; display: flex; flex-direction: column; gap: 8px; } +.fp-actions { grid-area: actions; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; } +.fp-report { grid-area: report; } +.fp-opening { padding-top: 10px; padding-bottom: 14px; } +.fp-opening .fp-names .fa-name { font-size: 16px; } .ftv-children .fp:last-child { border-bottom: 0; } -.fp-opening { padding-top: 6px; padding-bottom: 20px; } -.fp-body { font-size: 17px; line-height: 1.6; overflow-wrap: anywhere; color: var(--ink); } -.fp-body p + p { margin-top: 10px; } +.fp-nested { padding: 8px 0; row-gap: 4px; } +.fp-nested .fp-body { font-size: 15px; } +.fp-body { font-size: 16px; line-height: 1.55; overflow-wrap: anywhere; color: var(--ink); } +.fp-body p + p { margin-top: 8px; } +.fp.fp-removed { display: flex; flex-direction: column; } .fp-removed { - gap: 4px; margin: 12px 0; padding: 12px 14px; border: 1px dashed var(--line-2); + gap: 4px; margin: 10px 0; padding: 12px 14px; border: 1px dashed var(--line-2); border-radius: 12px; color: var(--ink-2); font-size: 15px; } .fp-mod-note { font-size: 13px; color: var(--danger); } .fp-collapsed { - align-self: flex-start; min-height: 44px; padding: 0; border: 0; background: none; color: var(--muted); + align-self: flex-start; min-height: 40px; padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 15px; text-decoration: underline; cursor: pointer; } -.fp-helped { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ok); } -.fp-helped svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; } -.fp-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; } +.fp-helped { display: inline-flex; align-items: center; gap: 4px; margin-right: 2px; font-size: 12px; font-weight: 500; color: var(--ok); } +.fp-helped svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; } .fp-spacer { flex: 1; } -.fp-link { - min-height: 44px; padding: 0 8px; border: 0; background: none; color: var(--gold); - font: 500 15px var(--font-body); cursor: pointer; +.fp-reply { + display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 0 8px; border: 0; border-radius: 8px; + background: none; color: var(--ink-2); font: 500 13px var(--font-body); cursor: pointer; } -.fp-link:hover { color: var(--gold-hover); } -.fp-tools { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; } -.fp-tools:empty { display: none; } -.fp-tool { - min-height: 36px; padding: 0 8px; border: 0; border-radius: 8px; background: none; color: var(--muted); - font: 400 14px var(--font-body); cursor: pointer; +.fp-reply:hover { color: var(--gold); background: var(--f-hover); } +.fp-reply svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; } +.fp-more { + display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; border-radius: 8px; + background: none; color: var(--muted); cursor: pointer; } -.fp-tool:hover { color: var(--ink); background: var(--f-hover); } -.fp-tool[aria-pressed="true"] { color: var(--ok); } -.fp-tool-mod { color: var(--danger); } -@media (min-width: 900px) { - .forum-inner .ftv { gap: 14px; } - .fp { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 0 24px; padding: 20px 0; } - .fp.fp-removed { display: flex; flex-direction: column; } - .fp-head { display: none; } - .fp-author { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; } - .fp-author-name { font-size: 16px; font-weight: 600; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; margin-top: 2px; } - .fp-author-name:hover { color: var(--gold); } - .fp-author-signs { display: flex; flex-direction: column; gap: 1px; font-size: 13px; color: var(--muted); margin-top: 2px; } - .fp-when { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); } - .ftv-children { margin-left: 40px; padding-left: 20px; } - .ftv-children .fp { grid-template-columns: 120px minmax(0, 1fr); } - .fr-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } +.fp-more:hover, .fp-more[aria-expanded="true"] { color: var(--ink); background: var(--f-hover); } +.fp-more svg { width: 18px; height: 18px; fill: currentColor; } +@media (min-width: 760px) { + .fp { grid-template-columns: 44px minmax(0, 1fr); grid-template-areas: "av head" ". body" ". actions" ". report"; column-gap: 14px; } + .fp-av { justify-content: center; } + .fp-nested { grid-template-columns: 30px minmax(0, 1fr); column-gap: 10px; } .ftv-incoming { bottom: 20px; } } -/* --- reactions --- */ -.fr-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } -.fr-big { - display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 12px; border-radius: 12px; - border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); font: 500 15px var(--font-body); cursor: pointer; - text-align: left; -} -.fr-big:hover:not(:disabled) { border-color: var(--f-border-hover); } -.fr-big[aria-pressed="true"] { border-color: var(--gold); background: var(--f-tint-strong); } -.fr-big:disabled { cursor: default; } -.fr-big-label { flex: 1; min-width: 0; } -.fr-count { color: var(--muted); } -.fr-big[aria-pressed="true"] .fr-count { color: var(--gold); font-weight: 600; } +/* --- reactions: the forum's own marks, an icon and a count --- */ +.ri { fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; } +.ri-with_you { stroke: var(--r-with_you); } +.ri-thanks { stroke: var(--r-thanks); } +.ri-me_too { stroke: var(--r-me_too); } +.ri-insight { stroke: var(--r-insight); } +.ri-filled.ri-with_you { fill: color-mix(in srgb, var(--r-with_you) 28%, transparent); } +.ri-filled.ri-thanks { fill: color-mix(in srgb, var(--r-thanks) 28%, transparent); } +.ri-filled.ri-me_too { fill: color-mix(in srgb, var(--r-me_too) 24%, transparent); } +.ri-filled.ri-insight { fill: color-mix(in srgb, var(--r-insight) 28%, transparent); } +.ri-filled .ri-line { fill: none; } .fr-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; } .fr-chip { - min-height: 44px; min-width: 44px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); - background: none; color: var(--ink); font: 500 14px var(--font-body); cursor: pointer; + display: inline-flex; align-items: center; gap: 5px; min-height: 32px; min-width: 32px; padding: 0 10px; box-sizing: border-box; + border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); + font: 500 13px var(--font-body); cursor: pointer; justify-content: center; } +.fp-nested .fr-chip { min-height: 30px; } .fr-chip:disabled { cursor: default; } -.fr-chip:hover:not(:disabled) { border-color: var(--f-border-hover); } -.fr-chip[aria-pressed="true"] { border-color: var(--gold); background: var(--f-tint-strong); } -.fr-add { border-style: dashed; color: var(--muted); font-size: 18px; } -.fr-down { color: var(--muted); font-size: 18px; } +.fr-chip:hover:not(:disabled) { border-color: var(--line-2); } +.fr-chip[aria-pressed="true"]:has(.ri-with_you) { border-color: var(--r-with_you); background: color-mix(in srgb, var(--r-with_you) 9%, var(--panel)); } +.fr-chip[aria-pressed="true"]:has(.ri-thanks) { border-color: var(--r-thanks); background: color-mix(in srgb, var(--r-thanks) 9%, var(--panel)); } +.fr-chip[aria-pressed="true"]:has(.ri-me_too) { border-color: var(--r-me_too); background: color-mix(in srgb, var(--r-me_too) 9%, var(--panel)); } +.fr-chip[aria-pressed="true"]:has(.ri-insight) { border-color: var(--r-insight); background: color-mix(in srgb, var(--r-insight) 9%, var(--panel)); } +.fr-add { padding: 0; border-style: dashed; border-color: var(--line-2); background: none; color: var(--muted); } +.fr-add svg, .fr-down svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; } +.fr-down { padding: 0; border-color: transparent; background: none; color: var(--muted); } +.fr-down svg { width: 18px; height: 18px; } .fr-down[aria-pressed="true"] { background: var(--f-hover); color: var(--ink); } -.fr-more { position: relative; } -.fr-pop { - position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 10; min-width: 210px; padding: 6px; + +/* --- small menus (the + of reactions, the ⋯ of a post) --- */ +.fpop-wrap { position: relative; display: inline-flex; } +.fpop { + position: absolute; left: 0; top: calc(100% + 6px); z-index: 20; min-width: 210px; padding: 6px; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--f-shadow); } -.fr-pop-item { - display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 8px; - background: none; color: var(--ink); font: 400 15px var(--font-body); text-align: left; cursor: pointer; +.fpop-right { left: auto; right: 0; } +.fpop-item { + display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border: 0; border-radius: 8px; + background: none; color: var(--ink); font: 400 15px var(--font-body); text-align: left; cursor: pointer; white-space: nowrap; } -.fr-pop-item:hover { background: var(--f-hover); } +.fpop-item:hover, .fpop-item[aria-pressed="true"] { background: var(--f-hover); } +.fpop-danger { color: var(--danger); } /* --- composer --- */ .fc { display: flex; flex-direction: column; gap: 8px; } @@ -505,3 +541,5 @@ body:has(.forum[data-theme="light"]) .site-footer { background: #0d1220; } .ftyping-dots span:nth-child(3) { animation-delay: 0.3s; } @keyframes ftyping { 0%, 60%, 100% { opacity: 0.25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } } @media (prefers-reduced-motion: reduce) { .ftyping-dots span { animation: none; opacity: 0.6; } } +.fp-link { min-height: 32px; padding: 0 8px; border: 0; background: none; color: var(--gold); font: 500 15px var(--font-body); cursor: pointer; } +.fp-link:hover { color: var(--gold-hover); } diff --git a/services/frontend/src/components/forum/AuthorLine.tsx b/services/frontend/src/components/forum/AuthorLine.tsx index c61cb72..25319a5 100644 --- a/services/frontend/src/components/forum/AuthorLine.tsx +++ b/services/frontend/src/components/forum/AuthorLine.tsx @@ -17,6 +17,28 @@ export function signsText(signs: Record | null | undefined): str return parts.length ? parts.join(" · ") : null; } +/** + * The short form next to a post: Sun, Moon and Ascendant as glyphs + * ("☉♓ ☽♋ ↑♍"), with the names in `title`. Every planet only on the profile. + */ +export function signGlyphs(signs: Record | null | undefined): { text: string; title: string } | null { + if (!signs) return null; + const parts: string[] = []; + const names: string[] = []; + for (const [point, label] of [ + ["sun", "Nap"], + ["moon", "Hold"], + ["ascendant", "Aszcendens"], + ] as const) { + const sign = signs[point]; + if (!sign) continue; + const mark = point === "ascendant" ? "↑" : (POINTS[point]?.glyph ?? ""); + parts.push(`${mark}${SIGNS[sign]?.glyph ?? ""}`); + names.push(`${label}: ${SIGNS[sign]?.hu ?? sign}`); + } + return parts.length ? { text: parts.join(" "), title: names.join(", ") } : null; +} + const ORDER = [ "sun", "moon", @@ -65,7 +87,8 @@ export function AuthorLine({ ); } - const shown = signs ? signsText(author.signs) : null; + const glyphs = signs ? signGlyphs(author.signs) : null; + const shown = glyphs?.text ?? null; return (
@@ -83,7 +106,11 @@ export function AuthorLine({ {(shown || time) && ( - {shown && {shown}} + {shown && ( + + {shown} + + )} {shown && time && " · "} {time && (
) : null} - {intent && thread.intent === "listen" && ( -
- {intent.label} - {starter} most nem kér tanácsot. Elég, ha jelen vagy, és leírod, ha veled is történt hasonló. -
- )} - {intent && thread.intent === "advice" && ( -
- {intent.label} - {starter} kíváncsi a véleményetekre és a tapasztalataitokra. -
- )} -

{thread.pinned && Kitűzve} {thread.locked && Lezárva} {thread.title}

+ {intent && ( +

+ {intent.label} + {thread.intent === "listen" + ? "tanács helyett elég, ha jelen vagy, és leírod, ha veled is történt hasonló" + : `${starter} kíváncsi a véleményetekre és a tapasztalataitokra`} +

+ )} {opening && } @@ -570,6 +603,7 @@ export function ThreadView({ initial }: { initial: ThreadPage }) { {childrenOf(top.id).map((child) => (