Commit Graph

493 Commits

Author SHA1 Message Date
bwang b295ccc931 Fix aria-expanded status for user menu
The user menu dropdown was announcing to screenreaders as "Personal tools expanded collapsed". This is due to the core icon classes causing the spans to be display: block. This patch adds !important to the relevant display styles to ensure the statuses are always read out correctly

Bug: T253650
Change-Id: I0b51af5da98af1bd0c0029db54420e395242842d
2021-09-16 13:48:26 -05: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 f271c86238 [refactor] DRY up attribute suffixing
This makes the code more readable and allows us to apply
the suffixing in other places in the sticky header.

Change-Id: I44008c18a3faea2089bc93eb5ce7fea1cad1aaec
2021-09-14 23:34:48 +00:00
jdlrobson 21a21f7e93 [refactor] reduce usages of typescript type declarations
While needed for cloned elements, others can be avoided by
using more general Element class

Change-Id: Iaee121a9f746e9729b5ecbdec80915bf05c11655
2021-09-14 23:34:36 +00:00
jenkins-bot 8f2a5c58f2 Merge "Add history and talk page icons to sticky header" 2021-09-14 23:26:06 +00:00
jenkins-bot 056ec56208 Merge "Clean up for adding title to sticky header" 2021-09-14 22:22:01 +00:00
jenkins-bot bd1dab6bb8 Merge "[Storybook] Add Header component" 2021-09-14 21:45:53 +00:00
Clare Ming 5ec728ec60 Clean up for adding title to sticky header
- Update styles for fade out.
- Remove unused styles.

Bug: T289814
Change-Id: I0bdbaf1a1f0306d47df83f61811b0c85056415e0
2021-09-14 15:10:46 -06: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
jenkins-bot 53d1508f62 Merge "Add user menu to sticky header" 2021-09-14 19:23:13 +00:00
Clare Ming 3362e62ef2 Add page title to sticky header
- Fade out after 500px.

Bug: T289814
Bug: T290596
Change-Id: Ice3054f417707261d7c06769cb92aa170cfadba1
2021-09-14 19:12:29 +00:00
Clare Ming 755f10cd0b Add user menu to sticky header
- Remove unused button, data from sticky header.
- Simplify template to leave sticky user menu placeholder.
- Update js to clone user menu with new ids.
- Include gadget-injected items in sticky user menu.

Bug: T289816
Change-Id: I23fde537efc2a66a2df22cd2633fbab034b73eb6
2021-09-14 12:57:08 -06:00
jdlrobson ad5c127239 [Storybook] Add Header component
* Moves screen variables relating to Header to Header
* Adds a Header storybook entry
* Moves data-logo from Logo template to Header.mustache
* Updates UserLinks to use USER_LINK_PARTIALS
* Renames confusing SearchBox story names
* Updates package.json to use a static folder.
* Use mediawiki.org for sourcing mw-ui-button and mw-ui-icon styles
since deploys there come earlier
* Removes usages of ID selectors

Change-Id: I0e158fa7e62c56a50cfff497d75f0808effd1eed
2021-09-14 18:33:10 +00:00
bwang 687c6a50d8 Improve heading structure and heading semantics by removing redundant headings and labels for modern Vector
- Apply aria-hidden to h3 in Menu template, ensuring the nav landmarks are still properly labeled, but no longer reading duplicate labels to screenreaders
- Remove "Navigation menu" h2 element, which is not needed as the nav landmarks are already labeled
- Remove searchbox h3 element, which is redundant with the search landmark
- Scope all changes to modern vector

Bug: T265993
Change-Id: I4e5da7a0699160fa57234bd126b75243e0157778
2021-09-14 10:47:05 -05:00
Nicholas Ray 326e11dfbf Scope styles that should only apply to the main header to Header.less
We have many styles related to the layout and visibility of search that
are only useful in the context of the main header. Since many of these
elements have classes that will also be in the sticky header, we should
scope these rules to the main header so that we avoid an uphill battle
of styles trying to override eachother.

Additional changes:

* We previously had a mix of #p-search and .vector-search-box selectors
for the same element in the CSS. Header.less now only uses
.vector-searchbox to avoid specificity wars.

* Removed nearly all of the #p-search rules previously found on L147 -
L167 in screen.less after observing nothing relatively bad happening
when they were removed.

Bug: T289724
Change-Id: I2e6c269e29717cd20d8acfaddc3631ea1b8fedfa
2021-09-14 15:34:05 +00:00
jenkins-bot 6a0607afdf Merge "Inherit link colors from core variables and override @color-link-new" 2021-09-13 18:23:06 +00:00
jdlrobson 0238078aaf Inherit link colors from core variables and override @color-link-new
Vector should use the variables defined in core for red links

Bug: T288739
Depends-On: I799b46664f01c5631fb9d1ae4f5c43caeeaac818
Change-Id: Idcf5a54d76a1343d3407821b8a5b8d8ece8af9d0
2021-09-13 17:56:26 +00:00
jenkins-bot 82832b137a Merge "Remove disable dropdown behavior" 2021-09-13 07:05:25 +00:00
Clare Ming e639c9287d Make sticky header functional/visible
- Show sticky header after bottom of first h1.
- Hide sticky header before bottom of first h1.
- Add media query for reduce motion preference.

Bug: T290101
Change-Id: I2b1ecd31ac360a1ef5bf2f016978d6e0665a316c
2021-09-07 16:10:21 -06:00
jenkins-bot 9e9f3ec0cd Merge "[refactor] Remove common UserLinks code" 2021-09-07 16:31:18 +00:00
jdlrobson ff8e29d240 [refactor] Remove common UserLinks code
There is no common UserLinks code. These styles serve
legacy only.

Bug: T288852
Change-Id: Ied191bc1bc5dbd48491fa285b5def265c7d5262d
2021-09-07 15:37:13 +00:00
jenkins-bot 9ffb6cb044 Merge "Restrict sticky heaader visibility" 2021-09-03 21:05:17 +00:00
Clare Ming af317dbc58 Restrict sticky heaader visibility
- Hide if javascript disabled.
- Hide at lower resolutions.

