diff --git a/.Jules/palette.md b/.Jules/palette.md index 692a9e9..a53889c 100644 --- a/.Jules/palette.md +++ b/.Jules/palette.md @@ -111,3 +111,19 @@ ## 2025-06-25 - [Copy-to-Clipboard UX and Immediate Feedback] **Learning:** Adding a copy-to-clipboard feature for key user identifiers (like email or IDs) significantly reduces friction in user workflows. Implementing this with `navigator.clipboard.writeText` and providing immediate visual feedback via a toast notification ('Correo copiado al portapapeles') confirms success. Using icon-only buttons with explicit `aria-label` and `title` ensures the feature is both accessible and intuitive. **Action:** Always provide a copy-to-clipboard option for static text that users frequently need to reuse, and ensure immediate feedback is provided upon action. + +## 2025-01-15 - [Keyboard Efficiency and Discoverability in Flashcards] +**Learning:** For high-repetition tasks like flashcard study, keyboard shortcuts (Space/Enter for flip, 1-4 for rating) dramatically improve user flow and "flow state" immersion. However, shortcuts must be discoverable; adding bracketed visual hints like "[Espacio]" or "[1]" directly to button labels, along with descriptive "aria-label" and "title" attributes, ensures accessibility and lowers the learning curve for power users. +**Action:** Always include keyboard shortcuts for core repetitive loops and provide integrated visual hints for those shortcuts to ensure they aren't "hidden" features. + +## 2025-06-18 - [Standardized Accessibility and Password Visibility in V2 Auth Forms] +**Learning:** In V2 authentication flows, maintaining feature parity between Login, Signup, and Forgot Password pages—specifically regarding password visibility toggles and label-input associations—ensures a predictable and accessible user experience. Missing `id` and `htmlFor` attributes on inputs breaks screen reader navigation even if the layout looks correct. +**Action:** Always audit the full authentication suite (Login, Signup, Recovery) for accessibility parity and ensure interactive password fields consistently offer visibility toggles. + +## 2025-06-17 - [Accessible Progress Indicators and V2 Navigation Polish] +**Learning:** For progress indicators to be truly accessible, they must include `role="progressbar"` along with `aria-valuenow`, `aria-valuemin`, and `aria-valuemax` attributes, allowing screen readers to accurately report status. In side-navigation rails, ensuring decorative icons are marked with `aria-hidden="true"` and the active link has `aria-current="page"` significantly improves screen reader navigation. Additionally, maintaining localization consistency (e.g., 'Inicio' vs 'Home') in new UI versions (V2) is essential for a cohesive user experience. +**Action:** Always implement full ARIA attributes for progress components and audit new navigation structures for both accessibility markers and language consistency. + +## 2025-06-17 - [Accessible Checkboxes and Consistent Prop Spreading] +**Learning:** Enhancing base form components like `CustomCheckbox` with standardized `required` indicators (visual asterisk and `aria-required`) and grid support (`s`, `m`, `l`, `xl`, `offset`) improves both accessibility and developer productivity. Ensuring that `...props` are consistently applied to the inner `input` regardless of the presence of a wrapper `div` maintains a predictable component API. +**Action:** Always provide visual and semantic cues for mandatory fields and ensure consistent prop-spreading behavior in multi-layered components. diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 24a2e72..ccde658 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -42,3 +42,11 @@ jobs: - name: Run tests run: npm test + + - name: Check for console warnings in test output + run: | + npm test 2>&1 | tee vitest-output.txt + if grep -qE 'not wrapped in act|changing an uncontrolled|does not recognize the.*prop|Received `.+?` for a non-boolean attribute|Invalid DOM property|Each child in a list should have a unique.*key' vitest-output.txt; then + echo "ERROR: Console warnings detected in test output!" + exit 1 + fi diff --git a/AGENTS.md b/AGENTS.md index b0ec578..b031d61 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -8,3 +8,67 @@ ## GitHub Actions - The CI/CD pipeline is configured to use `npm`. - Ensure `package-lock.json` is always updated and committed when changing dependencies. + +## Testing Standards + +### Console Warning Interceptor +All tests run through a global interceptor in `src/test/setupTests.js` that fails tests on specific console.error/console.warn patterns. This catches test-quality issues before they reach CI. + +**Blocked patterns (console.error):** +| Pattern | Issue | Common Cause | +|---|---|---| +| `not wrapped in act` | Async state update after test ends | API mock resolves after `await waitFor(() => {})`; loading state mock never resolves | +| `changing an uncontrolled` | Input rendered without `onChange` handler | Mock form with initial undefined `value`; component renders without controlled prop | +| `does not recognize the.*prop` | Invalid prop passed to DOM element | Passing `noMargin` or other custom props directly to `