78 Commits
Author SHA1 Message Date

2026-10-01

lezi-fun b42944b687 feat: follow lite forum updates 2026-10-01 14:10:12 +08:00

2026-09-12

lezi-fun fea9ad1c48 feat: bring lite topic feed styling to next 2026-09-12 18:49:13 +08:00

2026-09-11

lezi-fun 6a0b6adf61 feat: refresh next post feed visuals 2026-09-11 21:45:09 +08:00

2026-08-14

lezi-fun 5f81b819af fix: address automated review findings 2026-08-14 10:37:23 +08:00
lezi-fun f5d173350b feat: refine forum settings uploads and transitions 2026-08-14 10:16:34 +08:00

2026-08-13

lezi-fun 63db81e498 feat: add recovery-code password reset to login 2026-08-13 15:13:30 +08:00
lezi-fun 84c9e97451 feat: add path navigation and shared settings transitions 2026-08-13 12:29:09 +08:00

2026-08-12

lezi-fun caad17d195 feat: animate reply loading state 2026-08-12 20:50:51 +08:00
lezi-fun 207b64b705 fix: unify home post card colors 2026-08-12 20:31:34 +08:00
lezi-fun 96e0e6f08e fix: prevent super admin demotion 2026-08-12 20:12:22 +08:00
lezi-fun 3840bb3c54 fix: support replies on legacy databases 2026-08-12 20:05:29 +08:00
lezi-fun 68b58851e8 fix: refine user post transitions 2026-08-12 19:34:42 +08:00
lezi-fun bbf3262aff feat: animate user profile transitions 2026-08-12 10:24:20 +08:00
lezi-fun 9ae54dff29 fix: synchronize post return handoff 2026-08-12 09:55:13 +08:00
lezi-fun 5e9909ac7a fix: reverse post return transition 2026-08-12 09:34:28 +08:00
lezi-fun b9d6ca5da8 security: server-owned audit logs + fullscreen custom pages
Port upstream PR #22 + Lite style updates:
- lib/audit.js: server-side logAudit(req, action, userId), records
  IP from x-forwarded-for / cf-connecting-ip
- login/register/create_post/create_reply record server-side
- Remove client logEvent calls (AppProvider/NewPost/ReplyList)
- Remove forgeable POST /api/event-logs endpoint
- CustomPage: fullscreen immersive (fixed, 100vh-nav, mobile 56px
  nav offset) matching upstream Lite
2026-08-12 09:06:50 +08:00

2026-08-11

lezi-fun 45ace3ba75 cleanup: remove chain view + show-more, all replies always visible 2026-08-11 22:26:02 +08:00
lezi-fun 0aac277aea Revert "feat: reply chain view (sub-thread folding)"
This reverts commit 4c0f146338.
2026-08-11 22:22:18 +08:00
lezi-fun 4c0f146338 feat: reply chain view (sub-thread folding)
Build reply tree, show up to 3 children per reply. '继续此消息串' opens a dedicated chain view (only that reply + all descendants). '返回所有回复' goes back.
2026-08-11 22:21:09 +08:00
lezi-fun 84616ff4a1 feat: remove reply indicator, dynamic folding (min 3 replies)
Remove per-reply '正在回复 @xxx' indicator. Collapse replies: show count based on viewport height (min 3). Clean up unused CSS.
2026-08-11 22:07:10 +08:00
lezi-fun a57d29ceed feat: collapse replies (show last 5, 继续此消息串)
When >5 replies, show the latest 5 and a '继续此消息串 (还有N条回复)' button. Click to expand all. Discourse-style folding.
2026-08-11 22:03:12 +08:00
lezi-fun b18cd05455 fix: narrow-only reply-header wrap
Remove global flex-wrap, add @media (max-width:480px) flex-wrap: wrap. Wide: one line. Narrow: flex-wrap naturally wraps buttons as whole units (white-space:nowrap prevents text split).
2026-08-11 22:00:52 +08:00
lezi-fun 32fc3cb599 fix: reply-header flex-wrap (natural wrap, no text split)
Removed compact media query. reply-header gets flex-wrap: wrap so buttons wrap as whole units when width is insufficient (white-space:nowrap prevents text splitting).
2026-08-11 21:47:39 +08:00
lezi-fun f3586ef2aa fix: narrow screen compact reply buttons
Media query (max-width:480px): reply-header flex-wrap, smaller btn padding/ font-size, prevent overflow beyond card border.
2026-08-11 21:43:55 +08:00
lezi-fun 56912d28d6 fix: reply-delete-btn white-space:nowrap (prevent narrow-wrap split) 2026-08-11 21:41:43 +08:00
lezi-fun 6c100ff3a1 fix: reply chain uses reply_to_id (UUID) instead of reply_to_username
- reply_to_id UUID FK: precise parent tracking (username was ambiguous
  when same user wrote multiple replies in a chain)
