Commit Graph

684 Commits

Author SHA1 Message Date
jenkins-bot 6129fef3a0 Merge "Allow preview on certain article titles" 2022-08-09 16:02:46 +00:00
Jan Drewniak 5676097135 Remove .mw-ui-button styles from user-links overflow menu
Removes the .mw-ui-button styles from the userpage link
and create account link in the user menu.

Overrides the userpage redlink style so that the link
remains blue even if the userpage doesn't exist.

Visual changes: userpage link and create account link
in header are no longer .mw-ui-buttton styles, but
look like standard blue links. The user links menu shifts
slightly because of this as well.

Bug: T312157
Change-Id: Id98e566952e5875527f38d1edbc8f6e058af4518
2022-08-08 22:12:07 -04:00
Clare Ming eb597645c3 Refactor TOC A/B test to bucket users on backend
- Include temporary feature requirement for TOC A/B test.
  - Assumes 100% of logged-in users with even/odd user ids
  being assigned to treatment/control buckets respectively.
  - Sampling rates passed in by config are not considered
  during bucketing.
- Update hook for adding needed TOC A/B test body classes.
- Add test for temp feature.

Note: the temporary feature requirement and associated hooks
should be removed once the 2nd TOC A/B test concludes.

Bug: T313435
Change-Id: If9c75235614af289cd50182baab29bec3155eb81
2022-08-08 15:50:28 -06:00
Jon Robson d771a1d60d Allow preview on certain article titles
The list is exposed in mw.config so banners can work out if the
preview mode is active.

We change the skin the same way MobileFrontend changes the skin.

Bug: T314286
Change-Id: Ib3c90d2640f2fa8cac17514b59aa720e4aba6d96
2022-08-08 19:58:07 +00:00
bwang ef2b0a2372 Remove vector-layout-legacy styles and grid feature flag
Bug: T313559
Change-Id: I050d0e243186ba4341accc26f8d644f55ff995b7
2022-08-08 08:22:26 +00:00
Clare Ming 5b55a2f894 Minor fixes to TOC hide/show buttons
Bug: T307901
Change-Id: I37c6b3b4c5c20e914423c311795dbccce2a7b3fd
2022-08-04 15:20:58 -06:00
jenkins-bot a4949503f6 Merge "Update #siteSub, #contentSub and #contentSub2 to fix spacing, conditionally render #contentSub and #contentSub2" 2022-08-03 20:16:51 +00:00
bwang b89307c6bb Update #siteSub, #contentSub and #contentSub2 to fix spacing, conditionally render #contentSub and #contentSub2
Visual changes:
- Reduced spacing above #siteSub
- Updated spacing from #contentSub and #contentSub2

Bug: T311421
Change-Id: I7fd78d2c92007b231cfc49af0fbd02a4f74f3901
2022-08-03 01:14:30 +00:00
bwang 37149c9e67 Remove custom rendering of the user links overflow menu in favor of using 'vector-user-menu-overflow', a vector specific menu bucket in Hooks.php
- Rename 'vector-user-menu-more' class to 'vector-user-menu-overflow'
- Update storybook and tests

Visual changes
- Small intentional change on the create account button

Bug: T306662
Change-Id: I371bb11903d8cdd8f0da89266fcf549050c0da8c
2022-08-01 20:18:46 +00:00
Clare Ming 1d1585d214 Add feature to hide/show collapsible TOC above desktop
- Add hide/show links to TOC template.
- Add i18n messages for hide/show text.
- Add event listener to TOC js.
- Update relevant TOC collapsed styles.
- Update test snapshot.

Bug: T307901
Change-Id: Ic94fda79bd14856ccda14985d5860aa54d3118d0
2022-07-29 14:19:55 -05:00
jenkins-bot e4b4f5bf9f Merge "Show ULS button when article exist only in single language" 2022-07-27 20:22:02 +00:00
jenkins-bot 54ac78bba0 Merge "Make site banner full width in grid layout" 2022-07-27 16:57:05 +00:00
bwang 320175d22c Make site banner full width in grid layout
Bug: T312749
Change-Id: Ia888615762a641f98409b11c6448a32897c4c835
2022-07-27 10:01:49 -05:00
Ed Sanders 23a5261ef6 Add "Add topic" button to sticky header
Bug: T304187
Change-Id: Ib497eb91ec7548e2ba6d1d474a196ada770f955d
2022-07-26 22:15:02 +00:00
Ed Sanders c9a04099d0 Sticky header: Add a link to the 'subject' page when on talk pages
The subject link does not have a consistent ID like the talk link,
so it needs to be computed from the canonical namespace name.

