import Link from "next/link"; import { Suspense } from "react"; import CopyButton from "@/components/CopyButton"; import NextCard, { NextCardShell } from "@/components/piece/NextCard"; import { ProjectDecisions } from "@/components/projects/report/OverviewTab"; import { PILE_WHAT } from "@/components/tools/ToolList"; import { CUT_NAMES, type Song } from "@/lib/browse"; import { decisionsForProject } from "@/lib/projects"; import { fmtBytes } from "@/lib/format"; import { cutHref, findHref, mixHref, pileHref, projectHref, songToolsHref, sourcesHref, trimHref } from "@/lib/hrefs"; import { Markdown } from "@/lib/markdown"; import type { PieceFrame } from "@/lib/pieces/frame"; import type { ProjectRef } from "@/lib/project-types"; import { readSpec } from "@/lib/spec"; import { MODES } from "@/lib/types"; import type { ThumbView } from "@/lib/thumbs"; // The Overview tab of a song piece (P4a-3; canvas "Piece · Overview" in a // song's words): the Next card -- the song's top Inbox call, an unjudged // variant, a missing cut, a stale recipe -- then the song's decisions and its // four cut slots beside what the song is, the paste ("copy this song", from // SongProject's head row), and the song tools, which stay in Tools (the four // judging piles, find, mix, sources, the hook trimmer). The README is // SongProject's, unchanged. export default async function OverviewTab({ project, song, frame, covers, }: { project: ProjectRef; song: Song; frame: PieceFrame; covers: ThumbView; }) { const [decisions, spec] = await Promise.all([decisionsForProject(project), readSpec(song.id)]); const looksDone = (frame.piece?.looksDone ?? []).map((w) => w.replace(`${project.id}: `, "")); if (!looksDone.length && song.present === CUT_NAMES.length) looksDone.push("every cut shipped"); const trimSet = spec.hooks?.trimSet ?? null; return ( <> Reading the Inbox… } >
{/* --- what is wrong, first ------------------------------------- */}

Cuts · {song.present} of {song.cuts.length}

All cuts →
    {song.cuts.map((cut) => { const live = cut.variants.filter((v) => !v.retired).length; return (
  • {cut.name} {cut.shipped ? `built · ${fmtBytes(cut.shipped.size)}` : "a hole in the set"} {live ? `${live} variant${live === 1 ? "" : "s"}` : ""}
  • ); })}

This song

  • cuts built {song.present} / {song.cuts.length} {song.missing.length ? ` · no ${song.missing.join(", ")}` : ""}
  • variants {song.variantCount}
  • verdicts {song.counts.keep} keep · {song.counts.reject} reject · {song.counts.undecided} undecided
  • plans {song.plans.length}
  • cover {covers.accepted ? `accepted · ${covers.accepted.name}` : covers.candidates.length ? `${covers.candidates.length} on offer, none accepted` : "none generated"}
  • {looksDone.length > 0 && frame.lifecycle === "active" && (
  • looks done {looksDone.join("; ")}
  • )}

Song tools

    {MODES.map((m) => (
  • {m} {PILE_WHAT[m]}
  • ))} {trimSet && (
  • trim {trimSet} the hook trimmer, for the spec's hooks
  • )}

song piles find mix sources

{/* --- the song's own account of itself ---------------------------- */} {song.readme && (
)} ); }