Bug: T289714
Change-Id: I0c669c7fc46fda7bf5055d20cc1cd54d472a9330
2021-09-03 14:19:24 -06:00
jenkins-bot fed987d079 Merge "Simplify how we generate icons and button classes in Vector" 2021-09-03 19:54:03 +00:00
jdlrobson b88f2970f7 Simplify how we generate icons and button classes in Vector
- Separate icon classes from button classes in user links/language
- Upgrades the personal tools language button preference to
a mw-ui-button with icon
- Adds a generic selector for dropdown menus without an icon
- Cleans up user links CSS now mw-list-item class is available
- Removes icon hack CSS

Bug: T289630
Bug: T283757
Change-Id: Ib518858e06549f252d73d57fd4768f446cc561b9
2021-09-03 19:25:31 +00:00
jdlrobson 520dfd2260 Do not hard code Special:Search
Bug: T287540
Change-Id: I234acbaa2cce8f43653507b4298090c50451699d
2021-09-02 20:20:56 +00:00
Clare Ming 21c45837ef Spoof aria-expanded for dropdown menus using checkbox hack
- Mimic expanded/collapsed state of menu without JS.
- Update template, styles, i18n to make accessibility of dropdowns accurate.

Bug: T253650
Change-Id: I58ecebf520d6107554dbb81470dee69a5d4a7f1d
2021-09-01 16:12:26 -06:00
jenkins-bot 94d135ecfa Merge "Build the sticky header skeleton" 2021-09-01 20:35:21 +00:00
jdlrobson 8657171471 Build the sticky header skeleton
The sticky header is currently disabled unconditionally
and nothing is wired up, with placeholders for data and
functionality which will be added in future.

Bug: T289716
Change-Id: I16223ce849267e718aad22b8a24b2327332ac8b7
2021-09-01 12:32:31 -07:00
Nicholas Ray 5ca9d00d55 Set responsive max-width on username in header
Per T287522#7295558, the username should have a computed max-width of
200px above 1200px and a max-width of 155px below 1200px.

Additional changes:

* Use flex-wrap: nowrap on header instead of wrap. I think the former
may have been an unintended consequence of the consolidated links
feature flag clean up.

* Use core's text-overflow mixin for both the username and the usermenu
items

* Change the user menu's max-width to use relative units

Bug: T287522
Change-Id: I536e6371f85ccde75673af46c7667eb447eff081
2021-08-31 17:06:35 -06:00
jdlrobson c8dd4e9ed1 Remove disable dropdown behavior
Now that we bind the ULS dialog to the checkbox element,
(see c08ae11) the default behaviour of the checkbos is prevented,
so it is impossible for the dropdown to ever
be shown when ULS is enabled and clicked so this code no longer
serves any purpose.

Depends-On: I97a69c30b27cb1ded06451389e086229561c3589
Change-Id: Ic9d03dea12ee8bb2d7430eccd70e4343e3805d36
2021-08-31 20:53:41 +00:00
jenkins-bot 3ff5e1b6a4 Merge "Update ULS button states to be consistent with other quiet buttons" 2021-08-31 19:44:15 +00:00
bwang c08ae1152e Update ULS button states to be consistent with other quiet buttons
- JS-enabled ULS button gets a focus state by moving the ULS click handler to the Menu checkbox instead of the h3, and unhiding the checkbox
- JS-enabled ULS button no longer gets a darker background when the menu is open (ULS default style)
- JS-enabled and no-js ULS buttons both rely on mw-ui-button and mw-ui-quiet classes for focus/hover/active states
- Old styles and skinStyles are removed

Bug: T283757
Change-Id: I66073d6128a27afbd80a7adcff03cc7fcefa9556
2021-08-31 10:59:59 -05:00
Nicholas Ray a35b21d2cf Correct positioning of search icon before WVUI loads
WVUI sets the icon as `left: -11px` [1]. Vector should do the same to
ensure the icon doesn't move when WVUI loads. Also set top and bottom
properties to zero so that the height of the icon's container is the
same as in WVUI (32 px).

[1] https://phabricator.wikimedia.org/F34622194

Change-Id: I73fa55f9013dc1bdd51581d357109d4817638d91
2021-08-30 16:59:12 -06:00
jenkins-bot fef51f9023 Merge "Improve readability of anon user menu for screenreaders" 2021-08-27 20:36:16 +00:00
bwang d15005408f Improve readability of anon user menu for screenreaders
Bug: T288293
Change-Id: I10ca58aa492447f179c0ce12eabc0cd1ce4e9d9b
2021-08-26 12:58:10 -05:00
Clare Ming 1efe0a4203 Remove user links feature flag
Update/remove config, constants, hooks, templates, styles, logic, tests, stories to check legacy vs modern Vector where applicable instead of the decommissioned user links feature flag.

Bug: T288852
Change-Id: I5c5831091a10711838a8a2877c782df4996d4596
2021-08-26 10:07:15 -06:00
Clare Ming 129bf5c350 Update vector menu hide dropdown class to use BEMish convention.
- Keep double-dash class name for cached HTML.
- Update instances of renamed class in less + js.

Bug: T253671
Change-Id: Ieb1ce630e8fa84167e2ca8497f66a20183fdaf90
2021-08-24 15:33:41 +00:00
jenkins-bot 040cbb7dc4 Merge "Use the search title if configured" 2021-08-13 18:11:07 +00:00
jenkins-bot 1c93c90902 Merge "Use centralized MediaWiki typescript definition" 2021-08-13 17:23:44 +00:00
bwang 21c273af1f Override user menu line height
Bug: T288540
Change-Id: I30810de5ba36e082a4e8a1f6f93f34c99344dae8
2021-08-12 19:56:05 +00:00
jdlrobson 5a0214afc9 Copy class across to new language link item
If the Vector code runs before the Wikibase code,
the Wikibase code will not work as the CSS selector
will no longer match.

