Commit Graph
245 Commits
Author SHA1 Message Date

2026-08-11

lezi-fun 0933220c70 fix: restore dark post view and API revalidation 2026-08-11 13:32:44 +08:00
lezi 773db0dec7 Update README.md 2026-08-11 12:25:27 +08:00
lezi-fun ef9d8b8f9c 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:27 +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 78ef6cd798 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:18 +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 1934edebd5 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

# Conflicts:
#	components/AppProvider.js
#	components/NewPost.js
2026-08-11 11:33:57 +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 024b678ad3 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:33 +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 517661441a 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:44 +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 c4ec3340de fix: loading title double-render + spinner restart (hydration)
Inline script fills cached name into #loadingTitle before React
hydrate; React then saw text mismatch and rewrote the DOM, making the
name appear twice and restarting the spinner animation. Add
suppressHydrationWarning so React keeps the script-filled content.
2026-08-11 10:25:33 +08:00
lezi-fun 91ab1c6239 fix: loading title double-render + spinner restart (hydration)
Inline script fills cached name into #loadingTitle before React
hydrate; React then saw text mismatch and rewrote the DOM, making the
name appear twice and restarting the spinner animation. Add
suppressHydrationWarning so React keeps the script-filled content.
2026-08-11 10:25:24 +08:00
lezi-fun 1dbcb89fbd 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:40 +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
lezi-fun a136d468af fix: show cached forum name at first paint via inline script
Loading screen now always renders the title container; layout.js inline
script fills the cached name on DOMContentLoaded (before React hydrate),
so 2nd+ visits show the forum name immediately instead of waiting for
React to start. Static appear class avoids hydrate clobbering.
2026-08-11 10:18:53 +08:00
lezi-fun bfe8a80822 fix: show cached forum name at first paint via inline script
Loading screen now always renders the title container; layout.js inline
script fills the cached name on DOMContentLoaded (before React hydrate),
so 2nd+ visits show the forum name immediately instead of waiting for
React to start. Static appear class avoids hydrate clobbering.
2026-08-11 10:18:42 +08:00
lezi-fun aeb8adae4c feat: public user profile API + settings swipe navigation
- GET /api/users/profile/:username public endpoint (no auth) for user
  pages, matching upstream main; UserProfile uses it (was admin /users
  search)
- Settings page: vertical scroll-snap panels (profile/security/recovery),
  swipe up/down to switch smoothly; sidebar nav scrolls to panel and
  active highlight follows scroll position
2026-08-11 10:07:30 +08:00
lezi-fun 0b86c54867 feat: public user profile API + settings swipe navigation
- GET /api/users/profile/:username public endpoint (no auth) for user
  pages, matching upstream main; UserProfile uses it (was admin /users
  search)
- Settings page: vertical scroll-snap panels (profile/security/recovery),
  swipe up/down to switch smoothly; sidebar nav scrolls to panel and
  active highlight follows scroll position
2026-08-11 10:07:21 +08:00
lezi-fun 93be3a2880 fix: show cached forum name immediately on reload (no server wait)
- forumNameLoaded initializes true when localStorage has a cached name,
  so 2nd+ visits show the name right away instead of waiting for the
  settings fetch
- layout.js inline script writes cached name to <title> on first paint
  (first request HTML now carries the name)
2026-08-11 10:03:25 +08:00
lezi-fun fe71b03d2e fix: show cached forum name immediately on reload (no server wait)
- forumNameLoaded initializes true when localStorage has a cached name,
  so 2nd+ visits show the name right away instead of waiting for the
  settings fetch
- layout.js inline script writes cached name to <title> on first paint
  (first request HTML now carries the name)
2026-08-11 10:02:03 +08:00
lezi-fun c8a3fcfe3a docs: update Next.js 16 + React 19 in README 2026-08-11 09:51:34 +08:00
lezi-fun c55fce445c docs: update Next.js 16 + React 19 in README 2026-08-11 09:51:22 +08:00
lezi-fun 7966ac0eeb feat: upgrade Next.js 16 + React 19, R2 binding storage, adaptive build
- Next.js 14 → 16.3.0, React 18 → 19.2.8
- Route handlers: async params (await params) for Next 15+ — 17 files
- Fix destructuring params pattern (const {id} = await params) in
  users/[id] and users/[id]/role
- storage.js: prefer Cloudflare R2 binding (FORUMLIFY_BUCKET, no S3
  keys) on Workers; fallback S3-compatible API (Vercel/local)
- wrangler.jsonc: add FORUMLIFY_BUCKET binding to forum bucket
- scripts/build.js: adaptive build (CF env → OpenNext, else next build);
  fix recursion via NEXT_PRIVATE_STANDALONE detection
- 40/40 tests pass on Next 16

