Forum: answers to me as the only count, reply box in the branch, keyboard-safe inputs
- The "Követett" tab becomes "Válaszok": its count is the unread answers to the member (a reply to their post, a first-level reply in their thread, or a post naming them), listed on /forum/valaszok with "Mind olvasott"; the followed threads are its second view. The other counts are gone from the menu; listeners see the waiting threads on their card on the front page. - Replying to a post opens the box at the bottom of its branch and scrolls there; another branch moves it (with the text typed so far). - Phones: while typing, the forum's bottom menu and floating bars step aside and the box with its send button is scrolled above the keyboard (KeyboardSafe, site-wide; Android resizes the page for the keyboard). - The "Meghallgató" badge is now "Kísérő", with a new icon. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
@@ -151,7 +151,7 @@ export default async function PrivacyPage() {
|
||||
<td>
|
||||
Fórumprofilod: az álneved (a korábbiakat 90 napig, hogy más ne vehesse fel), az avatarod vagy a
|
||||
feltöltött saját képed (kicsinyítve, a kép rejtett adatai, például a helyszín nélkül), a
|
||||
bemutatkozásod, a képletedből megosztott jegyek, hogy önkéntes meghallgató vagy-e, a Támogató
|
||||
bemutatkozásod, a képletedből megosztott jegyek, hogy önkéntes kísérő vagy-e, a Támogató
|
||||
jelvény (ha bekapcsolod, mások látják, hogy vásároltál), a láthatatlan mód és az e-mail-értesítések
|
||||
beállítása
|
||||
</td>
|
||||
@@ -221,7 +221,7 @@ export default async function PrivacyPage() {
|
||||
<strong>Fórum:</strong> amit a nyilvános témákban írsz, bárki láthatja, a keresők is; a csak tagoknak szóló
|
||||
témákat csak belépett felhasználók látják, a zárt témákat csak a jóváhagyott tagjaik. A hozzászólásaid
|
||||
mellett az álneved, az avatarod, a rangod, az általad megosztott jegyek és a bekapcsolt jelvényeid
|
||||
(Meghallgató, Támogató) látszanak; a valódi neved, az e-mail-címed és a születési adataid nem, és a
|
||||
(Kísérő, Támogató) látszanak; a valódi neved, az e-mail-címed és a születési adataid nem, és a
|
||||
képletedből soha nem mutatunk fokokat. A privát üzeneteidet csak a beszélgetés két résztvevője látja; a
|
||||
moderátorok csak akkor, ha valaki egy üzenetet jelent, és akkor is csak a jelentett üzenetet és az előtte
|
||||
lévő néhányat. A moderátorok (az üzemeltető által kijelölt tagok) a valódi nevedet és az e-mail-címedet nem
|
||||
|
||||
@@ -248,10 +248,10 @@ export function ProfileForm({ me, back }: { me: ForumMe; back: string | null })
|
||||
<label className="fprof-check">
|
||||
<input type="checkbox" checked={listener} onChange={(e) => setListener(e.target.checked)} />
|
||||
<span>
|
||||
<strong>Önkéntes meghallgató vagyok</strong>
|
||||
<strong>Önkéntes kísérő vagyok</strong>
|
||||
<span className="hint">
|
||||
A nevem mellett megjelenik a „Meghallgató” jelvény, és a menü jelzi, ha egy meghallgatást kérő szál válasz
|
||||
nélkül vár. E-mailt is kérhetsz róla lent.
|
||||
Szívesen válaszolok azoknak, akik meghallgatást kérnek. A nevem mellett megjelenik a „Kísérő” jelvény, és
|
||||
a fórum főoldalán látom, hány ilyen szál vár válaszra. E-mailt is kérhetsz róla lent.
|
||||
</span>
|
||||
</span>
|
||||
</label>
|
||||
@@ -315,7 +315,9 @@ export function ProfileForm({ me, back }: { me: ForumMe; back: string | null })
|
||||
</select>
|
||||
{listener && (
|
||||
<>
|
||||
<label htmlFor="fprof-mail-listener">Meghallgatóként: ha egy szál két órája válasz nélkül vár</label>
|
||||
<label htmlFor="fprof-mail-listener">
|
||||
Kísérőként: ha egy meghallgatást kérő szál két órája válasz nélkül vár
|
||||
</label>
|
||||
<select
|
||||
id="fprof-mail-listener"
|
||||
className="inp"
|
||||
@@ -340,8 +342,8 @@ export function ProfileForm({ me, back }: { me: ForumMe; back: string | null })
|
||||
</span>
|
||||
</label>
|
||||
<span className="hint">
|
||||
Ha éppen itt vagy a fórumon, nem küldünk levelet: a menü jelzi az újdonságot. A privát üzenetek szövege nem
|
||||
kerül bele a levélbe.
|
||||
Ha éppen itt vagy a fórumon, nem küldünk levelet: a válaszokat a Válaszok fülön, az üzeneteket az Üzenetek
|
||||
fülön látod. A privát üzenetek szövege nem kerül bele a levélbe.
|
||||
</span>
|
||||
</fieldset>
|
||||
|
||||
|
||||
@@ -605,3 +605,42 @@ a.fh-online-item:hover { color: var(--gold); }
|
||||
.ftopic-private svg, .ftv-private svg { width: 15px; height: 15px; flex: none; margin-top: 2px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
|
||||
.ftv-private { display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; font-size: 13px; color: var(--muted); }
|
||||
.ftv-private svg { margin-top: 0; width: 13px; height: 13px; }
|
||||
|
||||
/* --- "Válaszok": answers to the member --- */
|
||||
.frep-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
|
||||
.fanswers { list-style: none; margin: 0; padding: 0; }
|
||||
.fanswers li + li { border-top: 1px solid var(--line); }
|
||||
.fanswer {
|
||||
display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: start;
|
||||
padding: 14px 16px; color: var(--ink); text-decoration: none;
|
||||
}
|
||||
.fanswer:hover { background: var(--f-hover); }
|
||||
.fanswer-new { background: var(--f-tint); }
|
||||
.fanswer-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
|
||||
.fanswer-who { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 15px; }
|
||||
.fanswer-thread { font-size: 14px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.fanswer-excerpt {
|
||||
font-size: 14px; color: var(--muted); overflow: hidden;
|
||||
display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
|
||||
}
|
||||
.fanswer-time { font-size: 12px; color: var(--muted); white-space: nowrap; }
|
||||
.fh-me-waiting { font-size: 14px; color: var(--harmonic); text-decoration: none; }
|
||||
.fh-me-waiting:hover { text-decoration: underline; }
|
||||
|
||||
/* The reply box at the bottom of a branch, where the answers to that post go. */
|
||||
.ftv-inline {
|
||||
display: flex; flex-direction: column; gap: 6px; margin: 4px 0 8px 17px; padding: 8px 0 4px 14px;
|
||||
border-left: 2px solid var(--gold); scroll-margin: 96px 0 120px;
|
||||
}
|
||||
.ftv-inline .ftv-replyto { display: flex; align-items: center; gap: 5px; margin: 0; }
|
||||
.ftv-inline .ftv-replyto svg {
|
||||
width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
|
||||
}
|
||||
|
||||
/* Phones, while typing: the bottom menu and the floating button step aside
|
||||
for the keyboard (KeyboardSafe sets kb-open), and a focused box keeps room
|
||||
around it for its send button. */
|
||||
@media (max-width: 759px) {
|
||||
.kb-open .forum-nav, .kb-open .ftv-incoming { display: none; }
|
||||
}
|
||||
.forum textarea, .forum input { scroll-margin: 88px 0 96px; }
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
import { RepliesTabs } from "@/components/forum/RepliesTabs";
|
||||
import { ThreadList } from "@/components/forum/ThreadList";
|
||||
import type { ForumViewer, ThreadCard } from "@/lib/forum";
|
||||
import { forumGet } from "@/lib/forumServer";
|
||||
@@ -13,7 +14,8 @@ export default async function FollowedPage() {
|
||||
const { threads } = res.data;
|
||||
return (
|
||||
<div className="fh">
|
||||
<h1 className="fpage-title">Követett szálak</h1>
|
||||
<h1 className="fpage-title">Válaszok</h1>
|
||||
<RepliesTabs current="followed" />
|
||||
<p className="muted">A saját szálaid, azok, amelyekhez hozzászóltál, és amelyeket követni kezdtél.</p>
|
||||
{threads.length === 0 ? (
|
||||
<p className="fh-card fh-empty">Még nem követsz egy szálat sem.</p>
|
||||
|
||||
@@ -42,10 +42,9 @@ export default async function ForumLayout({ children }: { children: React.ReactN
|
||||
member={viewer?.member?.nickname ?? null}
|
||||
loggedIn={viewer?.logged_in ?? false}
|
||||
initial={{
|
||||
unread: nav.ok ? (nav.data.followed?.new_replies ?? 0) : 0,
|
||||
replies: nav.ok ? (nav.data.replies ?? 0) : 0,
|
||||
messages: nav.ok ? (nav.data.messages ?? 0) : 0,
|
||||
reports: nav.ok ? (nav.data.reports ?? 0) : 0,
|
||||
waiting: nav.ok ? (nav.data.waiting ?? 0) : 0,
|
||||
}}
|
||||
wsUrl={process.env.FORUM_WS_URL || "/api/v1/forum/ws"}
|
||||
/>
|
||||
|
||||
@@ -87,7 +87,7 @@ function SkyCard({ sky }: { sky: SkyNow }) {
|
||||
export default async function ForumHomePage() {
|
||||
const [home, sky] = await Promise.all([forumGet<ForumHome>("/v1/forum/home"), loadSky()]);
|
||||
if (!home.ok) notFound();
|
||||
const { viewer, followed, topics, unanswered, hot } = home.data;
|
||||
const { viewer, replies, waiting, topics, unanswered, hot } = home.data;
|
||||
|
||||
return (
|
||||
<div className="fh fh-home">
|
||||
@@ -123,17 +123,17 @@ export default async function ForumHomePage() {
|
||||
</p>
|
||||
)}
|
||||
|
||||
{followed && followed.new_replies > 0 && (
|
||||
<Link href="/forum/kovetett" className="fh-banner o-2">
|
||||
{replies !== null && replies > 0 && (
|
||||
<Link href="/forum/valaszok" className="fh-banner o-2">
|
||||
<span>
|
||||
<strong>{followed.new_replies} új válasz</strong> a követett szálaidban
|
||||
<strong>{replies === 1 ? "1 új válasz" : `${replies} új válasz`}</strong> érkezett neked
|
||||
</span>
|
||||
<span aria-hidden="true">›</span>
|
||||
</Link>
|
||||
)}
|
||||
|
||||
{unanswered.length > 0 && (
|
||||
<section className="fh-section o-4" aria-labelledby="fh-waiting">
|
||||
<section className="fh-section o-4" id="varnak" aria-labelledby="fh-waiting">
|
||||
<div className="fh-section-head">
|
||||
<h2 id="fh-waiting">Várják a válaszod</h2>
|
||||
<span className="hint">még senki nem válaszolt</span>
|
||||
@@ -267,6 +267,13 @@ export default async function ForumHomePage() {
|
||||
<RankBadge rank={viewer.member.rank} name={viewer.member.rank_name} />
|
||||
</span>
|
||||
</div>
|
||||
{waiting !== null && waiting > 0 && (
|
||||
<Link href="#varnak" className="fh-me-waiting">
|
||||
{waiting === 1
|
||||
? "1 meghallgatást kérő szál vár válaszra"
|
||||
: `${waiting} meghallgatást kérő szál vár válaszra`}
|
||||
</Link>
|
||||
)}
|
||||
<div className="fh-me-actions">
|
||||
<Link href="/forum/uj" className="btn btn-primary btn-sm">
|
||||
Új szál
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
"use client";
|
||||
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
|
||||
import { api } from "@/lib/api";
|
||||
|
||||
/** "Mind olvasott": the answers stay in the list, the count on the tab goes. */
|
||||
export function ReadAll() {
|
||||
const router = useRouter();
|
||||
const [busy, setBusy] = useState(false);
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-ghost btn-sm"
|
||||
disabled={busy}
|
||||
onClick={async () => {
|
||||
setBusy(true);
|
||||
try {
|
||||
await api("/forum/replies/read", { method: "POST" });
|
||||
window.dispatchEvent(new Event("forum:nav"));
|
||||
router.refresh();
|
||||
} finally {
|
||||
setBusy(false);
|
||||
}
|
||||
}}
|
||||
>
|
||||
Mind olvasott
|
||||
</button>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
import Link from "next/link";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
import { Avatar } from "@/components/forum/Avatar";
|
||||
import { RepliesTabs } from "@/components/forum/RepliesTabs";
|
||||
import { type ReplyEntry, ago, threadHref } from "@/lib/forum";
|
||||
import { forumGet } from "@/lib/forumServer";
|
||||
|
||||
import { ReadAll } from "./ReadAll";
|
||||
|
||||
export const metadata = { title: "Válaszok", robots: { index: false } };
|
||||
|
||||
const KIND: Record<ReplyEntry["kind"], string> = {
|
||||
reply: "válaszolt neked",
|
||||
thread: "válaszolt a száladban",
|
||||
mention: "megemlített",
|
||||
};
|
||||
|
||||
/** The answers to the member, newest first; the unread ones stand out. */
|
||||
export default async function RepliesPage({ searchParams }: { searchParams: Promise<{ oldal?: string }> }) {
|
||||
const page = Math.max(1, Number((await searchParams).oldal) || 1);
|
||||
const res = await forumGet<{ replies: ReplyEntry[]; unread: number; more: boolean }>(
|
||||
`/v1/forum/replies?page=${page}`,
|
||||
);
|
||||
if (!res.ok) redirect("/belepes?vissza=/forum/valaszok");
|
||||
const { replies, unread, more } = res.data;
|
||||
return (
|
||||
<div className="fh">
|
||||
<h1 className="fpage-title">Válaszok</h1>
|
||||
<div className="frep-head">
|
||||
<RepliesTabs current="replies" />
|
||||
{unread > 0 && <ReadAll />}
|
||||
</div>
|
||||
<p className="muted">
|
||||
Ha valaki a hozzászólásodra vagy a száladban válaszol, vagy megemlít. A menüben csak ezek száma látszik.
|
||||
</p>
|
||||
{replies.length === 0 ? (
|
||||
<p className="fh-card fh-empty">Még nem válaszolt neked senki. Ha valaki ír neked, itt látod.</p>
|
||||
) : (
|
||||
<ul className="fh-card fh-flush fanswers">
|
||||
{replies.map((r) => (
|
||||
<li key={r.id}>
|
||||
<Link href={threadHref(r.thread, r.id)} className={r.unread ? "fanswer fanswer-new" : "fanswer"}>
|
||||
<Avatar avatar={r.author?.avatar} size={36} online={r.author?.online} />
|
||||
<span className="fanswer-text">
|
||||
<span className="fanswer-who">
|
||||
<strong>{r.author?.nickname ?? "Törölt tag"}</strong> {KIND[r.kind]}
|
||||
{r.unread && <span className="fa-badge fa-badge-new">új</span>}
|
||||
</span>
|
||||
<span className="fanswer-thread">{r.thread.title}</span>
|
||||
<span className="fanswer-excerpt">{r.excerpt}</span>
|
||||
</span>
|
||||
<time className="fanswer-time" suppressHydrationWarning dateTime={r.created_at}>
|
||||
{ago(r.created_at)}
|
||||
</time>
|
||||
</Link>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
)}
|
||||
{(page > 1 || more) && (
|
||||
<nav className="forum-pager" aria-label="Lapozás">
|
||||
{page > 1 ? <Link href={`/forum/valaszok?oldal=${page - 1}`}>‹ Újabbak</Link> : <span />}
|
||||
<span className="hint">{page}. oldal</span>
|
||||
{more ? <Link href={`/forum/valaszok?oldal=${page + 1}`}>Régebbiek ›</Link> : <span />}
|
||||
</nav>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -834,6 +834,9 @@ a.pair-row:hover strong { color: var(--gold); }
|
||||
.qdock-fab-label { display: none; }
|
||||
.qdock-dot { left: 42px; }
|
||||
.qdock-panel { inset: 0; width: 100%; height: 100dvh; border: 0; border-radius: 0; }
|
||||
/* While typing: only the part of the screen above the keyboard (KeyboardSafe). */
|
||||
.kb-open .qdock-panel { top: var(--vv-top, 0px); bottom: auto; height: var(--vv-height, 100dvh); }
|
||||
.kb-open .qdock-fab { display: none; }
|
||||
body.qdock-open { overflow: hidden; }
|
||||
}
|
||||
@media (max-width: 480px) {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import type { Metadata } from "next";
|
||||
import type { Metadata, Viewport } from "next";
|
||||
import { Cormorant_Garamond, Inter } from "next/font/google";
|
||||
import { Suspense } from "react";
|
||||
|
||||
import { KeyboardSafe } from "@/components/KeyboardSafe";
|
||||
import { NightSky } from "@/components/NightSky";
|
||||
import { NpsBanner } from "@/components/NpsBanner";
|
||||
import { PaymentReturn } from "@/components/PaymentReturn";
|
||||
@@ -30,6 +31,10 @@ export async function generateMetadata(): Promise<Metadata> {
|
||||
};
|
||||
}
|
||||
|
||||
// On Android the opening keyboard shrinks the page instead of covering it
|
||||
// (iOS ignores this; KeyboardSafe handles both).
|
||||
export const viewport: Viewport = { width: "device-width", initialScale: 1, interactiveWidget: "resizes-content" };
|
||||
|
||||
export default async function RootLayout({ children }: { children: React.ReactNode }) {
|
||||
const me = await getMe();
|
||||
// The Moon today in the header (cached for five minutes).
|
||||
@@ -38,6 +43,7 @@ export default async function RootLayout({ children }: { children: React.ReactNo
|
||||
<html lang="hu" className={`${cormorant.variable} ${inter.variable}`}>
|
||||
<body>
|
||||
<NightSky />
|
||||
<KeyboardSafe />
|
||||
<ValidationMessages />
|
||||
{me && <SiteHeader me={me} sky={sky} />}
|
||||
{children}
|
||||
|
||||
@@ -85,7 +85,7 @@ const DATA: [string, string, string][] = [
|
||||
"Legitimate interest (Art. 6(1)(f))",
|
||||
],
|
||||
[
|
||||
"Your forum profile: your nickname (earlier ones for 90 days, so nobody else can take them), your avatar or the picture you uploaded (made smaller, without its hidden data such as the location), introduction, the signs of your chart you share, whether you are a volunteer listener, the Támogató (supporter) badge (if you switch it on, others see that you bought something), the invisible mode and your e-mail notification settings",
|
||||
"Your forum profile: your nickname (earlier ones for 90 days, so nobody else can take them), your avatar or the picture you uploaded (made smaller, without its hidden data such as the location), introduction, the signs of your chart you share, whether you are a volunteer companion (Kísérő), the Támogató (supporter) badge (if you switch it on, others see that you bought something), the invisible mode and your e-mail notification settings",
|
||||
"Taking part in the forum; sharing the signs and the badges is your choice",
|
||||
"Performance of the contract",
|
||||
],
|
||||
@@ -191,7 +191,7 @@ export default async function PrivacyPolicyPage() {
|
||||
<strong>Forum:</strong> what you write in the public topics can be seen by anyone, including search engines;
|
||||
the members-only topics are seen only by logged-in users, and the restricted ones only by their approved
|
||||
members. Next to your posts we show your nickname, avatar, rank, the signs you chose to share and the badges
|
||||
you switched on (Meghallgató – listener, Támogató – supporter); never your real name, e-mail address or birth data, and never the
|
||||
you switched on (Kísérő – companion, Támogató – supporter); never your real name, e-mail address or birth data, and never the
|
||||
degrees of your chart. Your private messages are seen only by the two people in the conversation; moderators
|
||||
see a message only when someone reports it, and then only that message and the few before it. Moderators
|
||||
(members appointed by the operator) do not see your real name or e-mail address. The forum rules are in
|
||||
|
||||
Reference in New Issue
Block a user