From f77666db87bc2234bcdffa670e6bee1427808be3 Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Sat, 7 Feb 2026 17:36:23 -0600 Subject: [PATCH] CLAUDE: Add XCheckWizard component and result constants (step 6) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New files: - constants/xCheckResults.ts - Labels, helpers for all result codes - components/Gameplay/XCheckWizard.vue - Interactive x-check UI XCheckWizard features: ✅ Displays d20 and 3d6 dice results prominently ✅ Shows 5-column chart row (Range 1-5) as selectable buttons ✅ Hash result sub-choices (G2#/G3# → pick G2 or SI2) ✅ SPD result sub-choice (click to reveal d20, pick safe/out) ✅ Error selection (NO/E1/E2/E3/RP) based on 3d6 ✅ Submit validation (both result + error required) ✅ Read-only mode for transparency (opponent sees same UI) ✅ Mobile-responsive layout (stacks on small screens) ✅ Tailwind styling with clear visual hierarchy Helper functions: - getResultLabel() - Display names for all codes - getErrorLabel() - Display names for error types - isHashResult() - Detect G2#/G3# - isSpdResult() - Detect SPD - getHashConversions() - Get conversion options Next: Integrate XCheckWizard into GameplayPanel Co-Authored-By: Claude Sonnet 4.5 --- .../components/Gameplay/XCheckWizard.vue | 506 ++++++++++++++++++ frontend-sba/constants/xCheckResults.ts | 87 +++ 2 files changed, 593 insertions(+) create mode 100644 frontend-sba/components/Gameplay/XCheckWizard.vue create mode 100644 frontend-sba/constants/xCheckResults.ts diff --git a/frontend-sba/components/Gameplay/XCheckWizard.vue b/frontend-sba/components/Gameplay/XCheckWizard.vue new file mode 100644 index 0000000..85b0e55 --- /dev/null +++ b/frontend-sba/components/Gameplay/XCheckWizard.vue @@ -0,0 +1,506 @@ + + + + + diff --git a/frontend-sba/constants/xCheckResults.ts b/frontend-sba/constants/xCheckResults.ts new file mode 100644 index 0000000..4366570 --- /dev/null +++ b/frontend-sba/constants/xCheckResults.ts @@ -0,0 +1,87 @@ +/** + * X-Check Result Code Labels and Descriptions + * + * Display labels for all possible result codes that can appear in + * defensive x-check chart rows (5 columns). + */ + +export const X_CHECK_RESULT_LABELS: Record = { + // Groundball results + G1: 'Groundball Out (best)', + G2: 'Groundball Out (good)', + G3: 'Groundball Out (weak)', + 'G2#': 'Groundball (speed test)', + 'G3#': 'Groundball (speed test)', + + // Singles + SI1: 'Single (clean)', + SI2: 'Single (through)', + + // Doubles + DO2: 'Double (2-base)', + DO3: 'Double (3-base)', + + // Triples + TR3: 'Triple', + + // Flyball results + F1: 'Flyout (deep)', + F2: 'Flyout (medium)', + F3: 'Flyout (shallow)', + + // Catcher-specific + SPD: 'Speed Check', + FO: 'Fly Out', + PO: 'Pop Out', +} + +export const X_CHECK_ERROR_LABELS: Record = { + NO: 'No Error', + E1: 'Error (+1 base)', + E2: 'Error (+2 bases)', + E3: 'Error (+3 bases)', + RP: 'Rare Play (+3 bases)', +} + +/** + * Hash result conversions (player mentally resolves based on batter speed) + */ +export const HASH_CONVERSIONS: Record = { + 'G2#': ['G2', 'SI2'], + 'G3#': ['G3', 'SI2'], +} + +/** + * Get display label for a result code + */ +export function getResultLabel(code: string): string { + return X_CHECK_RESULT_LABELS[code] || code +} + +/** + * Get display label for an error result + */ +export function getErrorLabel(code: string): string { + return X_CHECK_ERROR_LABELS[code] || code +} + +/** + * Check if a result code is a hash result (requires speed test) + */ +export function isHashResult(code: string): boolean { + return code.endsWith('#') +} + +/** + * Check if a result code is SPD (speed check) + */ +export function isSpdResult(code: string): boolean { + return code === 'SPD' +} + +/** + * Get conversion options for a hash result + */ +export function getHashConversions(code: string): string[] | null { + return HASH_CONVERSIONS[code] || null +}