Skip to content

Proposal H, Step 2 PR 2b: requested-printing badge + Confirm affordance - #102

Merged
WilfordGrimley merged 1 commit into
masterfrom
claude/proposal-h-2b-badge-confirm-04bam2
Jul 18, 2026
Merged

Proposal H, Step 2 PR 2b: requested-printing badge + Confirm affordance#102
WilfordGrimley merged 1 commit into
masterfrom
claude/proposal-h-2b-badge-confirm-04bam2

Conversation

@WilfordGrimley

Copy link
Copy Markdown

Description

Instrument parity, PR 2b of the Step 2 sequence for docs/proposals/proposal-h-unified-display-page.md
(behind NEXT_PUBLIC_UNIFIED_DISPLAY_ENABLED; PR 2a/#96 already merged). Wires the rail's
always-visible status header to two real instruments per the design doc's §2/§5:

Requested-printing badge, full degraded-state treatment. EditorSearchResponse.degradedQueries
(schema_types.ts) was already returned by the backend but discarded on the frontend before this PR

  • APIEditorSearch only ever returned content.results. This PR:
  • Changes APIEditorSearch/APIEditorSearchLegacy (api.ts) to return {results, degradedQueries}.
    The legacy (2/editorSearch/) endpoint predates this field entirely, so it always reports [].
  • searchResultsSlice.ts: doSearch() accumulates degradedQueryHashKeys across paginated remote
    requests (client-side/local-folder search never reports degraded queries - only the remote backend
    can retry a printing filter unfiltered); the fetchSearchResults.fulfilled reducer merges new
    hash keys without duplicating; clearSearchResults resets them alongside searchResults.
  • New selectIsSearchQueryDegraded selector: true only for a query that both carries a printing
    filter (expansionCode) and whose hash key is in degradedQueryHashKeys.
  • DisplayPage.tsx's RailHeader: the badge switches from bg-secondary to a bg-warning text-dark degraded style (plus a warning icon and explanatory title) when
    selectIsSearchQueryDegraded is true. Bootswatch's Superhero theme is known to hardcode some
    component colors past the CSS-variable layer (see PR /whatsthat: fix oversized starburst + swap accent to an AA-verified navy against the orange bg #91's own theming caveat), so the new
    Playwright test reads the badge's actual getComputedStyle().backgroundColor, not just its
    class name, to confirm the degraded state really renders as a distinct, visibly-warm color.

Confirm? affordance in the rail's header. Mounts the real DeckbuilderConfirmAffordance -
the exact same component CardSlot.tsx already mounts in the classic editor, not a fork. The only
adapted prop is onOpenGridSelector: the rail has no modal to open, so N expands (or keeps
expanded, if already open) the Choose Image accordion section instead, per the design doc's §4.3/
§4.4 ("focus, if already open").

Checklist

  • I have installed pre-commit and installed the hooks with pre-commit install before creating any commits.
  • I have updated any related tests for code I modified or added new tests where appropriate.
  • I have manually tested my changes as follows:
    • DisplayPage.spec.ts (13 tests, incl. 4 new: plain-badge, degraded-badge with computed-style
      verification, Confirm affordance YES vote, Confirm affordance NO expanding Choose Image).
    • searchResultsSlice.test.ts (new degradedQueryHashKeys reducer tests + selectIsSearchQueryDegraded
      selector test), full existing mergeSearchResults coverage unaffected.
    • CardSlot.spec.ts/DeckbuilderConfirmAffordance.spec.ts (individually/filtered - this sandbox
      hit intermittent Playwright test-collection flakiness on full-file runs today, reproducing even
      on completely untouched spec files like GridSelectorModal.spec.ts; every test verified
      individually/in filtered subsets passed cleanly, confirming this is sandbox flakiness, not a
      regression from this change).
    • npx tsc --noEmit clean.
    • npx jest - 359 tests passing, 0 failures.
    • NEXT_PUBLIC_UNIFIED_DISPLAY_ENABLED=true npx next build - clean production build with the
      flag on (the standing verification bar from PR Fix production build: RailProps.cardDocumentsByIdentifier needs | undefined #90's build-failure lesson).
  • I have updated any relevant documentation or created new documentation where appropriate.

Per the Step 2 instructions: zero changes to the classic editor's/DeckbuilderConfirmAffordance's
own behavior (verified above - same component, same gating logic, only the mount-site prop differs).


Generated by Claude Code

…ce in the display rail

Wires EditorSearchResponse.degradedQueries end to end for the first time on the
frontend (previously captured by the API but discarded before reaching Redux):
APIEditorSearch now returns {results, degradedQueries} instead of discarding the
latter, searchResultsSlice accumulates degradedQueryHashKeys across paginated
search requests, and a new selectIsSearchQueryDegraded selector answers "did this
printing-filtered query get retried unfiltered" for a given slot's query.

The display rail's always-visible header consumes that selector: the requested-
printing badge switches from bg-secondary to a bg-warning degraded style (plus a
warning icon and explanatory title) when the backend reports the filter as
degraded, per the design doc's §2/§5. Bootswatch's Superhero theme is known to
hardcode some component colors past the CSS-variable layer (see PR #91), so the
new Playwright test verifies actual computed background-color, not just the class
name, to confirm the degraded state really renders distinctly.

The header also mounts the real DeckbuilderConfirmAffordance - the same component
CardSlot.tsx already mounts, adapted only via its onOpenGridSelector prop: the
rail has no modal to open, so N expands (or keeps expanded) the Choose Image
accordion section instead of opening GridSelectorModal.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MHapYojTkT5wenrQwGbGYk
@WilfordGrimley
WilfordGrimley merged commit 099f60f into master Jul 18, 2026
7 checks passed
@WilfordGrimley
WilfordGrimley deleted the claude/proposal-h-2b-badge-confirm-04bam2 branch July 18, 2026 23:33
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.

2 participants