feat(autocomplete): implement searchable single-select component#286
Open
Gabo-Dev wants to merge 3 commits into
Open
feat(autocomplete): implement searchable single-select component#286Gabo-Dev wants to merge 3 commits into
Gabo-Dev wants to merge 3 commits into
Conversation
- Add 6-file structure (component, hook, types, test, stories, index) - Implement popover-based autocomplete with search input - Support controlled/uncontrolled modes - Add clear button, loading state, custom filtering - Add keyboard navigation (ArrowUp/Down, Home/End, Enter, Escape, Tab) - Add 24 tests covering hook logic, DOM behavior, and ARIA - Include 10 Storybook stories documenting all states - Apply accessibility fixes (live regions, robust Tab handler) - Add dev warning for missing accessible name - Copy shared CVAs from Select for component independence - Add search-input spacing tokens to theme.css Closes #12
Member
|
Buen trabajo con la estructura del componente y la evidencia de CI. La duplicidad con
Además, el PR tiene +2025 líneas, por encima del presupuesto de review de 400 líneas. Si no se va a partir, dejemos explícita una excepción de maintainer para este caso. |
Member
|
Actualizo la revisión sobre el commit nuevo Quedan estos puntos antes de aprobar:
|
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.
Closes #12
Summary
Implementa el componente Autocomplete como átomo del design system.
Permite buscar y seleccionar una opción de una lista con popover,
search input y navegación por teclado completa.
Tabla de cambios
src/components/atoms/autocomplete/Autocomplete.tsxsrc/components/atoms/autocomplete/useAutocomplete.tssrc/components/atoms/autocomplete/types.tssrc/components/atoms/autocomplete/Autocomplete.test.tsxsrc/components/atoms/autocomplete/Autocomplete.stories.tsxsrc/components/atoms/autocomplete/index.tssrc/index.tssrc/styles/theme.css--spacing-search-input-*Evidencia de tests/build
Pre-commit hooks pasan:
Resultado de pre-PR component review
Component Audit → PASS
any✅@default✅Visual Review → PASS
focus-visible:focus-ring✅motion-safe:prefix ✅Judgment Day (accesibilidad) → APPROVED
Issues CRITICAL encontrados y resueltos:
role="status" aria-live="polite"→ fixedIssues WARNING encontrados y resueltos:
3. Tab handler con DOM traversal frágil → robusto con
querySelectorAll4.
needsScopedDarkPortallee ref durante render → movido auseEffect5. Clases
data-[focused=true]duplicadas → eliminadas6.
popoverPropsretornado pero nunca usado → eliminado7. Trigger sin nombre accesible sin label → dev warning agregado
Mejoras menores adicionales:
aria-labelademás delabel/ariaLabelNotas de accesibilidad
ARIA pattern
buttonconaria-haspopup="listbox"+aria-expandedrole="combobox"conaria-controls,aria-activedescendant,aria-autocomplete="list"role="listbox"conaria-labelrole="option"conaria-selected,aria-disabled,data-focusedrole="status"+aria-live="polite"role="status"+aria-live="polite"Keyboard navigation
Separación de Select
Autocomplete tiene CVAs propios (copiados de Select) para ser
independiente según roadmap v1. Ambos componentes podrán evolucionar
por separado. Select queda pendiente de sus propios fixes de
motion-safe:y dev warning en issue separada.