Skip to content

Commit 8f5bd9f

Browse files
committed
refactor(ui): migrate remaining loading placeholders
1 parent 9c2a00a commit 8f5bd9f

8 files changed

Lines changed: 191 additions & 138 deletions

File tree

‎app/src/components/GoalDetail.tsx‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import InterviewDialog from "./InterviewDialog";
1414
import GraduateDialog from "./GraduateDialog";
1515
import RetroTimeline from "./RetroTimeline";
1616
import GoalPlanApprovalDialog from "./GoalPlanApprovalDialog";
17-
import { ConfirmDialog, EmptyState } from "../ui/primitives";
17+
import { ConfirmDialog, EmptyState, Loading, Skeleton } from "../ui/primitives";
1818

1919
interface Props {
2020
goalId: number;
@@ -84,7 +84,18 @@ export default function GoalDetail({ goalId, onChanged, onDeleted }: Props) {
8484
};
8585

8686
if (err && !detail) return <div style={{ padding: 24, fontSize: 13, color: "#dc2626" }}>{err}</div>;
87-
if (!detail) return <div style={{ padding: 24, fontSize: 13, color: "#9ca3af" }}>加载中…</div>;
87+
if (!detail) {
88+
// 批 4 T14:详情面板结构已知(目标 + 里程碑 + 准则)⇒ 骨架占位;可读语义由 `Loading` 给
89+
// (骨架整组 aria-hidden —— 只留骨架等于把"在等什么"从无障碍树里删掉)。
90+
return (
91+
<div style={{ padding: 24 }}>
92+
<Loading />
93+
<div style={{ marginTop: 10 }}>
94+
<Skeleton lines={3} />
95+
</div>
96+
</div>
97+
);
98+
}
8899

89100
const { goal, milestones, criteria } = detail;
90101
const p = progress?.progress;

‎app/src/components/RefineWorkbench.tsx‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* 两栏的**独立滚动 + 同步滚动**保留(见 `PANE_MAX_H` 的 Why)。
2020
*/
2121
import { useCallback, useEffect, useRef, useState } from "react";
22-
import { Modal, EmptyState } from "../ui/primitives";
22+
import { Modal, EmptyState, Loading, Skeleton } from "../ui/primitives";
2323
import { invoke } from "@tauri-apps/api/core";
2424
import type { AiRefineResult, DiffOp, MarkdownDiffOps, RefineStrategyInfo, RefineStrategyMeta, WorkbenchData } from "../types";
2525
import { escapeHtml } from "../utils/html";
@@ -282,8 +282,12 @@ export default function RefineWorkbench({
282282
if (status === "loading") {
283283
return (
284284
<Modal open onClose={onClose} title="精修工作台" size="l" testId="refine-workbench">
285-
<div style={{ display: "flex", alignItems: "center", justifyContent: "center", minHeight: 160 }}>
286-
<p style={{ fontSize: 13, color: "#6b7280" }}>⏳ 加载工作台数据…</p>
285+
<div style={{ display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", minHeight: 160 }}>
286+
{/* 批 4 T14:双栏对照的形状已知 ⇒ 骨架;文案逐字保留(含 ⏳ —— 装饰 emoji 规则只覆盖弹层标题) */}
287+
<Loading label="⏳ 加载工作台数据…" />
288+
<div style={{ marginTop: 10, width: "100%" }}>
289+
<Skeleton lines={4} />
290+
</div>
287291
</div>
288292
</Modal>
289293
);

‎app/src/components/SecondPassPanel.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,8 @@ export default function SecondPassPanel({ sessionId, onChanged, onClose }: Props
213213
</div>
214214

215215
{view === null ? (
216-
<p style={{ color: "#9ca3af", fontSize: 12 }}>加载中…</p>
216+
/* 批 4 T14:草稿行数未知(`view === null` 时无计数)⇒ 带文案的 Loading(默认「加载中…」) */
217+
<Loading />
217218
) : view.total === 0 ? (
218219
view.running ? (
219220
<Loading label="任务已启动,等待首个窗口…" />

‎app/src/pages/ReviewPage.tsx‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { invoke } from "@tauri-apps/api/core";
2020
import type { NoteGroup } from "../types/notes";
2121
import ReviewSessionPanel from "../components/review/ReviewSessionPanel";
2222
import { dueGroupRows, scopeDueCount, scopeLabel } from "../utils/reviewStats";
23+
import { Loading, Skeleton } from "../ui/primitives";
2324

2425
interface Props {
2526
/** 页面是否可见(App 层 display 门控同步透传——切回时重载到期统计) */
@@ -198,7 +199,15 @@ export default function ReviewPage({ active, focusGroupId, onFocusGroupConsumed
198199

199200
{/* 主体:加载/错误/空态/范围引导(会话开始后切换为会话面板) */}
200201
<div style={{ flex: 1, minHeight: 0, overflowY: "auto", padding: 24 }}>
201-
{!loaded && <p style={{ fontSize: 13, color: "#9ca3af" }}>加载中…</p>}
202+
{!loaded && (
203+
<div>
204+
{/* 批 4 T14:起始卡结构已知(标题 + 正文块)⇒ 骨架;可读语义由 `Loading` 给 */}
205+
<Loading />
206+
<div style={{ marginTop: 10 }}>
207+
<Skeleton lines={3} />
208+
</div>
209+
</div>
210+
)}
202211
{status && <p data-testid="review-status" style={{ fontSize: 12, color: "#dc2626" }}>{status}</p>}
203212
{loaded && !status && scopeDue <= 0 && (
204213
<div data-testid="review-empty" style={{ textAlign: "center", padding: "56px 0", maxWidth: 480, margin: "0 auto" }}>

0 commit comments

Comments
 (0)