Bug: T287206
Change-Id: I8555b60f2463ad19efadd57bccbb91ae4e2cc528
2021-08-10 13:17:30 -07:00
jenkins-bot aec29ebc2d Merge "Update UserLinks and SearchBox storybook stories to match prod" 2021-08-06 22:49:34 +00:00
bwang 7aeda662a5 Ensure emptyPortlet class cannot hide user links menu
Bug: T28819
Change-Id: Ia477439f28d5a3ac98cfc28385f179ca72946c26
2021-08-05 13:38:17 -05:00
jdlrobson aebb3fb522 Use the search title if configured
Allow commons to use Special:MediaSearch

Depends-On: 	I37b9d3a2b263f496a283f4bfdc769b7dc880ab06
Bug: T287540
Change-Id: I2a2463d704ef5b2264574cdf186836ba00a639f5
2021-08-05 15:45:41 +00:00
bwang d1f1f32418 Update UserLinks and SearchBox storybook stories to match prod
- Update UserLinks data to wrap link content with spans and other markup changes
- Use UserLinks__login.mustache and UserLinks__logout.mustache for rendering UserLink stories
- Add new SearchBox story to account for search collapse behavior in modern Vector

Change-Id: Ib0abce31db60a0c5c88dea17085e2974ac5112b5
2021-08-05 10:08:31 -05:00
jenkins-bot 78223873e3 Merge "Add sticky header feature flag, query param, and class" 2021-08-04 20:02:09 +00:00
bwang 46d98c90f4 Add sticky header feature flag, query param, and class
Bug: T284463
Change-Id: I520832fa1e0a66bb24479e47c8e8f8011e514299
2021-08-04 18:49:56 +00:00
jenkins-bot 100e8281d0 Merge "Add max-width to user menu and text-overflow: ellipsis" 2021-08-04 16:15:45 +00:00
Nicholas Ray 8c36871f1b Add max-width to user menu and text-overflow: ellipsis
When implementing how to cut overflowing text, a white fade out was
considered instead of an ellipsis, but that implementation brings
additional complexity when considering the user menu's hover states.

Therefore, the widely used `text-overflow: ellipsis` was used instead
with approval from the designer [1]

[1] https://phabricator.wikimedia.org/T287522#7255400

Bug: T287522
Change-Id: I49e6084bd621ca1637fbd167c8eaf8c07ee695ca
2021-08-03 16:59:52 -06:00
jenkins-bot 65ea203549 Merge "Remove 'legacy' feature" 2021-08-03 18:28:28 +00:00
bwang 58c87018b2 Remove 'legacy' feature
Bug: T287410
Change-Id: Ibf8c20cfb1c3adb262224a28488c03c64323f509
2021-08-03 11:06:36 -07:00
jdlrobson 85ffc0805e Do not rely on load order for disabling language button fallback
Some code disables the dropdown behaviour when ULS is loaded, however
it does not always appear to be working as the `ext.uls.interface`
module may be loaded for other things unrelated to the compact
languages link button.

The safest thing to do for now seems to be to check the configuration
flag wgULSisCompactLinksEnabled. In future, perhaps a hook event could
be added to ULS and that could be subscribed to instead.

Bug: T287191
Change-Id: I0cf8d387919078aabc9e77a0a452f8b3364016ee
2021-07-28 16:59:48 -07:00
Nicholas Ray f62e1997f5 Fix padding/positioning of the user menu orange talk message notification
The padding-top of the orange notification set in
ext.echo.styles.alert.less was being overriden by the `padding-top: 0`
set in UserLinks.less which was intended to only override the padding
set in Menu.less.

This commit:

* Scopes the li styles in Menu.less to apply only to the legacy user
menu (found in both legacy and modern vector with the consolidated user
links feature off) which appears to be the only menus that needs these
rules.

* The padding-top previously in UserLinks is no longer needed as a
result of the above point.

* Adjusts/cleans up the positioning of the orange notification by
removing an unneeded margin/padding-top and setting the top to 100% (the
previous `calc` statement was unintentionally resulting in 112%).

Bug: T287633
Change-Id: Ia7069d291f53d8e0e0e576d7b96b7a8b1a6cb29d
2021-07-28 16:35:08 -06:00
Nicholas Ray 7205a0b8e3 Fix user menu "learn more" link spacing
Per the design spec of T287523 and T285786.

Bug: T287523
Change-Id: Icdfc6dca19b83fcc54352c9f4a8c15e1f1bd640f
2021-07-28 09:52:45 -06:00
jenkins-bot 7881d8e651 Merge "Restore print, links, table and message box styles" 2021-07-27 21:45:16 +00:00
jenkins-bot 63dcfb720d Merge "Copy interwiki links into sidebar" 2021-07-27 21:21:20 +00:00
jdlrobson 722b5fbf80 Restore print, links, table and message box styles
These should have been added in the migration.
Follow up to 4a93c70

Bug: T278896
Change-Id: I089077d7ff7a9daf0e98b4dc40f04a11b4764277
2021-07-27 21:18:03 +00:00
Nicholas Ray d8f62f780c User menu design tweaks
* Revises UserLinks.less according to the T285786 spec.

* Unsets 'createaccount' data in $content_navigation in favor creating
this link inside SkinVector which follows the same pattern as the Login
link. This is needed because the create account link needs to be on top
of the login link in the menu per T285786#7231671.

* Changes MenuDropdown.less to pad the anchor element instead of the li
element. This results in a more intuitive click target.

* Places an end margin on the search box to add space between the user
links and the search box.

Bug: T285786
Change-Id: Idb860e6b65c9f266a8027e3f486ccf4c4ec4ed3c
2021-07-27 14:25:32 -06:00
bwang a27b6f7096 Copy interwiki links into sidebar
Bug: T287206
Change-Id: I951b2a277f9484f8e2735951d85c0766098607b5
2021-07-27 12:08:11 -05:00
jdlrobson a46e790187 Use centralized MediaWiki typescript definition
Use @wikimedia/types-wikimedia rather than maintaining our own.

Bug: T263914
Change-Id: I5319f422b85a772c248f2114a75f906a1aff6251
2021-07-26 21:27:12 +00:00
jdlrobson e96cce7207 Restore the true height of the language button
Drop the override, now that the skinStyles have been identified
that were causing this irregularity.

