Skip to content

Commit 85910cb

Browse files
committed
fix(graph): a11y + style polish from review
- iconGraph: use 16-viewBox + 1.5 stroke (matches project icon spec) - View relationships pivots: drop redundant aria-label that didn't match the visible text; rely on the visible "View relationships" span as the accessible name - users_v2 pivot: use vm.User.DN() (consistent with rest of file), not vm.User.User.DN() - TestAxeAAA_GraphPages -> TestAxeAA_GraphPages (matches the AA-only ruleset; AAA login ratchet stays separate in axe_test.go) Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
1 parent cea6d47 commit 85910cb

5 files changed

Lines changed: 22 additions & 21 deletions

File tree

internal/e2e/axe_graph_test.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@ import (
1414
"github.com/stretchr/testify/require"
1515
)
1616

17-
// TestAxeAAA_GraphPages asserts the Phase 3 graph view pages have zero
18-
// WCAG violations under the same axe-core ruleset used by the login
19-
// page test. Covers:
17+
// TestAxeAA_GraphPages asserts the Phase 3 graph view pages have zero
18+
// WCAG 2.2 Level AA violations under axe-core. The graph view's stated
19+
// conformance level is AA (not AAA — the dynamic SVG/JS interactions
20+
// don't clear the AAA bar; the AAA-equivalent flat edge table below
21+
// the canvas provides the text alternative). The login page has a
22+
// separate AAA ratchet in TestAxeAAA_LoginPage. Covers:
2023
// - /graph?entity=<seeded-DN>&depth=2 (entity-focused mode)
2124
// - /users?view=graph (list-page Graph mode)
2225
// - /groups?view=graph
@@ -25,7 +28,7 @@ import (
2528
// Authenticated as the test user; uses the first user from /users to
2629
// pick a real DN for the entity-focused page (matches the existing
2730
// graph_test.go pattern).
28-
func TestAxeAAA_GraphPages(t *testing.T) {
31+
func TestAxeAA_GraphPages(t *testing.T) {
2932
config := DefaultTestConfig()
3033
browser := NewTestBrowser(t, config)
3134
defer browser.Close()

internal/web/templates/computers_v2.templ

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,7 @@ templ computerDrawerContentsCtx(vm ComputerDrawerVM, inDrawer bool) {
361361
}
362362
<li>
363363
<a class="drawer__pivot" href={ templ.URL("/graph?entity=" + url.QueryEscape(vm.Computer.DN())) }
364-
aria-label="View relationship graph"
365-
title="View relationship graph">
364+
title="View relationships">
366365
<span class="drawer__pivot-icon" aria-hidden="true">@iconGraph()</span>
367366
<span class="drawer__pivot-text">View relationships</span>
368367
</a>

internal/web/templates/groups_v2.templ

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,8 +371,7 @@ templ groupDrawerContentsCtx(vm GroupDrawerVM, inDrawer bool) {
371371
}
372372
<li>
373373
<a class="drawer__pivot" href={ templ.URL("/graph?entity=" + url.QueryEscape(asLdapGroup(vm.Group).DN())) }
374-
aria-label="View relationship graph"
375-
title="View relationship graph">
374+
title="View relationships">
376375
<span class="drawer__pivot-icon" aria-hidden="true">@iconGraph()</span>
377376
<span class="drawer__pivot-text">View relationships</span>
378377
</a>

internal/web/templates/icons.templ

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -201,17 +201,18 @@ templ iconOSApple() {
201201
}
202202

203203
// iconGraph — four nodes connected as a square. Semantic for the
204-
// relationship-graph view introduced in Phase 3.
204+
// relationship-graph view introduced in Phase 3. Matches the project
205+
// icon spec: 16-viewBox, 1.5 stroke, currentColor.
205206
templ iconGraph() {
206-
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">
207-
<circle cx="6" cy="6" r="2.5"></circle>
208-
<circle cx="18" cy="6" r="2.5"></circle>
209-
<circle cx="6" cy="18" r="2.5"></circle>
210-
<circle cx="18" cy="18" r="2.5"></circle>
211-
<line x1="8.5" y1="6" x2="15.5" y2="6"></line>
212-
<line x1="6" y1="8.5" x2="6" y2="15.5"></line>
213-
<line x1="18" y1="8.5" x2="18" y2="15.5"></line>
214-
<line x1="8.5" y1="18" x2="15.5" y2="18"></line>
207+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">
208+
<circle cx="4" cy="4" r="1.5"></circle>
209+
<circle cx="12" cy="4" r="1.5"></circle>
210+
<circle cx="4" cy="12" r="1.5"></circle>
211+
<circle cx="12" cy="12" r="1.5"></circle>
212+
<line x1="5.5" y1="4" x2="10.5" y2="4"></line>
213+
<line x1="4" y1="5.5" x2="4" y2="10.5"></line>
214+
<line x1="12" y1="5.5" x2="12" y2="10.5"></line>
215+
<line x1="5.5" y1="12" x2="10.5" y2="12"></line>
215216
</svg>
216217
}
217218

internal/web/templates/users_v2.templ

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -459,9 +459,8 @@ templ userDrawerContentsCtx(vm UserDrawerVM, inDrawer bool) {
459459
</li>
460460
}
461461
<li>
462-
<a class="drawer__pivot" href={ templ.URL("/graph?entity=" + url.QueryEscape(vm.User.User.DN())) }
463-
aria-label="View relationship graph"
464-
title="View relationship graph">
462+
<a class="drawer__pivot" href={ templ.URL("/graph?entity=" + url.QueryEscape(vm.User.DN())) }
463+
title="View relationships">
465464
<span class="drawer__pivot-icon" aria-hidden="true">@iconGraph()</span>
466465
<span class="drawer__pivot-text">View relationships</span>
467466
</a>

0 commit comments

Comments
 (0)