291 Commits

Author SHA1 Message Date
xfy
4d7d7ec383 db: add performance indexes on posts, tags, sessions 2026-06-08 16:39:13 +08:00
xfy
72d28e2db3 deps: add tower-governor for rate limiting 2026-06-08 16:37:50 +08:00
xfy
185bcab9f9 cleanup(forms): remove unused BUTTON_SECONDARY_CLASS 2026-06-08 16:19:35 +08:00
xfy
e5d37aa034 refactor(api): extract error helper functions, DRY up db/query/tx error handling 2026-06-08 16:17:03 +08:00
xfy
717266db1e fix: resolve conditional compilation and dead code warnings 2026-06-08 16:11:24 +08:00
xfy
012704d0a5 chore(tiptap-editor): update package-lock.json 2026-06-08 15:54:27 +08:00
xfy
b6f41e74e7 feat: image thumbnail + lightbox viewer
- Add ImageViewer reusable component with thumbnail and click-to-zoom
- PostCover: load ?w=1200 thumbnail, click to view full-size
- PostCard: display cover thumbnail (?thumb=400x300) in list view
- PostContent: inline images load ?w=800 thumbnail, click to zoom
- Add lightbox overlay styles with fade-in animation
- Add zoom cursor and hover effect for zoomable images
- Extend web-sys features for DOM image/lightbox manipulation
2026-06-08 15:52:47 +08:00
xfy
2c08c6c7fd fix(image): case-insensitive format matching in process_image 2026-06-08 15:29:17 +08:00
xfy
8b1b949bf8 refactor: apply formatting to image.rs 2026-06-08 15:13:18 +08:00
xfy
d584ef6e00 fix(image): improve cache keys, case-insensitive format, strict thumb validation 2026-06-08 15:13:18 +08:00
xfy
7963103f62 feat: wire up image processing route replacing ServeDir 2026-06-08 15:13:18 +08:00
xfy
1f009f57c8 feat: add image processing handler with resize/thumbnail/rotate/format 2026-06-08 15:13:18 +08:00
xfy
8109740e94 chore: add image and moka dependencies for image processing 2026-06-08 15:13:18 +08:00
xfy
72ba8ea9ec chore(tiptap-editor): update package-lock.json 2026-06-06 00:29:53 +08:00
xfy
3fc91db515 fix(posts): replace space-x-3 with flex gap-3 for edit/delete button spacing 2026-06-05 18:22:59 +08:00
xfy
c776536678 fix(write-skeleton): align skeleton layout with actual write page
- fix bottom button bar layout (justify-end -> items-center with flex-1 spacer)
- remove extra p-6 padding from editor container
- add p-4 padding to toolbar area to match Tiptap editor padding
2026-06-05 18:21:35 +08:00
xfy
078e9b1da1 fix(tiptap-editor): configure link via StarterKit to avoid duplicate extension warning 2026-06-05 18:19:24 +08:00
xfy
f6db477a88 fix(write): reset tiptap editor state on unmount to prevent blank editor on re-navigation 2026-06-05 18:16:46 +08:00
xfy
ad208a4603 fix(tiptap-editor): correct setContent call signature for markdown parsing 2026-06-05 18:05:47 +08:00
xfy
72b932c21b fix(write): add allow lint for unused vars in write_editor 2026-06-05 17:58:05 +08:00
xfy
077573af67 fix(layout): highlight write nav for both /write and /write/:id 2026-06-05 17:55:18 +08:00
xfy
4805f915c7 fix(write): address review feedback - backfill race, load errors, nav delay 2026-06-05 17:51:46 +08:00
xfy
2ecdc09138 feat(write): support edit mode with data backfill 2026-06-05 17:45:54 +08:00
xfy
0c3a084c9b feat(admin): add edit button to post list 2026-06-05 17:37:37 +08:00
xfy
026a331dcd feat(router): add /admin/write/:id route for post editing 2026-06-05 17:34:26 +08:00
xfy
6d28c2b4ce feat(api): add get_post_by_id server function for editing 2026-06-05 17:29:48 +08:00
xfy
0a33a843f8 fix(theme): resolve hydration mismatch in ThemeToggle by deferring icon render until mounted 2026-06-05 17:07:23 +08:00
xfy
6d621d9ec4 feat(admin): remove '前台' nav item from admin header 2026-06-05 17:07:22 +08:00
xfy
26eb62c2ae fix(upload): disable default body limit and fix error object serialization 2026-06-05 16:52:52 +08:00
xfy
ad6c69b0e8 db(migration): merge slug partial unique into 002_posts.sql 2026-06-05 16:29:20 +08:00
xfy
22de5add83 fix(api): restore deleted_at filter in slug uniqueness check 2026-06-05 16:20:43 +08:00
xfy
488dbc144d Add migration: partial unique index on posts.slug 2026-06-05 16:19:45 +08:00
xfy
c7668c679c fix(api): include deleted posts in slug uniqueness check 2026-06-05 16:02:45 +08:00
xfy
53047bf824 fix(utils): strip images before links in markdown stripping 2026-06-05 15:58:35 +08:00
xfy
5e77e7efea build: verify image upload feature compiles and passes checks 2026-06-05 15:25:59 +08:00
xfy
08bd69d64b feat(write): add onImageUpload callback to tiptap editor 2026-06-05 15:23:36 +08:00
xfy
c2c7b46958 fix(tiptap-editor): use insertContentAt with drop position in onDrop handler
Previously dropped images were inserted at the current cursor position
instead of the actual drop position. Now uses insertContentAt(pos, ...)
to place images at the correct location.
2026-06-05 15:21:38 +08:00
xfy
00c5a880f4 feat(editor): add FileHandler extension for image paste/drop upload 2026-06-05 15:19:31 +08:00
xfy
3d7dd5b5a5 deps(editor): add @tiptap/extension-file-handler 2026-06-05 15:17:39 +08:00
xfy
76797f1bc3 feat(server): register upload route and static file serving 2026-06-05 15:14:10 +08:00
xfy
371ebcf8f9 fix(upload): gate axum imports behind #[cfg(feature = "server")]
Wrap all axum imports and constants with #[cfg(feature = "server")]
to prevent WASM compilation failures. Provide a no-op stub for
non-server builds.