Something similar is done in VE.

Bug: T309424
Change-Id: Ie82ca61aef30204edd09793963b25464febb17fe
2022-07-22 22:24:38 +01:00
Clare Ming 1297733a65 Add text to TOC collapsible button label for accessibility.
- Provide message translations.
- Include other TOC message that was missing.

Bug: T310810
Change-Id: Ibd612b48ea3ef3f9f31f4bb5791c0cb82e447ece
2022-07-22 10:45:40 -06:00
Santhosh Thottingal 40f6c5e29d Show ULS button when article exist only in single language
When the article exist only in one language, currently we do not show
language selector. This prevents showing the entry points to create article
in other languages by various means.

Show the language selector so that options like translate, interlanguage
links, language settings can be shown.

Bug: T275147
Bug: T290436
Depends-On: I42c5d44ec15e291d71723c9738ddb8f0d1cf0b09
Change-Id: I7fb68457c1203d824fe7433c9f272f300a483c44
2022-07-21 16:28:22 -07:00
Clare Ming 28732cf4f7 Remove Table of Contents feature flag
- Update related selectors, styles.
- Remove unneeded styles.
- Remove link hijack js.
- Simplify hook to only add experiment name to body.

Bug: T310527
Change-Id: I25527261d529a16e28f1b90f2f5af234d26fd40f
2022-07-21 12:41:39 -06:00
jenkins-bot 3c8796ee04 Merge "Search: Use Codex and Vue 3 instead of WVUI and Vue 2." 2022-07-19 15:18:29 +00:00
Roan Kattouw ce77018b7c Search: Use Codex and Vue 3 instead of WVUI and Vue 2.
[Visual changes]
This should result in 9 visual regression failures relating to
increased height of search results and loading bar

[More details about change]
- Migrate search app from Vue 2 to Vue 3; update tests
  accordingly
- Remove dependence on WVUI and use Codex instead, via the special
  `@wikimedia/codex-search` package
- Update search app to use CdxTypeaheadSearch, which no longer
  takes in props related to the search client or fetch start/end
  instrumentation. Instead, directly use the restSearchClient
  and call fetch start/end events in the search app.
- Handle hideDirection in the search app/API response formatting
  code, not within the TypeaheadSearch component
- Handle showing/hiding the search button in the app
- Move the WVUI URL generator into Vector
- Update server-rendered search box styles to match design updates
  included with CdxTypeaheadSearch
- Replace references to WVUI with references to Codex
- Update values of various LESS variables to match Codex, and update
  searchBox styling to prevent jankiness when the searchBox is replaced
  with the Codex TypeaheadSearch component

The VectorWvuiSearchOptions config variable has been maintained and
will be updated to a code-agnostic name in a future patch.

Bug: T300573
Bug: T302137
Bug: T303558
Bug: T309722
Bug: T310525
Co-Authored-By: Anne Tomasevich <atomasevich@wikimedia.org>
Change-Id: I59fa3a006d988b14ebd8020cbd58e8d7bedbfe01
2022-07-18 12:54:47 -07:00
Jan Drewniak c9c5c9e5a4 Followup to 33a6fb6 - remove is-title-above-tabs from template
The configuration for this feature was removed, so the conditional
in the skin.mustache template should be removed as well.

Bug: T311773
Change-Id: I6a8e671c5f08d9af73145b900398b185febb3bc7
2022-07-18 10:43:36 -04:00
Ed Sanders e2d70c383e Move code for adding sticky header class to SkinVector22.php
Per the comment at the top of the file, much more of this code
needs to be moved to SkinVector22.php, but this is causing a specific
regression, so can be moved now.

Bug: T312782
Change-Id: Ief7581782f1e4eefc7474cceb81830783dff99a8
2022-07-11 16:11:58 +01:00
Jon Robson 2a4ac3152b Move Vector menu class logic into Menu mustache template
Cleaned 'vector-menu' in SkinVector file, updated
includes/templates/Menu.mustache and includes/templates/legacy/Menu.mustache.

Bug: T290281
Change-Id: I7286fa82abfd437a228b9ac07ac781210d7cd98f
2022-07-07 12:34:23 -05:00
Jon Robson 33a6fb6028 Layout: Title should always be above tabs
**UI CHANGES**
- This change will result in expected UI changes so will flag problems
with Pixel.
- Before merging please confirm Pixel reports 31 passed, 47 failed
- After merging, we should update LocalSettings.php to reset these
changes.

Bug: T310054
Change-Id: Ib35c6bfa5493f7dc81b63c42e7fedb8f1e47226b
2022-07-06 15:25:42 +00:00
Jdlrobson e16a8e4775 Revert "Layout: restore sticky toc behavior by adding additional TOC container"
This reverts commit 3a26cc220c.

Reason for revert: Pixel flagged a UI regression relating to this change https://phabricator.wikimedia.org/F35291665

Change-Id: Id0b3d13da7dfbd8a55605e9f1fae157fe45abd2f
2022-06-30 22:53:19 +00:00
bwang 3a26cc220c Layout: restore sticky toc behavior by adding additional TOC container
Fix sticky behavior changed by impacted by e23fc1f

Change-Id: I7ead5e1d5954f772a533e1116f8c55d2d9cfd143
2022-06-30 21:40:14 +00:00
bwang e23fc1fe11 Grid: fix footer styles
Fixes https://phabricator.wikimedia.org/F35289862

Change-Id: If14bfb357d077ebd3886ce7290f0d46d19588dc6
2022-06-30 13:34:25 -05:00
Jon Robson 11618b5d81 Grid: Add table of contents to grid
Bug: T303484
Change-Id: Ic854b34b739b59e2d1efd864a711c961548f079f
2022-06-29 00:00:06 +00:00
bwang 4ab798441e Refactor SkinVector to use Hooks::updateMenuItems code to process menu data
SkinVector and Hooks both had code to add classes and handle Vector specific template data. This patch simplifies the way we handle menu data to always use Hooks:updateMenuItem. This has an additional side effect of removing instances of mw-ui-icon-before.

Bug: T306628
Change-Id: I73514a0eada4d92705b70e7c2ebd91092fc12544
2022-06-28 21:53:51 +00:00
jenkins-bot a47f46009e Merge "Attach VE to `#content` while title-above-tabs feature is disabled." 2022-06-27 20:15:35 +00:00
Jan Drewniak 05a1c330fe Attach VE to `#content` while title-above-tabs feature is disabled.
Limits the usage of the `data-mw-ve-target-container` attribute,
which changes the position of VE, to be enabled only when the
title-above-tabs feature is enabled.

Bug: T310197
Change-Id: I846135a88acf713bed608ad4f147f7602ce7cc2b
2022-06-27 15:44:19 -04:00
Jon Robson 6efcf775c0 Technical: Use unambigious menu template
Follow up to 49c8b5f514
Our PHP parser resolves >Menu to the parent directory which
differs from the frontend Mustache library.

Best to have different names for these files to avoid this problem.

Bug: T311319
Change-Id: Iea708718a0b928c4902dc7bac0c5ee304b89f961
2022-06-27 12:29:03 -07:00
Jon Robson 5beadc4bc2 Layout: Don't hide footer < 1000px when sidebar closed
The 'mw-workspace-container' class is present on both
the footer and the sidebar. The CSS rule should only hide
the latter.

When there is no table of contents on the page, and the sidebar
is closed, the content
should always span the grid columns and the sidebar container
closed.

Bug: T293443
Change-Id: I852b9024fbd21339b7c78dbb4deba811ab17c7e7
2022-06-25 00:03:41 +00:00
Jan Drewniak 6e96a8e936 Rename `data-ve-target-container` attribute to `data-mw-ve-target-container`
Updates the data attribute for placing VE on the pages.

Bug: T310197
Depends-On: Ia6f87535f11ccc7aadb26b7dd9e1ac8a867c377c
Change-Id: I081d5e23a15902e1429e68ac4ae191e498e6aba6
2022-06-23 10:53:44 -04:00
Jan Drewniak 97783e5bd8 Use the data-ve-target-container attribute to position VE
Uses the data attribute `data-ve-target-container` to determine where
on the page to insert VisualEditor. Also moves the #siteSub back into
the #bodyContent container. This makes the SiteSub match the font-size
it had in legacy Vector & positions the VE toolbar between the tabs
and the tagline.

Bug: T310197
Bug: T310839
Depends-On: Idae6755c90eacaab1a9daa88c6e28850d427810c
Change-Id: Idb2a743c93316786d6d36e1989cf6620a6092281
2022-06-23 00:39:19 +00:00
Jon Robson 49c8b5f514 [Fix] Adjustment to legacy menu templates
Follow up to c5cfd4d

1) Partial paths are incorrect
These are not a problem with our current Mustache template
parser but could break with any changes in our PHP implementation

2) Add dedicated class to legacy menus

On the longer term this will allow us to further separate the
old and new CSS.

Change-Id: I056b033855c28f919a4af99784620503f10b9dcb
2022-06-22 22:42:39 +00:00
bwang f473129485 Add support for floating TOC lower down the page
This patch only handles the first case listed in the task description

Bug: T308689
Change-Id: I4e7dbded7a8206633a98653aaf4ced3fd2b6f69d
2022-06-21 16:02:11 +00:00
Jon Robson 64ee3686b8 Cached CSS is no longer a problem
The !important is retained for cached HTML and will be retained
for another release cycle

Cached HTML will continue to be a problem until next deploy. The CSS
cleanup will thus be fixed in a follow up
(I47b7a0bc9c5dad5451f1dbb5e32e513643a1534b)

Bug: T307900
Change-Id: I47b7a0bc9c5dad5451f1dbb5e32e513643a1534b
2022-06-16 17:48:29 +00:00
jenkins-bot d529efeaf8 Merge "Follow-up: Update menu label elements" 2022-06-13 14:37:25 +00:00
bwang 93e8cfcd90 Collapse ToC into page title at narrow view ports with CSS/template changes only
Bug: T307900
Change-Id: I72607ec9d8b46401468de5815cf47dac9f4612a5
2022-06-10 15:49:06 -06:00
Jon Robson 664b6c5cc5 [Grid] Vector 2022 layout uses CSS grid
It gracefully degrades to a single column
layout on grade C browsers, IE11, and Safari 9.

Bug: T303484
Change-Id: Iaa3c1bee146dc39b1259a1ce712a29c6b22305d1
2022-06-07 17:23:08 +00:00
bwang 467d994123 Follow-up: Update menu label elements
- Update the modern menu template to avoid using aria-hidden on the `label` element, and avoid using a `label` element when no checkbox is present.
- Revert legacy menu template to use h3 elements


Bug: T301051
Change-Id: I6ab10e35f0d67d70877e55cca5a512c2af4cb972
2022-06-06 23:59:13 +00:00
Jon Robson a018a909d9 [Grid] Minor HTML restructure for grid
Make the sidebar and content siblings of the header element. This
will allow us to easily apply grid column and rows to these elements.

Bug: T303484
Change-Id: I0a91eddbddbe58781892eddb93edfc3d58777968
2022-06-06 14:58:20 -07:00
Jon Robson 02fb90531b [Grid] Add TableOfContentsContainer
In preparation for grid work where the table of contents will
be moved into a new container.

Bug: T303484
Change-Id: I931d5148e314c1c05f0474b47be5efd7c166144d
2022-06-03 22:27:22 +00:00
jenkins-bot f94c86c3e0 Merge "Exclude from max-width via query string patterns" 2022-06-01 16:15:01 +00:00
jenkins-bot 54991e1d13 Merge "Remove unnecessary inner-tag whitespace and self-closing tags" 2022-06-01 15:05:50 +00:00
Sam Wilson 87e4ca9a21 Exclude from max-width via query string patterns
Add action=edit to the exclusions in $wgVectorMaxWidthOptions
and update the parsing of the query string values for that config
variable to accept a regex.

Bug: T307725
Change-Id: Iba526033d45e18cb340a2648378d3d90ef3ae3c6
2022-06-01 10:00:39 +08:00
Jan Drewniak a3cef30154 Move page title above article toolbar menus
Moves the page's title above the article toolbar (i.e. tabs) based
on the VectorTitleAboveTabs config option. This feature remains
off by default, but can be accessed via the query parameter `vectortitleabovetabs`.

Removes the Navigation.mustache template since it's just a wrapper
for the sidebar + tabs elements, which, with this change, are placed
in different locations in the DOM and don't need a common parent element.