Depends-On:   I9d62ad8a79168bdaebace07fb82f22da4c534b5c
Bug: T191021
Change-Id: Ic5bc639186477570028efa1cb2a09cd64a5aaca1
2021-07-22 16:27:48 -07:00
jdlrobson 83e63d3e99 Sidebar hover background should be consistent with mw-ui-icon
Remove override now it's a default.

Addresses Alex's feedback item 1 in
T191021#7231088

Bug: T191021
Change-Id: I2702ffb9cbee2dfc841b3f03638fdfd24a128493
2021-07-22 22:07:09 +00:00
jenkins-bot accb2892ad Merge "Correct the user icon padding" 2021-07-22 19:53:36 +00:00
jdlrobson 628c436f15 Correct the user icon padding
Addresses topic 3 from Alex's feedback in:
    T191021#7228591

Bug: T191021
Change-Id: I12e5fea3f1893b94e520bcec91d52af9596a2fd4
2021-07-22 19:21:48 +00:00
jenkins-bot 2b93a50fe2 Merge "Remove margin-left: auto on search box to prevent it from switching sides" 2021-07-22 18:49:41 +00:00
bwang 589bb21d1c Remove margin-left: auto on search box to prevent it from switching sides
- Scopes margin-left: auto style to vector with user links off only

Bug: T286733
Change-Id: If5dbdd89c2f773d6a98bf4ffa76f64409c11fd8d
2021-07-22 13:22:40 -05:00
jdlrobson 68e55542af Drop redundant border
This was increasing the icon size from 44x44 to 46x46

Addresses topic 1 from Alex's feedback in:
T191021#7228591

Bug: T191021
Change-Id: I03c80b5ceda9b23dfa53a245bed820ca22a1d95a
2021-07-21 21:50:04 +00:00
jenkins-bot 364c35dcdf Merge "Remove Vector skinStyles for icons and fix language button" 2021-07-21 18:44:37 +00:00
jdlrobson 96136a0e2d Remove Vector skinStyles for icons and fix language button
Depends-On:  Id08590f6a3fbbfda8226f2899f50f0b64cbb1481
Change-Id: I5be642f2e20d67e1d27c74ddb6ec086738a261aa
Bug: T191021
2021-07-21 11:02:42 -07:00
bwang 14e9d6ba9f Fix dropdown font sizing in legacy vector
Bug: T287052
Change-Id: I5ec4fb0dc61ed8913debc85061421f567c8cd824
2021-07-21 14:29:37 +00:00
jdlrobson 13de4ff225 Prepare for updated mw-ui-icon implementation in Vector
We will couple the roll out of the consolidated user links code
with the roll out of the new icon styles.

This change is restricted to the user links feature and will result
in some slight UI discrepencies until
Ibc136a17662ae839f90babb21e0f7e8f27b7a7d5
is merged.

Bug: T191021
Change-Id: Ia2d2c86e61341b9900f9ac337ddd763252e0515f
2021-07-20 18:52:40 +00:00
jdlrobson 60923c6ddb Collapse search below desktop breakpoint
The tablet breakpoint doesn't work. It is not possible to apply
the min width of 350px for the search input given the other elements
in the header, however the desktop breakpoint provides plenty of space.

Change-Id: I93c29700d465d641f8155c01a311e1e720c37695
2021-07-15 22:02:55 +00:00
jenkins-bot 297322f810 Merge "Remove caching FIXMEs" 2021-07-15 21:12:00 +00:00
jdlrobson dd73491331 Remove caching FIXMEs
Code here has been in production a week now, so we no longer need to support
the old HTML structure.

Change-Id: I508dec3294588c9fc7f86958c47a3e5b52493df9
2021-07-15 20:28:48 +00:00
jdlrobson 276738b620 Consolidate user links outside of the user menu dropdown into a single new menu
- Adds UserLinks__more template to process the list of user links.
- Simplifies styles in UserLinks.less, and namespace them under .vector-user-menu-more
- Add i18n for the label of the new navigation menu
- Update storybook and typing

Bug: T284584
Change-Id: I92290815869dcb939f01d9aff4aa202f6f004894
2021-07-15 20:27:54 +00:00
Nicholas Ray ca22b84df4 Make #p-search's start margin dependent on .vector-search-box-show-thumbnail
Before this commit, the following config would result in the search box
not lining up vertically with the tabs:

