24 Commits

Author SHA1 Message Date
xfy
c2f68b9c2d fix: wrap Outlet in SuspenseBoundary to prevent full-page flash on route change 2026-06-04 11:03:56 +08:00
xfy
e09a0f4616 chore: remove unused PageLayout component
- Delete src/components/page_layout.rs — no longer used by any page
- Remove 'pub mod page_layout' from components/mod.rs
- All frontend pages now use FrontendLayout via the router instead
2026-06-03 18:38:57 +08:00
xfy
e861b8a5be feat: add FrontendLayout component with Header, Footer and Outlet
- New FrontendLayout component wraps all frontend pages with shared
  Header (with nav items and theme toggle) and Footer
- Uses Outlet::<Route> to render child route components
- Similar pattern to existing AdminLayout but without auth checks
- Registered in components/mod.rs

This is the first step toward eliminating page transition flicker by
keeping Header/Footer mounted while only the main content area swaps.
2026-06-03 18:32:43 +08:00
xfy
326108ab68 fix: delay skeleton pulse animation instead of hiding skeleton, prevent blank flash 2026-06-03 17:47:51 +08:00
xfy
73e30d6f89 feat: add DelayedSkeleton wrapper to prevent skeleton flicker on fast loads 2026-06-03 17:41:49 +08:00
xfy
068d13c69f refactor: remove obsolete SuspenseWrapper, all pages now use dedicated skeleton screens 2026-06-03 17:33:44 +08:00
xfy
62519d620d feat: add SearchSkeleton component and replace inline skeleton on search page 2026-06-03 17:30:47 +08:00
xfy
c2e1fbe3ac feat: add TagsSkeleton/TagDetailSkeleton and replace generic fallback on tags pages 2026-06-03 17:25:47 +08:00
xfy
5becd73ebc feat: add ArchiveSkeleton and replace generic fallback on archives page 2026-06-03 17:19:29 +08:00
xfy
372c701b07 feat: add PostDetailSkeleton and replace generic fallback on post detail page 2026-06-03 17:13:39 +08:00
xfy
076448d6ed feat: add HomeSkeleton and replace generic fallback on home page 2026-06-03 17:09:20 +08:00
xfy
db8e88e1fe feat: add skeleton screens module and PostCardSkeleton component 2026-06-03 17:01:39 +08:00
xfy
60a2cd49ab feat: add SuspenseWrapper component for SSR 2026-06-03 14:14:45 +08:00
xfy
6b1f2e27c9 feat(components): add post page components (header, toc, content, footer, nav) 2026-06-02 18:21:25 +08:00
xfy
f3c1718cd0 feat: add use_delayed_loading hook to prevent skeleton flash 2026-06-02 17:53:04 +08:00
xfy
1950646bef feat: add shared components, new pages, and pagination 2026-06-02 17:33:28 +08:00
xfy
b6cabe489f feat: migrate frontend to database-driven posts
- Replace hardcoded POSTS with API-driven data in home, archives, tags
- Add post detail page /post/:slug with HTML rendering
- Add admin posts management page with list and soft delete
- Update dashboard with real stats from database
- Add admin navigation for posts management
- Fix PartialEq derives for Post, Tag, PostStats models
- Use use_resource and use_memo for data fetching with proper loading states
2026-06-02 17:33:28 +08:00
xfy
a58e0f4e3b 修复 Footer 组件滚动监听器未正确清理的问题 2026-06-02 17:33:28 +08:00
xfy
c924b1e643 修复编译器警告并改进代码质量 2026-06-02 17:33:28 +08:00
李林军
4093178fc3 添加tracing日志并重构服务器启动逻辑 2026-05-27 11:39:09 +08:00
xfy
9c834ba1df 添加骨架屏组件,优化 admin 路由切换和编辑器初始化体验
- AdminLayout 使用骨架屏替代简单"加载中"文字,保持布局结构一致避免闪烁
- WritePage 添加编辑器初始化骨架屏和就绪状态轮询
- 新增 admin_skeleton.rs 和 write_skeleton.rs 组件

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 09:25:26 +08:00
xfy
61376f6ba9 修复 admin 路由切换闪烁,全局替换原生导航为客户端路由
- 新增全局 UserContext,将用户认证状态提升到 App 级别缓存
- 将 /admin 和 /admin/write 改为嵌套路由,AdminLayout 作为共享父布局
- AdminLayout 使用 Outlet 渲染子页面,避免路由切换时重复挂载
- 修复所有原生 <a> 标签导致的整页刷新问题:
  - Header 导航栏 Logo 和 NavItem
  - 首页文章卡片、分页按钮
  - 归档页文章条目
  - 标签页标签云、文章卡片、标签链接
  - 登录/注册页面链接
  - Dashboard 快捷操作按钮

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 00:18:15 +08:00
xfy
0be0719fdb 将 session cookie 改为后端 HttpOnly 设置
- login 通过 Set-Cookie 响应头设置 HttpOnly cookie
- get_current_user 从请求 Cookie header 读取 token,匹配具体 session
- logout 通过 Set-Cookie 清除 cookie,并删除对应 session
- 移除前端 document.cookie 操作代码

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 23:54:58 +08:00
xfy
8b9c6aa83d 重构 admin 模块,新增共享组件和文章撰写页面
- 将 monolithic admin.rs 拆分为 admin/ 目录模块(dashboard、write)
- 新增 components 模块:Header、Footer、AdminLayout
- 新增 /admin/write 文章撰写页面,支持 Markdown 实时预览
- 添加 pulldown-cmark 依赖用于 Markdown 渲染
- .env 移出版本控制,新增 .env.example 模板
- Home、Archives、Tags、Login、Register 等页面适配新组件

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 16:13:18 +08:00