Skip to content

Conversation

joshsadam
Copy link
Contributor

What does this PR do and why?

Describe in detail what your merge request does and why.

Add accessible tabs component to the Pathogen design system following W3C ARIA Authoring Practices Guide.

What's Changed

  • New Pathogen::Tabs component with ViewComponent architecture
    • Tabs - Main container with automatic tab activation
    • Tab - Individual tab controls with keyboard navigation (Arrow keys, Home, End)
    • TabPanel - Content panels with proper ARIA relationships
  • Stimulus controller (pathogen--tabs) for interactive behavior
    • Automatic tab activation on focus
    • Full keyboard navigation support
    • Programmatic API for external controls
  • Turbo Frame integration for lazy loading tab content

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other pull requests.

image

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

See Lookbook Previews

PR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

…and tests

- Implement Stimulus controller (pathogen--tabs) for accessible tabs: ARIA setup, roving tabindex,
  keyboard navigation (Arrow/Home/End), automatic activation and Turbo Frame lazy-loading integration.
- Add Pathogen::Tabs component and subcomponents (Tab, TabPanel) with ERB templates for rendering.
- Provide CSS progressive enhancement to hide non-active panels until JS initializes.
- Add comprehensive unit, preview and system tests (including lazy-loading/system scaffolds); many system tests are skipped where Turbo integration is required.
@joshsadam joshsadam added enhancement New feature or request accessibility Accessibility concerns and/or requests labels Oct 16, 2025
Replace TabsPanel with Pathogen::Tabs, switch tab option keys from text to label,
add default_index, introduce tabs.with_panel blocks for members/groups, and
make member/group turbo_frame tags and pagination frames lazy-loading with
refresh: "morph".
- Add `sync_url` option to Pathogen::Tabs API and pass as `data-pathogen--tabs-sync-url-value`
- Update tabs template to include sync data attribute and project members view to enable `sync_url: true`
- Enhance Pathogen tabs Stimulus controller:
  - read initial tab from URL hash, update selected tab, and listen for `hashchange`
  - update URL hash using history.replaceState on tab selection (no extra history entries)
  - handle back/forward navigation by responding to hash changes and clean up listener on disconnect
  - add helpers to map between tab/panel IDs and indices
- Add CSS rules for `[role="tab"][aria-selected="true|false"]` to override server-rendered classes when JS updates `aria-selected`
- Minor comment/documentation tweaks in Tab and Tabs component
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accessibility Accessibility concerns and/or requests enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant