Background
We would like to give users the ability to collapse the sidebar. This task will contain the building of the sidebar and sidebar buttons.
Acceptance criteria
- Build hamburger icon
- Make sidebar collapsible
- Selecting hamburger icon should open/close the sidebar
- The sidebar should allow for different default states for logged-in and anon users. - now tracked in T254230: Sidebar should allow for different states for logged-in and anonymous users
- The initial state for both will be uncollapsed by default. We will later change this to collapsed by default for anonymous users.
- Ensure that persistent criteria is met prior to deploying to production T246427: [Spike 8hrs] Decide how to persist state of collapsible sidebar across sessions for logged-in users, logged-out users - now tracked in deployment task T254228: Deploy new version of vector skin to all wikis as a user preference
Note on default states
INITIAL STATE: sidebar is default on for all users
EVENTUAL STATE: sidebar is default off for anons, default on for all other users
Designs & prototype
sidebar closed | sidebar open |
---|---|
Prototypes
https://people.wikimedia.org/~jdrewniak/dip/p3.html#/en/wiki/Main_Page
http://patchdemo.wmflabs.org/wikis/24b6fd1f6a50fc53846f92f943ce79a4/w/ (Code: GitHub - commits of layout | GitHub - usermenu | Gerrit - squash)
Persistence of of open/closed sidebar state
- For all users sidebar state should persist across pageviews (i.e. if I go from one article/page to another, in the same browser tab)
- For logged-in users sidebar state should also persist across sessions (i.e. if I close the browser tab, and then open a new one)
- For logged-out users every session should start with the sidebar closed
Sticky/fixed sidebar
To begin with the sidebar will not be fixed/sticky alongside the content, because doing so creates a slightly more complicated two column interface and we don’t want to make access to language links more difficult. Once we’ve moved language links we can revisit this behavior.
Open/close trigger/icon
TBD based on closer review of feedback, however considering something like
sidebar closed (hamburger icon) | sidebar open (<< icon) |
---|---|
Icon svg: [coming soon!]
Requirements
- Don't break Korean Wikipedia. Maybe we can expose the skin version preference and only run the collapsible gadget if mw.config.get( 'vectorSkinVersion' ) !== '2'. We should document how we approach this so we don't accidentally break any API exposed.
- We could use the logic in Popups for NavigationPopups existence and default to old Vector when the gadget is enabled.
References
- MinervaNeue (MainMenu, ToggleList (using the CSS-only checkbox trick with JavaScript enhancements)
- Core (table of contents, CSS-only checkbox trick)
- Korean Wikipedia gadget (enabled by default, JavaScript)
- GitHub (profile and create new dropdowns use <details> and <summary> elements but unfortunately our support matrix won't allow that)
Developer notes
Use of CSS checkbox hack seems preferable here as it requires HTML + CSS only changes.
POC implementation
Pure css with the checkbox trick: GitHub - latest | Gerrit - old
Preliminary QA
Explore sidebar functionality on the beta cluster and confirm functions in the following circumstances:
- a variety of screen sizes
- a variety of browsers
- at least one rtl language
- the history page
- the recent changes page
- an article page
QA Results - Beta
AC | Status | Details |
---|---|---|
1 | ✅ | T246419#6222186 |
2 | ✅ | T246419#6222186 |
3 | ✅ | T246419#6222186 |
4 | ✅ | T246419#6222186 |
5 | ✅ | T246419#6222186 |
6 | ✅ | T246419#6222186 |
QA Results - Prod
AC | Status | Details |
---|---|---|
1 | ✅ | T246419#6222198 |
2 | ✅ | T246419#6222198 |
3 | ✅ | T246419#6222198 |
4 | ✅ | T246419#6222198 |
5 | ✅ | T246419#6222198 |
6 | ✅ | T246419#6222198 |