You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+57Lines changed: 57 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,63 @@ All notable changes to this project will be documented in this file.
5
5
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
8
+
## [1.5.10] - 2024-12-01
9
+
10
+
### Changed
11
+
-**Configuration flag renamed**: The `enabled` flag has been renamed to `accessibility_enabled` for better clarity. The old `enabled` key is still supported for backward compatibility.
12
+
13
+
### Added
14
+
-**Composed Page Scanning**: The static scanner now analyzes complete page compositions (layout + view + partials) for page-level accessibility checks, eliminating false positives for heading hierarchy, ARIA landmarks, duplicate IDs, and heading issues.
15
+
-**View Composition Builder**: New comprehensive system that traces the complete page structure by finding all partials recursively across all directories in `app/views`.
16
+
-**Exhaustive Partial Detection**: Enhanced partial detection that finds partials in any subdirectory, not just specific folders. Works for deeply nested namespaces (e.g., `collections/collection_questions`).
17
+
-**ERB Content Detection**: Improved handling of ERB expressions (`<%= ... %>`) to prevent false positives for empty headings and missing accessible names on buttons.
18
+
19
+
### Changed
20
+
-**Heading Hierarchy Checks**: Now performed on the complete composed page instead of individual files, preventing false positives when H1 is in layout or partials.
21
+
-**ARIA Landmarks Checks**: Now checks for `<main>` landmark across the entire composed page.
22
+
-**Duplicate ID Checks**: Now checks for duplicate IDs across the complete page composition.
23
+
-**Empty Heading Checks**: Now checks for empty headings across the complete composed page.
24
+
-**Partial Search**: Enhanced to traverse ALL folders in `app/views` recursively using `Dir.glob`, making it a general solution that works for any folder structure.
25
+
26
+
### Fixed
27
+
- Fixed false positive for "Page missing MAIN landmark" when `<main>` is in the layout file.
28
+
- Fixed false positive for "Page has h2 but no h1 heading" when H1 is in a partial rendered via `render @model`.
29
+
- Fixed false positive for "Heading hierarchy skipped (h0 to h2)" when first heading is h2.
30
+
- Fixed false positive for "Duplicate ID 'ERB_CONTENT'" by filtering out ERB placeholder strings.
- Fixed path normalization to handle both relative and absolute paths consistently.
34
+
35
+
### Performance
36
+
- Optimized exhaustive directory search to return first match found instead of checking all matches.
37
+
38
+
## [Unreleased]
39
+
40
+
### Added
41
+
-**Composed Page Scanning**: The static scanner now analyzes complete page compositions (layout + view + partials) for page-level accessibility checks, eliminating false positives for heading hierarchy, ARIA landmarks, duplicate IDs, and heading issues.
42
+
-**View Composition Builder**: New comprehensive system that traces the complete page structure by finding all partials recursively across all directories in `app/views`.
43
+
-**Exhaustive Partial Detection**: Enhanced partial detection that finds partials in any subdirectory, not just specific folders. Works for deeply nested namespaces (e.g., `collections/collection_questions`).
44
+
-**ERB Content Detection**: Improved handling of ERB expressions (`<%= ... %>`) to prevent false positives for empty headings and missing accessible names on buttons.
45
+
46
+
### Changed
47
+
-**Heading Hierarchy Checks**: Now performed on the complete composed page instead of individual files, preventing false positives when H1 is in layout or partials.
48
+
-**ARIA Landmarks Checks**: Now checks for `<main>` landmark across the entire composed page.
49
+
-**Duplicate ID Checks**: Now checks for duplicate IDs across the complete page composition.
50
+
-**Empty Heading Checks**: Now checks for empty headings across the complete composed page.
51
+
-**Partial Search**: Enhanced to traverse ALL folders in `app/views` recursively using `Dir.glob`, making it a general solution that works for any folder structure.
52
+
53
+
### Fixed
54
+
- Fixed false positive for "Page missing MAIN landmark" when `<main>` is in the layout file.
55
+
- Fixed false positive for "Page has h2 but no h1 heading" when H1 is in a partial rendered via `render @model`.
56
+
- Fixed false positive for "Heading hierarchy skipped (h0 to h2)" when first heading is h2.
57
+
- Fixed false positive for "Duplicate ID 'ERB_CONTENT'" by filtering out ERB placeholder strings.
Copy file name to clipboardExpand all lines: docs_site/architecture.md
+39-1Lines changed: 39 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,45 @@ layout: default
3
3
title: Architecture
4
4
---
5
5
6
-
# Architecture Overview
6
+
# Architecture
7
+
8
+
## Composed Page Scanning
9
+
10
+
The gem now uses **composed page scanning** for page-level accessibility checks. This ensures that checks like heading hierarchy, ARIA landmarks, and duplicate IDs are evaluated against the complete rendered page (layout + view + partials), not individual files.
11
+
12
+
### View Composition Builder
13
+
14
+
The `ViewCompositionBuilder` class traces the complete page structure:
15
+
16
+
1.**Finds Layout File**: Identifies the layout file (defaults to `application.html.erb`)
17
+
2.**Finds View File**: The main view file being rendered
18
+
3.**Recursively Finds Partials**: Discovers all partials rendered in the view, including:
19
+
- Partials in the same directory
20
+
- Partials in `layouts/`, `shared/`, `application/`
21
+
- Partials in any subdirectory (exhaustive search)
22
+
- Nested partials (partials within partials)
23
+
24
+
### Partial Detection
25
+
26
+
The gem detects all Rails render patterns:
27
+
-`render 'partial'`
28
+
-`render partial: 'partial'`
29
+
-`render @model` (Rails shorthand)
30
+
-`render collection: @models`
31
+
-`render partial: 'item', collection: @items`
32
+
-`render partial: 'form', locals: {...}`
33
+
34
+
### Exhaustive Folder Traversal
35
+
36
+
The partial search traverses ALL folders in `app/views` recursively using `Dir.glob`, ensuring partials are found regardless of their location:
37
+
-`app/views/collections/`
38
+
-`app/views/collections/collection_questions/`
39
+
-`app/views/items/`
40
+
-`app/views/profiles/`
41
+
-`app/views/loan_requests/`
42
+
- Any other nested structure
43
+
44
+
This makes it a general solution that works for any Rails application structure. Overview
7
45
8
46
This guide explains how Rails Accessibility Testing works under the hood in simple terms.
Copy file name to clipboardExpand all lines: docs_site/index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ title: Home
7
7
8
8
**The RSpec + RuboCop of accessibility for Rails. Catch WCAG violations before they reach production.**
9
9
10
-
**Version:** 1.5.5
10
+
**Version:** 1.5.9
11
11
12
12
Rails Accessibility Testing is a comprehensive, opinionated but configurable gem that makes accessibility testing as natural as unit testing. It integrates seamlessly into your Rails workflow, catching accessibility issues as you code—not after deployment.
0 commit comments