Bug: T303549
Change-Id: Id4816b753a1b2133c53c3b1d390b45631c704daf
2022-05-31 18:06:11 -04:00
Sam Wilson c32c64481d Use new ResourceLoader namespace
To fix Phan errors with the now-deprecated ResourceLoaderContext
class alias.

Bug: T308718
Change-Id: Ifd265d29cee5f8a68e7b3036deaf2ba2b6c49d2e
2022-05-25 10:36:40 +00:00
Volker E 06708ba198 Remove unnecessary inner-tag whitespace and self-closing tags
Self-closing tags are so XHTML. HTML5 allows them on some elements, but
doesn't require them. Cleaning up for consistency and for a few bits
saved to clients.

Change-Id: I781b8d79bbd5dd1ee75a167718964c1142ecfc5d
2022-05-24 14:46:37 -07:00
jenkins-bot dafe3c8fd4 Merge "Handle accessible labels differently for dropdown and portal menus" 2022-05-24 15:09:04 +00:00
Mo Abualruz e46eef19d0 Normalise PHP namespaces used in Vector
- `MediaWiki\Skins\Vector\Tests` is now the prefix for all tests in the skin
- we followed PSR conventions of following folder structure after the prefix
- Optimize imports/use order
- update namespace in skin.json

Bug: T303102
Change-Id: Ib76374d81d973c83adfd6c8e7863ff6d797e655d
2022-05-23 09:32:40 +02:00
Jon Robson d74890df63 [Grid preparation] Add feature flag for grid
Additional changes:
* Make the query string parameter optional and if not defined set it
to lowercase configuration name. I think this makes it more predictable
as some configuration flags are prefixed with vector and some without.

This has the following consequences:
languageinheader => vectorlanguageinheader
languageinmainpageheader => vectorlanguageinmainpageheader
languagealertinsidebar => vectorlanguagealertinsidebar
titleabovetabs => vectortitleabovetabs

Note since table of contents query string is used in the A/B test
I've kept that as tableofcontents for now.

Bug: T303484
Change-Id: Iaca026ef5f32836098dc3b6f0f18632fe84fa8d0
2022-05-13 15:21:52 +00:00
bwang 9e665f9034 Handle accessible labels differently for dropdown and portal menus
An issue was found in QA where certain browser/screenreader combos could not read `aria-labelledby`+`aria-label`. Instead, we avoid using `aria-labelledby` and the `label` element entirely and apply the accessible label directly to the `input`. This great simplifies our labelling and improves screenreader support, while also allowing us to hide the `label` element to reduce verbosity.
Because the `label` element is used differently in the portal menu, we use the `is-portal` variable to maintain the old markup for portal menus

Bug: T301051
Change-Id: I5a0f7d5d78838fabe561095b33176e7162b31aea
2022-05-12 22:11:22 +00:00
Jon Robson 78369c51d3 Omit ArticleToolbar in Navigation when title above tabs
Change-Id: Ib3d9c28e4dbbf1deb85adccec84f208f086c1a04
2022-05-12 11:04:10 -07:00
jenkins-bot ef42ef7e66 Merge "Create feature flag for VectorTitleAboveTabs feature" 2022-05-11 19:53:11 +00:00
jenkins-bot 8d1dbab356 Merge "Simplify TOC spacing styles/logic by reusing the visible sticky header class" 2022-05-10 22:18:26 +00:00
bwang 2f32d1378c Fix personal tools navigation landmark label
Bug: T291304
Change-Id: I62c24cf739048b794cc33045cbe2333ecb51efdb
2022-05-10 17:12:46 +00:00
Jan Drewniak 29d938b0f9 Create feature flag for VectorTitleAboveTabs feature
Adds a feature called VectorTitleAboveTabs that will be used to
toggle a forthcoming feature that moves the page title above the
tabs (the ones that link to talk/history etc).

Bug: T303549
Change-Id: Ibadb4293eca16a83e5e7a9f90ddcf51fab0a0e41
2022-05-10 12:53:31 -04:00
bwang 91e2e55a10 Simplify TOC spacing styles/logic by reusing the visible sticky header class
- Remove the 'vector-scrolled-below-table-of-contents' class, reducing the number of classes added with JS and simplifying the scrollObserver logic
- Move the 'vector-sticky-header-visible' class from the sticky header element to the body element. Hopefully, this is where other feature specific classes can go in the future
- This approach means the TOC will not need JS to update it's spacing when the sticky header is not enabled

