Commit Graph

493 Commits

Author SHA1 Message Date
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
jdlrobson 0e0ec99c81 Language button - design fixes
* change color to #202122 (currently it's #54595d)
* padding-right for button text should be 30px (currently it's 40px)
* language icon seems to be displaying at 21x21px (should be 20x20px)
* language icon's margin-right should be 7px (currently is 14px)
* the down arrow should be 10px from the right edge of the button (currently it's 8px)
(requires core change in 661497 to apply)
* increase font-size to 16px (currently it's 13px)
* add a max-height of ~65vh (or something similar)
* add overflow: scroll
* add a border-top (since the menu is wider than the button)

Bug: T268241#6805123
Change-Id: I8891556cb82450db77b90837eeeb72ac78926e29
2021-02-08 19:03:02 +00:00
Nicholas Ray e3abac06a6 Add mw-interlanguage-selector class to language button & hide menu/arrow when appropriate
* We add the `.mw-interlanguage-selector` class to the
.vector-menu-heading in the server rendered HTML. `ext.uls.interface.js`
later attaches a click handler to this selector that loads the rest of
ULS.

* We hide the dropdown arrow for js users and only show it again if
ext.uls.interface module isn't installed or is not being loaded.

* When the `ext.uls.interface` module has been loaded, we hide the checkbox
and checkbox hack menu in favor of showing the ULS popover.

Additionally:

* Adds '.vector-menu-heading' class to menu headings.

* Change h3 selector to `.vector-menu-heading`.

Bug: T273232
Change-Id: I6f4572c16ca4096dcda3aac4d585003b93dcccfa
2021-02-05 15:03:07 -07:00
jenkins-bot 3cb3b08ee5 Merge "Style the language button" 2021-02-05 00:06:21 +00:00
jdlrobson 98e7bce753 Style the language button
For now the core button mixins are used. In the longer
term we should aim to leverage wvui.

Bug: T268241
Change-Id: I334af039567c52462bcb4c15f07242c6de8eeace
2021-02-04 23:02:48 +00:00
jdlrobson 36eda30e0f Language button should use a new id to identify itself
This breaks existing integrations with extensions which will need
to be revisited as part of this redesign.

Change-Id: Iabf627e6926d4574f27448400d76210386ebdaa2
2021-02-04 20:27:13 +00:00
jdlrobson f083eb2716 Add language icon to language button
The sidebar currently uses mw-ui-icon so we continue this
practice, however we provide a general rule to ensure all icons
rendered through it default to 20x20. This didn't impact the side
bar icon as that already specifies a height of 20px.

Bug: T268241
Change-Id: I6f8e8400da048a97cbf59c3e6ad918763fc91041
2021-02-03 15:38:30 +00:00
jenkins-bot 4b171bf74f Merge "After portlet is included in display of menu dropdown" 2021-02-01 11:02:44 +00:00
jdlrobson 3ecc89e5c5 After portlet is included in display of menu dropdown
Bug: T273143
Change-Id: I72165ba3784da3fcc9d1dd7076b3a6c96e670a2f
2021-01-28 14:08:36 -08:00
Nicholas Ray 1e7ed6b2e1 Make expanding search input dependent on $wgVectorWvuiSearchOptions
Per T270202#6767750 the input should expand when focused before WVUI
loads. However, the input should *only* expand when `showThumbnail` is
`true` in `$wgVectorWvuiSearchOptions` to match how its done in WVUI
where it takes into account the size of the thumbnails. When
`showThumbnail` is false, it should not expand as the input won't match
WVUI and the WVUI load transition will be jarring.

To test locally, toggle between true/false in your LocalSettings.php:

```
$wgVectorWvuiSearchOptions = [
  "showThumbnail" => false,
];
```
Bug: T270202
Change-Id: I70277c1082a504fbd5f6023e9873e8071de7e35d
2021-01-26 17:37:22 -07:00
Sam Smith 746315bb5b Add search widget treatment A/B test
If the VectorSearchTreatmentABTest config variable is truthy and the
user is loged in, then pick the Core treatment (defined in the
mediawiki.searchSuggest RL module) or Vector's Vue.js-based treatment of
the search widget based on their user ID. If not, then fall back to
picking the treatment based on VectorUseWvuiSearch.

Supporting changes:

* Update initSearchLoader() in skins.vector.js/searchLoader.js to check
  whether the body.skin-vector-search-vue exists

* Remove wgVectorUseWvuiSearch from the skins.vector.js RL module's config

* Update the performance-related metrics collection to check which
  module is being loaded rather that use the above

Bug: T261647
Change-Id: Idc978392f5db14f0ae2b06ade0175fe534f4ae70
2021-01-26 12:02:01 +00:00
jenkins-bot 93578b0d77 Merge "Create .mw-body-header element for body content" 2021-01-26 02:56:20 +00:00
Jan Drewniak 03d61e12c9 Create .mw-body-header element for body content
For language-in-header feature, edits the <header> element to
contain:
- page title,
- language selector
- tagline (siteSub)
- Indicators

These elements are associated with header/meta content so grouping
them inside one header element makes sense semantically.

Bug: T248761
Change-Id: Ief6c4936d1ebe381432369f8d86419da5f7c6cae
2021-01-25 23:57:47 +01:00
jenkins-bot 27ad6eab12 Merge "Rename `wgVectorUseCoreSearch` to `wgVectorUseWvuiSearch`" 2021-01-25 22:47:49 +00:00
jenkins-bot 407036710c Merge "Align the menu dropdown list to the end of the "more" button." 2021-01-25 22:39:51 +00:00
jenkins-bot 162cf8449d Merge "Languages can be moved out of sidebar" 2021-01-25 22:38:12 +00:00
Jan Drewniak 4a959a6878 Align the menu dropdown list to the end of the "more" button.
Instead of aligning the dropdown list to the starting edge of the
"more" button, this aligns the dropdown list to the end of the
"more" button, preventing any potential horizontal scrolling.

The containing list box is right-aligned, but this does not affect
the text alignment.

Bug: T267325
Change-Id: I8b889f8314519b8c6a74c661aca773b9b546657b
2021-01-25 15:52:16 +00:00
Nicholas Ray 53f49c5c64 Rename `wgVectorUseCoreSearch` to `wgVectorUseWvuiSearch`
This allows better compatibility with FeatureManager (e.g. can use
requirements such as REQUIREMENT_LATEST_SKIN_VERSION). It will become
especially useful in I70277c1082a504fbd5f6023e9873e8071de7e35d and when
A/B testing search.

Bug: T270202
Change-Id: I3a063e0b085765ea1db3c4478fb30c11b0942b75
2021-01-22 16:25:46 -07:00
jdlrobson 355b188db4 Languages can be moved out of sidebar
A new config flag wgVectorLanguageInHeader is added to allow
us to render languages in sidebar or outside sidebar, in the
header.

it defaults to false to allow for further development and to
not disrupt the status quo.

To accomodate the new menu, a new header is added based on the design
in Minerva to contain the heading and language button. The language
button is floated to the right.

The new menu is not styled. That exercise is left for the follow up
task T268241

No caching implications of this change, as legacy and modern
experiences remain touched without changing the default value of the
new config flag

Bug: T260738
Change-Id: I5af1522cac3831c1c833388461fe254c03191f65
2021-01-22 09:10:49 -08:00
jenkins-bot 0867954219 Merge "Allow more control over the max-width rules" 2021-01-21 19:27:10 +00:00
jdlrobson 05dc15954d Allow more control over the max-width rules
Bug: T260091
Change-Id: Ie534b0c34e240c588a4cc330898531f1d12df1f0
2021-01-21 18:51:12 +00:00
jenkins-bot db5f1ebc1d Merge "Use `pointer-events: none` on magnifying glass to prevent submit button behavior and tooltips" 2021-01-15 22:21:06 +00:00
Nicholas Ray 2d57153c08 Only override .mw-page-container horizontal padding on tablet+ viewport width
`.mw-page-container` currently has an intentional non-zero vertical
padding that was being overriden by tablet media query styles. Instead,
only override horizontal padding on tablet.

[1] d525e564db/resources/skins.vector.styles/layout-default.less (L169)

Bug: T271868
Bug: T270146
Change-Id: I736805c9febeb333ea682ba0c70b2ff4768ae397
2021-01-15 11:58:09 -07:00
jenkins-bot d525e564db Merge "Use padding margin-collapse hack instead of overflow" 2021-01-14 22:42:50 +00:00
Ed Sanders 9abf12bbfa Use padding margin-collapse hack instead of overflow
Using the overflow hack breaks scrolling logic in OOUI.

Bug: T271868
Bug: T270146
Change-Id: I4038164efe54a8fb847781a004af98ec74c92cdb
2021-01-14 14:18:38 -08:00
jenkins-bot b0c30102fb Merge "Remove min-height style from #searchButton, #mw-searchButton" 2021-01-14 22:16:18 +00:00
Volker E 26126d15e4 [styles] Ensuring correct rendering height of search button in Safari
Overriding weird UA styles to ensure maximum click interaction area on
search button in no-JS and JS environment.

Bug: T272089
Change-Id: I8600402e022c041da29b31bf828198843c2ad7c6
2021-01-14 13:22:01 -08:00
Nicholas Ray de88675570 Use `pointer-events: none` on magnifying glass to prevent submit button behavior and tooltips
Follow up from Ibab9992a6aa3a60f83324b40017b53fb061991d7 (please refer
to that commit message), but using `pointer-events: none` to remove all
submit button behavior (submit behavior, cursor change, and tooltip).

Bug: T270202
Change-Id: I2bd8e88f1f497cc3b2d88c7fdad33c812d13a40a
2021-01-13 16:25:03 -07:00
jenkins-bot 7273a5194c Merge "Change magnifying glass cursor from pointer to default (arrow)" 2021-01-13 22:50:02 +00:00
Nicholas Ray ef700c4a6a Set Vector search variables relative to @font-size-base factor and increase max-width
T270202 shows the correct dimensions of the search component having a
max-width of 500px and min-width of 350px but since we set the font size
of `#p-search` to `@font-size-base` [1], I suspect the search related
variables need to account for this factor as well.

This increases the max-width of search to 500px per the spec.

[1] 30eb683a70/resources/skins.vector.styles/VueEnhancedSearchBox.less (L23)

Bug: T270202
Change-Id: I13ad550734e8a5347ed70e4b3c33102b4a13bde7
2021-01-13 22:18:57 +00:00
Nicholas Ray ab4a41426d Change magnifying glass cursor from pointer to default (arrow)
Before WVUI loads, we show a magnifying glass at the start of the input
that visually mimics the magnifying glass start icon in WVUI's typeahead
search component. Unfortunately, this element is a submit button in
Vector instead of the inert span element used in WVUI.

Although the submit button is useful for no-js users, it might be
confusing for js users. Ideally, an inert element like a span would be
used instead, but that deserves its own ticket. As a temporary easy
stopgap, changing the cursor to be an arrow instead of the pointer might
make this less confusing and discourage clicks to it.

Bug: T270202
Change-Id: Ibab9992a6aa3a60f83324b40017b53fb061991d7
2021-01-13 15:15:32 -07:00
jenkins-bot 4316db55d5 Merge "Vector should support lower 500px resolution" 2021-01-12 23:09:22 +00:00
jdlrobson 6f1c2cfd73 Vector should support lower 500px resolution
* Lower the min-width from Vector to 500px

At lower resolution per mock:
* Tabs converge into single grouping
* Search input is 150px
* Sidebar rushes content below

Drop rule for mw-content-container for special pages and history as it is already
accounted for in .mw-checkbox-hack-checkbox:checked ~ .mw-workspace-container .mw-content-container
rule.

Bug: T264218
Change-Id: I14ee75bd173fb2de1e33067f95ce09deba5bf27a
2021-01-12 14:18:45 -08:00
Nicholas Ray dd0199a060 Remove min-height style from #searchButton, #mw-searchButton
These buttons are already absolutely positioned with their `top` and
`bottom` styles set. More importantly, the min-height style is causing
the buttons to not be vertically centered in Safari.

Bug: T270202
Change-Id: I21b88af4313249d8b2b775c32d12aa1f65c2d0c2
2021-01-12 11:01:19 -07:00
Nicholas Ray 37f6ff02df Sync Vector styling with latest changes in WVUI
* In Iecc3eebf0dce495400ba3d644dce39186f4fa395, a border was applied to
`.wvui-typeahead-search` to make it appear like the input box contains
the search submit button. Because of this change, we can't apply a
max-width to #searchForm when WVUI loads as it will cause the border to
extend farther than it should. Instead, we apply the max-width/other
styles to `.wvui-typeahead-search` (WVUI search's root container) and
`#p-search`'s direct child after WVUI loads.

* In I0ec3dcedaea90b01fe94e3416ee68ea33b782b4b, the start icon was moved
1 pixel to account for the input's border. These changes sync with the
changes to WVUI.

Depends-On: I0ec3dcedaea90b01fe94e3416ee68ea33b782b4b
Bug: T270202
Change-Id: I0ffd0a9225a5a9b935e09748d78ac45b17623790
2021-01-11 17:02:45 -07:00
jdlrobson 9f1a1fa829 Simplify menu code
SkinMustache in core provides most of what is required for Vector to
generate its menus.  In the interest of having a canonical source of
truth for menus across all skins, Vector should use this data.

To ensure the HTML generated is (mostly) the same after this patch to
prior, a few modifications are necessary:

* The data from core is decorated so that Vector can continue having its
  own custom class names on menus. This is done using the
  decoratePortletClass method.
* There is no support for a menu having a header representing the
  selected menu item, as is currently the case with variants. This is
  achieved via an extension to getPortletData. It's assumed that later
  when variants are merged with languages, this can be removed.
* Menus are agnostic to how they are displayed, so we must continue to
  add the is-dropdown template variable to drop down menus. In future we
  may want to rethink our Menu partial to make this unnecessary in PHP.
* The portal-first class is redundant in the modern Vector as we can
  use the first-child selector. Previously we introduced a class to
  service the legacy skin where this rule doesn't apply as #p-logo is
  the first child.  However, the legacy skin can do this using a special
  next sibling selector instead.

Bug: T268157
Change-Id: I5f7adc1840441b508ffee40139b85b64021789e6
2021-01-04 19:02:34 +00:00
jdlrobson 289f1d48f5 Gadgets can change the search API
```
mw.config.set('wgVectorSearchClient', {

   fetchByTitle: function( query, domain, limit ) {
      var xhr = fetch('http://' + domain + '/w/rest.php/v1/search/title?q=banana')
      .then(function (resp) {
          return resp.json();
      }).then(function (json) {
         return {
             results: json.pages
         }
      });
      return {
         fetch: xhr,
         abort: function() {}
      }
   }
})
```

This should be the absolute minimum to allow API clients to configure
the search. This should be considered an interim solution to buy us time to work out a more
elegant way to do this e.g. do this in the API itself…

Bug: T262566
Change-Id: Iac6f2551bed911980064dcb023193f800df0934f
2020-12-23 12:16:29 +00:00
Nicholas Ray 0fdd4a99ac Sync location/other styles of #mw-searchButton with #searchButton
`#mw-searchButton` is apparently used with no-js clients or if the
js-search is broken [1]. Its position and dimensions should be kept in
sync with #searchButton.

This commit:

* Ensures that the same styles, including position, applied to #searchButton
are applied to "#mw-searchButton" so the dimensions are identical. This
should also address a critique in T270202 by removing the "invisible
button".

* Applies a `client-js` selector to ensure these buttons are
only positioned to the left of the search input if js is enabled. If js
is not enabled, having these positioned to the left is confusing as the
input has no obvious "submit" button.

* Syncs the input's end padding to match WVUI's input's end padding if
JS is enabled.

[1] 465e9492bb/includes/templates/SearchBox.mustache (L12-L21)

Bug: T270202
Change-Id: Ie1bb8c68b713b3a18f90ee11b44c78b436a6d0ba
2020-12-18 11:14:19 -07:00
Nicholas Ray 465e9492bb Remove suggestion link underline on hover and li bottom margin
Per T270202, there should be no underline on hover. The underline is
coming from a style in core.

There should also be no bottom margin on the suggestion li elements. The
bottom margin is also coming from a style in core.

Bug: T270202
Change-Id: I215a41aa328366aee2bb552d5d49c95905fd37f2
2020-12-17 10:06:29 -07:00
Nicholas Ray 720bd0e6b7 [modern][styles] Use @size-search-figure variable in padding-left calc
This variable is used in the same way in WVUI.

Change-Id: Ib7a6d7bb456b3179c3b2eae4b1b0da064fe1f79c
2020-12-14 17:04:33 -07:00
Volker E 595870baeb [modern][styles] Amend Typeahead component styles in modern
Following Design Style Guide components sizing and Alex' feedback
on task. Changing applied styles scope to non Vue.js enhanced,
modern-only style of search component as well, in order to have
clean appearance and transforming disruption free.
Also changing em static values to LESS calculations for more developer
friendliness and change background-size to be `em` as well for
user-set typographic zoom preference ability.

Bug: T269959
Change-Id: I157712721621344171a32a8887a5e20cc16cae0d
2020-12-14 11:37:14 -08:00
Volker E 816836c2ae [modern][styles] Shift search bar to the left
`@margin-horizontal-search` is used for margin of search component
and for personal tools, but they are also floated right so one only
gets a clearer picture of this change when the canvas is exactly at
one specific size.
Additionally it's used for a media query, so the min-width is slightly
reduced (by 32px equivalent) as well. That's advantageous too.
At some point we're going to change this to `rem` unit, that's why I've
taken distance from changing it to a `px` value for now although devised
differently before.

Bug: T269959
Change-Id: I21cac3f049eed64520dd229ef80d10f9be853e0e
2020-12-14 08:12:01 -08:00
Jan Drewniak 8afa6f4440 Improve visual similarities between Vector and WVUI search forms.
Modifies and annotates the CSS required to make the server-rendered
version of the new search form look like the WVUI version of the
search form.

Bug: T264355
Change-Id: I989860cfbb755ecbb706b79bd807e9d0013bc4e5
2020-12-09 16:04:45 +01:00
jenkins-bot a9b47f57fb Merge "Development: Allow us to test search with different API hosts" 2020-12-09 00:14:43 +00:00
jenkins-bot 454611f60a Merge "[search] Add Vue search performance instrumentation" 2020-12-09 00:06:32 +00:00
jenkins-bot 707862df60 Merge "[search] Instrument Vue.js-based search widget" 2020-12-09 00:06:30 +00:00
Nicholas Ray 3aaedcfe3c [search] Add Vue search performance instrumentation
This is almost identical to the instrumentation currently used in
production for mediawiki.searchSuggest -- the only differences being in
the nomenclature of variables, etc.

As part of comparing Vue search with legacy search, we need to track how
long it takes a keypress to load and render search results for Vue
search. This will only be used only in synthetic testing at this time
(Real user monitoring (RUM) is not in scope for this ticket).

To test locally, first enter characters in input. Then to see the
metrics recorded:

```
// View all marks
performance.getEntriesByType('mark');

// View all measures
performance.getEntriesByType('measure');
```

This commit adds the following metrics which will only be used in our
synthetic tests. We are not collecting RUM metrics at this time.

Measures:

* mwVectorVueSearchLoadStartToFirstRender: Measures the time it takes
from the start of loading the search module to the first render of results.

* mwVectorVueSearchQueryToRender: Measures the time it takes from
the start of the fetch to the render of search results.

Bug: T251544
Change-Id: I39200648a3a0a4079a132134d142ad8997c8962a
2020-12-08 23:41:28 +00:00
Sam Smith aa10668e6d [search] Instrument Vue.js-based search widget
Add event listeners and associated helpers to emit SearchSatisfaction
events via the `mediawiki.searchSuggest` protocol.

Bug: T257698
Change-Id: Ica040cd18d6c4bf8a1b1f607bb4647c7e8eb7108
2020-12-08 23:41:19 +00:00
jdlrobson dce24c9784 Development: Allow us to test search with different API hosts
By default the API uses location.host as the host, however during
development it is useful to test against production wikis

For example to test against English Wikipedia:
$wgVectorSearchHost = 'en.wikipedia.org';

Note: Links when clicked will not take the user to the target page, and
instead will take the user to the search results page with a link to
create the page.

The following config can be used to workaround that page:
$wgDisableTextSearch = true;
$wgSearchForwardUrl = "/w/index.php?title=$1";

Change-Id: I5fbac7f54844d7a9d6976007bc0d0ff9938b9f2b
2020-12-08 15:22:45 -08:00
jenkins-bot b8e8655af3 Merge "Add Wvui Config to show/hide thumbnails and descriptions" 2020-12-08 22:25:18 +00:00
jenkins-bot 3c6c8ebbba Merge "Integrate WVUI search into Vector" 2020-12-08 22:18:38 +00:00
Nicholas Ray e0c47dc462 Add Wvui Config to show/hide thumbnails and descriptions
Uses ResourceLoader's virtual config feature to get the config and pass
it down to Wvui's typeahead search component.

Disclaimer: I'm a typescript noob and am not sure if the
config.json.d.ts is correct although it seems to make tsc happy.

Bug: T260167
Change-Id: I2eced14c7df3b795b4de0e5149c2ca9fd598c7be
2020-12-08 13:28:42 -08:00
Jan Drewniak bd83398659 Integrate WVUI search into Vector
Creates a new skins.vector.search module that
replaces the searchSuggest module from MediaWiki core.

This module creates a new Vue app using the WVUI
search widget for the new search experience.

The legacy search input form is still retains on pageload,
and the new search kicks on search input focus.

In order to manage that transition, the legacy search
input is styled to resemble the new WVUI input, and the
new input is manually focused after the component mounts.

Vue is also added as a dev-dependency to help with
type-checking.

Other changes:
* the entry in skin.json is reordered alphabetically after
skins.vector.js

Bug: T264355
Change-Id: Ibb9561a77a14734297cb4d0ddcd415fc0750b45d
2020-12-08 13:27:12 -08:00
Volker E 795de73496 Amend standard 'search' icon size, position and CSS rules
Updating 'search' icon to latest WVUI/OOUI optimized, reduced path. Also
- amending size of search input and position of icon in input slightly to
  align it closer to standard text inputs
- simplify CSS by getting rid of selector which is targeting both, input and
  button and applying rules only where needed
- fixing code comments
- increasing icon size to `16px` equivalent `em` to enable user text zooming
  preference applied to search icon as well. `16px` is a compromise towards the
  old look and feel of the previous icon bringing it closer to standard icon size in
  legacy Vector.

This change affects both modern and legacy versions of Vector.

Bug: T266166
Change-Id: Ib4c0c74d3cac30e1893f4c76e56e1197652d41ba
2020-12-07 12:19:01 +00:00
Jan Drewniak 125fa03395 Update Vector search icon
Replaces vector search icon with an update version that is
copied from the OOUI icon set and used in WVUI search.

This update will help us unify the visual appearance of the
existing search input with the one in WVUI.

Bug: T264355
Change-Id: I34792ee80e711b10b441668cc4ae18cc0cc9daa6
2020-11-26 13:19:11 +01:00
Nicholas Ray 0492bc5fb8 Apply static positioning to mw-footer-container
There are popovers such as the discussion tools "Add a link" popover
that need to stack on top of the footer. This replaces the
mw-footer-container's `relative` positioning with `static` positioning
which is one possible solution to this problem.

Alternatively, the popover could be appended to the end of the body
after the footer and positioned absolutely.

Bug: T264679
Change-Id: I34168c181a1e05c33cd42f664fcccb25abd4519b
2020-11-18 18:10:20 +00:00
jenkins-bot 9ccd8e2c23 Merge "[modern][styles] Remove unnecessary `margin-top`" 2020-11-17 14:03:40 +00:00
Ed Sanders 1dccf67d0f Follow-up I43a6951: Remove unnecessary only-child selector
An only-child will match first- and last-child selectors
so this additional selector is not required.

Change-Id: I17d468ba2bda37edc4e54f42f42d50e4b8831b46
2020-11-16 22:39:17 +00:00
Volker E b0e54eec45 [modern][styles] Remove unnecessary `margin-top`
Following-up Iecb0d6c4c80cee1d1684597a6dedf7323e2ec54d.
It isn't set anywhere inherited, hence we don't need to set it here.

Change-Id: Ife24aa95e6d1830b8d50001976277dbb2535c47f
2020-11-09 07:49:56 -08:00
jdlrobson f99946236a Cleanup: Merge layout-max-width.less into default layout rules
* Drop some unused variables
* Drop global variables.less per max width FIXME

Bug: T258116
Change-Id: Iecb0d6c4c80cee1d1684597a6dedf7323e2ec54d
2020-11-06 20:21:56 +00:00
jdlrobson 717506b9c0 Cleanup: Merge layout-search-header.less into default layout rules
Dropped all usages of the no longer applicable `skin-vector-search-header-legacy`
class.

Bug: T258116
Change-Id: I16a5cf8dda2ab84ff4b505d5a368587190c409cd
2020-11-04 14:30:13 -08:00
jenkins-bot 924c751421 Merge "Unify blockquote spacing and border style with Design Style Guide" 2020-11-02 23:27:26 +00:00
Volker E 0884f55767 Unify blockquote spacing and border style with Design Style Guide
Unifying blockquote spacing and border style with Design Style Guide.
Also ensuring that blockquote children don't apply inherited whitespace.

Bug: T265947
Change-Id: I43a6951c17376fe3fdd4d24966ec4661c18ffd87
2020-10-30 13:38:01 -07:00
Jan Drewniak 4ff30a16a0 Convert personal menu to use flexbox alignment.
Uses flexbox alignment to resolve an issue where the
clickable area of the notification and alert icons were
overlapping with the links next to them.

Bug: T264339
Change-Id: I2afc12504d7184583fa8331479125474c68017dc
2020-10-29 15:53:56 +01:00
jdlrobson 0bba957a37 Reduce min-width so it doesn't include personal tools
Now the header is no longer absolutely positioned the height is not
fixed and the personal tools can safely spill onto a new line

Bug: T264206
Change-Id: Ib2a3cf1907c7d06c2c92ccbd902a98a3f8242f37
2020-10-28 20:05:55 +00:00
jdlrobson eda19bd6e4 Remove SearchInHeader requirement/feature
Styles will be cleaned up further in a follow up.

Bug: T258116
Change-Id: I878239a85ffbecb5e78d73aed5568c56dbd7d659
2020-10-28 20:05:28 +00:00
jdlrobson 61558af56f Fix logic in collapsibleTabs code
Follow up to  6d967ed4a8c
Add the missing ! to check that the portal is hidden rather
than visible to restore the correct logic.

Bug: T71729
Change-Id: I29f6f5e1e6adf3d6d9795cbdabcc152c5d5ac28f
2020-10-23 09:59:29 -07:00
jenkins-bot 99f9597109 Merge "Add client-side performance metrics for searchLoader" 2020-10-15 08:47:18 +00:00
jdlrobson 839876ba82 Use variables for padding content
On the long term we want to provide access to these variables in other
extensions. e.g. VisualEditor

Bug: T259331
Change-Id: Ibbc6f1905ea384a3d159088e3f5eca947eb6ec08
2020-10-13 21:26:08 +00:00
jdlrobson da26e09bca Vertically align personal tools
Bug: T264339
Change-Id: Ic9df8c1cea0fef82461a84190689791ce2275812
2020-10-13 19:39:12 +00:00
Nicholas Ray 8cf278d305 Add client-side performance metrics for searchLoader
As part of comparing Vue search with legacy search, we need to track how
long it takes to lazy load the wvui library. A similar metric was added
to measuring the mediawiki.searchSuggest module in
I0fa6b8904bd43c87a68e9161f00d686a0e588966.

This commit adds the following metrics which will only be used in our
synthetic tests. We are not doing RUM tests at this time.

To test locally, add the following to your LocalSettings.php and append
the query param `useskinversion=2` e.g.
(http://localhost:8181/wiki/Test?useskinversion=2):

```
$wgVectorUseCoreSearch = false;
```

Marks:

* mwVectorVueSearchLoadStart: Marks the start of loading the search
module.

* mwVectorVueSearchLoadEnd: Marks the end of loading the search
module.

Measures:

* mwVectorVueSearchLoadStartToLoadEnd: Measures the time it takes to
load the search module.

Bug: T251544
Change-Id: I14e44b45a66213821d69cd22395fedbae747da88
2020-10-09 13:26:28 -06:00
jenkins-bot 178a552ad1 Merge "[icons] Re-optimize SVGs with SVGO and manually" 2020-10-06 23:23:15 +00:00
Volker E a6288523d3 [styles]: Remove IE 8 workaround
Change-Id: I8ec8899aba282d4b232cc86f8683e53ea9c30f06
2020-10-06 16:48:09 +00:00
jenkins-bot d8750377f3 Merge "Drop unsupported skin CSS classes" 2020-10-05 19:32:55 +00:00
jenkins-bot 6516a93085 Merge "[docs] Add support note to `linear-gradient` fallback" 2020-10-05 19:03:34 +00:00
Volker E b23a809c44 [docs] Add support note to `linear-gradient` fallback
Change-Id: I9db03e4f2a0fe3eb52aeb9273f871150d2c93375
2020-10-05 18:41:26 +00:00
Jan Drewniak 5718afbc37 Adjust the left-alignment of the sidebar
Bug: T257395
Change-Id: Iae03d45b2d21be7e4635646c57480c0ced770419
2020-10-05 18:19:10 +00:00
Volker E 7bbad93bc4 [icons] Re-optimize SVGs with SVGO and manually
- Reducing precision to 1 decimal point (no visible change),
- adding `title` tags where useful,
- reducing paths,
- removing unnecessary `g` elements and
- lowercasing hex colors

Change-Id: I77ee08fbdb54d529f34576b076def985407b3bc2
2020-10-05 10:27:33 -07:00
jdlrobson 89fee04f0b Drop unsupported skin CSS classes
Drop support for vectorMenu, vectorTabs and
vectorMenuCheckbox, body, menu selectors in preference
for standard selectors.

This change will impact a large amount of user scripts/styles but should
not impact any gadgets.

These classes were kept around for user scripts and styles however are not
needed internally. As we transition to a more maintainable skin menu
system, it is time to lose these selectors even though this will cause
disruption.

Vector now will use the mw-portlet class rather than the vector-menu
class in its own CSS styling, however it keeps the other classes to
allow differentiation of the different types of menu.

Changes to test: Previously the tests assumed all portlets were empty
when checking the classes. This is very rare, so its better to check
the classes of non-empty portlets, so several tests are updated
accordingly to drop the emptyPortlet class.

Bug: T262092
Change-Id: I1824335eb47d613c2a4804ec1f1106c0f4c16101
2020-10-01 19:50:24 +00:00
jdlrobson 711a41812a Use newly available Skin::getPortletData method to get mw-portlet class
Kept as simple as possible for now. The new class is added but no classes
are removed. This will be done in a follow up.

Bug: T256897
Bug: T253938
Change-Id: Ib31a9d8f2ac14e63b63e82abd4a9aa1fcb956f45
2020-09-29 00:09:26 +00:00
jenkins-bot c9645fe691 Merge "Prevent Vector tabs from overlapping search loader" 2020-09-28 13:31:09 +00:00
Jan Drewniak 422955e160 Prevent Vector tabs from overlapping search loader
Bug: T254695
Change-Id: I8391407b8efa5b8165f8b2c33de8849de642ecb5
2020-09-28 12:15:13 +02:00
jenkins-bot 57e069ba81 Merge "[styles] Make Trident workaround value a variable" 2020-09-22 15:06:25 +00:00
Ed Sanders 21d4716612 Follow-up I673c28c2: Only apply clearfix to main content area
Bug: T254195
Bug: T263445
Change-Id: I693cd3d4d32501a2a4ab20140a662943fba22bb6
2020-09-21 13:23:48 +01:00
Timo Tijhof 7e0731de48 Implement mediawiki.skin.variables.less for Vector
For now, only define:

- @font-family-sans
- @border-radius-base

Bug: T112747
Depends-On: Icf86c930a3b5524254bb549624737d3b9dccb032
Change-Id: I47da3046678117d5214354d1efe635f32f307dad
2020-09-16 08:39:13 -07:00
jdlrobson 9b31740514 Reduce max-width and adjust margin-left
* The margin-left should only be auto at small resolutions - otherwise on large
monitors it becomes visually separated from the logo
* the margin left should be larger
* and max width should be smaller.

Bug: T261686
Change-Id: Ia1331f51764a34f113e3336735e6cfd5fde1d49d
2020-09-11 14:54:58 +00:00
Jan Drewniak df3954eff8 [IE9] Layout flex-box adjustments
Minor visual fix for IE9 for modern mode with search not in header.
i.e. with these settings:

    $wgVectorIsSearchInHeader = false;
    $wgVectorDefaultSkinVersion = 2;

Slight refactor of CSS. Removes block of styles that "reset" floats.
These were uneccessary because as flex-children, the floats were
ignored on those elements anyway.

Moves flex-wrap on .mw-header from layout-search-header.less
to layout-default.less since that's where display:flex is defined
and the rule is general enough that it should apply for different layouts.

Remove the @supports block with the `float:none;`. That is unnecessary
because flex-children are not affected by floats.

Change-Id: Ida3d2a7bc2b2f70238129df876714228fe5cdf84
2020-09-10 20:10:19 +00:00
Nicholas Ray 78787d9665 Switch to navigation-first DOM order under `$wgVectorIsSearchInHeader` feature flag
This moves the header, navigation, sidebar, and article toolbar to be
before the content in the DOM. As a result, a lot of absolute
positioning logic can be removed and styles can be simplified.

Note that although the sidebar was moved from the header into the
workspace container allowing it to de-absolutely positioned, its
absolute positioning was kept intact as it has a fair amount of
complexity that should be handled in a separate task.

To activate, set  `$wgVectorIsSearchInHeader = true;`

Changes that could cause concern:

* The "jump to search" link was removed as the search is now much
earlier in the DOM and I questioned the value of keeping this. However,
it can be added back in if this change is contentious.

* A "jump to content" link was added to account for the new DOM order.

* Because the sidebar was taken out of the header, users will not be
able to tab from the sidebar button into the sidebar without additional
tweaking (e.g. should we add JS to enable this?). It was deemed that
this work can be saved as a follow-up task.

* I applied `overflow-y: auto` to the `mw-page-container` because the
header's top margin was collapsing and caused whitespace to appear
between the viewport and the header. Alternatively, we could apply a top
padding to the page container and remove the header's top margin. I went
for the simplest solution but am open to alternatives.

* I left the footer as-is in this patch to minimize risk. It might be
cleaner later on to move the footer inside the workspace container which
would leave only one workspace container.

Bug: T261802
Change-Id: Ic553fab3bde25769b103d899b92b3b694c00c384
2020-09-09 18:31:35 +00:00
jenkins-bot b65de993dc Merge "Adds loading indicator for new search module" 2020-09-08 14:24:09 +00:00
Jan Drewniak 1dad545f63 Adds loading indicator for new search module
Provides a loading indicator to show while the new Vue.js based
search widget loads. Given that the new widget will pull down the
entire Vue.js runtime, it's likely that there will be a delay
before the search suggestions appear. This loader is meant to
improve the perceived loading experience of the new widget.

Adds:
- New searchLoader.js file containing loading behaviour.
  - This overrides the code searchSuggest loading behaviour.
- New SearchBoxLoader.less file containing the loader styles.
- i18n message: 'vector-search-loader'.
- The Event type to jsdoc.json

Bug: T254695
Change-Id: I6b5f0a60018954e10b9e80792030b67b2ec33e5a
2020-09-08 13:59:41 +00:00
Stephen Niedzielski f5323d9bf1 [search] Tweak the search input styles
Update the search input styles to match WVUI.

Change-Id: Id7f88c31eb662cc859d7e465f85631d7a8cbe184
2020-09-04 14:49:50 -06:00
jenkins-bot 6ae5cf8064 Merge "Reduce space between sidebar and content" 2020-09-03 17:22:33 +00:00
Jan Drewniak 5a8bb57b55 Reduce space between sidebar and content
Bug: T259761
Change-Id: Ieb7a49e1239fe4e0d2866a1433f9dde0141c0b3d
2020-09-03 13:18:52 +02:00
jenkins-bot dd178231c1 Merge "Flush search to right on smaller resolutions" 2020-09-03 09:59:59 +00:00
jenkins-bot 53f0b183e8 Merge "Remove the loading background image for loading class" 2020-09-02 19:38:20 +00:00
hmonroy 4169fc6dc1 Remove the loading background image for loading class
The star should spin its current background image when transitioning between different
watch requests.

Bug: T259053
Depends-On: I1e11f0e129c53b405a2ffa8
Change-Id: Id2f9b2e25761c052aeaa410edead65ec298209a2
2020-09-02 11:42:49 -07:00
jdlrobson bd8bfa8deb Flush search to right on smaller resolutions
Bug: T261686
Change-Id: I30985009c05e64bff5aaa240f7c3970475fe0fba
2020-09-01 15:53:20 -07:00
jenkins-bot d4663ef0ec Merge "Accommodate longer user names in personal tools" 2020-09-01 22:20:21 +00:00
jdlrobson 43e9776142 Accommodate longer user names in personal tools
The width should apply at all resolutions. Note, because of the nature
of flex box and flex-grow the personal tools can grow larger than this
value.

This avoids Alex Hollender (WMF) and similarly long usernames from every
running to the next line before they are allowed to.

Bug: T249363
Change-Id: I4640947aaaf7ab764cb17b911af7085ac291b7d1
2020-09-01 12:10:08 -07:00
jenkins-bot 8b70eec55d Merge "Include @padding-horizontal-page-container in header adjustment calculations" 2020-09-01 11:21:41 +00:00
jdlrobson 287e577cfd Drop legacy selector from Vector
This is no longer needed.

Change-Id: I537dbbcf007860f74feefe3b61f95561969344d6
2020-08-28 12:52:49 -07:00
Volker E 5bffb899a8 [styles] Remove Internet Explorer 8 specific hacks and workarounds
Bug: T261378
Change-Id: If51f20137a001276800fafb97ed4ceb53617ae79
2020-08-27 01:34:13 -07:00
Volker E fdde3192fa [styles] Make Trident workaround value a variable
Carved out from I8e6e283db5d4034861f8d50d9b3f211df1a78c6c.
It makes sense to have a variable defined for that value.

Change-Id: Iaaca1fd7c15a0c121e60b5ae6debf4bf6920168e
2020-08-27 01:27:50 -07:00
jdlrobson 6659be5b49 Include @padding-horizontal-page-container in header adjustment calculations
I overlooked the horizontal padding on the page container. This needs to be
included in the decision on whether to make the header 2 lines on 1.

Bug: T249363
Change-Id: I4fabac7d57e37db87d2363073317109f582de883
2020-08-26 14:33:22 -07:00
jenkins-bot b98872714a Merge "Allow personal tools to span 2 lines" 2020-08-19 17:20:41 +00:00
Volker E 5b563ba9f9 skins.vector.styles: Remove obsolete linear-gradient hack
Following up I6bc4cf541eefd00e2e42 we also need to remove the
linear-gradient hack that only made sense in combination with the
now gone PNG fallback background-image.

Change-Id: I0e7ed0451884a6bd612cb1082555338a26129e2d
2020-08-18 20:50:19 +00:00
jdlrobson aa45edd2f2 Refactor: Drop legacy selectors
These are no longer needed. The classes remain where necessary for
gadgets but the CSS rules no longer need to apply to them.

Change-Id: I18afa15ddab75128463dc83c916e11436db0575a
2020-08-18 12:39:13 -07:00
jdlrobson 370add977c Allow personal tools to span 2 lines
The calculations were a little incorrect as I failed to consider the
sidebar button correctly and how the search's min width and max width
impact layout.

I also move rules from Sidebar.less regarding the placement of the button
into layout where I believe they belong.  We do not have a header component, so the
positioning (margin) of the sidebar button in current form should be here.

This can be revisited if we introduce a header component.

Bug: T249363
Change-Id: I4ff640380eafc8beedb2c3c8fb00a56c71c5cb45
2020-08-18 11:42:18 -07:00
jenkins-bot 4b6b46631c Merge "skins.vector.styles: Remove PNG fallback and merge skins.vector.icons module" 2020-08-18 11:51:56 +00:00
jdlrobson 8a2ffe0722 Search in header: fix break point
The width comfortable should consider the max-width of the search
not the min-width.

This fixes the bug documented in T249363#6391041

Bug: T249363
Change-Id: I3e216a3705730092f88d1dcbb5193e411945a083
2020-08-17 14:36:01 -07:00
Nicholas Ray 7a769a0374 Apply @min-width-supported to .mw-page-container
As part of moving search into header work, a min-width (via
@min-width-supported variable) was introduced on the body and takes
effect when the search feature is enabled.

However, given a min-width already exists on the page container from the
max-width work, I'm wondering if it makes sense to replace that one with
the @min-width-supported variable as it seems like we should only have
one min-width vs. having two.

Note: As a bonus, this has the (unintended but helpful) side-effect of
mitigating the sidebar button being blocked by the personal menu at
small viewport widths (T258465).

[1] I7f8059d43eaab49de362405784b34a4fe502c7b0

Bug: T258465
Change-Id: I920cd0e9d1564c82bcdc89b721352620158073c6
2020-08-13 17:11:48 -06:00
Timo Tijhof 31c5273ef9 skins.vector.styles: Remove PNG fallback and merge skins.vector.icons module
* Remove the PNG fallbacks for chevronHorizontal-….svg and menu.svg.

  As of T248061, these are no longer needed.

* Added the one line of trivial CSS directly to skins.vector.styles
  instead of through its own module.

  This helps recovers the module cost of vue module deployed this
  week (from  Ib6c8f890fb3d6e7), which is currently empty and unused.

  With T253582, we'll be able to recover a lot more budget in
  this area.

Bug: T258766
Change-Id: I6bc4cf541eefd00e2e428f918664a26da331c1a9
2020-08-13 13:53:46 +01:00
jdlrobson 53d9452795 Move the personal tools and search into header
To support roll out and avoid issues with cached HTML the new
styles for the new search feature are restricted to HTML where
the body tag has `skin-vector-search-header` class.

For legacy mode, we introduce a new class
`skin-vector-search-header-legacy` and temporarily use a CSS3 `:not()`
selector to ensure the styles ship during the phase where cached
HTML can be served. While this will create some display issues in
browsers that do not support CSS3 selectors, all grade A browsers in
our compatability matrix support this.

Bug: T249363
Change-Id: I7f8059d43eaab49de362405784b34a4fe502c7b0
2020-08-11 23:36:01 +00:00
jdlrobson e3a986f587 [modern] Layout index file.
Keep variables concerned with layout in the master file but pull out
the default layout into a separate file.

Change-Id: I4acc2937f8e8a76274a3ffb76e3729dc89ce1ad7
2020-08-11 20:45:38 +00:00
jenkins-bot 05a82f6069 Merge "Vector manages search functionality and provides config flag" 2020-08-04 17:53:05 +00:00
Peter Ovchyn 7b8bad23f2 Vector manages search functionality and provides config flag
Add onSkinPageReadyConfig hook that overrides module after page loaded
The new module is currently empty pending further work in the
feature branch.

Depends-On: I0dc38e74052027f26a70d58b5f520e5830e0d55d
Bug: T257706
Change-Id: Ib6c8f890fb3d6e751f5f01a6576614b9cc9b440c
2020-08-04 00:06:31 +00:00
jdlrobson f92e40152a Print: Add layout print styles on Ctrl+p and ElectronPdf
Bug: T253842
Change-Id: Ia7104a30a37a13cbeb6cfa4bdf1ee50ee677a87a
2020-08-03 20:06:37 +00:00
jenkins-bot edb3fef5b9 Merge "Refactor: Replace PHP complexity with JS simplicity" 2020-08-03 18:47:09 +00:00
Volker E b0ccdc5892 [less] Remove normalize rules covered by mediawiki.skinning/normalize module
`padding: 0` was either a rule targeting very early Operas or
Netscape/Firefox or came out of Eric Meyer's reset.css as
misappropriation.
normalize.css haven't had it in v1.0.0, only relied on `margin: 0`
normalization for IE 6 & 7.

Change-Id: I3d2894a1e68414b64751bd6ebe7e1af77d260ee7
2020-07-31 22:21:25 +00:00
jdlrobson ed7fd252cd Refactor: Replace PHP complexity with JS simplicity
In PHP we add collapsible classes to all elements except watchstar
so that certain tabs can be collapsed under the more menu in JS.
This adds unnecessary complexity to our codebase and is not used
if JS is disabled.

To simplify this and bring Vector's PHP consistency with core this
logic is moved to JavaScript.

Bug: T259372
Change-Id: I2acbf7089198118626368ee8a37615d2de062f83
2020-07-31 22:15:08 +00:00
jdlrobson fe49542008 Collapse media print query
Per discussions, its proposed that the target of all media queries
is defined in the entry points skin and skin-legacy

Please verify with `git diff HEAD^ -w` that no changes to print
styles have occurred

Bug: T253842
Change-Id: Id7d1c806d77ee50335a1c9985acc7e4406e64ccf
2020-07-29 11:16:29 -07:00
jdlrobson c0f48624c7 Print: Logo styles should apply in printed media
Bug: T253842
Change-Id: I7875795f12bb3e5e01e18aeb1e54ccfe7e44a020
2020-07-29 11:15:08 -07:00
jenkins-bot eeb6182a91 Merge "Restrict image border to images in border" 2020-07-28 18:30:02 +00:00
Volker E 89114e38ac MenuTabs: Remove IE 8 fallback
Also removing the image. `rgba()` for the win.

Change-Id: Ieeb33c6af1019df97ae641a017a970ce2e0ec8ff
2020-07-23 18:13:31 -07:00
Volker E 389141651b Remove unused images
All those have been lingering while not being used for a while.
- arrow* files are part of core 'mediawiki.icon' module
- 'link-icon.png' is without any reference nor clear original usage
- 'magnify-clip.png' is part of core 'mediawiki.skinning' module
- 'search-fade.png' was used in #simpleSearch before it got unified with
  Design Style Guide components

Change-Id: I985d3ec25b26eea359ce3dbf5abbe4647bc37ab4
2020-07-23 18:04:26 -07:00
Volker E 5b5378a54f Replace deprecated `background-image-svg()` mixin calls
Use normal `background-image` properties with SVGs only now
that IE 8 and Android 2.1 is removed from Grade C.
Also removing all PNG fallback images.

Bug: T248062
Change-Id: Ib91cd0514d331ab6a0f8b668aef6991cf3267fe2
2020-07-23 17:50:31 -07:00
jdlrobson 01dd41a0b3 Restrict image border to images in border
In future we will be displaying the header and logo in the print
display - to avoid adding unnecessary borders scope this rule.

Bug: T253842
Change-Id: I123b73fcaa09c0213914ca6fd8074a1305814529
2020-07-23 10:37:36 -07:00
jenkins-bot d09649250d Merge "Make collapsible code more resilient" 2020-07-20 22:08:07 +00:00
Jan Drewniak a8c79f3d52 Add config to disable sidebar state persistence for logged-in users.
Bug: T255727
Change-Id: Id28e0bc5249ba68b5de2a078a259e9964f619ef7
2020-07-17 09:32:21 -07:00
jdlrobson 17a07e4c76 Make collapsible code more resilient
$.collapsibleTabs.getSettings can return undefined so the code
should take this into account

Bug: T177108
Change-Id: I2630a2ba2884542869748047ab84752543072647
2020-07-16 14:17:30 -07:00
jenkins-bot 3651b41cb0 Merge "Max-width layout: Make page container fill viewport if content height is small" 2020-07-15 05:15:23 +00:00
Nicholas Ray acf42aa48f Max-width layout: Make page container fill viewport if content height is small
This will help mitigate the sidebar overflowing the page container
(related to T257518). Note that this does not prevent the overflow from
happening as the sidebar can still be longer than the viewport, but it
should reduce the number of times it can happen.

Bug: T257518
Change-Id: Id7138b4d4459242772bee8e11dc7edeaf76b3ca0
2020-07-14 17:20:06 -06:00
jdlrobson 018f30c615 [Refactor] Simplify searchbox layout rules
Follow up to I340b9e7e91960713c0ebb4d3d26e2ae2d5628f37

The layout styles reference internal CSS classes within
Vector components that may change at any time.

For legacy layout, I leave the styles the same (they have a FIXME)
As Aron noted on code review the impact such a change
could have on user styles. For modern however I simplify the styles
as follows:
* The top margin on the form is promoted to the main element - this has
the same end result.
* Likewise the width dimensions are moved from child elements to
the parent


Bug: T249363
Change-Id: If923a5dddaac6217462e75d476e07d923ee1743f
2020-07-14 21:02:03 +00:00
AronDemian ba8ec2f842 Split Searchbox layout styles for legacy and modern
No changes made to the CSS rules.
* 'SearchBox.less' is the common part that won't change in modern.
* layout styles copied to both 'layout.less'

Bug: T249363
Change-Id: I340b9e7e91960713c0ebb4d3d26e2ae2d5628f37
2020-07-14 13:01:35 -07:00
Nicholas Ray d5cb58b3f0 Max-Width Layout: Make footer width match content width to avoid overlap with sidebar
* `mw-content-container` now wraps the footer (as well as the content)
because we want the footer to match the content width at all times and
to expand with the content when the sidebar is closed (at small viewport
widths or when on history/special pages)

* `mw-footer-container` margins were replaced with padding to avoid
issues with margin collapsing.

* Applied a white background to sidebar to handle the case of the
sidebar overflowing the `mw-page-container`. When that happens, we at
least want the text in the sidebar to be legible.

* Closely related, `mw-page-container`'s `overflow: hidden` style was
removed to prevent `mw-page-container` from cutting off the sidebar. The
purpose of this style was make it appear as if the sidebar was being
hidden by `mw-page-container`, but tweaking the sidebar's translation
animation to achieves this effect as well.

Bug: T257518
Change-Id: I89edf89b2ac4abe2053f0c9b366f143133ff420f
2020-07-13 18:26:18 -06:00
jenkins-bot 02c44e7302 Merge "[docs] Fix typos in comments" 2020-07-10 22:22:56 +00:00
Jan Drewniak 2b5857f624 Add enter/spacebar keyboard support to sidebar.
Bug: T255727
Depends-On: I388ac873997aa02d713ae7453216e0cb7d983993
Change-Id: Ie438db4f752c77aa40191d2bceb83f52d3371c6c
2020-07-09 22:38:15 +02:00
Volker E aaf8b7721a [docs] Fix typos in comments
Following-up Ib1ce934f3646cd8fe.

Change-Id: Id32cbfb5256d55e6c9d8b081a126ca0275b7565d
2020-07-09 00:47:27 -07:00
Jan Drewniak 1fac82f895 Sidebar persistence for logged-in users in modern Vector.
- Creates a new user-preference called 'VectorSidebarVisible'
which stores the sidebar hidden/collapsed state for logged-in
users.
- Updates that user-preference on the client whenever the sidebar
is expanded or collapsed.
- Refactors the sidebar related javascript into a separate file.

Bug: T255727
Change-Id: Ib1ce934f3646cd8feebf0d3b15c38b5b969ec957
2020-07-09 00:28:52 +02:00
jenkins-bot 36a1516f96 Merge "Implement Page, Workspace, Content, and Article Toolbar Containers" 2020-07-08 01:21:49 +00:00
Nicholas Ray 092a2957af Implement Page, Workspace, Content, and Article Toolbar Containers
This patch closely follows the desired guidelines/desired
styles Alex Hollender has put forth in his prototype, but uses
multiple containers to achieve this look since our DOM order/structure
is different than the DOM structure in the prototype. The following
containers are used, but unlike his prototype, they are sometimes used
more than once:

* Page Container: Contains every other container and limits the overall
max-width of the white part of the page.

* Workspace Container: Contains the sidebar and content container. The
sidebar is displaced ~30 pixels to the start (left) of the workspace
container at all times.

* Content Container: Contains the content. The max-width of this changes
depending on whether you are on a special page/history page vs. other
pages.

* Article Toolbar Container: Contains the article toolbar. The max-width
of this is always the same as the max-width of the article content as we
don't want the toolbar to move when going from the article page to the
history/special page.

Changes to be aware:

* To test locally, `$wgVectorLayoutMaxWidth = true;`. This design is
temporarily feature flagged and defaults to being "off".

* Note that layout-max-width.less is a temporary file made to meet the
feature flag requirement of T246420 (intended to derisk the deployment).
After the deploy, we should merge most if not all of the rules into
layout.less where the max-width design will become the default.

* Per Jon's code review comment, I have relaxed the indenting of
skin.mustache to make the diff easier to reason about. If desired, the
correct indenting can be achieved in a (much less risky) follow-up
commit.

Bug: T246420
Bug: T153043
Change-Id: Ie49f629bc705850c6996164a516957476c034048
2020-07-07 18:34:38 -06:00
jdlrobson 04bcd93adf Logo shouldn't import layout
This explains a few issues that were occuring in the storybook
relating to modern/legacy.

Follow up to 5195f5fd6 which doesn't reference why.

Components should not import styles relating to one of the Vector
versions. They should all be self contained.

Change-Id: I6f9ef974be97f8be593cd2b79ce37c3e517d549f
2020-07-07 22:22:24 +00:00
Ed Sanders 36e91dc04f build: Update devDependencies
Applies new ESLint documentation rules

Change-Id: I7fe458cf52e98baf92f3baec2d9ff54484326673
2020-07-01 14:43:39 -07:00
jenkins-bot 9a1897be82 Merge "Use core `.mixin-clearfix()` instead of DOM element" 2020-07-01 18:45:47 +00:00
Volker E a9b35fa2e4 Use core `.mixin-clearfix()` instead of DOM element
Removing  presentational `<div class="visualClear"></div>` in process.
Only leaving in for legacy/layout.less and adding comment for future
evaluation if clearfix is continuously needed. In modern we've
got all parts of Vector in our awareness without featuring `float`s.

Bug: T254195
Depends-On: Iddf8f1dffc2d30299b89b3f4966b7fe8ee63090b
Change-Id: I673c28c2d7da4f96c31121d9aec6558e390de24e
2020-07-01 11:20:26 -07:00
Nicholas Ray b40c3f3743 Update CheckboxHack interface for future placement of `aria-expanded` on label button
Currently, the `aria-expanded` attribute is placed on the checkbox
element. However, since Ife287fc8c6e0d2aee5facf42d5d4308dea918ee3, the
checkbox is excluded from the accessibility tree, and this attribute
should be placed on the label button instead.

This commit prepares for future changes [1] to the checkbox hack interface
in a backwards compatible way:

* Passes button to `updateAriaExpanded` function

* Passes button to `bindUpdateAriaExpandedOnInput` function

[1] Ia2755e189babbd70945b66a1a812fc3ece40b577

Change-Id: Icc6ba994d57ea1f8050aa408aebc8c81f03d8783
2020-06-29 13:31:24 -06:00
Nicholas Ray bfc95effdb Move sidebar into header to improve tab order
* Moves the sidebar into the header so that user can tab directly from
the sidebar button into the sidebar (when open).

* Because the sidebar is absolutely positioned inside the header and the
header applies a top-margin, we need to adjust the top position
calculation for the sidebar.

* Removes the checkbox from the accessibility tree through CSS `display:
none;` instead of HTML attributes.

* Given that the checkbox is not able to receive focus, the
`#mw-sidebar-checkbox:focus ~ .mw-header .mw-checkbox-hack-button` CSS
rule is obsolete and moved instead to the label button. An additional
outline: 0 rule was added to remove the dotted outline that Firefox
applies.

* Makes the "Skip to navigation" jump link point to the sidebar now.
After the sidebar has been tabbed through, the rest of the navigation
can be tabbed to.

Bug: T246420
Change-Id: I981da3650854568bb9cfbf3c6c59e7625e7d094c
2020-06-25 16:55:34 -06:00
Volker E d2a0ae588a [less] Merge 'content.less' and 'typography.less'
This separation introduced in I8dbc29b7a19f7f doesn't work as well
as expected. All but strictly `.mw-jump-link` rule are typographic
rules.
In the current mish-mash of when to apply typographic styles only to
article content (`.mw-body`, `mw-body-content`, `.mw-parser-output`,
`#mw-data-after-content`?) inherited from core, it makes looking up
and finding issues between typographic styles harder, and leads to
unnecessary complexity instead of clean separation of concerns.
This question surfaced in where would link styles belong originated in
T213778.

Change-Id: I521185d505d8688f076dd09acbedb22e801f772e
2020-06-25 18:45:19 +00:00
AronDemian 2ccc975f0a [modern] Move sidebar checkbox above content, sidebar button into header
- Sidebar's checkbox hack CSS selectors adjusted.

Bug: T246420
Change-Id: I1cc1ad4eb1938c4931b1ae881b3878fbd6bb7a39
2020-06-23 07:09:38 +02:00
jenkins-bot 72afb66fb8 Merge "[less] Move `margin` and `padding` on `body` only" 2020-06-17 00:08:47 +00:00
AronDemian 772fb26683 Restore Watchlist star
Fixup for I8669d402b6b757cd5bf59a5e0df377b6023b0700:
Applied `.vector-tabs` selector instead of `.vector-menu-tabs`
Class `vector-menu-tabs` is added by VectorTemplate.php#383

Bug: T255574
Change-Id: Iae8176221662aa47dcd69123e9dd6a9d6693cd42
2020-06-16 19:09:44 +02:00
jenkins-bot 7ec918c3b8 Merge "[less] Remove default, already inherited user-agent properties" 2020-06-16 00:18:35 +00:00
Volker E 5691e4c7c4 [less] Move `margin` and `padding` on `body` only
Both properties are needed for normalizing different browsers (`padding`
infamous on older Operas) and are only needed on `body`.

Change-Id: I661869ed43491824cbfe86dc36e39f97e29ccf8a
2020-06-15 17:05:54 -07:00
Volker E 922daba0a9 [less] Remove default, already inherited user-agent properties
Also describe #simpleSearch reasoning clearer.

Change-Id: Ief3ebe9b1f1c519d6424dd8495a3522889efbbbc
2020-06-15 16:10:25 -07:00
jenkins-bot a2864cb5ef Merge "[less] Normalize focus styles in Blink based browsers" 2020-06-15 22:44:28 +00:00
Volker E 97566a026b [less] Amend subtle color to WikimediaUI Base default
Replace former non-base variables color with one from the standard
variables files in preparation for iit's usage in core and Vector.
Color is still confirming to WCAG level AA contrast ratio.

Bug: T254474
Change-Id: I06d981f05554b6429d11f19b8f5848ba5a7441a0
2020-06-15 22:20:41 +00:00
Volker E 41b0b6c434 [less] Normalize focus styles in Blink based browsers
Normalizing focus styles in Blink based browsers and aligning to
Design Style Guide components.

Bug: T245887
Change-Id: I4d571dcbbada5edffbfee631c8b438cf7c8d273a
2020-06-15 22:20:30 +00:00
jenkins-bot 7786fd9d1f Merge "[less] Extract cross-browser normalization rules into new 'normalize.less'" 2020-06-12 22:40:20 +00:00
Volker E 35b2f65914 [less] Extract cross-browser normalization rules into new 'normalize.less'
Change-Id: I23da024b47020212173380315acd37210b924327
2020-06-12 20:33:46 +00:00
AronDemian 22a8b6c5d5 Fix dropdown menu checkbox hack's CSS selector
`ul.vector-menu-content-list` was wrapped into `div.vector-menu-content`, thus becoming the sibling of
`input.vector-menu-checkbox`:
https://gerrit.wikimedia.org/r/c/mediawiki/skins/Vector/+/589395/39/includes/templates/Menu.mustache#15
Rename of `.vectorMenuCheckbox` to `.vector-menu-checkbox`:
https://gerrit.wikimedia.org/r/c/mediawiki/skins/Vector/+/597849/7/includes/templates/Menu.mustache#7

Follow-up to: Id59234aa6b822a24848386bdc04d8d7ed37ca145 and I00b4d2fd795195cd9c8add650a3b3cafdced5465

Bug: T255069
Change-Id: I299f4648acf83d2abdad274851e0960fe09a70b1
2020-06-12 14:06:27 +02:00
jenkins-bot f92df81fc5 Merge "[less] Put element selectors in the right place" 2020-06-12 00:07:22 +00:00
Volker E 0b1abe7a03 [less] Put element selectors in the right place
Element selectors need to come before class selectors.

Change-Id: I278adf4c5eb19e64fd0e2afdd4416dd45077389f
2020-06-11 16:41:44 -07:00
Volker E 7e7bdb4f54 Replace deprecated classes with modern ones
Following-up I00b4d2fd795195cd9c8add650a3b3cafdced5465
it's now time to settle on `.vector-menu*` classes.

Change-Id: I8669d402b6b757cd5bf59a5e0df377b6023b0700
2020-06-11 14:05:15 -07:00
jenkins-bot 23393d3685 Merge "Fix portal heading border in Safari" 2020-06-09 20:54:26 +00:00
Stephen Niedzielski 3003724a3a [fix][Less] disable sidebar animations on page load
There's a longstanding Chrome bug that causes CSS transitions to show in
their terminal states. This patch works around the issue by limiting
transitions to JavaScript users only via the `client-js` class which is
added to the root `html` Node some time after page content loads. The
effect is a better overall experience for everyone but transitions
unfortunately no longer appear for no-JS devices.

I am unable to reproduce this issue in Vector's configuration. This
patch should only be merged as a last resort.

Bug: T246419
Bug: T234570
Change-Id: Ifcb2bf1fddb85113a4858b7a210ded3954952e6e
2020-06-09 12:18:59 -06:00
Volker E 3888b4075e Fix portal heading border in Safari
By using `rgba()` instead of `transparent` the color gradient
calculation works as expected in Safari as it does in all
other browsers.
Also using same distance 33%/66% for gradient start and end.

Bug: T254489
Change-Id: I64ec6aa51a9ea931a2351c9c7a9ffaf28c8d130b
2020-06-08 14:02:09 -07:00
bkudiess-msft 3eea85aad9 Fixes "Contributions" control gets Overlapped in 200% Zoom mode
Bug: T253599
Change-Id: I37fa8b75982a2347bced878ae83e10e1af61360c
2020-06-05 00:29:18 +00:00
Stephen Niedzielski a0d2c2497b [fix][RTL] flip menu collapse button icon
Fix the icon button directionality in right-to-left languages.
Previously, the button was hardcoded to support left-to-right only.

- Replace the skin.vector.icons' `.mw-ui-icon-wikimedia-{name}:before`
  `selector` in skin.json with a placeholder, `{name}`. I don't think
  this selector should be needed but it seems to be erroneous not have
  one. I believe this issue of wanting a null selector was encountered
  in Minerva or MobileFrontend but am unable to locate the past
  discourse.

- Add check and unchecked menu button selectors to skin.json that set
  the appropriate background image. This shards some of the styles out
  of Less and into ResourceLoader-land but it's worthwhile.

- Revise the name of horizontal collapse icon to describe its form not
  function, "collapseHorizontal" to "chevronHorizontal". This has been
  an established convention that was missed a couple patches back.

- Add a flipped chevronHorizontal for RTL. I used Inkscape to do the
  flip and tried to match the style of the original by hand. Feel free
  to edit further.

- Drop the now unnecessary icon flipping JavaScript and initial Mustache
  class. This enables a real CSS-only solution for the icons.

Bug: T246419
Change-Id: I60f65b3c595bf18d309b667d9a0b066691b90c97
2020-06-03 17:09:38 -06:00
Volker E fd250975c4 Fix misconception on icon coloring
It's advisable to rely on default icon color and set it's color
by opacity. With that we've got a better playing field to respond
to user interaction with icon color changes, not relying on
several icons at once for different states and also being
backwards-compatible for a variety of browsers.

Change-Id: Iaff869774007ed962104d704103f0392a3516f4f
Bug: T246419
2020-06-02 23:06:49 -06:00
Volker E 4b30bceda3 [dev] Remove outdated selector now that cache has expired
Change-Id: Ia3f914c96f03e3c70c3cb4c8d7de96f34cb4b1f5
2020-06-01 21:45:08 +00:00
Stephen Niedzielski 909cbaac11 [fix][a11y][Less] use percentage for sidebar button icon size
The sidebar button's icon previously used pixel dimensions while the
button itself uses ems. This caused the button to scale with the user's
font such that the icon is distorted and unrecognizable.

This patch drops the vertical margin and sets the icon height to 100%.
The width is proportionally constrained so the effect is that the icon
may grow with the button but the margin stays consistently at 12px.

This approach deviates from other items in the header (globe,
notifications) and tab bar (watchstar, search icon), that were 
historically implemented without the user text zoom capability in mind.

Bug: T246419
Change-Id: I2ae46fd49dcb619004587b8b3560b9115c3bdaaa
2020-06-01 21:08:02 +00:00
AronDemian bdffc10fbb Fix bug: "dancing vector tabs"
Related: I0672b05bc3eb9564e1943ee8099bafb959dc474d
"Cannot rename `.emptyPortlet` to `.vector-menu-empty` yet." This is the JS part.
Given the regression, we can't make this rename just yet. Restore
the old class, we'll deal with this rename later.

Bug: T253819
Change-Id: Ia6bb33be807bfe98de09ce0b61924da232fc9941
2020-06-01 20:02:28 +00:00
Volker E 4200a8665c Naming convention using 'skin' as entrance point
Using 'skin' as entrance point files, similar to already existing
convention in MediaWiki land with 'skin.json' or 'SkinVector.php' as
example in Vector skin. Replacing Apache inspired 'index' convention.
Also renaming legacy to 'skin-legacy' to be clear on file base that it's
a modification of 'skin'.

Bug: T249073
Change-Id: Ief1c469724d4ffe238d307407c3ddb46f2e1abfa
2020-05-28 20:58:01 -07:00
jdlrobson 56f7520120 Hotfix: Cannot rename emptyPortlet to empty-portlet yet.
Given the regression, we can't make this rename just yet. Restore
the old class with the documentation block that should have been there
before. We'll deal with this rename later.

Bug: T253912
Change-Id: I0672b05bc3eb9564e1943ee8099bafb959dc474d
2020-05-28 16:01:38 -07:00
Volker E feb025d8a1 Horizontally and vertically align menu icon to design templates
Put icon on one line with sidebar contents horizontally and with
logo vertically.

Bug: T246419
Change-Id: I6876e6f39a5f804ad4459cd9721c796ae7a8e3fb
2020-05-28 11:28:59 -07:00
jenkins-bot 15a30c26f8 Merge "[feature] add menu button to toggle panel visibility" 2020-05-28 02:57:14 +00:00
Stephen Niedzielski 5195f5fd67 [feature] add menu button to toggle panel visibility
Add a menu button that toggles the panel's (also referred to as a
sidebar) collapse state. When the screen is wide enough, animate the
transition.

The menu icon from OOUI is copied into Vector to avoid two
ResourceLoaders modules (collapseHorizontal icon isn't ready for
inclusion in the OOUI icon pack and ResourceLoaderOOUIIconPackModule
doesn't support images).

Additional polish and collaboration is needed but this patch fulfills
the scope of its referenced task.

Bug: T246419
Depends-On: I8e153c0ab927f9d880a68fb9efb0bf37b91d26b2
Change-Id: Ic9d54de7e19ef8d5dfd703d95a45b78c0aaf791a
2020-05-28 02:14:13 +00:00
jenkins-bot 6a1458eada Merge "Reduce distribution of legacy classes" 2020-05-26 21:01:55 +00:00
jdlrobson cb7ca11274 Reduce distribution of legacy classes
The .menu class historically only needs to apply to dropdowns.
the .vectorMenuCheckbox is inconsistent with the other classes on the
menu so we should begin its deprecation.

Bug: T253329
Change-Id: I00b4d2fd795195cd9c8add650a3b3cafdced5465
2020-05-26 20:22:08 +00:00
jdlrobson d49eb1e0ff Merge EmphasizedSidebarAction.less into Sidebar.less
The opt in link is part of the sidebar in the current modern version
of vector. The legacy sidebar has been split out and frozen. For this
reason I think it makes sense to move the styles for the button into
the sidebar stylesheet.

The class name is renamed to reflect the hierarchy. We are not using
BEM but we are using hyphens to describe location so the newly proposed
names `mw-sidebar` and `mw-sidebar-action` seem more applicable than
the previous generic class names.

This doesn't impact caching given anonymous users cannot see the opt
in/out link.

Change-Id: I2991e941592a0678f40c73bb6daeab71ada6b7c3
2020-05-26 18:53:25 +00:00
Stephen Niedzielski 0fac9045ac [dev][Legacy] split sidebar Mustache and Less
Split out the sidebar in advance of significant Latest mode only
changes.

The Less split was made by adding a new Sidebar.less file that imports
the Legacy implementation.

The Mustache split was made by file copying the existing implementation
into a legacy/ subfolder. Both the Legacy and Latest implementations
were then stripped of templates not applicable to their modes.

These changes are aligned with the splits for JavaScript.

Bug: T246419
Change-Id: Ib82769ea16bfc09efe8a088220aab55bdde0d381
2020-05-15 18:05:30 +00:00
Volker E de788c6446 [dev] Remove `white-space` attribute from personal menu
Removing `white-space` on `.vector-menu` as we couldn't find any
use case of this any more and it's breaking DRY-ed up Menu in portals on
modern Vector.

Bug: T252717
Change-Id: I87a64e64c02a6690a7ecea93ce7712619457d575
2020-05-13 15:22:10 -07:00
jenkins-bot 4fb5f4e903 Merge "Show half-star when the page is temporarily watched" 2020-05-13 19:28:16 +00:00
jenkins-bot 8950f60eba Merge "[modern] Center the logo tagline beneath the wordmark" 2020-05-13 17:55:37 +00:00
AronDemian 450f7d237a [modern] Center the logo tagline beneath the wordmark
Bug: T252430
Change-Id: If16fa9e70c52a8cb51b4f297d0ed7db8e72cebcb
2020-05-13 05:33:49 +00:00
jdlrobson e048c2a729 Refactor: Simplify and standardize menu definitions
* Standardise the menu markup. This means all menus in Vector will now
be wrapped in a div and will have a heading.
* All menus now have the vector-menu class. Styles specific to personal tools
are moved to layout since these are concerned with placement.
* The ul class will always have menu class.
* emptyPortal class is generalised into vector-menu-empty for consistency
with other classes and moved from common.less into Menu.less
* Standardise hooks - BaseTemplateAfterPortlet can now be run on any
menu.

Changes to HTML:
* lang and dir attributes are moved from the h3 up to the div element
.vectorTabs, .portal(s) and #p-personal now has hidden span element inside h3
* for non portals ul.menu" is now wrapped in a div.vector-menu-content

This change does impact the following CSS selectors which will need to be updated:

I see no matches for these selectors in code search.

```
 #p-variants > ul
 #p-namespaces > ul
 #p-personal > ul
 #p-views > ul
 #p-cactions > ul

```
Using global-search.toolforge.org I see one match
for p-variants, 26 for p-namespaces, 30 for p-personal,
36 for p-views and 7 for p-cactions. I see this as acceptable
breakage provided a user notice is sent out which it has been
(T252447)

Bug: T249372
Change-Id: Id59234aa6b822a24848386bdc04d8d7ed37ca145
2020-05-12 15:17:38 -07:00
MusikAnimal ca71f762fa Show half-star when the page is temporarily watched
Bug: T248495
Depends-On: I61b24fddf6aaf5233f426602bfa1cc4fafce942b
Change-Id: I712af9a0646d22c3b7873bbf77dba363c5770181
2020-05-12 00:06:16 +00:00
Stephen Niedzielski 108393daf1 [dev][Legacy][JS] Split Legacy mode JavaScript into new ResourceLoader module
The collapsible sidebar adds a new JavaScript dependency and behavior to
Latest mode only. There are a number of ways of to make the deviation
but we think now is the time to start splitting by module.

This patch adds a new ResourceLoader module, skins.vector.legacy.js, and
moves the existing JavaScript into it. The old module, skins.vector.js,
has been given a currently matching index.js entry point that references
the collapsible tabs' files by reaching across directories. It's not
quite ideal as usually ResourceLoader modules and directory structures
strive for 1:1 correspondence but this patch makes the bold assertions
that it's better than a file copy, better than a new
"skins.vector.common.js" ResourceLoader module, more compatible than a
symlink, and the existing jQuery tabs implementation will eventually be
replaced in Latest mode.

A "Legacy" module was added instead of a "Latest" with the assumption
that active development should generally be considered "latest" and
Legacy an intentional distinction.

Bug: T246419
Change-Id: I9980403f1ee5897c27ac0331f0b51a5bcbdff778
2020-05-11 15:29:56 -06:00
AronDemian c42739a200 [legacy] Merge 'background-gradient.less' into 'layout.less'
Bug: T249073
Change-Id: Icb4ef65fbc72b5793061d97194ef4b88836c0fe2
2020-05-08 20:05:56 +00:00
AronDemian 015bfa74d9 [modern] Move up color and background-color rule from content to body
Bug: T251583
Change-Id: I93e4ef82210e0f8c559f4476480a3c3b0b6474c8
2020-05-08 20:05:46 +00:00
AronDemian b4ce8210ca [modern] Drop the background gradient
Move content border rules to layout (will be removed).

Bug: T251583
Change-Id: I28b7a3fdd3f89a0aef93e64c1ae12f39ae430e66
2020-05-08 18:25:31 +00:00
jdlrobson 9f2ca0d072 Refactor: Portal is also a Menu
To complete the refactor, the Portal is also refactored
as a Menu using the getMenu function.

An old code path supporting portals outputted by hooks with
strings is marked as deprecated to simplify this code in future.

array-portals-first -> data-portals-first (the value is not
an array)

Changes:
* $this->getLanguages and  $this->getToolbox() always returns an array (see BaseTemplate)
but we previously supported portals made using raw HTML. Let's move away from that
behaviour and deprecate it.
* Hooks are moved into buildSidebarProps and marked as deprecated where possible
(SkinTemplateToolboxEnd). SidebarBeforeOutput can be used instead.

Bug: T249372
Change-Id: I2549af3e24e5d51c09e9a88ca50a0d9b2e154c3f
2020-05-07 16:56:59 -07:00
jdlrobson e4a4050b81 Organize CSS by common, layout, typography and components
Moving styles from the existing styles to common/layout
or components stylesheets they should be associated with.

Components are identified using PascalCase. Lowercase names are used for things
that are not components. This distinction should help us reason with the code
better and make it clearer where CSS belongs, saving us lots of wasted
effort discussing conventions.

Patch isn't making actual CSS changes themselves - for testing purposes this
should be a NOOP.

In preparation for the gradient removal,
'background-gradient.less' is marked as legacy.

Merged 'externalLinks.less' into content.less, they belong to content.

Bug: T249073
Change-Id: I8dbc29b7a19f7613b57b0984a8befaeae9c08798
2020-05-07 22:57:13 +00:00
jenkins-bot 85e162caea Merge "Class names with hyphens preferred over camel case" 2020-05-07 22:12:51 +00:00
jdlrobson 4dfe4a97c9 Class names with hyphens preferred over camel case
The classes were recently changed so provided this is merged before
next branch cut no need to worry about cached HTML.

Bug: T249073
Change-Id: Ib20c7a359bda858df89ebb245e682d321dd5acd0
2020-05-07 14:43:13 -07:00
Volker E 9934783544 Remove `#footer` selectors now that cache has expired
Following-up Ica9f8c43617c624648fa12dc86ebb3daa10f0409.

Change-Id: I6f698ff98b9c474085bf7370ecaa78db3a3617e8
2020-05-06 18:55:50 -07:00
jdlrobson 9cd47c5339 Refactor: VectorMenu merged in to Menu
Bug: T249372
Change-Id: Ifaf78b507c12aa251228213c89751cbb4d111d9a
2020-05-06 16:09:22 -07:00
jdlrobson a43e79c1d3 Refactor: Merge VectorTabs into Menu
Bug: T249372
Change-Id: Ib6ae191b31564dc23a3b1d6aedf48cbaaad006af
2020-05-06 10:23:58 -07:00
jdlrobson a3bb097cf8 Refactor: Generalise personal menu
the PersonalMenu should be generalised. In future we will use it as
the template for all menus

Bug: T249372
Change-Id: Id1c43d2e9eefef1d7aec45f0137e27f10ad935df
2020-05-05 17:34:44 -07:00
AronDemian ffcd4b6113 refactor: Move up `.portal` underline gradient from `.body` to `h3`
Change-Id: I3c057e048ada0601497ee6697c19bf207c3bc821
2020-04-30 22:16:29 +00:00
jdlrobson 6a9ee465bc [modern] A new version of Vector with a new logo
Changes to support feature:
* ResourceLoaderSkinModule logo features are dropped
* New layout provided given the fork in layout between legacy and new.
* Legacy sidebar styles now pulled out
* breakpoint styles are not carried over from legacy Vector
The new Vector layout for now has one breakpoint.

Changes to storybook:
* The storybook script now pulls down image assets so that the logos can
be shown in storybook. The script is adjusted to make use of a static folder to
serve these images.

Note:
* The legacy mode is not touched as part of this patchset.
* The personal menu is unaffected by this patch and is out of scope.
* The alignment issue is noted, but will be solved at a later date.
* Changes to portal are out of scope.
* Adding storybook for modern descoped, given its not possible to load
both legacy layout and modern layout inside a storybook at current time.

Sample config:

$wgLogos = [
        'icon' => 'https://di-logo-sandbox.firebaseapp.com/img/globe.png',
        'tagline' => [
                'src' => 'https://di-logo-sandbox.firebaseapp.com/img/tagline/en-tagline-117-13.svg',
                'width' => 117,
                'height' => 13,
        ],
        '1x' => 'https://en.wikipedia.org/static/images/project-logos/enwiki.png',
        'wordmark' => [
                'src' => 'https://en.wikipedia.org/static/images/mobile/copyright/wikipedia-wordmark-en.svg',
                'width' => 116,
                'height' => 18,
        ],
];

Coauthor: Aron Manning

Bug: T246170
Change-Id: Ibc4b055150761388a6b78f9127da342c451ce0e7
2020-04-30 14:11:54 -07:00