Fixes: error[E0433]: cannot find module or crate  in scope
2026-06-05 15:08:19 +08:00
xfy
93020a8e14 fix(upload): remove space in filename format and unused UploadResponse struct 2026-06-05 15:00:29 +08:00
xfy
1bae3446e6 feat(api): add image upload handler with admin auth 2026-06-05 14:56:29 +08:00
xfy
eaec6d5da7 deps: add fs feature to tower-http for static file serving 2026-06-05 14:51:35 +08:00
xfy
16248ca330 chore: create uploads directory for image storage 2026-06-05 14:49:22 +08:00
xfy
dd7022ec75 fix: replace select element with overlay pattern to fix dropdown arrow alignment in write page 2026-06-05 11:09:02 +08:00
xfy
28d1ee0d52 fix: reset UserContext on login/logout to prevent admin page stuck on re-login
Root cause: UserContext.checked was never reset on logout, causing AdminLayout's use_effect to skip get_current_user() on subsequent mounts, leaving the page in (checked=true, user=None) limbo.

- Reset ctx.user and ctx.checked on logout in admin_layout.rs
- Reset ctx.checked on login success in login.rs so AdminLayout re-validates session on mount
2026-06-05 10:42:20 +08:00
xfy
58cfcc31bf fix: improve label and button text contrast in write page light mode 2026-06-05 10:33:41 +08:00
xfy
7866c53e36 feat: add dark mode toggle button to admin layout 2026-06-05 10:33:34 +08:00
xfy
a8704e199f feat(editor): add slash command, table, task list, image and link extensions
- Add @tiptap/suggestion-based slash command menu with 12 commands
- Add TableKit for table support (3x3 with header)
- Add Image extension with base64 support
- Add Link extension with autolink and paste detection
- Add TaskList/TaskItem extensions for checklists
- Upgrade all tiptap packages from 3.23.6 to 3.25.0
- Add CSS styles for all new features including dark theme
2026-06-05 10:20:47 +08:00