Proposal H, Step 2 PR 2b: requested-printing badge + Confirm affordance - #102
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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'salways-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
APIEditorSearchonly ever returnedcontent.results. This PR:APIEditorSearch/APIEditorSearchLegacy(api.ts) to return{results, degradedQueries}.The legacy (
2/editorSearch/) endpoint predates this field entirely, so it always reports[].searchResultsSlice.ts:doSearch()accumulatesdegradedQueryHashKeysacross paginated remoterequests (client-side/local-folder search never reports degraded queries - only the remote backend
can retry a printing filter unfiltered); the
fetchSearchResults.fulfilledreducer merges newhash keys without duplicating;
clearSearchResultsresets them alongsidesearchResults.selectIsSearchQueryDegradedselector: true only for a query that both carries a printingfilter (
expansionCode) and whose hash key is indegradedQueryHashKeys.DisplayPage.tsx'sRailHeader: the badge switches frombg-secondaryto abg-warning text-darkdegraded style (plus a warning icon and explanatorytitle) whenselectIsSearchQueryDegradedis true. Bootswatch's Superhero theme is known to hardcode somecomponent 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 itsclass 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.tsxalready mounts in the classic editor, not a fork. The onlyadapted prop is
onOpenGridSelector: the rail has no modal to open, so N expands (or keepsexpanded, if already open) the Choose Image accordion section instead, per the design doc's §4.3/
§4.4 ("focus, if already open").
Checklist
pre-commitand installed the hooks withpre-commit installbefore creating any commits.DisplayPage.spec.ts(13 tests, incl. 4 new: plain-badge, degraded-badge with computed-styleverification, Confirm affordance YES vote, Confirm affordance NO expanding Choose Image).
searchResultsSlice.test.ts(newdegradedQueryHashKeysreducer tests +selectIsSearchQueryDegradedselector test), full existing
mergeSearchResultscoverage unaffected.CardSlot.spec.ts/DeckbuilderConfirmAffordance.spec.ts(individually/filtered - this sandboxhit intermittent Playwright test-collection flakiness on full-file runs today, reproducing even
on completely untouched spec files like
GridSelectorModal.spec.ts; every test verifiedindividually/in filtered subsets passed cleanly, confirming this is sandbox flakiness, not a
regression from this change).
npx tsc --noEmitclean.npx jest- 359 tests passing, 0 failures.NEXT_PUBLIC_UNIFIED_DISPLAY_ENABLED=true npx next build- clean production build with theflag on (the standing verification bar from PR Fix production build: RailProps.cardDocumentsByIdentifier needs | undefined #90's build-failure lesson).
Per the Step 2 instructions: zero changes to the classic editor's/
DeckbuilderConfirmAffordance'sown behavior (verified above - same component, same gating logic, only the mount-site prop differs).
Generated by Claude Code