- GET /api/replies: JOIN replies + users to return reply_to_username
- POST /api/replies: accept reply_to_id (UUID) instead of reply_to_username
- Frontend depth calc: follow reply_to_id chain (not username)
- Preview bar: resolve username from local replies by ID
- Indicator scroll: target by data-reply-id
2026-08-11 21:38:45 +08:00
lezi-fun 59d5fb89c0 fix: nested replies keep border-radius (was set to 0 by indent rule) 2026-08-11 21:33:44 +08:00
lezi-fun 16af1cfd41 fix: reply nesting depth + post detail card radius
- Replies: compute nesting depth via reply_to_username chain (depth
  tracking, max 5 levels, 18px indent per level)
- Post detail card: add border-radius var(--radius)
- Reply preview bar: cleaner bottom-border style (no blue box)
2026-08-11 21:31:06 +08:00
lezi-fun d9c4079619 style: reply hierarchy + cleaner reply-preview bar
- Replies with a reply_to target get left-border + indent (Discourse
  thread feel) via :has() selector
- Reply-box preview bar: removed blue box, now a clean bottom-border
  row (回复 @user + 取消 button)
- reply-to indicator: left border line, primary on hover
- Works in light & dark mode (uses --border/--text-light vars)
2026-08-11 21:22:20 +08:00
lezi-fun 4d0d5edec3 feat: Discourse-style reply-to indicator (↩ @username)
- replies table: add reply_to_username column
- POST /api/replies: accept reply_to_username param
- GET /api/replies: LEFT JOIN users to return reply_to_username
- ReplyList: submit replyTo as reply_to_username on create
- UI: each reply shows '↩ 正在回复 @username' indicator (clickable,
  scrolls to target reply)
- data-username attribute on .reply-item for scroll targeting
2026-08-11 21:18:18 +08:00
lezi-fun 7bf9e37036 fix: reply button always visible (mail-style icon), works on own replies
- Reply button: always visible (opacity 0.5), only icon (no text),
  hover → full opacity + primary color
- Works on own replies (no restriction on replying to self)
- Removed .reply-item:hover .reply-btn (was requiring parent hover)
2026-08-11 21:08:55 +08:00
lezi-fun 2bb1f4227e feat: hover reply button → quote + scroll to reply box
- Each reply shows a 回复 button on hover (always visible on touch)
- Click: sets '正在回复 @user' banner, smooth-scrolls to reply box,
  focuses textarea; 取消 clears it
- New reply icon (corner-up-left); clear replyTo after submit
- Reply markdown already rendered via renderMarkdown (sanitized)
2026-08-11 20:57:48 +08:00
lezi-fun d757bde780 feat: super admin badge — earliest admin shows 超级管理员 in user list
- /api/users: mark is_super for the earliest-registered admin (matches
  the auto-promotion migration semantics)
- AdminUsers: render 超级管理员 badge for is_super, 管理员 otherwise
- i18n keys admin.user.roleSuper (zh/en)
- Mobile settings nav: active tab gets top-left/top-right rounded
  corners only (desktop unchanged)
2026-08-11 20:40:02 +08:00
lezi-fun f0867935ac fix: mobile narrow — post action buttons wrap to own row
@media (max-width:640px): .post-header flex-wrap; .post-detail-controls
full-width right-aligned row (no more icon/text split across lines).
2026-08-11 20:34:05 +08:00
lezi-fun 7188d07aea security: server-side CAPTCHA (HMAC-signed) + magic-byte upload sniff + pagination bounds
Port upstream ac4af62 + PR #14/#17:
- lib/captcha.js: HMAC(CAPTCHA_SECRET, id:answer) challenge; GET
  /api/captcha returns {id, text, sig}; register/createPost/createReply
  verify answer server-side (bad answer / forged sig rejected)
- Frontend (Modals/NewPost/ReplyList): fetch challenge from server,
  submit id+answer+sig; no more client-side answer check (was bypassable)
- Upload: sniff JPEG/PNG/GIF/WebP magic bytes (ignore client MIME), UUID
  filenames — blocks spoofed HTML-as-image (stored XSS)
- Posts pagination: limit cap 50, page cap (deep-pagination DoS)
- CAPTCHA_SECRET env (falls back to JWT_SECRET)
2026-08-11 20:25:16 +08:00
lezi-fun 7c6b816ac7 fix: pinned posts not sorted to top + compose pulls GHCR image
- posts API: ORDER BY is_pinned DESC, pinned_at DESC NULLS LAST before
  sort (matches upstream) — pinned posts now appear first
- docker-compose: app service pulls ghcr.io/lezi-fun/forumlify-deploy:next
  instead of local build (auto-rebuilt on push)
2026-08-11 18:55:10 +08:00
lezi-fun dce94fd5af feat: auto-detect browser language (SSR Accept-Language + cookie)
- layout (server): derive language from cookie (user choice) > browser
  Accept-Language; set <html lang> accordingly
