Chuyển tới nội dung chính

v0.6.0 — Kiểm duyệt AI, xử lý nền và đường dẫn nhóm

· 3 phút để đọc

Thời gian: 2026-03-24 → 2026-04-03

Phiên bản này cải tổ phần nền tảng: xử lý các tác vụ nặng ở chế độ nền, kiểm duyệt nội dung bằng AI, và chuyển đường dẫn nhóm sang dạng thân thiện hơn.


Tính năng mới

Kiểm duyệt nội dung tự động

  • Thêm worker AI moderation (process-ai-moderation-queue.ts) chạy định kỳ mỗi 30 giây.
  • Xử lý các job kiểm duyệt nội dung tự động bằng AI.
  • Job type AI_MODERATIONAI_GROUP_MODERATION được enqueue vào NotificationQueue.

Xử lý nền cho tác vụ nặng

Chuyển các tác vụ nặng từ inline (fire-and-forget) sang queue bất đồng bộ:

Tác vụTrướcSau
XP AwardInline trong transactionEnqueue sau commit
Manga EmbeddingInline sau saveEnqueue sau commit
Chapter NotificationsInline khi publishEnqueue sau publish
  • Đảm bảo XP award dùng transaction client để tránh phantom job khi rollback.
  • Loại MANGA_EMBEDDINGXP_AWARD ra khỏi notification worker, chuyển sang AI worker.

Gộp các worker

  • Gộp tất cả 3 queue workers thành một process duy nhất để giảm RAM usage trên server.
  • Chuyển workers sang long-lived processes với internal sleep loop thay vì spawn mới mỗi lần.

Nhập hàng loạt dễ hơn

  • Thêm admin bulk import tools: giao diện import manga hàng loạt từ admin dashboard.
  • Import chương tuần tự có thứ tự (sequential upload) tránh race condition.
  • Quản lý file ZIP bulk import trong ./data/bulk-import-zips.

Đường dẫn nhóm thân thiện

Hoàn chỉnh migration URL nhóm dịch:

  • Thêm field slug vào model ScanlationGroup.
  • Thêm makeUniqueGroupSlugbackfill script cho dữ liệu hiện có.
  • Thêm getGroupBySlug service method.
  • Thêm helper groupUrl(slug) dùng toàn platform.
  • Replace toàn bộ route /group/[id]//g/[slug]/.
  • Thêm redirect shim tại /group/[id]/g/[slug] cho backward compatibility.
  • Migrate tất cả components sử dụng groupId prop → slug.
  • Cập nhật revalidatePath calls theo route mới.

Điều hướng chương tiếp theo

  • Thay thế cơ chế "hold" desktop bằng sticky bottom bar cho điều hướng chương tiếp.
  • Cải thiện pull indicator mobile:
    • Dùng position: fixed tránh layout shift.
    • Dùng getBoundingClientRect cho touch gesture chính xác hơn.
    • Dùng IntersectionObserver thay scroll listeners để phát hiện cuối trang.
    • Dùng translateY thay max-height animation cho smooth hơn.
    • Reset pull indicator khi đổi chương.

Mẫu email

  • Migrate toàn bộ email templates sang EmailMD format.

Hệ thống emoji (bản thiết kế)

  • Thêm spec và kế hoạch triển khai hệ thống emoji/reaction cho bình luận.

Cải tiến

  • Cập nhật Next.js, React và eslint-config-next lên phiên bản mới nhất.
  • Sync pnpm lockfile với dependencies mới.

Sửa lỗi

  • Sanitize recommendation payloads tránh lộ thông tin nội bộ.
  • Cập nhật admin group-manga links sang /g/[slug]/ đúng format.
  • Resolve các /group/ link còn sót và type errors sau migration.
  • Fix dead code trong floating hub reader (unused constants).
  • Sửa scroll jank reader với IntersectionObserver.

Commits nổi bật

HashMô tả
3c02684refactor: merge all queue workers into single unified process
featfeat: implement AI moderation worker script
featfeat: enqueue XP award instead of fire-and-forget inline
featfeat: enqueue manga embedding instead of fire-and-forget inline
featfeat: enqueue chapter notifications instead of inline processing
3c02684feat: add admin manga bulk import tools
featfeat: migrate group URLs from /group/[id] to /g/[slug]
featfeat: replace desktop hold mechanism with sticky bottom bar for next chapter nav
featfeat: migrate email templates to EmailMD