Service Layer medium complexity mobile
1
Dependencies
0
Dependents
0
Entities
0
Integrations

Description

A service layer that enforces gesture-free navigation contracts across the application. It audits route configurations to confirm every route has an explicit dismissal mechanism, verifies that no flow relies solely on swipe-to-dismiss, and surfaces compliance warnings during development.

Feature: Navigation & Gesture Accessibility

navigation-accessibility-service

Summaries

The Navigation Accessibility Service acts as a compliance guardian that ensures our application meets the accessibility standards required by our users who rely on Switch Access, Full Keyboard Access, or other assistive technologies. For users who cannot perform swipe gestures, every screen that lacks an explicit dismiss or back control is effectively a dead end — a trap that makes the app unusable. This component prevents such barriers from ever reaching production by surfacing violations during development. Beyond user experience, it supports our commitment to WCAG and platform accessibility guidelines, reducing legal and reputational risk associated with inaccessible software.

This is a medium-complexity service component that depends on navigation-route-config being in place before it can audit the full route tree. It should be integrated into the development workflow early — ideally wired into CI so that compliance reports surface on every pull request. The primary delivery risk is route coverage: as new screens are added by different team members, the service must be updated to register each modal route. Establish a team convention that no modal PR is merged without a corresponding `registerModalRoute()` call.

Testing requires simulating incomplete route configurations to verify that violations are correctly flagged and resolved. Budget time for initial route tree audit on integration.

Navigation Accessibility Service wraps the GoRouter route tree (via navigation-route-config dependency) with an audit layer. `auditRouteForDismissalMechanism()` inspects route metadata to confirm a close button or back control is declared; `auditAllRoutes()` traverses the full tree and populates an internal violations map. `getComplianceReport()` returns a structured summary suitable for CI output or developer tooling. `flagViolation()` and `resolveViolation()` maintain a mutable compliance state that can be queried at runtime during debug builds.

The service should be conditionally compiled out of release builds using kDebugMode guards or a build flag to eliminate any production overhead. Wire `registerModalRoute()` calls into route definition files to keep registration co-located with route configuration.

Responsibilities

  • Verify all modal routes include an explicit close action
  • Confirm all non-root routes expose a back control
  • Enforce no-horizontal-swipe policy by auditing route configurations
  • Log accessibility violations for Switch Access and Full Keyboard Access audits

Interfaces

auditRouteForDismissalMechanism(routeName)
auditAllRoutes(routeTree)
registerModalRoute(routeName, hasCloseButton)
getComplianceReport()
flagViolation(routeName, violationType)
resolveViolation(routeName)

Relationships

Dependencies (1)

Components this component depends on

API Contract

View full contract →
REST /api/v1/navigation-accessibility 7 endpoints
GET /api/v1/navigation-accessibility
GET /api/v1/navigation-accessibility/:id
POST /api/v1/navigation-accessibility
PUT /api/v1/navigation-accessibility/:id
DELETE /api/v1/navigation-accessibility/:id
POST /api/v1/navigation-accessibility/audit-all
+1 more