- I18nInit → I18nProvider: sync initI18n(lng) before children render
  (SSR/CSR first render same language, no hydration mismatch)
- setAppLanguage also writes cookie so SSR first paint uses chosen lang
- Verified: en browser → lang=en, zh → zh-CN, cookie overrides
2026-08-11 17:42:08 +08:00
lezi-fun 5a9a454ef3 fix: replies drawer auto-expand, settings no-scroll, title bug, admin links
- PostDetail: replies open as drawer (grid-rows animation) automatically
  after post loads — no toggle button
- SettingsPage: outer frame overflow hidden (100vh), only inner panel
  scrolls; hide #app layout when not on feed (fixes navbar moving when
  scrolling settings)
- Title: metadata 'Loading...' → 'Forumlify' (Next resets <title> to
  metadata on re-render → title became Loading... after load); unify
  title effect (rotate Loading. only while !ready && !forumNameLoaded)
- AdminLinks: link divider uses var(--border) (was #f1f5f9, invisible
  in dark mode); add admin.link i18n keys
- AdminPage i18n nav labels
2026-08-11 17:35:48 +08:00
lezi-fun 7cc1f0e228 fix: polish post transition details 2026-08-11 16:56:07 +08:00
lezi-fun cb89f1190c fix: stabilize markdown post transition 2026-08-11 15:58:39 +08:00
lezi-fun 0060034dec fix: morph post card content by element 2026-08-11 15:46:46 +08:00
lezi-fun ae2d5e82ca fix: smooth post title and card morph 2026-08-11 15:32:26 +08:00
lezi-fun 6947cdaf36 fix: polish forum navigation and interface states 2026-08-11 15:25:05 +08:00
lezi-fun 0933220c70 fix: restore dark post view and API revalidation 2026-08-11 13:32:44 +08:00
lezi-fun 5c554f27ea fix: Next 16 cookies() is async — await it in Home (page rendering error
cookies().get() without await threw in Next 16 (sync dynamic API
removed), breaking the whole Home SSR render → layout broken, spinner
restart, flash. Await cookies() before reading forumlify-name.
Also raise glass-bg opacity (0.18→0.62 light / 0.35→0.60 dark) so
cards/navbar/modal aren't see-through.
2026-08-11 11:43:10 +08:00
lezi-fun 72e93ca5bb fix: desktop layout — use #app flex container (was .app-container with no CSS)
HomeClient rendered className='app-container' but globals.css only
defines #app (flex) — sidebar/feed fell back to block layout, feed
pushed below. Switch to id='app' to match upstream stylesheet.
Also: AdminPage i18n (nav labels + title).
2026-08-11 11:38:10 +08:00
lezi-fun 0562dd735a feat: i18n (i18next + react-i18next) zh/en + hydration fixes
- i18next + react-i18next: zh/en locales, language detection
  (localStorage > navigator > zh), settings language switcher
- Components i18n'd: Navbar, Feed, NewPost, Modals, SettingsPage,
  SettingsProfile, AccountSecurity, RecoveryCodes
- Fix hydration mismatch (spinner restart): forum name via cookie
  (Server Component reads cookie, SSR outputs name, no inline script
  DOM injection); remove createPortal in RecoveryCodes modal; i18n
  sync init (initImmediate) so SSR/CSR text matches
- LoadingScreen: React-state name rendering (no script-injected nodes)
- Fix double spinner in Feed; DM icon emoji → SVG in ConversationList
2026-08-11 11:32:15 +08:00
lezi-fun 82bc2eb885 fix: hydration mismatch (loading spinner restart) + cache strategy
Root cause of loading spinner restarting / name appearing twice:
React hydration mismatch → whole tree regenerated. Fixed all sources:
- AppProvider: remove typeof window in useState init (SSR/client diff);
  read cached forum name in useEffect instead
- ToastProvider: remove createPortal(document.body) (SSR absent →
  mismatch)
- LoadingScreen: name container uses dangerouslySetInnerHTML('') so
  React never manages/clobbers the inline-script-filled text
- layout.js: inline script moved to body first child (React official
  anti-FOUC pattern)

Cache: dynamic pages/API no-cache + ETag (304 on revalidate); static
/_next/static assets immutable 1y. Verified: 304 + immutable headers.
2026-08-11 10:52:21 +08:00
lezi-fun b5fafdbc09 fix: long post fade uses mask (text fades out, no white block)
Replace background gradient overlay with mask-image so the text itself
fades to transparent toward the bottom; no solid edge color visible.
2026-08-11 10:30:34 +08:00
lezi-fun 74202f7551 fix: user profile avatar + loading spinners + modal opacity
- UserProfile now uses avatar_url (was always default ui-avatars)
- Loading states show spinner-sm spinner instead of plain text
  (Feed, UserProfile, chat, admin panels, custom pages)
- Modal background: semi-transparent glass (0.85 light / 0.88 dark)
2026-08-11 10:23:33 +08:00