feat(deck-builder): Wincon tag ↔ win-condition engine cross-link (E125)#1308
Merged
Conversation
Adds a narrow, single-purpose "tag as Wincon" toggle on WinConditionPanel's evidence chips (E125) — display-level only, never fed into detectWinConditions. A tagged card that's already engine evidence gets a "tagged by you" mark in place; a tagged card the engine doesn't currently surface gets its own dashed "Tagged by you" section, so a tag never silently disappears as the deck (and its live analysis) changes. Deck.winConTags is a new, deliberately minimal field — distinct from the retired general card-tag system (#1134).
georgepapagapitos
enabled auto-merge (squash)
July 23, 2026 15:52
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.
Summary
detectWinConditions(frontend/src/deck-builder/services/winConditions/detect.ts) is untouched, still pure, no new inputs — no v2-wincon signature bump needed.Deck.winConTags?: string[]— a narrow, single-purpose field (card names only, no goals/colors/categories), explicitly NOT a reopening of the general card-tag system retired in feat(deck): retire user card tags — automatic role pills take over the filter lens #1134. Set only via a user-confirmed click on an evidence chip's tag toggle.aria-pressed); a tag the engine doesn't currently surface gets a separate dashed "Tagged by you" section, so a tag never disappears silently when the live analysis changes.Files touched
frontend/src/deck-builder/services/winConditions/winConTags.ts(+test) — new pure module:tagOnlyWinCons(merge/dedupe) andtoggleWinConTag(add/remove).frontend/src/components/deck/WinConditionPanel.tsx(+test) — per-evidence-chip tag toggle (WinConEvidenceItem), the "Tagged by you" section, restructured render so the tag section survives thenoClearWinConditionempty state.frontend/src/components/deck/WinConditionPanel.css— toggle button styles (aria-pressed accent fill, 44px coarse-pointer target, reduced-motion guard), dashed border for the tagged-only section.frontend/src/store/decks.ts— newDeck.winConTags?: string[]field, additive/whole-row-synced likeprimer.frontend/src/pages/DeckEditorPage.tsx— wireswinConTags/onToggleWinConTaginto the existingWinConditionPanelcall site viaupdateDeck(same pattern asbracketOverride/archetypeOverride).Test plan
winConTags.test.ts— 11 cases: tagOnlyWinCons (primary/secondary dedupe, no-clear-wincon still surfaces tags, mixed split, de-dupe/order) + toggleWinConTag (add/remove/no-mutate).WinConditionPanel.test.tsx— 7 cases covering engine-only / tag-only / both / none states, dedupe, live toggle click, read-only mode when the callback is omitted.npm run typecheck/lint/format:check/test(both packages) — all green; coverage gate enforced (dev Postgres up).winConditionsfor the other 3 states, since the live EDHREC/Scryfall analysis pipeline was rate-limited in this environment) — 320/360(dpr3)/600/768/1024/1440, light+dark at 360+1440.polish:responsive-auditrun — no findings.