Skip to content

Add PagePreview orphan-badge parity with Card.tsx - #398

Merged
WilfordGrimley merged 1 commit into
masterfrom
worktree-agent-af86976183a3203a2
Jul 23, 2026
Merged

Add PagePreview orphan-badge parity with Card.tsx#398
WilfordGrimley merged 1 commit into
masterfrom
worktree-agent-af86976183a3203a2

Conversation

@WilfordGrimley

Copy link
Copy Markdown

Summary

  • PR Render orphan Drive-ID cards from text/XML import #393 gave orphan Drive-ID cards (a Drive file ID this catalog has never
    indexed, e.g. from a foreign order) a corner OrphanBadge on Card.tsx
    (the classic editor's card renderer), but recorded a known gap in
    docs/features/foreign-order-resilience.md: PagePreview.tsx — the
    /display unified sheet's own renderer — had no equivalent visual
    treatment, even though it already rendered the orphan's image correctly.
  • Closes that gap: PagePreviewSlotContent gains an orphanLabel?: string
    prop; when set (and a resolved imageUrl is present), the slot renders a
    data-testid="orphan-badge" pill in its top-right corner, matching
    Card.tsx's badge styling but reimplemented in this component's own mm-unit
    idiom (so it stays legible after the sheet's outer transform: scale(),
    same reasoning as the component's existing screen-only border/radius).
    Wired from both callers that already resolve a CardDocument:
    DisplayPage.tsx (the /display sheet) and PDFGenerator.tsx's fast
    preview.
  • Same orphan-badge testid Card.tsx already uses, by design, so a spec can
    target either surface uniformly — this was the actual blocker: a parity
    test on the parity-wave1 branch (ImportXML.spec.ts's orphan-cardback
    case) is red today because no orphan indicator exists anywhere on
    /display.
  • docs/features/foreign-order-resilience.md updated in place to mark the
    gap CLOSED, with the new files/props/tests recorded.

Why now

Foreign-order resilience is a high-priority feature (owner ruling,
2026-07-22/23) and /display is its acceptance surface. The badge gap was a
recorded, tracked item blocking a parity test elsewhere — this closes it on
master so that test's adaptation can proceed independently.

Evidence

  • npx jest — 568/568 passing (64 suites), including new PagePreview.test.tsx
    "orphan badge" cases (label shown/omitted/gated on a resolved imageUrl).
  • npx tsc --noEmit — clean.
  • npx prettier@2.7.1 --check on every changed file — clean.
  • npx playwright test tests/OrphanRendering.spec.ts (extended with sheet
    badge assertions on both faces + a new 390px-narrow case) — 3/3 passing.
  • npx playwright test tests/PagePreview.spec.ts — 3/3 passing (no
    regression).
  • npx playwright test tests/DisplayPage.spec.ts — 31/31 passing (no
    regression).
  • Screenshots (zoomed crops confirm the "YOUR FILE" pill renders correctly):
    frontend/test-results/orphan-text-import-desktop.png,
    frontend/test-results/orphan-xml-import-desktop.png,
    frontend/test-results/orphan-xml-import-backs-desktop.png (the "cardback
    corner" case),
    frontend/test-results/orphan-text-import-narrow-390.png (390px phone
    viewport).

Test plan

  • npx jest (full suite)
  • npx tsc --noEmit
  • npx prettier@2.7.1 --check on changed files
  • npx playwright test tests/OrphanRendering.spec.ts (desktop + narrow)
  • npx playwright test tests/PagePreview.spec.ts
  • npx playwright test tests/DisplayPage.spec.ts
  • wiki: no admin/user-facing docs page beyond docs/ itself covers this
    surface today — no wiki page identified as needing a change; flagging
    here per the merge-time checklist convention in case a reviewer knows
    of one this misses.

🤖 Generated with Claude Code

Ports Card.tsx's OrphanBadge corner treatment to the /display sheet's own
renderer, closing the documented gap and unblocking parity-wave1's red test.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@WilfordGrimley
WilfordGrimley merged commit 15d2308 into master Jul 23, 2026
12 checks passed
WilfordGrimley added a commit that referenced this pull request Jul 23, 2026
* Port parity wave 1: import/card-detail/export test clusters onto DisplayPage

Un-skips and ports 58 tests from the classic /editor grid onto the unified
page (issue #272 wave 1): ImportCSV/ImportText/ImportXML + visual (29),
the CardDetailedViewModal ecosystem via Browse mode (20), ExportDecklist/
ExportXML content-correctness (6), AddCardToProjectForm (3).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Fix orphan-cardback test's dangling importXML reference in ImportXML.spec.ts

* Adapt orphan-cardback test's badge assertion to the sheet's per-slot corner badge (#398)

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
WilfordGrimley added a commit that referenced this pull request Jul 24, 2026
* Swap Proposal H's unified page onto /editor, redirect /display

Nav-redesign PR #313 only pointed the "Editor" nav label at /display
while the classic grid page stayed live at /editor - per the owner's
explicit directive, this completes the actual route swap: the unified
sheet+rail page now serves at /editor, /display is a client-side
redirect preserving query params/hash, and the classic ProjectEditor
is fully unrouted (component kept in-tree, deletion is a later
decision).

Ports ProjectEditor's beforeunload unsaved-work guard onto DisplayPage
(it lived only in the now-unrouted component, so it wasn't naturally
inherited). Fixes a real, unrelated redirect-preservation bug found in
useBackendSetter.ts while verifying (documented in troubleshooting.md,
not fixed here - pre-existing, affects every page, out of scope).

~190 Playwright tests that exercised classic-/editor-only UI (CardSlot
grid, SelectedImagesRibbon bulk-select, GridSelectorModal-as-modal,
etc. - issue #272's own tracked parity gaps) are now individually
skipped with a standard citation rather than left red or silently
deleted.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Port chunkErrorRecovery/DisplayLeftRailFidelity specs to the unified-page route (proposal-h)

* Port import/card-detail/export test clusters onto DisplayPage (#395)

* Port parity wave 1: import/card-detail/export test clusters onto DisplayPage

Un-skips and ports 58 tests from the classic /editor grid onto the unified
page (issue #272 wave 1): ImportCSV/ImportText/ImportXML + visual (29),
the CardDetailedViewModal ecosystem via Browse mode (20), ExportDecklist/
ExportXML content-correctness (6), AddCardToProjectForm (3).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Fix orphan-cardback test's dangling importXML reference in ImportXML.spec.ts

* Adapt orphan-cardback test's badge assertion to the sheet's per-slot corner badge (#398)

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* Port ChangeQueryModal/Toasts/a11y/InvalidIdentifiers/SelectVersionSection clusters onto DisplayPage (#403)

Wave 2 of issue #272: un-skips and ports 44 Playwright tests from the classic
/editor grid onto the unified DisplayPage (issue #272 wave 2): SelectVersionSection
(7, already-adapted, just needed its skip removed), ChangeQueryModal via the shared
CardSlotContextMenu (9), 3 Toasts.spec.ts tests that fire on plain landing-page mount,
GeneralUIAccessibility's per-slot a11y checks (3), InvalidIdentifiersStatus (5) +
its visual companion, and SearchSettings.visual (1).

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* Port pin-persistence tests to unified-page routing

* Port GridSelectorModal/CardSlot clusters onto DisplayPage (#410)

* Port GridSelectorModal/CardSlot clusters onto DisplayPage (issue #272 wave 3)

Un-skips 30 of 55 deferred tests (GridSelectorModal.spec.ts +
GridSelectorModalVariants.spec.ts fully, CardSlot.spec.ts partially),
retargeted onto CardbackToolbarButton's cardback picker and the sheet's
page-preview-slot context menu; ports 2 of 6 CardSlot.visual.spec.ts
aria-snapshot tests, regex-tolerant on unrelated pre-existing icon-font
rendering leaves.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Fold the DOM-API sheet gap into the doc body per edit-in-place convention

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant