Repository navigation
fix(e2e): keyboard-reachable MCP config block, and 304s are not redirects - #76
Merged
Merged
Conversation
…he keyboard focus
wojciechszyjka
marked this pull request as ready for review
November 30, 2026 08:52
Collaborator
Author
|
om-auto-create-pr: complete
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tracking plan: .ai/runs/2026-11-30-worker-harness-e2e.md
Status: complete
What failed
The Worker harness (
node scripts/worker-harness.ts --data .data) ended 19 of 20; the one failure wasreal / e2e: 73 of 75:test/e2e/a11y.spec.ts"axe for-agents mobile": seriousscrollable-region-focusableon.fa-pre.test/e2e/layout.spec.ts"a click on Browse modules lands on the home page without a redirect":304 .../run/fonts/Geist-Regular.woff2(and Geist-Medium, GeistMono-Regular) collected as redirects.Root cause
/for-agentsrenders the MCP configuration as<pre class="fa-pre">withoverflow-x: autoonly whenmeta.mcpUrlis set. At 390 px its"url": ...line (about 60 monospaced characters) is wider than the block (under 39 fit), so it scrolls sideways, holds no link or button, and has notabindex: a keyboard cannot reach it. This is live on production (modules.openmercato.com/for-agents). The static e2e never saw it becausetest/e2e/build.tsemitted every variant without an MCP URL, so the Connect section was not rendered; the harness real build carries the production MCP_URL.public, max-age=0, must-revalidatefor/run/fonts(src/worker/headers.ts,REVALIDATE_CACHE), so on the click to the home page the browser revalidates the fonts and gets304 Not Modified. A 304 is not a redirect.What changed
site/src/pages/for-agents.astro:.fa-pregetstabindex="0"andaria-label="MCP configuration as JSON".site/src/islands/AgentPane.tsx(for-agents demo):.ap__json(full JSON of a call, scrolls both ways, sideways on phones) getstabIndex={0}and a name per call;.ap__res--err(an error,max-height: 360px; overflow: auto) too.site/src/islands/SubmitForm.tsx(/submit):.sf__yaml(overflow-x: auto, already named "Descriptor YAML") getstabIndex={0}.site/src/pages/about.astro:.ab-lines(the release-lines table,overflow-x: auto, no link) getstabindex="0", named by its figcaption..cmd__text(already focusable when it can scroll),/compat.cp-tablewrapand/radar.radar__scroll(hold links),/m.agentv__pre(already focusable and named),.tabs__listand.mods__cats ul(buttons and links), the/submitsamplepreand.ap__args(wrap, no overflow).test/e2e/build.ts: every variant (real, stale, templates) is emitted with--mcp-url:MCP_URLwhen set, else the production addresshttps://om-modules.openmercato.workers.dev/mcp(the same as the route matrix'sBUILD_ENV). Its JSON line is about 60 characters, well past the width of the block at 390 px, soa11y.spec.tson the static build fails without the fix above. No other fixture-based test or snapshot needed an update: the harness real build already carried this URL and its other 73 e2e tests passed with it; the e2e suite has no pixel baselines.test/pages/redirects.ts(new):isRedirect(status, location), true for 301, 302, 303, 307, 308 or any answer with a Location header. Used by:test/e2e/layout.spec.ts(the failing test; the rest of the test is unchanged),test/pages/route-matrix.ts(rowOf) andtest/worker/router.test.ts(the redirect rows), which had the same>= 300 && < 400pattern. No row of the three committed route matrices changes classification.Tests that cover it
test/e2e/a11y.spec.ts"axe for-agents mobile" now meets the Connect block in the static build too.test/e2e/layout.spec.ts"a click on Browse modules ..." passes on the Worker's 304 revalidations and still fails on a real redirect.test/pages/scroll-regions.test.ts(new, no browser): the five regions are focusable and named; the e2e build passes an MCP URL; its JSON block is wider than a 390 px phone.test/pages/redirects.test.ts(new): 301/302/303/307/308 and a Location header are redirects; 300, 304, 305, 306 without one are not.Run here:
tsc --noEmit,astro check(0 errors),prettier --check .,check-text, vitest (3255 passed; the same 22 tests in 5 files fail on unchanged main in this sandbox: git, shell and network fixtures), andE2E_ONLY=stale node test/e2e/build.ts, whosefor-agents.htmlhas the Connect section and<pre class="fa-pre" tabindex="0" aria-label="MCP configuration as JSON">. Playwright was not run (no browser in the sandbox).How to verify
Expected:
worker harness: 20 of 20 checks passed, 0 failed, 0 not run.Static path:
node test/e2e/build.ts && yarn e2e test/e2e/a11y.spec.ts test/e2e/layout.spec.ts; with thefor-agents.astrochange reverted, "axe for-agents mobile" fails on.fa-pre.Open question for the owner
Live Pages serves
/run/fontswithCache-Control: public, max-age=14400, must-revalidate(zone Browser Cache TTL; checked with curl on modules.openmercato.com/run/fonts/Geist-Regular.woff2), while the Worker sendsmax-age=0(REVALIDATE_CACHE), so every page view revalidates the fonts. Not changed here; should the Worker match Pages?Follow-up (out of scope): README code blocks on module pages (
lib/core/text.tsrenders<pre><code>,.md pre { overflow-x: auto }) can scroll sideways without a focus stop; the/maxe check passed on the KSeF page, whose README has no wide block.