$wgVectorWvuiSearchOptions = [
  "showThumbnail" => false,
];
```

This commit fixes that by making the start margin dependent on the
`showThumbnail` option.

Bug: T284242
Change-Id: I0132ef8afb3206836d9f16771cbefda5b8bfa3ec
2021-07-14 13:40:54 -06:00
Nicholas Ray 7d917c8dbb Widen WVUI search suggestions to edge of search button when search is toggled
Per T284242#7206507, the width of the search suggestions should be
increased at small resolutions.

Bug: T284242
Change-Id: I16ac7c4174c427d340dc16b0b56221ff7b6e1016
2021-07-14 13:36:35 -06:00
Nicholas Ray 91af0e098d Make search toggleable at smaller screen widths
Now that the header collapses at small resolutions
(I89d75843ca7e33e6de93af5d7c22e46b7249c4b7), this commit wires the
search toggle to show the search box when clicked and hides it when the
user clicks outside the search box.

* Adds searchToggle.js to perform handle the toggle behavior of the
searchbox.
* Adds `@padding-horizontal-tabs`, `@size-search-expand` to variables.less
so that these can be used to set the start margin of the search box
(enabling its start edge to match the tab text start edge).
* Modifies screen.less to only apply search max-width when >=
@width-breakpoint-tablet

Bug: T284242
Change-Id: I82563d44967f60aee1cd4d3aa6fb4f405822686b
2021-07-14 00:14:45 +00:00
jdlrobson 91e07c6b9a Fix collapsible item behaviour
the user-links-collapsible-item class now applies to list items
not links

Follow up to 05a02a39fb59117c522678001d79b0d9dfdf63ca

Bug: T285960
Bug: T276566
Change-Id: I04fa303c4e95373fdf5ff090de1bba030386c286
2021-07-13 23:42:34 +00:00
bwang 0a75e2e627 Ensure userAvatar icon is only used in logged in users
Additional change: A bundlesize increase is required given
recent developments in the user menu.

Bug: T284748
Change-Id: I2b0981d621c3add42731e50d5aef299b32548b4a
2021-06-30 22:41:47 +00:00
jdlrobson 6777c5b1fe Collapse header at lower resolutions
Reduces the min-width to 340px with several changes at lower
resolutions
* collapses create account into dropdown
* hides language button and user messages
* The search component is updated to include a search toggle which
can be used to hide and show the search input at lower resolutions
- this leads to a slight HTML change with caching implications,
it also moves away from a BEM usage which is not standard for this
repository.
* limits width of logo based on the dimensions we display
in mobile

Bug: T276566
Change-Id: I89d75843ca7e33e6de93af5d7c22e46b7249c4b7
2021-06-30 21:43:35 +00:00
jdlrobson a220e553eb Fixes transition from input focus state to WVUI focus state
VueEnhancedSearchBox tries to mimic the styles of WVUI to get a
seamless transition however doesn't account for the focus state that
shows briefly while this occurs.

This was leading to the icon jumping as it transitioned.

Bug: T279015
Change-Id: I10a4ec5d64bb58e2f21506c8a09a1bb6c34ecd65
2021-06-29 14:39:10 -07:00
bwang 0c8154f1bd Update search loading animation delay to 500ms
Bug: T273093
Change-Id: I517bb80a9557c85607ae3588bb44dc83cbeb1dc0
2021-06-24 17:18:16 +00:00
bwang 8389de9cb9 Update user menu icon and storybook
Bug: T284748
Change-Id: Icdbfd882490b380871befd3c6606c4b48d225132
2021-06-18 20:30:55 +00:00
jenkins-bot b54b85753b Merge "Move "logout" button to bottom of user links menu in modern Vector" 2021-06-14 23:02:46 +00:00
Jan Drewniak c26ae0f965 Move "logout" button to bottom of user links menu in modern Vector
For modern Vector, removes the logout link in the user menu and places it
below that menu by appending it to the html-after-portal property of the
skin data.

Also modifies the `.vector-user-menu-login` style to accommodate both the
login and logout button.

bug: T281791
Depends-On: If82a736e37174aaadd0ff07019a1fae3759a9e51
Change-Id: I7675230e09a50eaeab448182329f850ad2689514
2021-06-14 23:40:19 +02:00
jdlrobson 0b024a4a4d Allow disabling of the new compact languages button
Depends-On: I726c61d4c6895a28b999781752535e0ddc961744
Bug: T282149
Change-Id: I436554d9d51470d277d59c2c71e08124735e12fd
2021-06-14 15:49:43 +00:00
Clare Ming 9ec5d6ded0 Hide language links on print version
Add selector to hide language links for print version of pages.

Bug: T282304
Change-Id: I6b17676e7491863e684c1704d0a849f0ba3827f5
2021-06-10 16:35:28 -06:00
Clare Ming 06d0afbcb3 Update styles for user-interface-preferences in user links menu.
- Add new menu to UserLinks template.
- Fix styles for user links toolbar.

Bug: T282196
Change-Id: I42d6e6e11d76b2d25b2720a617f2fb2e545eb4b6
2021-06-05 02:01:17 +00:00
jenkins-bot 8021270bce Merge "Update UserLinks styles to use classes instead of ids" 2021-06-02 22:38:04 +00:00
bwang b5aa055900 Update UserLinks styles to use classes instead of ids
Follow up to: 298f945983

Change-Id: I5bc28501d0ae4c2597796dbf1ed9c10eacadad62
2021-06-02 22:16:59 +00:00
Roan Kattouw 02638ff59d Use the new wvui-search module from MW core
Depends-On: Ifa3abeab2a929e15597fa51b95b4442fe818ef31
Change-Id: I24712ca8e4d9558a17c029a4c59484dc0f5b8fad
2021-06-02 13:40:20 -07:00
jenkins-bot a15fd2eb80 Merge "search: Add option to disable highlighting query" 2021-06-02 19:21:30 +00:00
jenkins-bot 0141be5080 Merge "Create new user menu template for consolidated user links in logged out users" 2021-06-02 19:09:54 +00:00
Sam Smith 2b05a6a203 search: Add option to disable highlighting query
... for the WVUI search autocomplete widget.

The VectorWvuiSearchOptions object is sent to the client whole and
already used as the base props for the app component constructed in the
skins.vector.search RL module. We also define the highlightQuery prop on
that component so that its value can be passed to the WVUI
typeahead-search component.

Bug: T281797
Depends-On: I142810c177b850ecd7015f835bb6630bae00a6ea
Depends-On: Ia5e14fb9d0073a5126a0918f7a94213c671e773a
Change-Id: I551414b111226e690f6a2bc69dabf5edc6fb0a96
2021-06-02 18:51:01 +00:00
bwang 298f945983 Create new user menu template for consolidated user links in logged out users
- Adds mustache template for the new user menu
- Uses new functions for getting user link data that have been factored out of SkinTemplate in the dependent patch
- Refactor new user menu styles to be namespaced inside UserMenu.less

Notes:
- Originally this patch included more storybook changes, but I removed them in favor of this follow up patch: 696651

Bug: T276564
Depends-On: Ia841f92c626ca32a9ad437b3d1cff78309c83ed8
Change-Id: Ib15752428265fdc06a3000f62bdca44c67648974
2021-06-02 09:23:22 -05:00
jenkins-bot 56916a17d1 Merge "Change search button msg key to `searchbutton`" 2021-06-02 10:06:24 +00:00
Volker E 42216de481 Change search button msg key to `searchbutton`
Bug: T280405
Change-Id: Iea3bf40be029eaa330101b7b9a1bdea191d71416
2021-06-01 15:48:09 -07:00
jdlrobson 6300923601 Storybook should include UserLinks
Merge UserMenu into UserLinks for legacy and modern
Add a story for the UserLinks menu

Fixes: rendering of Skin (legacy) personal tools (the user icon
no longer overlaps)

Change-Id: I491ebb3962780bf2cf7f1dfb4dd09d576c294366
2021-05-27 19:27:27 +00:00
jdlrobson 96bf1e8276 Refactor: Create UserLinks component
Have a single template for the UserLinks component, with a single
element wrapping all its subcomponents as discussed.

Change-Id: I35936a6fa1ba335639ca3f47fd439a3662268fca
2021-05-25 16:57:35 +00:00
jdlrobson 3306124038 Introduce the vector-body class
This follows up I4c1b15d90bacbc9b13782a1d8f52e838ce8ecd83
In that change, a new class for Vector specific styles should have
been added and the existing CSS referenced. I could have sworn I did
this, but obviously not (perhaps a git rebase or unstage change problem).
We did it for the other skins e.g. Monobook (I90d85c21f4a62e6697f24e3ce388445a0a53c2b0)
but evidently not Vector.

We also have to worry about cached HTML now, the #bodyContent is
the most reliable selector to use for before and after
I4c1b15d90bacbc9b13782a1d8f52e838ce8ecd83

Additional:
Remove the mixin-clearfix rule on bodyContent - this is now
redundant with the changes in T279388 and should have been
removed.

Bug: T283206
Change-Id: I15103cea72c793589a03ab1a3e7f3b377acb287f
2021-05-21 13:50:31 -07:00
jdlrobson 6998c536d4 Both UserMenu stylesheets should be shipped in modern
Since we have feature flagged the new user menu feature, it is
imperative we load both sets of styles until the feature has
shipped. This allows us to switch seamlessly between the two
without worrying about cached HTML being served with updated CSS.

To do this, we add a new class to both user menu's distinguishing
the legacy version from the modern version. The styles are then
scoped to these new selectors.

This also fixes some regressions with the legacy user menu in
modern Vector when wgVectorConsolidateUserLinks is disabled.

Notes:
* No caching selector is needed for #pt-userpage given it can only
ever be output for logged in users.
* ID selectors in general are bad, so scoping to mw-portlet-personal-user-menu-legacy
isolates the legacy component allowing it to be rendered alongside the modern UserMenu

Bug: T276561
Change-Id: I068c5233bb25a7b141e66a6726b5761841f83eb2
2021-05-14 10:13:09 -07:00
Clare Ming 63f9dd81e3 Cleanup styles for personal user dropdown menu.
Remove redundant styles. Update personal menu dropdown to more closely reflect design of OOUI dropdown elements. Extract legcay-specific, modern-specific styles for UserMenu into separate partials. Create new shared UserMenu component.

Bug: T276561
Change-Id: I1e56cd5b3b24ac1b5cae684301b8e3a84ea33a5c
2021-05-13 23:19:54 +00:00
Sam Smith 7f780961a6 search: Wire up submit event handler
Bug: T274869
Change-Id: I5fab22564fa2fe140858cc214aac017d7bd6c68e
2021-05-13 15:29:18 +01:00
jenkins-bot 50430ea06a Merge "search: Update styling for the search loading state" 2021-05-10 20:55:31 +00:00
bwang 964e214e87 search: Update styling for the search loading state
Bug: T273093
Change-Id: Ifd7f07411597be844cb7de79e416975261069506
2021-05-07 17:04:42 -05:00
Jan Drewniak 9027d57804 Fix: update to 80d734b4, hide language dropdown when ULS loads
Bug: T276140
Change-Id: I70997fbc54554b8d1b9c271a5ca93f2a47f1ee92
2021-05-07 12:24:30 +02:00
jenkins-bot 840bc5b0cd Merge "Consolidate user links into personal dropdown menu for logged users." 2021-05-06 20:17:33 +00:00
Clare Ming dc0b679bfa Consolidate user links into personal dropdown menu for logged users.
Pull personal menu items except for user page link into a consolidated dropdown menu based on feature flag using Vector hooks. Add consolidate user links feature flag for logged in/out users. Update styles for personal toolbar. Add logic to template to show legacy toolbar or consolidated toolbar based on feature flag variables.

Bug: T276561
Depends-On: If4e143aada711d210ae45d33b97a6be0685b6a41
Change-Id: I1c305d89bece147a6f1b478441119c3169abfbdd
2021-05-06 12:49:39 -07:00
Nicholas Ray 8eba1da250 Silence eslint compat/compat for search performance instrumentation
Eslint is throwing compat warnings on every commit in Vector. This
commit silences those warnings.

Change-Id: I0e914c6179745415e916fadd382d86baa72e3e63
2021-05-05 14:37:35 -06:00
Jan Drewniak 80d734b4d2 Place language button near bottom of Main page.
In modern Vector, the language button that is placed inside
the page header should appear near the footer, if the page is a
Main page.

This changes some CSS selectors to not depend on the language
button having the `.mw-body-header` parent element.

Bug: T276140
Change-Id: I97bf0c11d0321752d472ac4988618a1db92b7271
2021-05-05 13:42:19 +02:00
Roan Kattouw 402b01e0ca search: Prevent double-escaping of messages passed to typeahead-search
The parameters passed to the typeahead-search Vue component don't need
to be escaped, they're already escaped by the Vue implementation. Use
.text() instead of .escaped() for the i18n messages passed to this
component, to prevent them from being escaped twice.

Change-Id: I5dcf442f6af181a99123bf7426743af01b097729
2021-04-29 11:34:48 -07:00
jenkins-bot 2acf0694c9 Merge "[search] Don't destroy #p-search element" 2021-04-22 20:14:21 +00:00
jenkins-bot 5820fa0b18 Merge "Scope right-aligned dropdown menus to #right-navigation & .mw-portlet-lang" 2021-04-21 19:15:27 +00:00
Sam Smith 9914d813d6 [search] Don't destroy #p-search element
The #p-search element is present in at least the Vector, Vector V2,
Timeless, and Monobook skins. This is because the HTML for the element
is generated in MediaWiki Core. At the very least, the
SearchSatisfaction instrument relies on the element always being
present.

Update the skins.vector.search module to simplify the App component
template so that it doesn't render a div#p-search element and mount that
component on the #searchform element instead.

Bug: T274869
Change-Id: Ifde679b62484fda7661fded2d978b78adac9f5da
2021-04-21 14:01:56 +01:00
jdlrobson afaa02ae42 Adjust floating override
Follow up to I3234e7712b8c111b070c35e38425c865ff7213f9
Do not disable the feature entirely as it has other purposes.

Bug: T280260
Change-Id: I47d16eb8186efa83e158713d852b443bce9aee1c
2021-04-15 17:18:29 +00:00
Jan Drewniak f52c2f8a4a Scope right-aligned dropdown menus to #right-navigation & .mw-portlet-lang
Removes the global rule for right-aligning the Vector dropdown menus
and instead scopes that alignment to dropdown menus that appear
inside #right-navigation and the language button in modern Vector.

Bug: T275158
Change-Id: I6c00ccc365f70682841d9eda9d31bbe25c757aa0
2021-04-14 23:31:59 +02:00
Jan Drewniak edd2f4ff85 Reorganize LESS files to match ResourceLoader conventions
Separating most LESS files into 2 ResourceLoader modules and a common
folder:

- skins.vector.styles
- skins.vector.styles.legacy
- common

This changes aims to clearly separate the old (“legacy”), the new
(“modern”) and the common styles which were previously all placed under
`skins.vector.styles/`.

Inside each directory are separate folders for `layouts` and
`components`.

The entry files, `skin.less` and `skin-legacy.less` are moved into the
specific folders and a third, `common.less` entry file is created that
contains the common imports for both old and new Vector.

Aliases have been added to the Storybook Webpack config to avoid adding
the story file changes to this patch. Images coming from CSS `url()`'s
have also been temporarily disabled in Storybook until Storybook can be
upgraded to use Webpack 5, and use array values for aliases, in a
follow-up patch.

This patch also slightly changes a footer layout specific rule so that
existing `padding` remains unchanged in rendering due to new common and
component structure.

Bug: T264309
Change-Id: I1cd2681a2b61edb7be56c38f9bb3994827d7e322
2021-04-08 15:47:56 +01:00
jenkins-bot 2e8f193072 Merge "Remove redundant mw-indicator styles from `layout-default.less` and `layout.less`" 2021-04-06 21:25:04 +00:00
jdlrobson bdd7eaacf1 [legacy] Restore old floating style inside Vector
This is a modified revert of Ia1eec412111e8f6af3b45affdc186d9eafd4262c.
This is not applied to modern Vector, for reasons given on ticket.

Bug: T279008
Change-Id: I3234e7712b8c111b070c35e38425c865ff7213f9
2021-04-05 15:07:07 -07:00
Bernard Wang 55fdf38714 Remove redundant mw-indicator styles from `layout-default.less` and `layout.less`
Bug: T278362
Change-Id: I76f39a9f4cf7404e7d50a272ebce08d53594ef5f
2021-04-05 16:58:41 +00:00
jenkins-bot 1b42cd8dd4 Merge "[styles] LanguageButton: Amend icon color by setting opacity" 2021-03-30 23:10:51 +00:00
Volker E 5a1a382c17 [styles] LanguageButton: Amend icon color by setting opacity
Amending icon color by setting `opacity` accordingly to Design Style
Guide requirements.
Also using `em` base sizing for accessibility reasons in order to
make icon resizable on user text zoom preferences. And adding some
comments and mediawiki mixin usage.

Bug: T277660
Change-Id: Ia226857a38d3b3d5b4583e95905ef55e406c5cb2
2021-03-30 22:13:50 +00:00
jenkins-bot d29bdb86bd Merge "build: Update SVGO to latest v2.2.2 and re-crush SVGs" 2021-03-25 23:17:31 +00:00
Ammarpad b7bf9a88a3 Use content-parser-output RL SkinModule feature
Require MW 1.36

Bug: T277218
Depends-On: I52f752aa782b09a51e2165300cc75d0e47fa3351
Change-Id: Ia1eec412111e8f6af3b45affdc186d9eafd4262c
2021-03-25 17:34:28 +00:00
Volker E 5734191840 build: Update SVGO to latest v2.2.2 and re-crush SVGs
SVGO v2.x changed configuration to JS, amending configuration.
Also re-crushing SVGs.

Change-Id: Id6379e06e6aa1c25760f8489166d354fca25cd52
2021-03-25 09:19:42 -07:00
jenkins-bot 734ced999b Merge "[styles] Remove `margin` normalization already covered in 'normalize' module" 2021-03-24 21:55:36 +00:00
Volker E e5b652852e [styles] Remove deprecated `.box-shadow()` mixin calls and cleanup vars
Removing calls to deprecated `.box-shadow()` as basic browser support
is now given unprefixed. In the course we also replace deprecated
vars with already available ones since MW v1.35 following unified
name scheme on both, box shadow and border ones.

Change-Id: Iae353c934c0995c0b6b2635761352685eb91accb
2021-03-24 14:03:25 -07:00
Volker E c8cd609862 [styles] Remove `margin` normalization already covered in 'normalize' module
Has been introduced before 'normalize' module, now it's time to remove
duplicated style property.

Change-Id: Idff74430655c29b67dfccf97a22f53caaee34155
2021-03-24 13:33:19 -07:00
Jan Drewniak 88dcdab6db Removing temporary `.body` selectors.
Per the comment, it's been a week. These selectors should be removed.

Change-Id: Ifebb7939596827fc8ade7213f3acf6bf80eebb40
2021-03-24 13:53:48 +01:00
jenkins-bot bd6770014e Merge "Inform anonymous A/B test by tracking time from navigationStart" 2021-03-23 18:29:36 +00:00
jdlrobson b183ac3bf3 Inform anonymous A/B test by tracking time from navigationStart
This will inform us on the approach taken in
I315ea30b88e43f3df29b0a0b37907272ec77d0a7

Additional change:
Flesh out TypeScript with eventLogging interface

Bug:  T275807
Change-Id: I9789cd1dfab5181fa093bce46c5c9b0d338339f5
2021-03-23 10:40:20 -07:00
jdlrobson 127422e4c6 Language button skinStyle overrides
* ULS makes the language button text font weight normal on bold,
reset this.
* Because our icon is non-standard our left margin is also non-standard.
Adjust.
* Remove opacity on language button (it applies to more menu because of
the label text color)

Bug: T268241
Change-Id: Ie9b275a857e8bcb7b767446f0523954134751659
2021-03-08 11:11:07 -08:00
jdlrobson 41d30615a2 [modern] Usability improvements to dropdown
* Don't reveal the menu on hover
* Don't flip the dropdown arrow when open
* Menus close when clicked outside

Bug: T275681
Change-Id: I36f5c46422725a935c962be3194fd37bde1fa769
2021-03-07 18:59:41 +00:00
jenkins-bot cf187653a8 Merge "Correct the height of the language button" 2021-03-03 19:53:23 +00:00
jdlrobson ac62386909 Correct the height of the language button
In wvui quiet buttons have a minimum height of 32px
Given the importance of vertical alignment, here inside Vector
seems the best place to define this.

Bug: T268241
Change-Id: I95b61a0c239ccfb7fa1b2ddaa6980ad2737e8f26
2021-03-03 10:03:17 -08:00
jdlrobson 1d01f70e32 Refactor: Separate Language button code into its own JS file
Having this outside the init function makes the code more
easy to understand.

Change-Id: I6bdcb385738ceb986e21075b006db40567386e7b
2021-03-03 00:13:45 +00:00
jenkins-bot 9bdd6c0130 Merge "[icons] Amend 'search' icon" 2021-03-02 18:40:52 +00:00
jdlrobson 8d8e2d85e6 Language button is quiet with focus, active and hover states
* Add mediawiki ui button styles to Vector and convert language
button to a quiet button
* Restore the arrow for language button with ULS
* Vertically align button to first line of header
* Add a storybook entry for LanguageButton

Additional changes:
* Fix issues revealed by storybook - menu dropdown should
reset generic typography rule for `ul` tags
* Allow quotes usage in storybook without disable rule

Bug: T268241
Change-Id: I483350084fb46a51c50af6aab78c62db6d02df89
2021-03-01 20:01:45 +00:00
Jan Drewniak d8bdba0026 Reorganize layout variables
Reorganizes the variables into sections in layout.less.

Also removes a few variables that were only used once for the calculation
of other variables (e.g. `@min-width-container-base`,
`@margin-horizontal-sidebar-button-icon-ems`) as well as
variables that were just multiplied by 2, e.g.
`@padding-horizontal-page-container-total`.

Change-Id: I4a3fc3111f7983a55b7992bee09c03a7ab4092b8
2021-02-24 22:23:07 +00:00
Volker E 35ce451498 [icons] Amend 'search' icon
Following Design Style Guide guidelines slightly decreasing icon on
canvas in accordance with designers.

Bug: T213580
Change-Id: I0ea2426f4e0873b9aac12fe2143203a765e42c3a
2021-02-23 13:01:59 -08:00
jenkins-bot fdd713b244 Merge "Search results should overlay personal tools" 2021-02-12 01:36:06 +00:00
jdlrobson a4f126a76f Search results should overlay personal tools
This removes the problem with the Echo icon being visible on top
of search when the browser is resized to 500px with Echo installed.

Change-Id: I6aba17cb85979617a55e9879518eacdb916ac18b
2021-02-12 00:53:50 +00:00
jdlrobson daf6a798c4 TypeError: data.collapseCondition is not a function
Lots of logspam relating to this error. If data is {}
this error will be thrown which is possible given the
code.

This is possible if a gadget rewrites tabs

e.g.
$( '#p-views ul' ).remove().append($('<ul>'))

Change-Id: I0d3f391fccdb38758fb3cfd7e84889143d479b1e
2021-02-11 21:19:28 +00:00
Jan Drewniak e1f2d2896f Convert max-width layout to relative units
The max-width layout uses a mix of ems and px.
the var `@max-width-margin-start-content` uses ems to define a max
width breakpoint, however the workspace and content containers
`@max-width-content-container` are defined in px.

This leads to layout bugs like the sidebar ovelapping when the base
em unit is not the assumed 16px.

This patch changes the layout px units to ems.

(There should be no visible difference at the assumed 16px font size).

Bug: T270104
Change-Id: If8f284dc5e27c8e1c10f3a6897b7a5e4b8bb357d
2021-02-10 22:58:14 +01:00
jdlrobson 68b989efb6 Simplify responsive Vector implementation
Vector has a wgVectorResponsive flag. This adds a ResourceLoader
module as well

I propose the configuration is repurposed to disable the min-width
on Vector and enable the viewport tag. This will allow us to use
test.wikipedia.org to test Vector at lower resolutions in future
as well as provide a suitable option for 3rd parties wanting to run
a responsive version of Vector that can be opted into using:

```
$wgVectorResponsive = true;
$wgVectorDefaultSkinVersion = '2';

```

As part of this change, the default skin version is set to 2, in
preparation for the next MediaWiki release. Note on Wikimedia wikis we
explicitly set this version so this will not impact any of our deployed
wikis.

Bug: T242772
Change-Id: I878920f49d18c5d60efd3ac45dc7912d2c62086e
2021-02-10 13:05:14 +00:00
Nicholas Ray b8f1d8c8a5 Bring back hoverability of dropdown menu (e.g. "More" tab)
Looks like I72165ba3784da3fcc9d1dd7076b3a6c96e670a2f removed the hover.
This brings it back.

Note this also makes the language button hoverable and will probably
need an additional specific selector (although the language button has
not been enabled anywhere yet)

Bug: T273143
Change-Id: Iac0539313eca5ba8d7ac165d31d2c028e803eacc
2021-02-08 23:11:43 +00:00