右上角「启程 n/N」按真实使用打勾,收费项读计价表。八条提示一次一条,看过写入已有的 onboarding_state。没有新表、新接口,也没有增加 Home 的状态。 自测:tsc --noEmit 通过;frontend 下 npm run lint 是 0 error、121 warning;定向测试 94 项全过,清单测试在最后一次改动后再跑 12 项全过;npm run build 后 / 仍是 Static。首屏 JS gzip-9 是 617860 字节,相对 592895 增加 4.21%,原因写在进度里。没有跑全量 npm test,没有跑 Python 快速门,没有宣称 test:db。 Co-Authored-By: Grok (agent loop)
23 lines
804 B
TypeScript
23 lines
804 B
TypeScript
export function OnboardingProgressRing({ done, total }: { readonly done: number; readonly total: number }) {
|
|
const radius = 7;
|
|
const circumference = 2 * Math.PI * radius;
|
|
const ratio = total > 0 ? Math.min(1, Math.max(0, done / total)) : 0;
|
|
return (
|
|
<svg className="onboarding-progress-ring" viewBox="0 0 18 18" aria-hidden="true">
|
|
<circle cx="9" cy="9" r={radius} fill="none" stroke="currentColor" strokeOpacity="0.28" strokeWidth="2" />
|
|
<circle
|
|
cx="9"
|
|
cy="9"
|
|
r={radius}
|
|
fill="none"
|
|
stroke="currentColor"
|
|
strokeWidth="2"
|
|
strokeLinecap="round"
|
|
strokeDasharray={`${circumference} ${circumference}`}
|
|
strokeDashoffset={circumference * (1 - ratio)}
|
|
transform="rotate(-90 9 9)"
|
|
/>
|
|
</svg>
|
|
);
|
|
}
|