# Conflicts:
#	app/api/posts/[id]/route.js
2026-08-11 09:46:51 +08:00
lezi-fun 6d41c6208c feat: upgrade Next.js 16 + React 19, R2 binding storage, adaptive build
- Next.js 14 → 16.3.0, React 18 → 19.2.8
- Route handlers: async params (await params) for Next 15+ — 17 files
- Fix destructuring params pattern (const {id} = await params) in
  users/[id] and users/[id]/role
- storage.js: prefer Cloudflare R2 binding (FORUMLIFY_BUCKET, no S3
  keys) on Workers; fallback S3-compatible API (Vercel/local)
- wrangler.jsonc: add FORUMLIFY_BUCKET binding to forum bucket
- scripts/build.js: adaptive build (CF env → OpenNext, else next build);
  fix recursion via NEXT_PRIVATE_STANDALONE detection
- 40/40 tests pass on Next 16
2026-08-11 09:45:56 +08:00
lezi-fun 3049aa96e4 docs: Cloudflare Workers one-click deploy (OpenNext) in README 2026-08-11 09:27:13 +08:00
lezi-fun 39716b7c8f docs: Cloudflare Workers one-click deploy (OpenNext) in README 2026-08-11 09:27:03 +08:00
lezi-fun dd5372a273 chore: .env is user-local env (gitignored), .env.example is the template 2026-08-11 09:19:26 +08:00
lezi-fun 59227d99a5 chore: .env is user-local env (gitignored), .env.example is the template 2026-08-11 09:19:18 +08:00
lezi-fun a42fe1dd89 feat: Cloudflare Workers deployment (OpenNext adapter)
- Add @opennextjs/cloudflare + wrangler config, open-next.config.ts,
  public/_headers, .dev.vars.example template
- package.json: cf build/preview/deploy/upload scripts
- Verified deployed: https://forumlify.roylikerebecca19930.workers.dev
  (DB read/write via outbound TCP to Postgres, R2 image upload + public
  domain access all working)
2026-08-11 09:18:38 +08:00
lezi-fun 962f7f67c1 feat: Cloudflare Workers deployment (OpenNext adapter)
- Add @opennextjs/cloudflare + wrangler config, open-next.config.ts,
  public/_headers, .dev.vars.example template
- package.json: cf build/preview/deploy/upload scripts
- Verified deployed: https://forumlify.roylikerebecca19930.workers.dev
  (DB read/write via outbound TCP to Postgres, R2 image upload + public
  domain access all working)
2026-08-11 09:18:29 +08:00
lezi-fun 9c4a694394 fix: R2 public URL without bucket prefix (custom domain serves at root)
S3_PUBLIC_URL (custom domain) serves objects at /<name>, not
/<bucket>/<name>. Only include bucket prefix when falling back to the
S3 endpoint path-style URL.
2026-08-11 09:07:19 +08:00
lezi-fun 778c2bcf4c fix: R2 public URL without bucket prefix (custom domain serves at root)
S3_PUBLIC_URL (custom domain) serves objects at /<name>, not
/<bucket>/<name>. Only include bucket prefix when falling back to the
S3 endpoint path-style URL.
2026-08-11 09:06:14 +08:00

2026-08-10

lezi-fun d2f377d380 feat: settings sidebar layout (align upstream) + fix mobile admin bottom bar
- SettingsPage: sidebar layout with 3 tabs (个人资料/安全设置/恢复码),
  extract SettingsProfile component; sync upstream settings CSS
- Fix: .page-slide backdrop-filter created containing block, breaking
  position:fixed children (mobile admin bottom nav floated up on scroll,
  modals mispositioned). Removed it — background is solid gradient
- Add missing user/lock icons
2026-08-10 22:16:57 +08:00
lezi-fun 24379f0ab1 feat: settings sidebar layout (align upstream) + fix mobile admin bottom bar
- SettingsPage: sidebar layout with 3 tabs (个人资料/安全设置/恢复码),
  extract SettingsProfile component; sync upstream settings CSS
- Fix: .page-slide backdrop-filter created containing block, breaking
  position:fixed children (mobile admin bottom nav floated up on scroll,
  modals mispositioned). Removed it — background is solid gradient
- Add missing user/lock icons
2026-08-10 22:15:53 +08:00
Furrium Network bd7899a180 Update dockerfile 2026-08-10 22:11:36 +08:00
lezi-fun 80eb313604 feat: toast notifications, canvas captcha, super admin, mobile fixes
- Toast system (ToastProvider + useToast): right-top colored toasts
  replace alert for publish success/error; CSS + layout mount
- Captcha as canvas image (noise + distortion) in NewPost/ReplyList/
  register modal — blocks bots, click to refresh
- Super admin: first registered user cannot be demoted (isFirstUser by
  created_at, DB-agnostic)
- Admins can delete others' posts/replies (UI buttons shown for admin)
- Mobile: post-actions wrap + compact, feed excerpt 2.5 lines
- Fix: missing sun icon in Icons (dark mode toggle showed nothing)
- Feed long posts: gradient fade mask instead of line-clamp
2026-08-10 21:56:05 +08:00
lezi-fun b2368f68df feat: toast notifications, canvas captcha, super admin, mobile fixes
- Toast system (ToastProvider + useToast): right-top colored toasts
  replace alert for publish success/error; CSS + layout mount
