peppa/apps/web/components/Onboarding.tsx
Асель 53ac7efdcc PEP-30/41/31: project memory, agent model per story with escalation, first-run checklist
- PEP-30: .peppa/memory.md in the project repo (core/memory.ts), agent MCP get_memory/remember
  (dedupe, 12k size limit, replace to compact), runner appends memory + last finished stories
  to the launch rules, RULES.md rule, memory on the project «Спеки» tab.
- PEP-41: agent settings platform → project → story (provider, model, effort, escalation model
  after N failures, fallback provider); Claude --effort / Codex model_reasoning_effort;
  sticky escalation relaunches a live runner on the stronger model (sendWithEscalation from
  CI feedback and the reviewer); fallback provider when the main one has no working
  subscription; web panels, MCP PM `agent`, CLI `peppa project agent`.
- PEP-31: first-run checklist on the home page (core/onboarding.ts), hide button,
  «Агенты не запустятся» warning on the project page when its pool has no working subscription.

No migrations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 07:44:24 +05:00

53 lines
2.5 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// PEP-31: first-run checklist on the home page.
import { CircleCheck, Circle, X } from "lucide-react";
import type { Onboarding } from "@peppa/core";
import { dismissOnboardingAction } from "@/app/(app)/actions";
import { Hidden } from "@/components/cards";
import { Button } from "@/components/ui/button";
import { cn } from "@/lib/utils";
export function OnboardingChecklist({ data }: { data: Onboarding }) {
const next = data.steps.find((s) => !s.done && !s.optional);
return (
<section aria-label="Первый запуск" className="mb-8 rounded-xl border bg-card p-4">
<div className="mb-3 flex flex-wrap items-center gap-3">
<h2 className="m-0 text-[15px] font-semibold">Первый запуск</h2>
<span className="font-mono text-xs text-muted-foreground tabular-nums">
{data.done} из {data.total}
</span>
<div className="h-1.5 min-w-24 flex-1 overflow-hidden rounded-full bg-muted" role="progressbar" aria-valuemin={0} aria-valuemax={data.total} aria-valuenow={data.done}>
<div className="h-full rounded-full bg-primary" style={{ width: `${Math.round((data.done / Math.max(1, data.total)) * 100)}%` }} />
</div>
<form action={dismissOnboardingAction}>
<Hidden fields={{ back: "/" }} />
<Button size="sm" variant="ghost" title="Скрыть чек-лист" aria-label="Скрыть чек-лист">
<X className="size-4" /> Скрыть
</Button>
</form>
</div>
<ol className="m-0 flex list-none flex-col gap-1 p-0">
{data.steps.map((s) => (
<li key={s.id}>
<a
href={s.href}
className={cn(
"flex items-start gap-2.5 rounded-lg px-2 py-1.5 hover:bg-muted hover:no-underline",
s === next && "bg-primary/8",
)}
>
{s.done ? <CircleCheck className="mt-0.5 size-4 shrink-0 text-ok" /> : <Circle className="mt-0.5 size-4 shrink-0 text-muted-foreground" />}
<span className="flex min-w-0 flex-col">
<span className={cn("text-sm", s.done ? "text-muted-foreground line-through" : "text-foreground")}>
{s.title}
{s.optional && <span className="ml-1.5 text-xs text-muted-foreground">необязательно</span>}
</span>
{!s.done && <span className="text-xs text-muted-foreground">{s.hint}</span>}
</span>
</a>
</li>
))}
</ol>
</section>
);
}