Compare commits

...

3 Commits

Author SHA1 Message Date
xfy
22d05a98b3 chore(lint): 修复 Biome 告警(schema 版本/optional chain/CSS !important 抑制)
Some checks failed
CI / check (push) Has been cancelled
CI / build (push) Has been cancelled
- biome.json: $schema 2.5.1 → 2.5.3,对齐已安装的 CLI 版本(消除 info)
- code-block-view.ts:157: `a && a.b()` → `a?.b()`(等价 optional chain)
- style.css:56: 保留刻意的 `transform: none !important`(删除会重新引入
  animation-fill-mode: both 导致的堆叠上下文 bug),仅加 scoped biome-ignore
  抑制 noImportantStyles,不做全局禁用
2026-07-15 18:12:04 +08:00
xfy
27ed605223 fix(comments): 修复 section.rs / dashboard.rs 括号不匹配导致编译失败
两处同一类错误:match arm 内 `if {} else {}` 表达式后多了一个 `}`,
导致 arm 被提前关闭,触发 "unexpected closing delimiter" 编译错误。

- section.rs:125 — `if !has_any {…}` 块后多余的 `}`,删除使 if-else 合一
- dashboard.rs:119 — 同类问题,另需补 `;` 终止 `let` 语句
2026-07-15 18:12:00 +08:00
xfy
bdc9f0f711 chore(make): fix 目标新增 cargo fmt 与 dx fmt
自动修复流程此前只跑 biome format + cargo fix,缺少格式化收尾:
cargo fix 应用编译器建议会重写代码,dx fmt 会改写 rsx!,
两者都可能留下不符合 rustfmt 风格的输出。

现在按 Biome → cargo fix → cargo fmt → dx fmt 顺序执行,
两道格式化收尾保证最终文件状态整洁。
2026-07-15 17:50:00 +08:00
6 changed files with 11 additions and 6 deletions

View File

@ -120,11 +120,17 @@ lint:
@cargo clippy --all-targets --all-features -- -D warnings
# JS + Rust 自动修复(直接写入文件)。
# 顺序Biome → cargo fix应用编译器建议重写代码→ cargo fmt格式化 Rust
# → dx fmt格式化 RSX 宏)。两道格式化收尾,保证最终文件状态整洁。
fix:
@echo "==> Biome format (libs, 写入文件)"
@cd libs && pnpm exec biome format --write .
@echo "==> Cargo fix (Rust)"
@echo "==> Cargo fix (Rust, 应用编译器建议)"
@cargo fix --allow-dirty
@echo "==> Cargo fmt (Rust, 格式化)"
@cargo fmt
@echo "==> Dioxus fmt (RSX 宏, 格式化)"
@dx fmt
# 只编译当前 crate 的文档(--no-deps 跳过依赖,--document-private-items
# 让纯 binary crate 的内部模块/私有项也进文档,否则页面基本是空的)。

View File

@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/2.5.1/schema.json",
"$schema": "https://biomejs.dev/schemas/2.5.3/schema.json",
"vcs": {
"enabled": false
},

View File

@ -154,7 +154,7 @@ export class CodeBlockNodeView {
if (mutation.target === this.contentDOM && mutation.type === 'attributes') return true;
// contentDOM 内的 mutationcharacterData/childList交给 ProseMirror编辑核心
// 注意 contains 对 target===contentDOM 自身也返回 true故上面的 attributes 判断须在前。
if (this.contentDOM && this.contentDOM.contains(mutation.target)) return false;
if (this.contentDOM?.contains(mutation.target)) return false;
// 工具栏/结果区等装饰元素的 mutation忽略
return true;
}

View File

@ -53,5 +53,6 @@ html.is-theme-transitioning *::after {
html.is-theme-transitioning .animate-page-enter {
/* !important 必需:animation-fill-mode: both 保留的关键帧值优先级高于普通
规则,只有 !important 能覆盖,确保 VT 期间 transform 被清为 none */
/* biome-ignore lint/complexity/noImportantStyles: animation-fill-mode: both 保留非 none transform 创建堆叠上下文,仅 !important 可覆盖(详见上方注释) */
transform: none !important;
}

View File

@ -121,7 +121,6 @@ pub fn CommentSection(post_id: i32) -> Element {
rsx! {
p { class: "text-paper-tertiary text-center py-8", "暂无评论,成为第一个评论的人吧!" }
}
}
} else {
rsx! {
CommentList {

View File

@ -115,8 +115,7 @@ pub fn Admin() -> Element {
"text-[var(--color-paper-secondary)]",
"text-[var(--color-paper-primary)]",
)
}
}
};
rsx! {
div { class: "text-sm font-medium {color_class}", "待审评论" }
div { class: "flex items-baseline justify-between mt-4",