首页审查修复(home/post_card/image_viewer/search/home_skeleton): - PostCard 消除嵌套 <a>:外层 Link 包裹改为绝对定位覆盖层链接, 标题/摘要/封面降级为普通元素,标签用 z-10 叠在覆盖层之上并 stop_propagation,整卡点击跳转文章详情。 - ImageViewer 新增 lightbox prop(默认 true),卡片封面传 false 禁用灯箱以归一为单一跳转交互;文章详情页零改动。 - home.rs 越界页码守卫:分页仅在 total>0 渲染,避免 /page/9999 出现孤立空分页;错误文案脱敏为"加载失败"。 - search.rs 错误文案脱敏为"搜索失败",与首页/标签页一致。 - HomeSkeleton 卡片 5→10,对齐 POSTS_PER_PAGE。 编辑器上传重构(write/tiptap_bridge): - consume_upload_event 改用 upload_errors Vec 自身判重,移除 seen_error_ids 副本状态;Signal 参数加 mut 修复 E0596 编译错误。 - make_upload_closure 构造阶段错误以 rejected Promise 返回而非 panic,单张坏文件不再拖垮整个编辑器。 - write.rs 移除未用的 success signal,编辑保存后统一跳转 Posts, 标签分隔符支持半角/全角逗号与分号,提取 META_*_CLASS 常量去重。 - Makefile dev 目标清理 static/ 目录。
30 lines
909 B
Rust
30 lines
909 B
Rust
//! 首页骨架屏
|
|
//!
|
|
//! 模拟首页文章卡片列表与分页区域。
|
|
|
|
use dioxus::prelude::*;
|
|
|
|
use crate::components::skeletons::atoms::SkeletonBox;
|
|
use crate::components::skeletons::post_card_skeleton::PostCardSkeleton;
|
|
|
|
/// 首页骨架屏组件。
|
|
///
|
|
/// 显示与 `POSTS_PER_PAGE` 等量的文章卡片骨架与分页按钮占位,
|
|
/// 使骨架屏与加载完成后的实际列表长度一致,避免内容跳变。
|
|
#[component]
|
|
pub fn HomeSkeleton() -> Element {
|
|
rsx! {
|
|
div {
|
|
// 10 个文章卡片骨架,对齐首页 POSTS_PER_PAGE。
|
|
for _ in 0..10 {
|
|
PostCardSkeleton {}
|
|
}
|
|
// 分页按钮占位
|
|
div { class: "flex mt-10 mb-6 justify-between",
|
|
SkeletonBox { class: "h-9 w-24 rounded-full" }
|
|
SkeletonBox { class: "h-9 w-24 rounded-full" }
|
|
}
|
|
}
|
|
}
|
|
}
|