Bug: T307345
Change-Id: I1084defc7025f5c946e22a36d373224fae6f8bd6
2022-05-10 11:39:05 -05:00
jenkins-bot b6847038f8 Merge "[HTML] Refactor Content header templates" 2022-05-06 18:43:34 +00:00
Jan Drewniak 1288c97179 [HTML] Refactor Content header templates
Creates two new templates:
- ContentHeader.mustache containing the site header and indicators or languages
- ContentSubheader.mustache containing site tagline and conditionally indicators

This changes DOM order.
- It adds the `<header class="mw-body-header">` to all pages,
  including special pages & edit pages, not just pages with the language button.
- It moves the #siteSub element (tagline) outside of the
  `<div id="bodyContent">` element.
- Adds a clearfix (or margin-collapse fix) to `.vector-body`.

This changes causes a minor difference (perhaps improvement) where on special pages,
the beginning of the content, starting with the `mw-specialpage-summary` element,
was positioned closer to the page title than on regular pages.

The clearfix ensures that the height between the page title and content is consistent across all pages.

Bug: T303549
Change-Id: I29ba337dbd6f9b0cf58c9a0ca517a9ba59cef414
2022-05-06 15:37:04 +00:00
Jon Robson 305fbdacf8 [Grid preparation] ArticleToolbar component
Structural change to prepare for CSS grid usage.
ArticleToolbar component is defined and self contained with
all layout rules relating to toolbar

UI regression testing suite shows 6 failures due to pixel alignment
changes to tabs. When comparing to the current release, you should
see 34 failures before /and/ after this change.

Notable changes:
- #mw-head element is no longer present in modern Vector skin
to allow us to distinguish between cached HTML and modern HTML

Bug: T303484
Change-Id: Ia261ea53931217f32a21b33c2ab3d4ec64efa48a
2022-05-05 21:13:01 +00:00
Jon Robson 9a2b3d6275 [Grid preparation] Structure the header
Restructure the header to have two child elements

Change-Id: Ib5b7f31419ae6b62f62878947651b8ab843a3955
2022-05-05 17:54:28 +00:00
jenkins-bot ff3d879ee2 Merge "Remove nav element from Vector menus and only render label elements in Vector menus when needed. Add new nav landmarks corresponding to user links, main site nav, and article editing tools. Split out legacy Menu template." 2022-05-03 15:42:02 +00:00
Jon Robson a1e5fd5fcc On special page do not show empty more menu to low resolutions
This is a follow up to I34ace0aeb3e23d8f6a8c5a8680bb492f37e343ad
On Special:Userlogin a "more" menu appears that's visible but empty
that should not

 Bug: T306229
Change-Id: I9384b3015de9991db41bde8ccc8f404ac533f198
2022-05-02 20:22:44 +00:00
Tim Starling 8d0659b1e6 Updates for core temp user autocreation feature
* Use pt-tmpuserpage for the temp user name.
* Use the userAnonymous icon for the temp user personal tools menu.
* Suppress the logout menu item for temp users.

Depends-On: Ib14a352490fc42039106523118e8d021844e3dfb
Bug: T300263
Change-Id: I8ac5de82f76a9ec58b0fbef85546bc7fd5b793d2
2022-04-28 20:32:53 +00:00
Jon Robson 64df4fde20 Remove dancing tabs with CSS only solution
Remove JavaScript that collapses tabs and replace with an easier
to maintain breakpoint based solution.

Tabs will now collapse below the tablet breakpoint

Note: In the case of mw.util.addPortletLink, to add items to the
`views` menu, these will not be collapsed into the more menu and
must now be explicitly added to both menus, ie. if the window is
resized these will hide and not appear in the more menu.

However, when mw.util.addPortletLink attempts to add to `views` menu
when there is not available space, we will redirect those links to
the more (`cactions`) dropdown menu.

Bug: T306229
Change-Id: I34ace0aeb3e23d8f6a8c5a8680bb492f37e343ad
2022-04-28 17:57:10 +00:00
bwang d54029a523 Remove nav element from Vector menus and only render label elements in Vector menus when needed. Add new nav landmarks corresponding to user links, main site nav, and article editing tools. Split out legacy Menu template.
Bug: T291304
Bug: T301051
Change-Id: I35c20103e4b45139ef1d3f73c23f6a744aa87a3c
2022-04-27 16:52:20 +00:00
Derick A 80b60c153a
Hooks: Migrate Vector skin hooks to the new MediaWiki hook system
Per https://www.mediawiki.org/wiki/Manual:Hooks#Handling_hooks_in_MediaWiki_1.35_and_later,
MediaWiki provides a new hook system. Vector is able to utilize this new
hook system because it requires a MW version >= 1.35, hence the migration.

