Source skip link lowered to core/button in every template, duplicating core's block-theme skip link

Chiusa
#4,393 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Una pull request collegata è già stata integrata.

  • #4423 di @chubes4 — chiusa senza merge
  • #4475 di @chubes4 — integrata

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
52/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
php, wordpress
Ambito
backend

Direzione di ricerca

Start by locating the code that converts source links into blocks and the template generation path; the issue does not name specific files or tests. Use the minimal HTML case to check whether the skip link is omitted, the main anchor remains, and front-end appearance at rest is unchanged. Then verify the stated kroonsbeautysalon.nl import has no generated skip-link button across its templates.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Problem

A source "skip to content" link is lowered to a core/button in every generated template. Block themes already get core's skip link (a#wp-skip-link.skip-link.screen-reader-text, injected by wp_enqueue_block_template_skip_link()), so every route ships two skip links. The source one is an editable visible button in the Site Editor, and it is duplicated into all 9 templates.

kroonsbeautysalon.nl (Jimdo, trunk): <a href="#main-content" class="jw-skip-link">Ga direct naar de hoofdinhoud</a> becomes core/button ("Ga direct naar de hoofdinhoud", white text, blocks-engine-layout-child-button) at the top of front-page.html, page.html, index.html, single.html, archive.html, search.html, 404.html and both route templates. Core's skip link is also present on each page. It also adds a non-content button that blocks site-wide button-style inference (#3716).

Minimal case

<body><a class="skip" href="#main">Skip to content</a><header>…</header><main id="main"><h1>Hi</h1></main></body>
<style>.skip{position:absolute;left:-9999px}.skip:focus{left:8px;top:8px}</style>

Expected: no block is generated for the skip link. Core's skip link targets the main landmark. The source's #main target id survives on the main group, so in-page #main links still resolve.

Expected

Recognise a skip link structurally: the first focusable in-page link whose target is the main landmark (or its first child), hidden until focus. Drop it in favour of core's template skip link. Keep any visible-until-focus styling irrelevant to parity because it is off-screen at rest.

Acceptance

  • A contract fixture: the minimal case yields no core/button or paragraph for the link, main keeps its anchor, and front-end parity at rest is unchanged.
  • Real check: a kroonsbeautysalon.nl import has no "Ga direct naar de hoofdinhoud" block in any template, and one skip link per page (core's).

Investigated by Franklin (Pi via Roadie, anthropic/claude-opus).

Lingua principale
PHP
Stelle
25
Fork
3
Merge medio
2h 29m
PR unite (30g)
931

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Automattic/blocks-engine

Tutte le issue di Automattic/blocks-engine

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.