FA-7891 / Keyboard accessibility / Open access
Roving tabindex navigation: Horizontal arrow direction ignores right-to-left layout · case 01
Horizontal arrow direction ignores right-to-left layout.
ROOT CAUSE
The rtl operation uses `1` where the contract requires `(-1 if rtl else 1)`.
VERIFIED REPAIR
Implement the rtl operation as `(-1 if rtl else 1)`.
Unsuccessful approach: Always reversing also breaks left-to-right layout.
Case contract
Home and End select enabled endpoints; horizontal arrows honor directionality and wrap; a removed current item resets to the first enabled item.
Why this case matters
A deterministic model of roving tabindex navigation; this isolates one interface invariant without requiring a browser.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(enabled, current, key, rtl):
if not enabled: return None
if key == 'Home': return enabled[0]
if key == 'End': return enabled[-1]
step = (-1 if key == 'Left' else 1) * 1
if current not in enabled: return enabled[0]
return enabled[(enabled.index(current) + step) % len(enabled)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('home', solve([1,3,7], 3, 'Home', False), 1)
check('end', solve([1,3,7], 3, 'End', False), 7)
check('rtl right', solve([1,3,7], 3, 'Right', True), 1)
check('ltr right', solve([1,3,7], 3, 'Right', False), 7)
check('removed', solve([1,3,7], 8, 'Right', False), 1)
check('wrap', solve([1,3,7], 7, 'Right', False), 1)
check('empty', solve([], 0, 'Home', False), None)
check('parameterized arrow', solve(list(range(N+3)), N, 'Right', False), N+1)
for repetition in range(N):
check('repeat empty', solve([], 0, 'Home', False), None)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| home | 1 | 1 | Passed |
| end | 7 | 7 | Passed |
| rtl right | 7 | 1 | Failed |
| ltr right | 7 | 7 | Passed |
| removed | 1 | 1 | Passed |
| wrap | 1 | 1 | Passed |
| empty | None | None | Passed |
| parameterized arrow | 2 | 2 | Passed |
| repeat empty | None | None | Passed |
SHA-256 / c866e052de3542c0b0f3b0944335262cf13315e34bbbb669d48539a93073117f
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(enabled, current, key, rtl):
if not enabled: return None
if key == 'Home': return enabled[0]
if key == 'End': return enabled[-1]
step = (-1 if key == 'Left' else 1) * -1
if current not in enabled: return enabled[0]
return enabled[(enabled.index(current) + step) % len(enabled)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('home', solve([1,3,7], 3, 'Home', False), 1)
check('end', solve([1,3,7], 3, 'End', False), 7)
check('rtl right', solve([1,3,7], 3, 'Right', True), 1)
check('ltr right', solve([1,3,7], 3, 'Right', False), 7)
check('removed', solve([1,3,7], 8, 'Right', False), 1)
check('wrap', solve([1,3,7], 7, 'Right', False), 1)
check('empty', solve([], 0, 'Home', False), None)
check('parameterized arrow', solve(list(range(N+3)), N, 'Right', False), N+1)
for repetition in range(N):
check('repeat empty', solve([], 0, 'Home', False), None)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| home | 1 | 1 | Passed |
| end | 7 | 7 | Passed |
| rtl right | 1 | 1 | Passed |
| ltr right | 1 | 7 | Failed |
| removed | 1 | 1 | Passed |
| wrap | 3 | 1 | Failed |
| empty | None | None | Passed |
| parameterized arrow | 0 | 2 | Failed |
| repeat empty | None | None | Passed |
SHA-256 / 92f24243df5169acba3ad009f8c5bb35e06b8e9f8ccdd108465aa53a7609ea9f
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(enabled, current, key, rtl):
if not enabled: return None
if key == 'Home': return enabled[0]
if key == 'End': return enabled[-1]
step = (-1 if key == 'Left' else 1) * (-1 if rtl else 1)
if current not in enabled: return enabled[0]
return enabled[(enabled.index(current) + step) % len(enabled)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('home', solve([1,3,7], 3, 'Home', False), 1)
check('end', solve([1,3,7], 3, 'End', False), 7)
check('rtl right', solve([1,3,7], 3, 'Right', True), 1)
check('ltr right', solve([1,3,7], 3, 'Right', False), 7)
check('removed', solve([1,3,7], 8, 'Right', False), 1)
check('wrap', solve([1,3,7], 7, 'Right', False), 1)
check('empty', solve([], 0, 'Home', False), None)
check('parameterized arrow', solve(list(range(N+3)), N, 'Right', False), N+1)
for repetition in range(N):
check('repeat empty', solve([], 0, 'Home', False), None)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| home | 1 | 1 | Passed |
| end | 7 | 7 | Passed |
| rtl right | 1 | 1 | Passed |
| ltr right | 7 | 7 | Passed |
| removed | 1 | 1 | Passed |
| wrap | 1 | 1 | Passed |
| empty | None | None | Passed |
| parameterized arrow | 2 | 2 | Passed |
| repeat empty | None | None | Passed |
SHA-256 / e682b0bd63403014ba0e32c92b4cff3ac8d294f86c791f9d2b91ae33a2741024
Verification & scope
This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:38:16.179402+00:00.
Case digest / 67ade3b0577db10a21ab51fc53c4e44be2baf36f839129050dd241a881bfc931