Bug: T271009
Change-Id: I6e01b151751485339a0d6a6dc6a843f7141d54bb
2022-04-26 23:58:13 +01:00
jenkins-bot cdc2df8e66 Merge "Always collapse Echo alert on "wide" headers" 2022-04-20 16:39:12 +00:00
jenkins-bot ff4a1ba89c Merge "Replace h2 in TOC with p and remove aria-hidden" 2022-04-19 21:04:20 +00:00
Jon Robson 5ef40f2f73 Always collapse Echo alert on "wide" headers
Bug: T301583
Change-Id: Ib4baab3ab814a79f45d8d19cfe4e499307852d52
2022-04-19 21:02:54 +00:00
jenkins-bot 065f3409b5 Merge "Replace Action::getActionName by IContextSource::getActionName" 2022-04-19 18:11:25 +00:00
bwang 9473758efd Replace h2 in TOC with p and remove aria-hidden
Ideally the TOC has an h2 after the article title h1, but because of the TOC sticky positioning and its placement in the grid, we cant use an h2 without messing up the heading order.

Bug: T301051
Change-Id: I462ddfb618ddd422c9f71293280d1790c4846f50
2022-04-19 17:51:36 +00:00
Umherirrender d0ac534749 Replace Action::getActionName by IContextSource::getActionName
Change-Id: I41bb15527e5ff9296a53205608c596291d485876
2022-04-19 10:46:48 +02:00
jenkins-bot 7565486e09 Merge "Restore persistent sidebar" 2022-04-18 21:47:34 +00:00
Mortal303 8b51041003 Move Vector menu class logic into Menu mustache template
Replaced “vector-menu-heading” with ‘’(empty string) in “$portletData['heading-class'] = '';”
in includes/SkinVector.php and updated accordingly the includes/templates/Menu.mustache file.
Updated “vector-menu-heading” with ‘’(empty string) in stories/LanguageButton.stories.data.js,
stories/UserLinks.stories.data.js, and tests/phpunit/integration/SkinVectorTest.php respectively
SkinVector and Storybook are cleaned up.

Bug: T290281
Change-Id: I4ca16953799b3dc52e45674bb398c78f14cfc842
2022-04-18 15:18:53 -05:00
Jon Robson f38a2afbf6 Restore persistent sidebar
Bug: T305989
Change-Id: I1304c777ad9581cd8b9153ad1e4483e31660857e
2022-04-18 19:44:11 +00:00
bwang 282fe1aa51 Fix missing create account link follow up
Follow up to 58b6831

Bug: T306116
Change-Id: I2989657f871b0a312e68c4af7757029b0c9c9f24
2022-04-15 18:57:14 +00:00
bwang 58b6831e4d Rely on core to provide accesskey/title attributes, update search toggle location in DOM
Bug: T299980
Depends-on: Ide214de5f246b38689799e20db9e8a4671d9b7ac
Change-Id: I43eb04ec095cc9c1d683df9da05887595c2eddfb
2022-04-14 13:53:07 -07:00
bwang 21f124dad5 Fix missing create account link icon and ensure icon attributes aren't showing up in rendered HTML
Bug: T306116
Depends-on: I509dd153ea2c1e04cb89415f185b7abbe0403773
Change-Id: Iaea83098fda7d77fda6629722dcef3e17e21fe06
2022-04-14 11:03:56 -05:00
Clare Ming 28a3c06cdf Replace TOC arrow icon
Bug: T304166
Change-Id: I182c9e5399d95ecea58dcdabb563a98b4e34e47e
2022-04-11 14:56:42 -06:00
Jon Robson 9f6295426f Prepare for grid layout
Add a legacy class to allow us to transition out certain CSS
with new grid system

