Skip to content

Commit 9de89f7

Browse files
corvid-agentclaude
andauthored
fix(a11y): fix accessibility issues across 5 components (#66)
- repo-browser: change outer <button> to <div> to fix invalid nested interactive elements, add keyboard handlers and aria-label to Manual button - section-nav: remove incorrect role="listbox"/role="option" ARIA pattern, fix aria-current="true" to aria-current="location" - table-editor: add aria-label to icon buttons (Move up/down, Remove row), add scope="col" to <th> elements - section-editor: add aria-label to textarea text blocks - spec-list: add tabindex="0" to suite-group treeitems for keyboard focus Closes #62 Co-authored-by: Claude Opus 4.6 <[email protected]>
1 parent 7f0ec1d commit 9de89f7

File tree

6 files changed

+19
-16
lines changed

6 files changed

+19
-16
lines changed

src/app/components/repo-browser/repo-browser.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="repo-browser" role="region" aria-label="Repository browser">
22
<div class="repo-browser-header">
33
<h4 class="repo-browser-title" id="repo-browser-heading">Your Repositories</h4>
4-
<button class="btn btn-sm" (click)="onManual()">Manual</button>
4+
<button class="btn btn-sm" (click)="onManual()" aria-label="Enter repository details manually">Manual</button>
55
</div>
66

77
@if (initResult(); as result) {
@@ -41,14 +41,16 @@ <h4 class="repo-browser-title" id="repo-browser-heading">Your Repositories</h4>
4141

4242
<div class="repo-list" role="list" aria-labelledby="repo-browser-heading">
4343
@for (repo of filteredRepos(); track repo.full_name) {
44-
<button
44+
<div
4545
class="repo-item"
4646
role="listitem"
4747
[class.has-specs]="repo.hasSpecs"
48-
[disabled]="connecting() !== null || initializing() !== null"
4948
[attr.aria-busy]="connecting() === repo.full_name || initializing() === repo.full_name"
5049
[attr.aria-label]="repo.full_name + (repo.hasSpecs ? ' (specs found)' : '') + (repo.private ? ' (private)' : '')"
5150
(click)="onSelectRepo(repo)"
51+
tabindex="0"
52+
(keydown.enter)="onSelectRepo(repo)"
53+
(keydown.space)="$event.preventDefault(); onSelectRepo(repo)"
5254
>
5355
<div class="repo-item-main">
5456
<div class="repo-item-name">
@@ -81,7 +83,7 @@ <h4 class="repo-browser-title" id="repo-browser-heading">Your Repositories</h4>
8183
</button>
8284
}
8385
</div>
84-
</button>
86+
</div>
8587
}
8688
</div>
8789

src/app/components/repo-browser/repo-browser.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@
7878
font-size: 13px;
7979
transition: background 0.1s, border-color 0.1s;
8080

81-
&:hover:not(:disabled) {
81+
&:hover:not([aria-busy="true"]) {
8282
background: var(--hover);
8383
border-color: var(--accent, #58a6ff);
8484
}
8585

86-
&:disabled {
86+
&[aria-busy="true"] {
8787
opacity: 0.6;
8888
cursor: default;
8989
}
@@ -92,7 +92,7 @@
9292
border-color: var(--status-active, #3fb950);
9393
background: rgba(63, 185, 80, 0.05);
9494

95-
&:hover:not(:disabled) {
95+
&:hover:not([aria-busy="true"]) {
9696
background: rgba(63, 185, 80, 0.1);
9797
}
9898
}

src/app/components/section-editor/section-editor.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
(ngModelChange)="onTextBlockChange(blockIdx, $event)"
3939
placeholder="Enter text..."
4040
rows="3"
41+
[attr.aria-label]="'Text block ' + (blockIdx + 1)"
4142
></textarea>
4243
}
4344
}

src/app/components/section-nav/section-nav.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<nav class="section-nav" aria-label="Spec sections">
22
<h3 class="nav-title" id="section-nav-heading">Sections</h3>
3-
<ul class="nav-list" role="listbox" aria-labelledby="section-nav-heading">
3+
<ul class="nav-list" aria-labelledby="section-nav-heading">
44
@for (item of navItems(); track item.label) {
5-
<li role="option" [attr.aria-selected]="isActive(item)">
5+
<li>
66
<button
77
class="nav-item"
88
[class.active]="isActive(item)"
99
[class.level-2]="item.type === 'section' && item.level === 2"
1010
[class.level-3]="item.type === 'section' && item.level >= 3"
1111
[class.frontmatter]="item.type === 'frontmatter'"
12-
[attr.aria-current]="isActive(item) ? 'true' : null"
12+
[attr.aria-current]="isActive(item) ? 'location' : null"
1313
(click)="onSelect(item.type === 'frontmatter' ? -1 : item.index)"
1414
>
1515
@if (item.type === 'frontmatter') {

src/app/components/spec-list/spec-list.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
<div class="suite-scroll-area" role="tree" aria-label="Spec suites">
1111
@for (entry of store.suites() | keyvalue:suiteOrder; track entry.key) {
12-
<div class="suite-group" role="treeitem" [attr.aria-expanded]="!isSuiteCollapsed(entry.key)">
12+
<div class="suite-group" role="treeitem" [attr.aria-expanded]="!isSuiteCollapsed(entry.key)" tabindex="0">
1313
<button
1414
class="suite-header"
1515
[class.collapsed]="isSuiteCollapsed(entry.key)"

src/app/components/table-editor/table-editor.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
<thead>
55
<tr>
66
@for (header of table().headers; track $index) {
7-
<th>{{ header }}</th>
7+
<th scope="col">{{ header }}</th>
88
}
9-
<th class="actions-col"></th>
9+
<th scope="col" class="actions-col"></th>
1010
</tr>
1111
</thead>
1212
<tbody>
@@ -26,12 +26,12 @@
2626
<td class="actions-cell">
2727
<div class="row-actions">
2828
@if (rowIdx > 0) {
29-
<button class="btn-icon" (click)="moveRowUp(rowIdx)" title="Move up">&#8593;</button>
29+
<button class="btn-icon" (click)="moveRowUp(rowIdx)" title="Move up" aria-label="Move up">&#8593;</button>
3030
}
3131
@if (rowIdx < table().rows.length - 1) {
32-
<button class="btn-icon" (click)="moveRowDown(rowIdx)" title="Move down">&#8595;</button>
32+
<button class="btn-icon" (click)="moveRowDown(rowIdx)" title="Move down" aria-label="Move down">&#8595;</button>
3333
}
34-
<button class="btn-icon btn-danger" (click)="removeRow(rowIdx)" title="Remove row">&times;</button>
34+
<button class="btn-icon btn-danger" (click)="removeRow(rowIdx)" title="Remove row" aria-label="Remove row">&times;</button>
3535
</div>
3636
</td>
3737
</tr>

0 commit comments

Comments
 (0)