Let readers expand table of contents chapters in the reference guide
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- css, javascript
- Área
- accessibility, documentation, frontend
Línea de trabajo
Start with guide.js, where the scroll spy adds is-open to the current chapter's li, and with the #toc styles that hide sections unless js-toc is set. Decide first how manual toggles interact with the spy (the issue leans toward option 2, with separate is-open and is-expanded states), since that choice shapes the code. Done means each chapter with sections has a button with aria-expanded and aria-controls that always matches what is visible, and the skip link, :focus-within and aria-current still work.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
The reference guide's table of contents (#1845) shows a chapter's sections only while that chapter is being read. guide.js adds is-open to the current chapter's li as you scroll. Every other chapter's sections are display: none. A chapter's sections also open while focus is inside the chapter (:focus-within). With that, keyboard users can reach every section by tabbing onto a chapter link.
Screen reader users in browse mode don't get there. The virtual cursor of NVDA and JAWS, and VoiceOver's reading cursor, move through the page without moving focus, so :focus-within never matches. The collapsed sections are not in the accessibility tree, and the only way to reach them is to scroll to the chapter. @papegaaij raised this in the review of #1845 (comment).
Proposal
Give every chapter with sections a disclosure button next to its link: a real <button> with aria-expanded and aria-controls pointing at the chapter's <ul>, showing a chevron (▸/▾). A screen reader announces it as "button, collapsed" or "button, expanded", and activating it opens or closes the sections. This is the WAI-ARIA disclosure pattern.
Considerations
-
Interaction with the scroll spy. This is the actual design question. The spy now opens the current chapter and closes all others on every section change. With manual toggles there are three options:
- The spy keeps control and closes a manually opened chapter as soon as the reader scrolls into another chapter. This is simple, but a chapter the user opened on purpose collapses under them.
- Manual state wins. A chapter opened by hand stays open until it is closed by hand, and the spy only adds and removes its own automatic opening. This needs two states per chapter (
is-openfrom the spy,is-expandedfrom the user), andaria-expandedhas to reflect their union. - The spy stops collapsing altogether once the user has toggled anything.
Option 2 matches what users expect from a tree. It also keeps
aria-expandedtruthful, because the button never says "collapsed" while the spy has the list open. -
aria-expandedmust follow the spy. Whatever the option, every time the spy opens or closes a chapter it has to update the button'saria-expandedtoo. Otherwise the announced state is wrong. -
Layout. There are about 40 chapters with sections. The button needs a target of at least 24×24 px (44 px on
pointer: coarse, as the masthead already does) without pushing the chapter titles out of line with chapters that have no sections. The ribbon-rail markers (#toc li::before/::after) sit on the left edge, so the chevron probably goes on the right or between the rail and the number. -
Tab order. The button adds one tab stop per chapter, about 40 in all, next to the existing links. The skip link already lets keyboard users jump past the TOC. Alternatively, the buttons could use
tabindex="-1"with arrow-key navigation (the tree view pattern), but that is much more script and a different ARIA role. The plain disclosure pattern is the smaller step. -
:focus-within. This can stay: tabbing onto a chapter link still opens it. It also shouldn't fight the button. A chapter closed by its button while focus is inside it would reopen at once, so a manual close must override:focus-within(for example with anis-collapsedclass that wins). -
Without JavaScript. Nothing changes. The
js-tocclass is only set by the script, so without it every section stays visible and no buttons are needed. -
Mobile. Below 768 px the TOC is not fixed. Check whether collapsing it there is wanted at all, or whether the buttons should only exist on wide screens.
Acceptance
- With NVDA in browse mode and with VoiceOver, every section of every chapter can be reached from the TOC without scrolling the content.
- The announced expanded state always matches what is visible.
- Keyboard behaviour from #1845 (skip link,
:focus-within,aria-current) keeps working.
- Lenguaje dominante
- Java
- Estrellas
- 800
- Forks
- 437
- Merge medio
- 21 h 36 min
- PR fusionados (30 d)
- 167
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/wicket
-
PropertyResolver fails on JDK classes with a non-public field named like the propertyPosiblemente ocupada @vaibhavgupta443 la tomó hoy. Abiertogood first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
apache/wicket#1991 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Stop the autocomplete from accumulating request parameters while typingPosiblemente ocupada @aryankalantri la tomó hoy. Abiertogood first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
apache/wicket#1947 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Validate the report-uri value given to CSPHeaderConfiguration#reportBackPosiblemente ocupada @AzizOuertani la tomó hace 3 días. Abiertogood first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
apache/wicket#1946 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
Todos los issues de apache/wicket
Issues similares
-
Quick Installation step 2 installs from the plugin manager, but the plugin isn't published yetAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
jenkinsci/user-guide-ai-chatbot-plugin#132 ·
Los mantenedores suelen responder en 6 días
-
account assessment course feature lecture
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 1 día
-
[Bug] 连接达梦时报错,agent 进程启动即退Abiertobug db/dameng user-priority/P2
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
t8y2/dbx#15534 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
app:learninggoalhub enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100