Background
See T306660: [Goal] Table of contents on narrow screens in vector-2022 for context. This is the first of two tickets that will provide collapsible behavior for the table of contents. The first (T307900: Collapse ToC into page title at narrow screens) will allow the ToC to automatically collapse into a button adjacent to the title for narrow screens. The second (this ticket) will allow the ToC to be collapsible into a button alongside the title at all screen sizes.
Prototype
https://di-collapsible-menus.web.app/Brown_bear
Acceptance criteria
- Create a "hide" button for the ToC
- Selecting the hide button will collapse the ToC into the title
- When ToC is opened from the title a move to sidebar button should appear
- Selecting move to sidebar will put the ToC back to its original location
- The "hide" and "move to sidebar" should be button elements, not links
- The brackets around "hide" and "move to sidebar" are purely visual elements, not read out by screen readers
QA steps
- On beta cluster page with a TOC, expand the view port to above desktop (1000px) and note that there are hide and move to sidebar links visible next to the TOC Contents that toggles the TOC location between the sidebar and below the TOC icon per ACs.
- Ensure that TOC works as before below desktop
- Ensure that the TOC toggle links are not visible in the no-js context
https://phabricator.wikimedia.org/T307901#8122243
https://phabricator.wikimedia.org/T307901#8230993
QA Results - Beta
AC | Status | Details |
---|---|---|
1 | ✅ | T307901#8122243 |
2 | ✅ | T307901#8122243 |
3 | ✅ | T307901#8122243 |
QA Results - Prod
AC | Status | Details |
---|---|---|
1 | ✅ | T307901#8230993 |
2 | ✅ | T307901#8230993 |
3 | ✅ | T307901#8230993 |