Skip to content

feat: hide Preview showcase button for non-terminal states; add back-to-piece link in showcase #992

@shaoster

Description

@shaoster

Problem / Motivation

The "Preview showcase" button currently appears on the piece detail page for all editable pieces, regardless of whether they are in a terminal state. The showcase view is only meaningful for terminal pieces (where the showcase story and video are finalized), so showing the button for in-progress pieces is premature and potentially confusing.

Additionally, the showcase view (/pieces/:id/showcase) has no navigation back to the piece detail page for the authenticated owner. The current "Edit" button in ShowcaseHeader navigates back, but it is labeled "Edit" rather than something that communicates "return to the piece." Unauthenticated visitors already have the PotterDoc logo linking to /, but authenticated owners deserve a clear way back to the piece they were viewing.

Proposed Solution

  1. In PieceDetail.tsx (around line 307), add isTerminal to the gate for the "Preview showcase" button — so it only renders when canEdit && isTerminal.
  2. In PublicPieceShell.tsx (ShowcaseHeader), rename the "Edit" button label to something like "Back to piece" (or "View piece") for the authenticated owner case, making the navigation intent explicit.

Acceptance Criteria

  • "Preview showcase" button is hidden for pieces in non-terminal states
  • "Preview showcase" button remains visible for pieces in terminal states with can_edit: true
  • The authenticated owner's back-navigation button in ShowcaseHeader is labeled "Back to piece" (not "Edit")
  • Component tests updated: PieceDetail test asserts button absent in non-terminal state, present in terminal state; PublicPieceShell test asserts button label

Out of Scope

  • Changing showcase routing, visibility rules, or share/public access behavior
  • Modifying showcase content or layout

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions