Commit Graph

178 Commits

Author SHA1 Message Date
Jon Robson 591e1d296c [Refactor] simplify watchlist link generation and adopt new icon
Bug: T289619
Change-Id: I8309492881142d47eec4da5cc4aa5c6febbd1b35
2022-01-14 00:26:10 +00:00
Nicholas Ray 699579e646 Add clarifying comment for why scroll padding is applied to html tag.
Change-Id: I9f4b44536b1e8aace41c8699a0d1946a54aa0bfe
2022-01-13 11:59:59 -07:00
jenkins-bot 25bfcf4d00 Merge "Ensure sticky header language button only shows when there are multiple languages and when ULS is enabled" 2022-01-07 23:42:51 +00:00
bwang 3dda2dda5b Ensure sticky header language button only shows when there are multiple languages and when ULS is enabled
Bug: T298705
Bug: T297579
Change-Id: Iae5db6fd0ec6ae66bb16e8579f14d3e799bf3cbd
2022-01-07 15:42:57 -06:00
jenkins-bot 84ed8343c2 Merge "Vector is split into 2 skins" 2022-01-07 20:16:57 +00:00
jdlrobson 7d2d50873f Vector is split into 2 skins
A new vector-2022 skin is added. This will be the eventual home
of the new Vector skin when we are ready to migrate.

Please see SkinVector class for the migration plan to simulate this
as part of testing.

Bug: T291098
Change-Id: Ibaddf94a5bfb5e21bbbaf1e0aa1b343a3f566d2d
2022-01-06 15:52:10 -08:00
Nicholas Ray 3028a4f9d8 Refactor search component expand behavior and add auto-expand-width prop to search component
In preparation for I30c670e3f195f77a27715c6b494a3088b7a55712, refactor
the search component expand behavior so that it can accomodate the new
changes in WVUI while maintaining backwards compatibility with the
status quo.

Additionally, pass/enable the `auto-expand-width` prop to the main
header's search. This will be inert until the new changes in WVUI have
landed.

Bug: T297531
Change-Id: Id8d3bd4aa74113b91ecaf66cb58cf5625db8a302
2022-01-04 15:14:49 -07:00
bwang bd799ecc2e Add watchstar to sticky header (alternative)
Bug: T294759
Depends-on: I88af8585e8fc75f77ebef867d267199aeb2c6592
Change-Id: I15c409830ef8970ff7319b4dd447904443949b8d
2021-12-21 09:40:48 -08:00
jdlrobson 9444bc3e86 DRY up mw-ui- class generation
Repeated in multiple places now, making it harder to change
button/icon classes.

Change-Id: I3799d065ac0c4ccdc900cbebe9140fb8ea657008
2021-12-17 10:06:46 -08:00
jenkins-bot c6691a191d Merge "Disable table of contents in article body" 2021-12-17 00:17:16 +00:00
jdlrobson ef59d7b973 Disable table of contents in article body
This will currently remove table of contents in article body
for legacy and modern skin.

To prevent us deploying this in current form, a check is
added in generateHTML

This requires an adjustment of OverridableConfigRequirement to
support requirements which do not vary on whether the user is
logged in or not.

Bug: T297610
Change-Id: I847a284229e498b3aa04c16ea3f84c360e735052
2021-12-16 16:11:05 -07:00
bwang 321e6b19e1 Move watchlist button out of user menu dropdown and adds temporary feature flag
Bug: T289619
Change-Id: I57addbed2ea8ead5d98bce659f3db1f88f8a5094
2021-12-15 23:21:37 +00:00
Clare Ming 72fecd41f2 Add feature flag for sticky table of contents
- Add TOC feature requirement.
- Update data for SkinVector.
- Add TOC template.

Bug: T297610
Change-Id: I90bc5e21ba187ac9dd74d5e97763834795a0545b
2021-12-14 16:26:58 -07:00
jdlrobson 983437312b Don't add language button to sticky header on pages without languages in content
In Commons languages appear in sidebar.
The language button shouldn't show in the sticky header on these wikis

Bug: T297362
Change-Id: I17d283a7c0ad20bdcaf39b234a7fe766880ab28a
2021-12-13 20:04:50 +00:00
jenkins-bot dc6bd9af95 Merge "Remove need for html-class template property" 2021-12-10 18:03:22 +00:00
jenkins-bot 2e492515b3 Merge "Add language switching alert in sidebar for language in header" 2021-12-10 17:04:06 +00:00
jdlrobson ca501bb581 Remove need for html-class template property
Follow up to 9dcfc1f

This simplifies the template by removing the need for the html-class.
The font-size can be provided to the entire content area meaning we don't
need the link-only class

Change-Id: Id5c49358f6ec007b3205ee390cf68334a1e56de5
2021-12-10 08:40:01 -08:00
Clare Ming 9dcfc1ff27 Add language switching alert in sidebar for language in header
- Add i18n messages.
- Update relevant data methods in Vector.
- Update sidebar template + styles.
- Add new template partial for sidebar actions.
- Add feature flag to turn on/off alert.

Bug: T295555
Change-Id: I232ce13770917d51495391f4b8d8d1a3a8a7afb8
2021-12-09 16:37:36 -07:00
jenkins-bot d0116e07f9 Merge "Make ULS in header quiet progressive button" 2021-12-09 17:33:03 +00:00
bwang b79290f5c9 Make ULS in header quiet progressive button
Bug: T291286
Change-Id: Id1e056330606b87bafb8f43e7ff28d96290465b4
2021-12-09 15:27:04 +00:00
jenkins-bot a7c16c7f30 Merge "Feature flag language button in main page header" 2021-12-08 23:11:53 +00:00
Nicholas Ray 24a5817315 Feature flag language button in main page header
Per the ticket, when this flag is enabled (and the
VectorLanguageInHeader config is enabled) we want to move the language
button from the bottom of the main page to beside the main page's title.

This config can be toggled with the `languageinmainpageheader` query
param (e.g. `?languageinmainpageheader=1`).

Bug: T293470
Change-Id: I41b4677f80b939810d16907b508ab29936f8629c
2021-12-08 15:11:25 -07:00
Clare Ming 43c1fee6b4 Add data-event-name attribute to sticky search icon.
Bug: T296999
Change-Id: I3d5d8534f1946a9e9c876451fb7f7605712827e4
2021-12-07 16:30:15 -07:00
vladshapik 262a520a2c Avoid using User::getOption
Remove using of User:getOption since this method
will be hard-deprecated. Now it is soft-deprecated.

Bug: T296083
Change-Id: I3194a9c1c5c70592f88bc4dbedc78846d1141768
2021-11-29 23:46:05 +00:00
bwang 90a3a226e7 Ensure sticky header ULS is tracked by DesktopWebUIActionsTracking
Bug: T289815
Change-Id: I1960614e12a50a20af157874b925610d29dfa2c7
2021-11-19 16:51:37 +00:00
jdlrobson 768a07ec6c Add sticky header edit feature flag
Can be disabled via &vectorstickyheaderedit=0 or configuration
change.

This will allow us to fine tune the edit features without blocking
deploying the existing feature.

Bug: T294383
Change-Id: Ic282ea4f2ff0108eeaa154c8a77e4e5fd30daeae
2021-10-26 21:59:29 +00:00
Fomafix 574bbfd549 Combine return paths in getLanguagesCached
Also use single quotes instead of double quotes and fix typos.

Change-Id: Ibfd855f55f38ea824d38ad858b654d8229838cd1
2021-10-23 12:55:37 +00:00
jdlrobson 358d81ddce [a11y] Add title attributes to logout, talk and history and DRY up code.
* Addresses feedback in:
** T289816#7440605
** T283505#7440585
Change-Id: I98abdab8c3eb20567af527e6a8bf75faa5670d6b
2021-10-19 08:47:00 -07:00
Clare Ming 6c009f87c0 Make edit icons in sticky header untabbable for VO/screen readers.
Bug: T290201
Change-Id: I5248db6ab29b1a9a995a5053d84e63cfb7b9fd93
2021-10-12 16:02:52 -06:00
Clare Ming c4d1d8c579 Switch order of edit icons in sticky header.
Bug: T289723
Change-Id: If54184eb28d32a189e539c74967918241ddcae41
2021-10-06 09:32:35 -06:00
Clare Ming 67e7eab714 Add edit icons to sticky header
- Add edit icons.
- Update data passed to sticky header, button templates.
- Show/hide edit icons client-side based on ids in fixed header.
- Disable sticky header when in Visual Editor mode.
- Use Visual Editor hooks to toggle IntersectionObserver.
- Remove extraneous js for setting offsets for other sticky elements (simplify by moving known sticky element th to css - follow up to https://gerrit.wikimedia.org/r/c/mediawiki/skins/Vector/+/722475/comment/7b8ab2db_cd5c7e78/).

Bug: T289723
Change-Id: Ifbab2f1c4d716f8fc261e3d7fa35fc71c6065ec5
2021-10-05 23:31:19 +00:00
bwang 405b52054f Update sticky header to be hidden to screen readers and not tabbable
- Adds aria-hidden="true" to the sticky header
- Adds tabindex="-1" support to Button.mustache and update sticky header button data
- Add tabindex to cloned user menu

Bug: T290201
Change-Id: I270db0485f08af310fb40365703da1efc07d3cb9
2021-09-30 09:47:57 -05:00
Nicholas Ray 1209b388e9 Add scroll padding to the root element when the sticky header is enabled
When the sticky header is visible, it has a global impact on the
scrolling UX. For example, it can undesirably overlap elements when the
user clicks on a jump link and when the user tabs through elements in
reverse order. Therefore, we need to add scroll padding to the root
element when the sticky header is enabled (when the feature flag is on
and at higher resolutions)

Known limitations:

* Scroll padding is supported by all the latest modern browsers except
for Safari [1]. This was considered an acceptable tradeoff with the
caveat that this decision may be revisited in the future as we learn
more about user interaction with the sticky header.

[1] https://caniuse.com/mdn-css_properties_scroll-padding-top

Bug: T290518
Change-Id: Ie5eb01d7eafd18ce740be620dfb5c8849386af6e
2021-09-29 14:25:26 -06:00
jenkins-bot 20135a348e Merge "Wire up sticky header search feature" 2021-09-27 22:58:34 +00:00
jdlrobson 125ea5dea9 Wire up sticky header search feature
Bug: T289724
Change-Id: I784ea5eb12b6f43d19769ff48a14d3fd4627853c
2021-09-27 14:47:58 -07:00
jenkins-bot f9405739ed Merge "Vector menu items are wrapped in spans + improve Vector addPortletLink support" 2021-09-27 19:38:36 +00:00
jdlrobson a6c0b21044 Vector menu items are wrapped in spans + improve Vector addPortletLink support
* In legacy Vector, menu items are now wrapped with spans. This
  consistency in HTML is required for splitting Vector into two
  different skins.
* Vector's portlet link items now support icons

Bug: T289163
Bug: T291722
Change-Id: I4464888983ac8b8b5f971e0c679dbeda09a61be5
2021-09-25 05:01:55 +00:00
jenkins-bot ce1888e6b6 Merge "Update anon user menu introduction link to be localized and not hardcoded" 2021-09-24 20:54:57 +00:00
bwang 8e35a09964 Update anon user menu introduction link to be localized and not hardcoded
Bug: T290813
Change-Id: I38bd95abbca0fea68a795986971da02ea25b1c36
2021-09-24 13:40:16 -05:00
jdlrobson caed16e26f Allow multiple search components on the same page
Styling should not depend on IDs to allow us to have multiple
searches in the page.

Precursor for wiring up search in the sticky header.

This also tweaks performance metrics to track separate metrics
for the sticky header search

Change-Id: I5b4192a8f5a9f95af26c1faf904f7cc994323518
2021-09-23 23:23:58 +00:00
jenkins-bot 67cd5b7db3 Merge "Do not use User session in the constructor" 2021-09-23 19:25:04 +00:00
Ammarpad 99930c4722 Defer to core for more template data
Bug: T289221
Depends-On: Ieb5398c3505602dfbf77d97f24f3d19f703924b8
Change-Id: Ib3ffe0b3f4fd7342b749cd827f40faa7a429bf23
2021-09-23 07:28:40 +01:00
jdlrobson d4befe8c39 Do not use User session in the constructor
This is going to be forbidden going forward.
The legacy lookup and overrides are deferred
until they are actually needed to keep the constructor
cheap

Bug: T289163
Change-Id: Ib23360e3439abc828404c1de8e0906915ee7d8b6
2021-09-23 01:36:42 +00:00
Ammarpad 2bcfac0f07 Remove redundant template data
These values are already provided in core

Bug: T289221
Change-Id: I36f5a22e3e866bc41502a9a53ec502b145955fbf
2021-09-22 19:18:05 +01:00
bwang 809a972676 Fix sticky header language button
- Fixes blank sticky header language button when no languages are present
- Adds arrow to sticky header language button

Bug: T289815
Change-Id: I36dc5fb0aad9c3ca1fced0d46e5167e8707f6731
2021-09-21 19:59:16 +00:00
Clare Ming bdc8852a1c Add aria-label to language dropdown menus
- Update portlet data.
- Update menu template.
- Add translatable strings.

Bug: T289523
Change-Id: I9b8f40843609c0192afdabd3117167b933155842
2021-09-15 12:25:23 -06:00
jenkins-bot 3c894154df Merge "Improve heading structure and heading semantics by removing redundant headings and labels for modern Vector" 2021-09-15 16:43:41 +00:00
Nicholas Ray 93745e4800 Add search to sticky header
Per T289724#7342741, server renders an anchor tag pointing to #p-search
into the "button-start" bucket of the sticky header.

In the future after T289718, this anchor will then acts as a button when
the search module is loaded and searchToggle executes.

* skins.vector.search was modified to accomodate instantiating multiple
search components (one in the main header and one in the sticky
header).

* searchToggle.js was modified to accept a searchToggle element as a
param which the caller can then instantiate when ideal. For the sticky
header toggle, this needs to happen *after* the search module loads.
Before then, the toggle will act as a link.

* Drops one jQuery usage from searchToggle so that it can be jQuery
free. Because the native .closest method is used, IE11 support is also
dropped. However, the script feature detects and returns early if the
API isn't available.

* Makes App.vue accept an `id` prop so that multiple instances of it can
be created.

Bug: T289724
Change-Id: I1c5e6eee75918a0d06562d07c31fdcbd5a4ed6d5
2021-09-14 16:58:07 -07:00
jdlrobson 52204c0f1a Add history and talk page icons to sticky header
Bug: T290597
Change-Id: Ib590399df09a9da8e181b331d4227b0de30b9a8e
2021-09-14 12:34:47 -07:00
jenkins-bot b7ef3d9a0e Merge "Add page title to sticky header" 2021-09-14 19:31:33 +00:00