Bug: T303484
Change-Id: Ie85451b721b64aee42eb4b356f38c3621ce40b5e
2022-04-11 18:12:43 +00:00
jenkins-bot 107abe79a0 Merge "Scope ULS styles to when language button is in header" 2022-04-09 00:07:09 +00:00
Jon Robson 3432cf2c80 Only consider article ID if A/B test enabled
The article ID shouldn't matter for display of table of contents
unless the A/B test is enabled.

This also has the added benefit of making the content provider
work with table of contents on articles again (content provider articles
always have a page id of 0)

Change-Id: I6af5e1476827828d0974ecbb110476ac1e5dc0c9
2022-04-08 20:04:24 +00:00
bwang 40045c6e0e Scope ULS styles to when language button is in header
Bug: T304468
Change-Id: Iebacb6a7bf3412a6ee76eb5c9fdb9471c02dd16c
2022-04-07 14:47:44 -05:00
jenkins-bot 1e75d6f373 Merge "Clean up unused constants and outdated comments" 2022-04-07 18:19:28 +00:00
jenkins-bot 125a8641e5 Merge "Prepare Vector for temporary user accounts" 2022-04-07 17:35:15 +00:00
jenkins-bot 6fc95b72ba Merge "Drop the Vector.Config service" 2022-04-07 16:54:01 +00:00
Func 12c7d6a0ca Clean up unused constants and outdated comments
Change-Id: If6462e3a67726234abe62fd4d02a5d19ff4f02e0
2022-04-07 16:10:52 +00:00
Func b61a92f052 Drop the Vector.Config service
It didn't vary by the skin version as documented in the Constants class,
and merely another instance of GlobalVarConfig.

Change-Id: I0acd0366a241e04bb79f6aae5dc52284dfa578df
2022-04-07 04:30:20 +00:00
bwang f1c70e99b7 Update sticky header to use ARIA attributes for section collapsing and add accessible label to toggle buttons
Bug: T303766
Change-Id: Idda4f286a42152af1d233588a1839ada5491ce95
2022-04-06 17:24:34 -05:00
bwang aa8ec1a878 Revert unnecessary TOC section id change
Change-Id: I62736b47557b79929b8ad984d6709e762b3db549
2022-04-05 15:38:00 -05:00
Nicholas Ray 6fbf08a198 Build A/B test bucketing infrastructure for the table of contents.
* Bucket and sample on server by using the
  `WikimediaEvents.WebABTestArticleIdFactory` service from
  WikimediaEvents (soft dependency)
* Add linkHijack.js so that users bucketed in one group have the
  possibility of remaining in that group if they click a link to another
  page.

Bug: T302046
Depends-On: Ie6627de98effb3d37a3bedda5023d08af319837f
Change-Id: Iff231a976c473217b0fa4da1aa9a8d1c2a1a19f2
2022-04-04 17:06:29 -06:00
jenkins-bot 19f114281a Merge "Drop the LatestSkinVersionRequirement" 2022-04-04 20:18:35 +00:00
Jon Robson 7e3d0828d5 Prepare Vector for temporary user accounts
Bug: T300263
Change-Id: I603b232da338655e54f372bec5df68dd96adfb2e
2022-04-04 19:45:14 +00:00
Jon Robson eca9fcbf79 Drop the LatestSkinVersionRequirement
The LatestSkinVersionRequirement is problematic for various reasons:

1) It uses the "useskin" query string
parameter which may or may not refer to the correct
skin (in the case of a non-existent skin it will always come to the conclusion that
it is not modern Vector and thus must be legacy).

2) It uses the User object which may or may not be safeToLoad
depending on when called.

The feature seems redundant at this point, as we are separating code
into separate classes Vector and Vector22 and all the features only apply
to modern Vector. I suggest we remove it and use the features explicitly in the skin
intended.

Bug: T305232
Bug: T305262
Bug: T302627
Change-Id: I92fa33547bd601e05ddc8c1468e681892e47c16b
2022-04-04 19:22:38 +00:00
bwang 733990f881 Small clean up and TOC update
Change-Id: Ic093888cb2b06d8eef95a1317d791e7e1627d0f6
2022-04-01 13:14:02 -05:00
Tim Starling 254ffbb55a Don't set a user preference on new accounts by default
Make it possible for Vector to be a non-default skin. Only set a user
preference on newly created accounts if that has been explicitly
requested in config.

This should have no effect on WMF production.

Change-Id: I52f62cf7eb78d2be4c59821a3cf29da9619602d9
2022-03-31 14:52:20 +11:00