import Link from "next/link"; import { UndoBar } from "@/components/piece/Lifecycle"; import AppShell from "@/components/shell/AppShell"; import { buttonVariants } from "@/components/ui/button"; import { Stepper } from "@/components/ui/stepper"; import { Tabs, type TabItem } from "@/components/ui/tabs"; import type { Crumb } from "@/components/shell/AppHeader"; import { articleHref } from "@/lib/hrefs"; import { researchCaseHref } from "@/lib/research/hrefs"; import type { PieceFrame as Frame } from "@/lib/pieces/frame"; import ScheduleControls from "@/components/series/ScheduleControls"; import { badgeVariants as chipVariants } from "@/components/ui/badge"; import type { Cadence } from "@/lib/schedule-types"; import { cn } from "@/lib/utils"; import LifecycleChip from "./LifecycleChip"; import Menu from "./Menu"; import PieceKeys from "./PieceKeys"; import StagePips from "./StagePips"; // --------------------------------------------------------------------------- // THE PIECE PAGE's frame (plans/umtool-redesign.md, P4a-1; canvas "Piece · // Overview"): the head -- the trail, the piece's title, the lifecycle chip and // the ⋯ menu, the page's status line, the stage stepper -- then the tabs, as // links (`?tab=`, lib/pieces/tabs.mjs), then the tab's own body. // // Kind-blind: the report-video page (components/projects/ReportProject.tsx) // and the article piece (components/articles/ArticlePage.tsx, P4a-2) hand it // the trail, the tabs and their addresses, the counts and the body. `1`–`9` // open the tabs, in order, and `n` runs the Next card's action (PieceKeys). // A living report's article carries its schedule's cadence chip in the head, // with Pause/Resume and Tick now (`schedule`, R5); an edition says its series. // // ON A PHONE (the desk unchanged): the title block is in flow and scrolls away; // the stepper is Work's stage pips with the lifecycle word; the lifecycle (three // labelled buttons, LifecycleChip), the ⋯ items, the open-notes count and // `head` (the policy chip) are the place bar's ⋯ sheet; the tabs are one // sideways strip, sticky under the place bar (app/globals.css, "phone: the // shell"). The Undo bar stays, above the dock. // --------------------------------------------------------------------------- export type FrameTab = { id: string; label: string; href: string }; export default function PieceFrame({ active = "projects", crumbs, frame, tab, tabs, counts, note, meta, head, more, primary, schedule, edition, children, }: { /** The rail's key (components/AppNav.tsx): a piece is under Work, never Work itself -- `projects` or `articles`. */ active?: string; /** The trail, its last crumb the piece's title (the head's `
{frame.lifecycleError} — every piece reads as active until it is fixed.
)}