- Captcha as canvas image (noise + distortion) in NewPost/ReplyList/
  register modal — blocks bots, click to refresh
- Super admin: first registered user cannot be demoted (isFirstUser by
  created_at, DB-agnostic)
- Admins can delete others' posts/replies (UI buttons shown for admin)
- Mobile: post-actions wrap + compact, feed excerpt 2.5 lines
- Fix: missing sun icon in Icons (dark mode toggle showed nothing)
- Feed long posts: gradient fade mask instead of line-clamp
2026-08-10 21:54:28 +08:00
lezi-fun c059ad0979 style: sync admin table full-width styles from upstream 2026-08-10 21:26:46 +08:00
lezi-fun e860978aef style: sync admin table full-width styles from upstream 2026-08-10 21:25:30 +08:00
lezi-fun 83d270eada feat: theme follows system preference by default + fix dark mode FOUC
- getTheme: manual localStorage override first, else prefers-color-scheme
- layout: inline head script sets data-theme before first paint (no
  white flash in dark mode on loading screen)
- AppProvider: listen for system theme change when user hasn't overridden
2026-08-10 18:27:17 +08:00
lezi-fun e3afba65fa feat: theme follows system preference by default + fix dark mode FOUC
- getTheme: manual localStorage override first, else prefers-color-scheme
- layout: inline head script sets data-theme before first paint (no
  white flash in dark mode on loading screen)
- AppProvider: listen for system theme change when user hasn't overridden
2026-08-10 18:25:44 +08:00
lezi-fun 156e178160 feat: markdown rendering + dark mode input fixes + DM icon align
- Add marked dependency; render post/reply content and signature via
  marked.parse (matches upstream). lib/markdown.js helper + CSS for
  code/pre/blockquote/tables in glass theme
- Fix hardcoded #e2e8f0 white inputs in dark mode: NewPost title/content,
  Modals report select, ReplyList, AdminForumSettings/Links/Users/Logs
- DM button: replace ✉️ emoji with upstream SVG chat bubble icon
2026-08-10 18:19:56 +08:00
lezi-fun 1a8a588d60 feat: markdown rendering + dark mode input fixes + DM icon align
- Add marked dependency; render post/reply content and signature via
  marked.parse (matches upstream). lib/markdown.js helper + CSS for
  code/pre/blockquote/tables in glass theme
- Fix hardcoded #e2e8f0 white inputs in dark mode: NewPost title/content,
  Modals report select, ReplyList, AdminForumSettings/Links/Users/Logs
- DM button: replace ✉️ emoji with upstream SVG chat bubble icon
2026-08-10 18:18:19 +08:00
lezi-fun 9eed101caa fix: recovery codes modal not showing (portal to body)
Modal rendered inside SettingsPage .page-slide whose slideIn animation
creates a containing block, so position:fixed modal was positioned
relative to the slide (invisible in some browsers). Render via
createPortal to document.body.
2026-08-10 17:57:58 +08:00
lezi-fun bd6314be38 fix: recovery codes modal not showing (portal to body)
Modal rendered inside SettingsPage .page-slide whose slideIn animation
creates a containing block, so position:fixed modal was positioned
relative to the slide (invisible in some browsers). Render via
createPortal to document.body.
2026-08-10 17:55:30 +08:00
lezi-fun 4a30e79269 feat: edit post images (upload/remove) + fix captcha input in dark mode
- PostDetail edit modal: show existing images with delete button, upload
  new images (multi-file, 5MB limit), save replaces image list
- API PUT /posts/:id accepts images array; omitting keeps original
- lib/api updatePost passes images
- NewPost/ReplyList captcha answer input: use CSS vars (was hardcoded
  #e2e8f0 border with white bg — glaring in dark mode)
2026-08-10 17:41:46 +08:00
lezi-fun f317e5eee6 style: sync upstream liquid glass theme (液态玻璃)
- Adopt upstream style.css glassmorphism: glacier-blue palette,
  --glass-* vars, backdrop-filter blur on navbar/cards/modals, gradient bg
- Keep old CSS variable aliases (--text/--bg/--surface/--border etc)
  mapped to glass colors so React components' inline styles keep working
- Re-append loading-screen / app-fade-in styles removed by upstream sync
2026-08-10 17:18:14 +08:00
lezi-fun ebc5201569 style: sync upstream liquid glass theme (液态玻璃)
- Adopt upstream style.css glassmorphism: glacier-blue palette,
  --glass-* vars, backdrop-filter blur on navbar/cards/modals, gradient bg
- Keep old CSS variable aliases (--text/--bg/--surface/--border etc)
  mapped to glass colors so React components' inline styles keep working
- Re-append loading-screen / app-fade-in styles removed by upstream sync
2026-08-10 17:16:34 +08:00