Commit Graph

940 Commits

Author SHA1 Message Date
Volker E 46514f2d2e styles: Remove `linear-gradient` hack for non-supported browsers
`linear-gradient` hack was necessary for browsers, that weren't
supporting SVGs.

Bug: T306486
Bug: T308344
Change-Id: Ie61ba7955ece62015436d2aee44a66bacf42e552
2022-07-20 12:40:41 -07:00
jenkins-bot 22969cb39d Merge "styles: Remove IE9 Flexbox fallback" 2022-07-20 16:45:37 +00:00
jenkins-bot 02451be660 Merge "search: Mark App.vue as being compatible with Vue 3" 2022-07-20 16:38:34 +00:00
jenkins-bot caf0221164 Merge "styles: Replace `@top-margin…` with `@margin-top…` variable names" 2022-07-20 16:38:32 +00:00
Volker E 2d0428b02a styles: Remove IE9 Flexbox fallback
IE9 is out of basic supported browsers, so removing this fallback.
Also using “Flexbox” as standard term in comment.

Bug: T306486
Bug: T308344
Change-Id: I6fcb0c4b54fea3d05593ae294c05e046131c93d2
2022-07-20 08:13:00 -07:00
Volker E cffd494107 styles: Unify on standard external link icon
Unify on using standard OOUI 'linkExternal' icon, which is directly
replacing Vector's image without relying on ResourceLoader.
Please note that the icon features standard link color `#36c` which is
implemented in a later step. Due to the small icon size and the fact
that current external link icon is also not using the legacy color, this
seems acceptable to move forward with.

Also using relative `em` instead of `px` to support user text zoom
capabilities and introducing a `@size-indicator` variable to be replaced
by WikimediaUI Base variables later.
Alternative to I49de3bfff45.

Replacing images and image names to make quicker lookup with icon
collection possible future-facing.

Note that CSSJanus is flipping the `ltr` string in the background image
rule to `rtl`, therefore making sure that both icons are available.

Bug: T261391
Change-Id: Ibd15517f3adf06010807901e8fb3299e2046a473
2022-07-20 04:41:14 -07:00
Roan Kattouw 21b9dda2a2 search: Mark App.vue as being compatible with Vue 3
This doesn't change any behavior, it just suppresses a compatibility
warning and ensures that future changes to this file won't introduce
code that relies on Vue 2 compatibility features.

Change-Id: Id15af7d5d5035f59dc8f402f00d8f7f0d73a77f7
2022-07-19 16:23:06 -07:00
Jan Drewniak d709bb5606 Update to 4ab2b1bf: Refactor Vector tabs layout
Removes a height:100% rule that was causing a shift in layout.

Change-Id: I7b29ba201e9937174852ba0d7919fd65e530851f
2022-07-19 17:24:05 -04:00
Volker E 0c7cc69e30 styles: Replace `@top-margin…` with `@margin-top…` variable names
Bug: T313243
Change-Id: Ibdcc50d2a67074bc7b3f28c58baf73ad39db922d
2022-07-19 12:16:28 -07:00
Volker E 048e40d0bf styles: Remove divider image fallbacks for now non-basic support browsers
Removing old PNG divider fallbacks, which were included for IE9, old
Firefox and Chrome browsers and are not mission critical even when not
rendered to unknown browsers.

Bug: T306486
Bug: T308344
Change-Id: I8a6622237a1cbb8116930a12e632329618d5c291
2022-07-19 18:29:09 +00:00
Jan Drewniak 4ab2b1bff1 Refactor Vector tabs layout for reduced size & complexity
Fix for iOS Safari 13 & 14 (T309223):
- Replaces flex-box layout from the top-level #right-navigation
  and #left-navigation tab elements with floats.
  Then for vertical alignment, sets the child <li> elements and
  <a> elements to inline block.

Opportunistic refactor (T308344):
- Moves the font-size rules to top-level #left/right-navigation,
  but leaving them as-is for legacy Vector.
- Removes a (seemingly) unnecessary `display:none` rule from
  Vector 2022, which previously applied to H3 labels in the
  sidebar, which are no longer targeted by the styles in
  MenuTabs.less.
- Removes an unnecessary selector and duplicated rules from
  ArticleToolbar.less

This change fixes a flexbox issue on iOS Safari 13 & 14, but also
reduces the CSS bytesize of the skins.vector.styles module by
0.9kB (uncompressed), from 54.2kB in the previous commit to
53.3kB with this commit.

Expected visual changes:
* The tab underline now overlaps with the toolbar underline, and text
pushed down on certain tabs
* The variant tab is now equally spaced
* Right navigation tabs slightly shifted to the right

Unexpected visual changes:
* More menu shifts to the left [see note at top of commit, will be
fixed in a follow up]

NOTE: this introduces a visual regression in the mobile viewport in that
the more menu.
Given this viewport is still experimental, after talking to Jan
we agreed to address this in a follow-up.

NOTE: Update addresses the reason for revert 5599cf2 and compatibility
with CSS Grid layout by adding a clearfix (display:flow-root)
for #right-navigation and #left-navigation elements inside toolbar.

Bug: T309223
Bug: T308344
Bug: T312212
Change-Id: I1482a81d16c53e0ba1977b0d98ba8c8a21362a6c
2022-07-19 13:26:49 -04:00
jenkins-bot 1ebf8c148d Merge "styles: Use default `border-width` and `border-style` vars" 2022-07-19 16:46:31 +00:00
jenkins-bot f7979192a8 Merge "styles: Apply `@background` var to Sidebar `background`" 2022-07-19 16:45:21 +00:00
jenkins-bot 9f7f292a6f Merge "styles: Rename `border-tabs` to `border-bottom-tabs`" 2022-07-19 16:45:17 +00:00
jenkins-bot 9a177a2f8f Merge "styles: Use mediawiki.skin.variables `transition-duration` vars" 2022-07-19 16:43:32 +00:00
jenkins-bot 22b4e4f31a Merge "styles: Replace distinct color var with standard variable" 2022-07-19 16:43:30 +00:00
jenkins-bot 3c8796ee04 Merge "Search: Use Codex and Vue 3 instead of WVUI and Vue 2." 2022-07-19 15:18:29 +00:00
Volker E 8d21f557c1 styles: Use default `border-width` and `border-style` vars
Bug: T313243
Change-Id: I8e40fbcff3d739318f6a53104128ed52ef8f294f
2022-07-19 05:11:39 -07:00
Volker E fca7726a17 styles: Apply `@background` var to Sidebar `background`
Also de-coupling border and background vars as they are aimed to
be fully replaced by tokens in future.

Bug: T313243
Change-Id: I5b7e46b6d2a0cc6975cb3c760645eaf2d5d30de5
2022-07-19 04:35:09 -07:00
Volker E b62f7fa4dd styles: Rename `border-tabs` to `border-bottom-tabs`
And use `@border-width-base` var.

Bug: T313243
Change-Id: Ic5febd54a6f28ef8998f4278589b08c6e5977d9f
2022-07-19 04:24:33 -07:00
Volker E 026b19925e styles: Use mediawiki.skin.variables `transition-duration` vars
Bug: T313243
Change-Id: Ic592dfe0a8711f33196d84a222ffa1d6214545e8
2022-07-19 04:19:08 -07:00
Jdlrobson 5599cf23af Revert "Refactor Vector tabs layout for reduced size & complexity"
This reverts commit 0c5e6ed9fe.

Reason for revert:  I was so focused on testing the current layout
I forgot to test the more important grid layout, which is being
deployed this week. The "from mediawiki" tagline is overlapping
with the tabs.

Change-Id: I3c53a8d243caf84e5c2766d730ced3d7da345026
2022-07-18 23:28:01 +00:00
Jan Drewniak 0c5e6ed9fe Refactor Vector tabs layout for reduced size & complexity
NOTE: this introduces a visual regression in the mobile viewport in that
the more menu.
Given this viewport is still experimental, after talking to Jan
we agreed to address this in a follow-up.

Fix for iOS Safari 13 & 14 (T309223):
- Replaces flex-box layout from the top-level #right-navigation
  and #left-navigation tab elements with floats.
  Then for vertical alignment, sets the child <li> elements and
  <a> elements to inline block.

Opportunistic refactor (T308344):
- Moves the font-size rules to top-level #left/right-navigation,
  but leaving them as-is for legacy Vector.
- Removes a (seemingly) unnecessary `display:none` rule from
  Vector 2022, which previously applied to H3 labels in the
  sidebar, which are no longer targeted by the styles in
  MenuTabs.less.
- Removes an unnecessary selector and duplicated rules from
  ArticleToolbar.less

This change fixes a flexbox issue on iOS Safari 13 & 14, but also
reduces the CSS bytesize of the skins.vector.styles module by
0.9kB (uncompressed), from 54.2kB in the previous commit to
53.3kB with this commit.

Expected visual changes:
* The tab underline now overlaps with the toolbar underline, and text
pushed down on certain tabs
* The variant tab is now equally spaced
* Right navigation tabs slightly shifted to the right

Unexpected visual changes:
* More menu shifts to the left [see note at top of commit, will be
fixed in a follow up]

Bug: T309223
Bug: T308344
Bug: T312212
Change-Id: I77f3dd8e8ccfe3a1d9693746106d9783cc0d38b9
2022-07-18 22:34:11 +00:00
Roan Kattouw ce77018b7c Search: Use Codex and Vue 3 instead of WVUI and Vue 2.
[Visual changes]
This should result in 9 visual regression failures relating to
increased height of search results and loading bar

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

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

Bug: T300573
Bug: T302137
Bug: T303558
Bug: T309722
Bug: T310525
Co-Authored-By: Anne Tomasevich <atomasevich@wikimedia.org>
Change-Id: I59fa3a006d988b14ebd8020cbd58e8d7bedbfe01
2022-07-18 12:54:47 -07:00
Volker E d4b205e149 styles: Replace distinct color var with standard variable
To safely looking forward to standard Codex tokens.

Bug: T313243
Change-Id: I3ed5dedab2b5f2edc2b1da13d07e21b77791f08a
2022-07-18 11:17:16 -07:00
Volker E a651d5e86b styles: Remove obsolete variable
Following-up Idf943449b5e4.

Bug: T308344
Change-Id: I06588d42e3e5c95248886df33ddda45d4f1eaf1f
2022-07-14 07:21:12 -07:00
jenkins-bot 1be236aa5a Merge "TOC: CSS clean up and spacing fix" 2022-07-11 21:05:05 +00:00
Jon Robson a3905e9acd CSS cleanup: Revise CSS that is no longer needed per FIXME guidelines
Bug: T311773
Bug: T308344
Change-Id: Idf943449b5e4358749be47435b3032215e533353
2022-07-11 15:43:44 +00:00
jenkins-bot 4df9e30757 Merge "Restore #siteSub font size" 2022-07-08 21:35:22 +00:00
bwang 42f863a936 TOC: CSS clean up and spacing fix
- Update TOC bottom padding to match spec in T304166.
  Before (30px): https://phabricator.wikimedia.org/F35312302
  After (20px): https://phabricator.wikimedia.org/F35312299
- Rearrange/combine some selectors in TableOfContents.less
- Delete some unnecessary styles/selectors
- Rename variables in TableOfContents.less

Change-Id: Ifffc434dcab4256a0c3ae8faf43a342935b820ff
2022-07-08 19:36:19 +00:00
bwang f0955e8ae3 Restore #siteSub font size
Bug: T311421
Change-Id: I9c6d66f91c071a23e02d646ace143f9605354eae
2022-07-08 19:26:03 +00:00
Clare Ming c18c9856b5 TOC scrollbar should not fade
Bug: T311436
Change-Id: I50e2d82982515f045596c1a19dd7f9932cde25ef
2022-07-08 13:03:39 -05:00
Jon Robson e8130d6628 Layout: Fixes table of contents alignment issues
This patch also adds some grid variables to be reused

Bug: T311793
Change-Id: Ib985e929b5ff013dfe9dcff1d0f33cebc24bbed6
2022-07-05 21:11:47 +00:00
jenkins-bot 197fab6905 Merge "Remove tablet specific styles for collapsed TOC, and misc CSS clean up" 2022-07-01 17:53:35 +00:00
bwang a84549f243 Remove tablet specific styles for collapsed TOC, and misc CSS clean up
This patch also fixes a regression for non grid layout Vector on tablet viewports when the sidebar and collapsed TOC is open
https://jmp.sh/xZhkU6q

No pixel regressions

Change-Id: Ic371f9b7ddd017af835565834e26a65ad3c2afc8
2022-07-01 15:25:34 +00:00
Jon Robson d8a66f0d49 Layout: Fixes content alignment issues
Bug: T311793
Change-Id: I256750d546e2ab818bca1f153a2b6a675db79a54
2022-07-01 14:54:10 +00:00
Jon Robson bcb6ca36ba Layout: Fixes header margin between search and user links
Restore header margin between search and user links, as its
still needed for grid (Fixes F35282398)

Bug: T303484
Change-Id: Ie8cf4adcadff430ebfc675029635e6c22061b238
2022-06-30 16:03:28 -07:00
Jdlrobson e16a8e4775 Revert "Layout: restore sticky toc behavior by adding additional TOC container"
This reverts commit 3a26cc220c.

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

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

Change-Id: I7ead5e1d5954f772a533e1116f8c55d2d9cfd143
2022-06-30 21:40:14 +00:00
Jon Robson 615181154c Layout: Grid columns are restricted to desktop views
On tablet, where the table of contents is hidden, the
sidebar should take up the full screen when open.

Fixes Pixel regression
MediaWiki_Test_vector-2022_sidebar-open_0_html_1_tablet.png

Bug: T303484
Change-Id: Ie0aa9f661a652e137d691a1fa4b05e69f0c5f8ab
2022-06-30 20:30:20 +00:00
bwang e23fc1fe11 Grid: fix footer styles
Fixes https://phabricator.wikimedia.org/F35289862

Change-Id: If14bfb357d077ebd3886ce7290f0d46d19588dc6
2022-06-30 13:34:25 -05:00
jenkins-bot 9d7b62b85d Merge "Layout: Use sibling selectors rather than adjacent sibling" 2022-06-30 15:10:58 +00:00
Jon Robson 79403a87e3 Fixes Content sub unreadable in Vector 22
Bug: T311564
Change-Id: Id9c3693796a197f4cacf6fee902b553ba077dc71
2022-06-30 00:52:24 +00:00
Jon Robson 9ac4fbb165 Layout: Use sibling selectors rather than adjacent sibling
Fixes MediaWiki_Main_Page_vector-2022_0_viewport_1_tablet.png
UI regression

Additional change:
- Remove inactive selector - nothing matches this media query

Bug: T303484
Change-Id: I25a21ed54189dd1ca371a0755eb4d726b20f965f
2022-06-29 23:12:42 +00:00
bwang 73ecf0f4f3 Refactor some max-width media queries to use min width
Bug: T310536
Change-Id: I900c2446b64533775b37d6e0a0ce781ab0ff890a
2022-06-29 18:09:19 +00:00
jenkins-bot e952a051c3 Merge "Cleanup ArticleToolbar grid styles" 2022-06-29 17:34:00 +00:00
bwang fabd2d6579 Cleanup ArticleToolbar grid styles
Change-Id: I0a0444cbbd460340b7bf000535d4cca252e58f2f
2022-06-29 11:19:38 -05:00
Jon Robson 257430ec13 Layout: Fix footer margin
Since CSS grid uses row-gap we need to decrease
the margin we used in the legacy layout to keep these
the same

Bug: T303484
Change-Id: Ib28f0d5ee0afbb809591c99ef18cd3cbecf1f800
2022-06-29 08:33:36 -07:00
Jon Robson 11618b5d81 Grid: Add table of contents to grid
Bug: T303484
Change-Id: Ic854b34b739b59e2d1efd864a711c961548f079f
2022-06-29 00:00:06 +00:00
bwang 8a88f61e89 Introduce media query breakpoint variables and replace all media query usage with new variables
Pixel shows 15 regressions, these are expected changes that are
fixing issues on specific viewports that fixes the following:

[At exactly the tablet breakpoint]
* the more menu dropdown was being
shown at the same time as the other menu items, resulting in duplicates
(see https://phabricator.wikimedia.org/F35285379)

[At exactly the desktop breakpoint]
* The table of contents AND the
table of contents toggle button to the left of the title were showing
(see https://phabricator.wikimedia.org/F35285392)
* The sticky header was not showing
* The fly out table of contents was showing instead of the sidebar
table of contents on scroll
* The top of the sidebar is brought into alignment with the tabs
(see https://phabricator.wikimedia.org/F35285408)

Bug: T310536
Change-Id: I6e870a032c8ba4ec003d00ff3f91732aaa2f38b0
2022-06-28 23:19:52 +00:00
bwang 4ab798441e Refactor SkinVector to use Hooks::updateMenuItems code to process menu data
SkinVector and Hooks both had code to add classes and handle Vector specific template data. This patch simplifies the way we handle menu data to always use Hooks:updateMenuItem. This has an additional side effect of removing instances of mw-ui-icon-before.

Bug: T306628
Change-Id: I73514a0eada4d92705b70e7c2ebd91092fc12544
2022-06-28 21:53:51 +00:00
Jon Robson 82f0433a11 Layout: Align content with hamburger icon
Content should always be aligned with the hamburger icon in the
new design between the tablet and desktop breakpoints.

Fixes: F35282438

Bug: T303484
Change-Id: I15215703d6392cd69ec57212d25c9a52149a6ac0
2022-06-28 00:07:34 +00:00
jenkins-bot 63e6daeb53 Merge "Fix table of contents when sidebar is open" 2022-06-27 23:36:00 +00:00
Jon Robson 89d9cf76b0 Remove hover and focus states on article toolbar links
Bug: T310886
Change-Id: I3b75d461ff0298e1ca3707e2cf4e79fd3db6497a
2022-06-27 22:26:03 +00:00
Jon Robson 393928a280 Fix table of contents when sidebar is open
Bug: T309807
Change-Id: If370246d13984981f4c3477fda2b2dce45337d91
2022-06-27 15:01:18 -07:00
Jon Robson 5beadc4bc2 Layout: Don't hide footer < 1000px when sidebar closed
The 'mw-workspace-container' class is present on both
the footer and the sidebar. The CSS rule should only hide
the latter.

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

Bug: T293443
Change-Id: I852b9024fbd21339b7c78dbb4deba811ab17c7e7
2022-06-25 00:03:41 +00:00
bwang 61e723c541 TOC: Ensure TOC spacing is correct when grid is enabled
Fix usage of CSS calc

Change-Id: I6dcf3751a4b478a14d8052a70720e138238203d3
2022-06-24 23:09:50 +00:00
Jon Robson ec6b6ebd9a Revise margin collapsing rules with new layout
Follow up to 97783e5

Bug: T311283
Change-Id: Ia0581713fd182b9236e398a2453efd06ce8b9f1f
2022-06-24 15:55:08 +00:00
Jon Robson 49c8b5f514 [Fix] Adjustment to legacy menu templates
Follow up to c5cfd4d

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

2) Add dedicated class to legacy menus

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

Change-Id: I056b033855c28f919a4af99784620503f10b9dcb
2022-06-22 22:42:39 +00:00
jenkins-bot bf117d1fc8 Merge "Restore sticky header class and update TOC styles" 2022-06-22 20:34:07 +00:00
Clare Ming 75cc9bdcd9 Restore sticky header class and update TOC styles
Bug: T311170
Change-Id: Ib12b6f79a20b2a25b49110e5a7de59d199917dc9
2022-06-22 14:46:07 -05:00
Jon Robson 25c3fc1863 Table of contents: Cached HTML is no longer a problem
Bug: T307900
Change-Id: Ic03bc15b8a15d6d095130c8346c399a2ac93d955
2022-06-22 18:17:52 +00:00
Jon Robson e1942cec4e Fix sticky header edit icons during A/B test init
- Add test case for T310750

Bug: T310750
Change-Id: Ie52a7227f337dd6cdb0ab441986aa2be6139f949
2022-06-22 09:38:19 -06:00
bwang f473129485 Add support for floating TOC lower down the page
This patch only handles the first case listed in the task description

Bug: T308689
Change-Id: I4e7dbded7a8206633a98653aaf4ced3fd2b6f69d
2022-06-21 16:02:11 +00:00
jenkins-bot 42127622dc Merge "Show scrollbars in sticky TOC" 2022-06-17 15:57:37 +00:00
jenkins-bot 0fff66b638 Merge "Add a URL parameter to edit links in the sticky header" 2022-06-16 18:00:37 +00:00
Clare Ming b6e76eb797 Show scrollbars in sticky TOC
Bug: T310540
Change-Id: I36af416901f9fde268f59a3e3fd690b743748514
2022-06-16 10:19:04 -06:00
David Lynch 734902811a Add a URL parameter to edit links in the sticky header
Briefly add it onto the originals when the click is being proxied so
that VE can pick up on it.

Bug: T309364
Change-Id: I871494b6e783018b1433f294e09b0d53dded6c3d
2022-06-15 18:20:59 -05:00
Clare Ming 536e53af7a Minor adjustments to collapsible TOC
Bug: T307900
Change-Id: Iec0c5c6e3dbede85e549fc9558b9d5c7be4fa10d
2022-06-15 09:56:27 -05:00
jenkins-bot def2a366bc Merge "[Regression] Revert border color of page title." 2022-06-14 22:20:23 +00:00
jenkins-bot 27a23465da Merge "Fix sticky header searchbox width and misc searchbox CSS cleanup" 2022-06-14 22:01:52 +00:00
bwang b6e7b5e880 Fix sticky header searchbox width and misc searchbox CSS cleanup
Bug: T310366
Change-Id: Id403f818b19747e3279df3112d93301f31323f9d
2022-06-14 15:58:53 -05:00
jenkins-bot 8d41918b6d Merge "Update checkbox.js comments" 2022-06-14 16:49:56 +00:00
Jan Drewniak 011a7b273b [Regression] Revert border color of page title.
Reverts the border color of the page title introduced in
I5d807f09bfbbceaded756daa78dbb023efcc91dc

Bug: T310533
Change-Id: I877f91bcd4c0915cc495b5237a53bda6ad971497
2022-06-13 14:38:09 -04:00
bwang 61c571ffb5 Update checkbox.js comments
Change-Id: I44d2087fefb28adf20c7ff938cff411cb0678a7e
2022-06-13 11:32:34 -05:00
Jon Robson 5fdd66fa3b Disable table of contents toggle on VE activation
While the table of contents is not updated by VisualEditor
we should hide it.

Bug: T307900
Change-Id: I246fbe0069329ef78735147b8d3f280433155158
2022-06-10 15:39:21 -07:00
bwang 93e8cfcd90 Collapse ToC into page title at narrow view ports with CSS/template changes only
Bug: T307900
Change-Id: I72607ec9d8b46401468de5815cf47dac9f4612a5
2022-06-10 15:49:06 -06:00
jenkins-bot 98cffb3f19 Merge "[Refactor] Generalize checkbox hack code" 2022-06-10 21:39:05 +00:00
jenkins-bot 677684d839 Merge "[Refactor] Separate sidebar persistence code from checkbox hack code" 2022-06-10 21:37:49 +00:00
Jon Robson 10810ec1da [Refactor] Generalize checkbox hack code
Allow it to apply to any appropriately marked up checkbox hack
element.

Change-Id: Ic3770877ee8e92574900715413a51acc964741be
2022-06-10 13:56:56 -07:00
Jon Robson de0729e604 [Refactor] Separate sidebar persistence code from checkbox hack code
Change-Id: I5d7d8897f656419a71b1327c37e88c9dd7f0767c
2022-06-10 13:55:22 -07:00
bwang e9ea4cee29 Hide TOC in print mode and clean up other print styles
Bug: T306719
Change-Id: I706225e01d1cc09bd387a008b56d9c2dcf8bdf4f
2022-06-09 19:15:27 +00:00
bwang d6e1dbd843 Move menu border style to legacy
Bug: T309398
Change-Id: Idfd88d98cb51ee35a359eef90ed54bc0a9feea87
2022-06-08 21:23:23 +00:00
jenkins-bot d91c921daa Merge "Make footer take up full width" 2022-06-08 19:33:12 +00:00
Jan Drewniak c5cfd4dce8 Restyle Vector tabs in modern Vector
Removes gradients from tabs (i.e. article toolbar) in new Vector, moving
the existing MenuTabs.less component into the skins.vector.styles.legacy module
and creating a new MenuTabs.less component for modern Vector.

Bug: T309398
Change-Id: I5d807f09bfbbceaded756daa78dbb023efcc91dc
2022-06-08 11:26:17 -07:00
Jon Robson c9fe4e83a1 Make footer take up full width
Bug: T293443
Change-Id: I0cea23fc6f7e013900211f10cc3da4066acf4d0c
2022-06-08 14:48:40 +00:00
Jon Robson 664b6c5cc5 [Grid] Vector 2022 layout uses CSS grid
It gracefully degrades to a single column
layout on grade C browsers, IE11, and Safari 9.

Bug: T303484
Change-Id: Iaa3c1bee146dc39b1259a1ce712a29c6b22305d1
2022-06-07 17:23:08 +00:00
Jon Robson e4aaf02ce8 [Grid] Move header rule into search rules
This will also apply to the grid layout so this seems a more
appropriate place, given the class relates to search.

Bug: T303484
Change-Id: Ib5b57fd948ecb5eefbf1d66e0e71045aed6e3102
2022-06-06 19:24:09 +00:00
jenkins-bot 3bc8b3a40e Merge "[Grid] Remove vector-layout-legacy selector from sidebar rules" 2022-06-03 22:05:34 +00:00
Jon Robson e801f917ae [Grid] Remove vector-layout-legacy selector from sidebar rules
These should actually be retained in the new design.

Bug: T303484
Change-Id: Ie1755e3cf5dec5da64615084ddc815fab7eb8bb1
2022-06-03 21:29:55 +00:00
bwang c45a4dd1e1 Add back search title to WVUI component
Bug: T291671
Change-Id: I30a917b4392256c0d23e57da882e0a1dc7b59562
2022-06-03 19:08:47 +00:00
Jon Robson deb54f9452 Correctly hide the sticky header when it is not in use
When the  vector-sticky-header-enabled class is removed from the body
it means the feature is not enabled, it doesn't mean the sticky header
should be invisible.

Call the hide method instead, and move it out of the function given
its a side effect

Bug: T308343
Change-Id: I4ecd6524146f203af926847812e20275c9573cab
2022-06-01 19:07:49 +00:00
Jon Robson b8701a3b58 [Grid preparation] Restrict certain rules to old layout
Having a clean slate to work from will help with the development of
introducing the grid

Bug: T303484
Change-Id: I8fb9a9d958e4e73e8bfbf4b797cee1353c915db5
2022-06-01 17:24:47 +00:00
jenkins-bot 5bf70d7fbb Merge "Sticky header edit button A/B test bucketing (updated)" 2022-06-01 16:20:33 +00:00
jenkins-bot 1f8a3c5318 Merge "i18n: Use correct direction for collapse Table of Contents" 2022-06-01 08:17:54 +00:00
Jan Drewniak d7e6690b52 Sticky header edit button A/B test bucketing (updated)
Adds behaviour for conditionally adding the edit button
to the sticky-header based on A/B test bucketing.

This behaviour depends on having the `$wgVectorStickyHeaderEdit` config
set to true for logged-in users:

    $wgVectorStickyHeaderEdit = [
        "logged_in" => true,
        "logged_out" => false
    ];

as well as an AB test configured with the following buckets:

    $wgVectorWebABTestEnrollment = [
        'name' => 'vector.sticky_header_edit',
        'enabled' => true,
        'buckets' => [
            'unsampled' => [
                'samplingRate' => 0
            ],
            'stickyHeaderEditButtonControl' => [
                'samplingRate' => 0
            ],
            'stickyHeaderEditButtonTreatment' => [
                'samplingRate' => 1
            ]
        ]
    ];

With that config, this change hides the sticky header for all users
except those in the stickyHeaderEditButtonTreatment bucket.

NOTE: This patch address the sticky header being visible on incorrect
namespaces when the AB test is enabled and the revert of
42b808738a.

Bug: T299959
Bug: T309370
Change-Id: I3effbb3e5f0bb1c8663255936458e3849511dfca
2022-05-31 15:58:35 -07:00
Jan Drewniak a3cef30154 Move page title above article toolbar menus
Moves the page's title above the article toolbar (i.e. tabs) based
on the VectorTitleAboveTabs config option. This feature remains
off by default, but can be accessed via the query parameter `vectortitleabovetabs`.

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

Bug: T303549
Change-Id: Id4816b753a1b2133c53c3b1d390b45631c704daf
2022-05-31 18:06:11 -04:00
jenkins-bot a6f5acd9de Merge "In max-width mode, constrain the width of page previews" 2022-05-31 15:29:26 +00:00
Sam Wilson 0ebae6c4ef In max-width mode, constrain the width of page previews
This allows the editing form to be wide, but makes sure that the
preview seen will more closely match how the page will end up
after being saved.

Bug: T307725
Change-Id: Ib2085eece69fe08b7fca4aaeacef66b26cdd5f16
2022-05-30 11:52:59 +08:00
Ebrahim Byagowi aebd782d75 i18n: Use correct direction for collapse Table of Contents
Collapse Table of Contents has incorrect direction for RTL, this fixes it.

Bug: T309478
Change-Id: I43f2d225aed7c3a74e35f8e72c1e261b39af9737
2022-05-30 02:37:10 +04:30
Ed Sanders 72d2653f59 Follow-up I1dee51009: Add url() to list-style-image
Bug: T309374
Change-Id: I91d690700cf82e315e98be7bfcadd8bdb4cc3450
2022-05-28 23:00:49 +01:00
Jdlrobson 0df8d35b43 Revert "Sticky header edit button A/B test bucketing"
This reverts commit 42b808738a.

Reason for revert: The sticky header is now showing up in unexpected
places e.g. special pages.

Bug: T299959
Bug: T309370
Change-Id: Ie7f224d84440279ba28e031e13d05984c81a3ad4
2022-05-27 18:10:29 +00:00
Jan Drewniak 42b808738a Sticky header edit button A/B test bucketing
Adds behaviour for conditionally adding the edit button
to the sticky-header based on A/B test bucketing.

This behaviour depends on having the `$wgVectorStickyHeaderEdit` config
set to true for logged-in users:

    $wgVectorStickyHeaderEdit = [
        "logged_in" => true,
        "logged_out" => false
    ];

as well as an AB test configured with the following buckets:

    $wgVectorWebABTestEnrollment = [
        'name' => 'vector.sticky_header_edit',
        'enabled' => true,
        'buckets' => [
            'unsampled' => [
                'samplingRate' => 0
            ],
            'stickyHeaderEditButtonControl' => [
                'samplingRate' => 0
            ],
            'stickyHeaderEditButtonTreatment' => [
                'samplingRate' => 1
            ]
        ]
    ];

With that config, this change hides the sticky header for all users
except those in the stickyHeaderEditButtonTreatment bucket.

Bug: T299959
Change-Id: If252956bc530d8ce54eeda61f42a93ffa48255cb
2022-05-25 10:15:47 -04:00
Jon Robson 4e67384131 Fixes Vector 2022 sidebar overlap when table of contents disabled
Bug: T308130
Change-Id: Ieec44e8f1657319962e2a7922d04186c260123fe
2022-05-23 23:13:29 +00:00
jenkins-bot e9cb96cde2 Merge "styles: Replace more deprecated mixins" 2022-05-19 23:27:07 +00:00
Jon Robson f91c3cd5a8 Use upstream reduces motion skin option
The new accessibility rules default to on, so no need to list
it in skin.json but we need to remove the now duplicated style.

Depends-On: Ie1c6c1ba7263c232d874263fdae7427a5ec489f6
Change-Id: I92f622b92adb8735c38a4ebe56eaf5bfc4ae37bf
2022-05-18 14:29:05 -07:00
jenkins-bot 7761ed4aff Merge "Revert "Move a max-width Less variable up into variables.less"" 2022-05-18 18:50:50 +00:00
Jdlrobson 55b5283148 Revert "Move a max-width Less variable up into variables.less"
This reverts commit bf4d843d97.

Reason for revert: These variables were intended as local to layout.
Only layout stylesheet should have access to layout variables. The
risk of having this in the global variables file is that non-layout
rules can be added to components.

Change-Id: I91fd01ed5333555052c243e25d37cd30d6d9bef6
2022-05-18 15:12:59 +00:00
jenkins-bot ce8ddbe0ea Merge "build: Update eslint-config-wikimedia to 0.22.1" 2022-05-18 00:41:00 +00:00
jenkins-bot 336b8eefb7 Merge "build: Update stylelint-config-wikimedia to 0.13.0" 2022-05-18 00:40:09 +00:00
Ed Sanders bf494b89fd build: Update eslint-config-wikimedia to 0.22.1
Change-Id: I25e0cf131c7d2ea53d362f4836a451b68cd31366
2022-05-17 23:40:46 +01:00
Ed Sanders 4a8eba29df styles: Replace more deprecated mixins
* .transform-origin
* .list-style-image

Change-Id: I1dee510097c179d23c5cc2192c70ca006869f5d0
2022-05-16 23:25:44 +01:00
Volker E 7eb818543e styles: Replace deprecated Less `.transform()` mixin with standard CSS
Replacing Less mixin calls of `.transform()`, deprecated
since MW 1.37, with CSS property.

Bug: T308360
Change-Id: Ic965193782a447d34eac4bd19816a7b753c36d44
2022-05-16 23:24:53 +01:00
Ed Sanders 7f7d5c4ae5 build: Update stylelint-config-wikimedia to 0.13.0
Change-Id: I122005b6817cf1997002dbe7a1bcbd249c9842cb
2022-05-16 17:44:12 +01:00
Sam Wilson bf4d843d97 Move a max-width Less variable up into variables.less
This makes it accessible elsewhere (such as within WikiEditor; see
the dependent patch) without having to include
all of screen.less.

Bug: T307725
Change-Id: I3fda9886c27fe0b78cf5bd5647d7e497a3aaba0e
2022-05-16 13:15:00 +08:00
Volker E 2adab440a5 styles: Replace deprecated Less `.transition()` mixin with standard CSS
Replacing Less mixin calls of `.transition()`, deprecated
since MW 1.37, with CSS property, but constituent properties.
This has been an outcome of recent discussions around design tokens,
which will be simpler to define, more modular, and better scoped. See
T304443 for further information.
Also clarifying, aligning comments.

Bug: T308351
Change-Id: Iab9d04c9a9f31f3842d076ce8fd8bf6e3534fc89
2022-05-13 20:37:22 +00:00
jenkins-bot 2cbb390edd Merge "styles: Replace deprecated Less `.box-sizing()` mixin with standard CSS" 2022-05-13 15:42:11 +00:00
Volker E e4d8c573a9 styles: Replace deprecated Less `.box-sizing()` mixin with standard CSS
Bug: T306488
Change-Id: I299e50397c4bf6f99b9892e83c966fffadd24048
2022-05-12 13:41:30 -07:00
Jon Robson 2213963241 [Grid preparation] Use variables for selectors with state
The checkbox hack adds complexity to our layout rules as we must
describe elements based on their siblings. To make these long selectors
easier to reason with and reduce the risk of rebase conflicts as these
shift I'd like to make these variables.

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

Bug: T307345
Change-Id: I1084defc7025f5c946e22a36d373224fae6f8bd6
2022-05-10 11:39:05 -05:00
bwang 94be7578f5 Factor out a separate scroll observer for the TOC A/B test, which should be fired separately from the page title observer used by the sticky header and TOC
Bug: T307952
Bug: T307345
Change-Id: I3f247730fa1c399e6d2e4d866677703fc24e8c58
2022-05-09 20:44:54 +00:00
jenkins-bot b6847038f8 Merge "[HTML] Refactor Content header templates" 2022-05-06 18:43:34 +00:00
Jan Drewniak 1288c97179 [HTML] Refactor Content header templates
Creates two new templates:
- ContentHeader.mustache containing the site header and indicators or languages
- ContentSubheader.mustache containing site tagline and conditionally indicators

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

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

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

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

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

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

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

Change-Id: Ib5b7f31419ae6b62f62878947651b8ab843a3955
2022-05-05 17:54:28 +00:00
Jon Robson 3b4b101459 Disable max width on article toolbar container
Bug: T306353
Change-Id: I1c9e223ebc22cf0e0a337856041f34449e6c483b
2022-05-05 02:21:17 +00:00
bwang cdc46e70da Fix TOC fadeout placement
Bug: T306893
Change-Id: Ib6fa8836948b6d6f202eb5365ae660acf210b473
2022-05-04 23:37:43 +00:00
jenkins-bot 3373d065c7 Merge "Fix Sidebar.less auto merge commit" 2022-05-04 20:19:12 +00:00
jenkins-bot a68409d262 Merge "[TOC] Remove pointer-events:none on .sidebar-toc-link" 2022-05-04 19:38:32 +00:00
bwang 6cc98aa449 Fix Sidebar.less auto merge commit
Auto merge commit for the 'Adjust table of contents margins at 1000-1200 breakpoint' patch incorrectly deleted a line from Sidebar.less. I need that deletion in 789210, because it will be backported later today
https://phabricator.wikimedia.org/F35103224

Change-Id: I0404c02d71160ec4537e49fc77489a8a5027a183
2022-05-04 17:05:42 +00:00
jenkins-bot 8a2f61ee02 Merge "Adjust table of contents margins at 1000-1200 breakpoint" 2022-05-04 16:49:53 +00:00
Jon Robson 9c26833af6 Adjust table of contents margins at 1000-1200 breakpoint
Bug: T307004
Change-Id: Ibb7be459305eaee57503d4efd67e19cd0f00046b
2022-05-04 16:04:33 +00:00
bwang 0b27b29475 Hide navigation menu label and remove legacy sidebar styles from modern styles
Change-Id: I701860ce0bf5f34c8318a999cddd7eede94aee3a
2022-05-03 16:50:58 -05:00
Jon Robson a1e5fd5fcc On special page do not show empty more menu to low resolutions
This is a follow up to I34ace0aeb3e23d8f6a8c5a8680bb492f37e343ad
On Special:Userlogin a "more" menu appears that's visible but empty
that should not

 Bug: T306229
Change-Id: I9384b3015de9991db41bde8ccc8f404ac533f198
2022-05-02 20:22:44 +00:00
Jan Drewniak 7e81c26712 [TOC] Remove pointer-events:none on .sidebar-toc-link
Previously, we relied on setting pointer-events:none on all child
elements of ToC links.

This propagated the click event up to the link itself in Javascript
and allowed us check if an element with the class `.sidebar-toc-link`
was clicked.

Unfortunately as of Chromium 101 this approach causes the entire link
in the sidebar to be unclickable.

Instead, this patch checks if the ToC link or any of it's children
have been clicked (using the less efficient `Element.closest()` ).

Bug: T307271
Change-Id: I2264b7862f6e1ef50c5c722daee81acc39eea54e
2022-05-02 19:48:30 +00:00
Tim Starling 8d0659b1e6 Updates for core temp user autocreation feature
* Use pt-tmpuserpage for the temp user name.
* Use the userAnonymous icon for the temp user personal tools menu.
* Suppress the logout menu item for temp users.

Depends-On: Ib14a352490fc42039106523118e8d021844e3dfb
Bug: T300263
Change-Id: I8ac5de82f76a9ec58b0fbef85546bc7fd5b793d2
2022-04-28 20:32:53 +00:00
bwang b075c90f60 Update TOC heading and link styles
Bug: T306562
Change-Id: Iafe335547a1e3c432efce303b5c0e5f8f5a23a15
2022-04-28 13:32:59 -05:00
Jon Robson 64df4fde20 Remove dancing tabs with CSS only solution
Remove JavaScript that collapses tabs and replace with an easier
to maintain breakpoint based solution.

Tabs will now collapse below the tablet breakpoint

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

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

Bug: T306229
Change-Id: I34ace0aeb3e23d8f6a8c5a8680bb492f37e343ad
2022-04-28 17:57:10 +00:00
jenkins-bot 0f31961e35 Merge "Add word-break CSS to TOC links" 2022-04-27 22:21:17 +00:00
bwang 61eec96090 Add word-break CSS to TOC links
Bug: T306913
Change-Id: I95420c837a779a85e55c20c7a9d1ae74b632c6cf
2022-04-27 19:24:18 +00:00
bwang af8cf470fd Fix TOC bottom fade
Additional change: Fixes an eslint warning

Bug: T306893
Change-Id: I778470ec5fa2081e4412f40b0180efbff7013d1b
2022-04-27 19:07:17 +00:00
bwang ea64b86f33 Enable collapsible TOC sections for user with preferred reduced motion
Bug: T306652
Change-Id: Ia94b9dd32484f5f8b4c8bfe28d7c5b1f303855bf
2022-04-26 23:38:14 +00:00
Jon Robson c269419af3 Disable animations when user prefers reduced motion
When browser preference for reduced motion is enabled:
* Disables bolding of table of contents
* Disables sticky header transition

Bug: T254399
Change-Id: I8ef9e59b258fed977ce370da352b1924832d842b
2022-04-26 23:31:38 +00:00
Jon Robson 7d75bb37ad [ToC] Increase threshold for ToC collapsing to 1000px
Bug: T306904
Change-Id: Ib3ad66a8f4ccf9c5ba323031821d6e681069bde5
2022-04-26 17:46:51 +00:00
Nicholas Ray 718bcef6f9 Fix empty space on left when bucketed in the control/unsampled group
When the AB test is enabled both the old and new TOC's are in the page's
html but only one is visible. The `.vector-toc-visible` class is also
present and will try to apply a left margin even if the page has been
bucketed into the control or unsampled group.

This patch takes the simplest approach to fix this problem with CSS only
especially given the transient nature of this code (will be removed when
AB test is finished):

* When the page bucketed in the control or unsampled group, prevent
  .vector-toc-visible from applying a left-margin through the use of
  `:not` selectors.

Additionally:

* Remove unnecessary `margin-left` rule that used to apply to the
  mw-workspace-container. Due to the work done in
  I2f95d5938674bb8263b6203c5f6a469762bf0cc2, the workspace container
  will now always have a computed left margin of zero because it is the
  same width as the page container.

Bug: T306366
Change-Id: Icd9572353bb5e29cfda91b095ceb8c2e652864e7
2022-04-19 14:35:49 -06:00
Clare Ming 5800b80596 Adjust alignment of searchbox in header
Per T305069#7832390, left edge of searchbox input should line up with
the left edge of the main content area.

Bug: T305069
Change-Id: I737c3cac09ae18c598164b232b6461f72451b3e3
2022-04-15 13:56:32 -06:00
Clare Ming f12659fff6 Layout + visual style changes for sticky TOC
- Layout updates per design review.
- Visual updates per design review.

Bug: T304166
Bug: T305069
Change-Id: I2f95d5938674bb8263b6203c5f6a469762bf0cc2
2022-04-15 10:24:46 -06:00
jenkins-bot b7268dd661 Merge "Fix position of search box in vector-22" 2022-04-12 00:41:52 +00:00
Nicholas Ray 5eacd5e629 Fix position of search box in vector-22
Looks like the selector for `vector-search-box-show-thumbnail` needs to
be adjusted as it is on the same element as the `vector-search-box-vue`
class.

Change-Id: Ief1dadddc082add65ae4bf29c951f2ddefb15d5b
2022-04-11 18:01:19 -06:00
jenkins-bot 107abe79a0 Merge "Scope ULS styles to when language button is in header" 2022-04-09 00:07:09 +00:00
jenkins-bot e527168978 Merge "Force legacy TOC to render at lower resolutions" 2022-04-07 23:39:14 +00:00
Clare Ming b24cf900fe Force legacy TOC to render at lower resolutions
- If TOC A/B test is enabled, page is in treatment group, and
viewport is below tablet, force legacy TOC to render.
- If TOC A/B test is disabled and new TOC feature is enabled,
and viewport is below tablet, neither TOC should render.

Bug: T300975
Change-Id: Ib30c3473eb47d6ac60924f40ccd0e42d29625407
2022-04-07 15:06:30 -06:00
bwang 40045c6e0e Scope ULS styles to when language button is in header
Bug: T304468
Change-Id: Iebacb6a7bf3412a6ee76eb5c9fdb9471c02dd16c
2022-04-07 14:47:44 -05:00
Clare Ming 805c6c97c2 Remove TOC margin to not always show fade out
Bug: T302076
Change-Id: I06dd5fc56c30299aceeae46b16d3ebd3e3cf11aa
2022-04-07 11:49:47 -06:00
jenkins-bot a56698c706 Merge "Update sticky header to use ARIA attributes for section collapsing and add accessible label to toggle buttons" 2022-04-07 15:51:56 +00:00
Clare Ming a0b1b5b056 Fix TOC fadeout proper
Bug: T302076
Change-Id: I247a1a92e6eaa3413053514866966393ff3c1964
2022-04-06 16:25:07 -06:00
bwang f1c70e99b7 Update sticky header to use ARIA attributes for section collapsing and add accessible label to toggle buttons
Bug: T303766
Change-Id: Idda4f286a42152af1d233588a1839ada5491ce95
2022-04-06 17:24:34 -05:00
Ed Sanders f04f62ec05 Update debounce param order
Parameter order was changed in
I2ef1c949d68c5642943a614e2cb3f2f0a4cb140c

Change-Id: Iefc61dd84e53de60a95a69275d5c5619b0db25ff
2022-04-06 17:15:20 +01:00
jenkins-bot ec3b66e0ed Merge "Only track headings that are included in the table of contents" 2022-04-05 22:10:33 +00:00
Clare Ming 83f324e863 Add fixes for sticky TOC fade out
Bug: T302076
Change-Id: I9fffb17e60182ef2d667ed86218b8f24e1d76f5c
2022-04-05 13:52:40 -06:00
Nicholas Ray 6fbf08a198 Build A/B test bucketing infrastructure for the table of contents.
* Bucket and sample on server by using the
  `WikimediaEvents.WebABTestArticleIdFactory` service from
  WikimediaEvents (soft dependency)
* Add linkHijack.js so that users bucketed in one group have the
  possibility of remaining in that group if they click a link to another
  page.

Bug: T302046
Depends-On: Ie6627de98effb3d37a3bedda5023d08af319837f
Change-Id: Iff231a976c473217b0fa4da1aa9a8d1c2a1a19f2
2022-04-04 17:06:29 -06:00
bwang 4a81d0e4eb Scroll active TOC links to midpoint when past threshold
Bug: T301150
Change-Id: I282dbeab8e0b121b71c04f921ab11311f1514da7
2022-03-31 15:50:54 -05:00
Jon Robson 94c7f31082 Only track headings that are included in the table of contents
Headings can also appear in templates inside divs and subtitles.
These do not
get rendered in the table of contents and should not be tracked.

This also excludes headings from the legacy table of contents which
may be in the article during the A/B test

See English Wikipedia examples [[Portal:Biography]] and [[Main page]]

Change-Id: I4ca8933a0e7736157f80e5e68077b153e5bfc81d
2022-03-31 17:35:00 +00:00
bwang 607f3279bd Move sticky header DOM queries into main.js
- Remove isStickyHeaderAllowed() from stickyHeader.js, move to main.js
- Rename variables in stickyHeader.js to be consistent

Bug: T301429
Change-Id: Ib445a19cbfab52a008b749ea63cef178d6288e6a
2022-03-30 09:21:25 -05:00
Clare Ming 2bfdbe74b6 Do not show footer menu in print mode
Bug: T300178
Change-Id: I48df6c39019dc0551ffb0ee559c51d5f6b31c825
2022-03-29 17:24:18 -06:00
jenkins-bot 0529f8cb26 Merge "Update scroll instrument for TOC" 2022-03-29 21:43:41 +00:00
jenkins-bot 056b242682 Merge "Make beginning bold on scroll" 2022-03-29 16:05:39 +00:00
Clare Ming f2c60983bb Update scroll instrument for TOC
- Leverage scrollObserver to use for TOC scroll events.
- Add new hooks to target legacy TOC intersection.
- See corresponding changes (not strict dependency) in related
WME patch 773628 for capturing scroll events from Vector TOC:
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/WikimediaEvents/+/773628
- Dependency on https://github.com/wikimedia/typescript-types/pull/30
which updates mwHookInstance interface with fire property to prevent
TS error on fire method of mw.hook in scrollObserver.

Bug: T303297
Change-Id: I5c2dd5f3a25ffcb0ed03b76ae28e65eb18ad8d33
2022-03-29 09:45:30 -06:00
jenkins-bot cda8df1cb2 Merge "Add fade to indicate scrollability in TOC" 2022-03-29 15:17:10 +00:00
Clare Ming ccdfbf2e58 Update @wikimedia/types-wikimedia to latest version
- Remove some @ts-ignore statements.
- Update invocation of mw.util.debounce to have correct order of
parameters.

Bug: T303297
Change-Id: I4bb795fbd4d026c21c66e9a3d161afff4d7ef09f
2022-03-28 23:33:50 +00:00
Clare Ming 1d574b86f1 Add fade to indicate scrollability in TOC
Bug: T302076
Change-Id: Ib803239602333e2a8232a26a10477a0f9933b819
2022-03-28 15:58:26 -06:00
Jon Robson a2c7c024df Make beginning bold on scroll
Bug: T301254
Change-Id: I4469575ea8590ae22023b98c3dbd31bc672d5766
2022-03-25 01:13:42 +00:00
jenkins-bot 1b8ee10357 Merge "Add data-event-name attributes to legacy and sidebar TOC" 2022-03-23 22:00:45 +00:00
Jon Robson c73e551d49 Pass script path to URL generator
Bug: T288686
Change-Id: I4d4d27de2d52f3486e01c8c70bda1b9c03178a24
2022-03-23 10:37:39 -07:00
jenkins-bot b3f19854b6 Merge "Revise AB.js to handle other features + server sampling/bucketing" 2022-03-22 22:53:30 +00:00
Nicholas Ray d01dead5a7 Revise AB.js to handle other features + server sampling/bucketing
* Eliminates AB.js dependency on sticky header
* Code coverage has been raised to 100%
* Instead of importing ABTestConfig, these props are now passed into the
  function along with a token.
* WikimediaEvents hook is now fired when experiment is initialized. The
  experiment should not be initialized if it is not enabled.
* Removes several methods (e.g. initAB, getEnabledExperiment) due to the
  preceeding changes.
* Adds `isInSample` and `isInTreatmentBucket` methods so that the client
  has less work.

Treatment buckets now follow a naming convention so that the client can
do less work querying if the subject is part of the treatment:

* Treatment buckets should have the case-insensitive `treatment`
  substring somewhere in their name (e.g. 'treatment',
  'stickyHeaderTreatment', 'sticky-header-treatment' )

Bug: T302046
Change-Id: I4febec42b4c471b2f2ef02be2e334bd6d2c31eec
2022-03-22 11:58:48 -06:00
bwang ac54984d75 Add data-event-name attributes to legacy and sidebar TOC
Bug: T302934
Depends-on: I5ef98d5f5713d3d99bc5f7f8112ba2d1e0f62e22
Change-Id: I5806c346abf0375c85248659c636ae3b2d73f661
2022-03-21 22:32:56 +00:00
Jon Robson 826a97db0e Table of contents should be hidden at lower resolutions
There should be no left margin on article content.

Bug: T298898
Change-Id: I92dafcc8f1bbd0dc4a21c20035b829198c18e8cb
2022-03-21 21:17:21 +00:00
Jon Robson b86dbc756c Address some code FIXMEs
- Remove references to the removed wgVectorUseWvuiSearch
configuration
- Remove mw-body qualifier on Indicators component.
- Drops some cache related FIXMEs

Change-Id: I6823b9c5bf19a067b56badf29f874a7127867a09
2022-03-21 20:29:58 +00:00
jenkins-bot 08efa139be Merge "Remove custom handling of aria-expanded in Vector checkbox hack buttons" 2022-03-21 18:03:14 +00:00
Mortal303 ae50914d4e Remove custom handling of aria-expanded in Vector checkbox hack buttons
Removed class "vector-menu-checkbox-expanded" and "vector-menu-checkbox-collapsed" in
includes/templates/Menu.mustache and deleted the necessary lines in
resources/common/components/MenuDropdown.less, tests/jest/stickyHeader.test.js,
includes/templates/skin.mustache, skin.json, i18n/en.json and i18n/qqq.json.

Bug: T299173
Change-Id: Ibf8a08e6e5d1a6c607abf170c030a0285e84ad74
2022-03-21 23:14:51 +05:30
jenkins-bot 822d1957f1 Merge "Revert "build: Update eslint-config-wikimedia to 0.22.1"" 2022-03-17 00:18:36 +00:00
Jdlrobson f7a859bac5 Revert "build: Update eslint-config-wikimedia to 0.22.1"
This reverts commit b72c648d21.

Reason for revert: Causes an issue with the search
(See https://phabricator.wikimedia.org/F35009362)

Change-Id: I09f7e5c9eab677bfd5a92cf2d8389d20a2d6e87a
2022-03-16 23:40:42 +00:00
jenkins-bot 0b3d452083 Merge "build: Update eslint-config-wikimedia to 0.22.1" 2022-03-16 17:04:23 +00:00
jenkins-bot 4bb95af10c Merge "Set position and z-index for mw-page-container" 2022-03-16 16:21:20 +00:00
Ed Sanders b72c648d21 build: Update eslint-config-wikimedia to 0.22.1
Change-Id: If632697f7c3bb3fad6668d791d9408f7b7a3590b
2022-03-16 15:42:07 +00:00
Abijeet 3a39708163 Set position and z-index for mw-page-container
This forms a stacking context inside mw-page-container. It allows
overlays appended to the body tag to position themselves over the
Vector interface.

Bug: T301452
Change-Id: Ie187fde43dd8e7f108388c848438545c75d19b09
2022-03-16 13:29:07 +05:30
Jon Robson 1113492383 Update Node version
Change-Id: Ib0f2fcb372e2d89450c26beca691bc7060f11718
2022-03-15 14:26:04 -07:00
jenkins-bot fc897266bc Merge "Use explicit line height for user menu items" 2022-03-03 17:47:44 +00:00
jenkins-bot 9205554552 Merge "Render sidebar menu above TOC" 2022-03-03 00:26:38 +00:00
bwang 9fb8af8ae8 Render sidebar menu above TOC
Can only be merged after I8c0924f6de28b15602969de873a843b4cd69548b
has been in production for 3 days

Bug: T300875
Change-Id: I924a69b37214a34f989f49f0425c701650928e17
2022-03-02 17:04:47 -06:00
jenkins-bot 288c8b95b2 Merge "Update Vector menu CSS to use `vector-menu-heading` instead of `h3`" 2022-03-02 19:21:10 +00:00
Mortal303 ab11cc9adb Update Vector menu CSS to use `vector-menu-heading` instead of `h3`
Replaced h3 tag in includes/templates/Menu.mustache with label tag.
Replaced h3 elements in .storybook/icons.less, resources/common/components/Menu.less,
resources/common/components/MenuDropdown.less, resources/common/components/MenuPortal.less,
resources/common/components/MenuTabs.less,resources/skins.vector.styles.legacy/components/MenuDropdown.less,
resources/skins.vector.styles/components/UserLinks.less, resources/skins.vector.styles.legacy/components/Sidebar.less
and resources/skins.vector.styles.legacy/layouts/screen.less
by vector-menu-heading.

Bug: T290280
Change-Id: I6eee7d6bc47c74a62166d4579fd4d3da3dc88e88
2022-03-02 20:05:36 +05:30
jenkins-bot 9c9d8693c5 Merge "Only show scrollbars when needed in language menu" 2022-03-01 20:20:09 +00:00
jenkins-bot 5dccb7ec04 Merge "Hide sticky header and ULS button in print mode" 2022-02-28 23:00:40 +00:00
Volker E f2d7158616 build: Update 'svgo' to latest v2.8.0 & re-crush images
Updating 'svgo' to v2.8.0 and newest Wikimedia SVG guidelines –
mainly around new whitespace features of SVGO.

Change-Id: Ie48f5e78b3f9b6e7f01b65618c1d6089fa4a2f54
2022-02-28 00:00:05 +00:00
bwang be2abb581c Hide sticky header and ULS button in print mode
Bug: T300178
Change-Id: Ie1eb02530ec62fa011da4be45a61d26522c1650b
2022-02-25 17:32:35 +00:00
BrandonXLF 1b0af9022b Add icon classes to portlet links without IDs
Only limit the mw-ui-icon-vector-gadget-ID class to portlet links with
IDs.

Bug: T301012
Change-Id: Ib69957b8d44d9b2a02df9f453de262beb8740799
2022-02-23 16:23:58 +00:00
jenkins-bot 11b968cf18 Merge "Clean up: Remove ts-ignores in stickyheader.js" 2022-02-23 16:18:06 +00:00
jenkins-bot d93f9e9bed Merge "Use TOC template data for showing collapsible section arrows" 2022-02-22 22:16:18 +00:00
bwang 5f0c0cb294 Use TOC template data for showing collapsible section arrows
Bug: T299361
Depends-on: I8ab5c0543b898d1df9399a1cb39672c45daf2acd
Change-Id: Ib68de8cd97cc1111a5a33e100e688d6832fc7e6e
2022-02-22 15:47:23 -06:00
Nicholas Ray 27939ac6c9 Revert "Improve jsdoc for tableOfContents.js and sectionObserver.js"
This mostly reverts commit f5ad6fe78a but
keeps the SectionObserverProps typedef.

Instead, we will use @module introduced in
Ib68de8cd97cc1111a5a33e100e688d6832fc7e6e.

Change-Id: I7aff49a3d922889cc99bc4313a6cb416410a7a0d
2022-02-22 12:36:35 -07:00
Nicholas Ray f5ad6fe78a Improve jsdoc for tableOfContents.js and sectionObserver.js
Switch to using @namespace which seems to have the best jsdoc support
for the revealing module pattern [1] that these two files use.

Additionally:

* Add typedef for section observer props

[1] https://www.oreilly.com/library/view/learning-javascript-design/9781449334840/ch09s03.html

Change-Id: I3eeda191e5da0294ad40533053adb57e1fc9c8e9
2022-02-21 17:40:10 -07:00
Nicholas Ray 6e9506dcad Dynamically expand/collapse sub-sections in ToC based on # of headings
Server render the table of contents in a collapsed state when the total
number of headings is equal or greater than the value of
`$wgVectorTableOfContentsCollapseAtCount`. Otherwise, the table of
contents will be server rendered in its "expanded" state.

In addition:

* Revise table of contents tests to call one `assertion` per element so
  that it is easier to see the exact element that may fail an assertion.
* Revise table of contents tests to call a mount function that can merge
  props to allow for a more flexible set of tests.
* Revise table of contents tests by wrapping a `describe` around tests
  that expect the same prop state.
* Adds typedef for table of sections props

Bug: T300973
Depends-On: Ifaee451e1903f2accd0ada2f2ed6dfa3f83037b6
Change-Id: I382200bc603b6abf757a91f14a8a55a6581969bd
2022-02-21 14:58:51 -07:00
bwang 48f1f1355b Clean up: Remove ts-ignores in stickyheader.js
From what I could tell, most instances of `toHTMLElement` or @ts-ignore could be fixed by using typeguards or using Element over HTMLElement.
Element is a looser typing than HTMLElement, but given `querySelector` returns `Element|null` and the fact that we were already inconsistently using both Element and HTMLElement in this file, I feel it was a worthwhile tradeoff

Change-Id: I3512a98fa67c13a4383b9497e8588960259b5b68
2022-02-21 11:41:12 -06:00
jenkins-bot 8dde172451 Merge "Sticky header dropdown should not contain gadgets in personal menu" 2022-02-21 17:35:41 +00:00
jenkins-bot db902a3250 Merge "Offset the TableOfContents `top` property only when the sticky header is shown" 2022-02-19 01:32:03 +00:00
Clare Ming 098f65712e Fix long titles with wbr tags in sticky header
Bug: T300134
Change-Id: Ice45acf026e4ef0deee9c6d6f905634cad59c2e3
2022-02-18 17:14:15 -07:00
Jon Robson 2dcd99ed21 Sticky header dropdown should not contain gadgets in personal menu
Bug: T302087
Change-Id: Iae1f42c3c526398d7dea038786ae9001e118307b
2022-02-18 21:30:29 +00:00
Nicholas Ray 29e40714bc Offset the TableOfContents `top` property only when the sticky header is shown
This uses the sticky header's `.mw-sticky-header-element` utility class
to conditionally offset the table of contents to the height of the
sticky header only when the sticky header is enabled.

Bug: T300077
Change-Id: Ibad97a11e708ba19acf27ca82320f7c3e5f80447
2022-02-17 12:20:15 -06:00
jenkins-bot 9b7d5ad473 Merge "Toggle ToC sections when clicking toggle button" 2022-02-16 22:30:25 +00:00
jenkins-bot 914e3d55e6 Merge "Add fetch tests from WVUI" 2022-02-16 22:07:18 +00:00
bwang 301e09916d Toggle ToC sections when clicking toggle button
Bug: T300167
Change-Id: If1150a9e018b232da900187383aaee9c9cf331a1
2022-02-16 15:48:28 -06:00
bwang a560fb814a Add fetch tests from WVUI
Bug: T288686
Change-Id: Ifeb2e355482d3d5920c2535c89193cc4f36a13c9
2022-02-15 14:00:40 -06:00
jenkins-bot 0f49a257d1 Merge "Collapse ToC by default & expand sections when clicking section headings" 2022-02-15 19:31:18 +00:00
jenkins-bot 45badb5127 Merge "Revert "Add fetch tests from WVUI"" 2022-02-15 19:16:06 +00:00
Bernard Wang 3c161cf49e Revert "Add fetch tests from WVUI"
This reverts commit 7e79ad5686.

Bug: T301810
Change-Id: Icc8ecf6b0f8b1106e0a69364da251ff52161f523
2022-02-15 18:47:37 +00:00
Jan Drewniak 7d32ec80d3 Collapse ToC by default & expand sections when clicking section headings
Collapses sub-sections in the new table of contents by default
(except for non-js and reduced-motion users) and expands the
sections when the top-level section link has been clicked.

Refactors the `activateSection` TableOfContents methods into separate
`activateSection` and `deactivateSection` functions.
Adds `expandSection` and `collapseSection` methods.

Adds triangle icon as a visual expand/collapsed indicator
next to all ToC section headings and are hidden via CSS based on
whether or not the section contains subsections.

Adds test for tableOfContents.

Bug: T299361
Change-Id: I36b3ae7f9f633877683bc17a9444c970d7fa7293
2022-02-15 00:09:50 -05:00
jenkins-bot bdef6990fb Merge "Add fetch tests from WVUI" 2022-02-14 22:08:04 +00:00
bwang 7e79ad5686 Add fetch tests from WVUI
Bug: T288686
Change-Id: Ic95b620087fc14b055a3108999540769ac123ec8
2022-02-14 13:52:16 -08:00
jenkins-bot 97f231d0fb Merge "Trigger a window resize event when toggling sidebar state" 2022-02-14 21:06:39 +00:00
bwang 2a83dad477 Add back flex-grow for sticky header search bar
Change-Id: Id503163d85dfc519d4c47f95e4567dcacfa7458e
2022-02-14 13:08:07 -06:00
jenkins-bot 4557c0910b Merge "Use new ve.activationStart hook to hide header earlier when loading editor" 2022-02-14 18:33:19 +00:00
jenkins-bot a541859743 Merge "[eslint] Disable mediawiki/class-doc" 2022-02-14 16:15:34 +00:00
Nicholas Ray 6b73bd2b41 Fix jsdoc comments for sectionObserver.js
Move jsdoc comment closer to the methods they are describing. This also
enables better typehint support.

I36b3ae7f9f633877683bc17a9444c970d7fa7293 will handle revising tableOfContents.js.

Change-Id: Ifcac7cfd88cd3f1c0405611c880a0d101d2aed3b
2022-02-11 12:17:38 -07:00
bwang 52c7c2ee75 [eslint] Disable mediawiki/class-doc
Given our use of constants for tracking classes this eslint rule
is more an annoyance than helpful.

Change-Id: I37570e3e851997d058f2d93777990dddb3d04089
2022-02-11 16:31:33 +00:00
bwang 3e92800bd6 Move REST search client out of WVUI into Vector
Bug: T288686
Depends-on: I4afc8c38dc9c51d55b46b766a1417b1266963482
Change-Id: Iac6023bb6edca5c8dddc3bfd362db727b2534946
2022-02-10 10:17:10 -06:00
jenkins-bot 5ac2b88293 Merge "Move #mw-sidebar-button layout styles to Header.less" 2022-02-09 23:11:56 +00:00
jenkins-bot 306dc89bf8 Merge "Limit WVUI search to ES6 browsers" 2022-02-09 23:01:03 +00:00
Jon Robson 0c2981d772 Limit WVUI search to ES6 browsers
Rather than test for fetch, limit the code to ES6 browsers.

Depends-On: I96a03796628a74ace93579d45a582711400c09c1
Change-Id: I4ca10182491118e61e155f99c713d4cb1b4fc7f0
2022-02-09 22:10:11 +00:00
Nicholas Ray 390155c67f Move #mw-sidebar-button layout styles to Header.less
Given that these styles deal with the layout of the sidebar button in
the main header and don't make sense in any other context (at least
currently), I think they belong in Header.less.

Change-Id: I191b9a404c82c5a1a80f97d98fa54535fdd53944
2022-02-09 09:29:47 -06:00
Nicholas Ray 80a111d0e4 Fix TOC section activation on link click bug
We want the link that the user has clicked inside the TOC to be "active"
(e.g. bolded) regardless of whether the browser's scroll position
corresponds to that section. Therefore, we need to temporarily ignore
section observer until the browser has finished scrolling to the section
(if needed).

However, because the scroll event happens asyncronously after the user
clicks on a link and may not even happen at all (e.g. the user has
scrolled all the way to the bottom and clicks a section that is already
in the viewport), determining when we should resume section observer is
a bit tricky.

Because a scroll event may not even be triggered after clicking the
link, we instead allow the browser to perform a maximum number of
repaints before resuming sectionObserver. Per T297614#7687656, Firefox
wasn't consistently activating the table of contents section that the
user clicked even after waiting 2 frames. After further investigation,
it sometimes waits up to 3 frames before painting the new scroll
position so we have that as the limit.

Bug: T297614
Change-Id: If3632529f58c15348a7200258f4f5999ea0dadc4
2022-02-08 14:45:16 -07:00
jenkins-bot bcd4ee0ee1 Merge "Fixes for sticky header:" 2022-02-07 16:16:47 +00:00
BrandonXLF 936bbc427a Only show scrollbars when needed in language menu
Bug: T301058
Change-Id: I19af6c27b7adf8a35ccbc4163c585e338240eb72
2022-02-05 21:24:47 -05:00
Clare Ming 19e5d2885a Fixes for sticky header:
- Make page title width fill container.
- Remove page title fadeout, replace with ellipsis.
- Prevent language button contents from wrapping.

Bug: T298885
Bug: T300036
Bug: T298887
Change-Id: I6b09f89ed89a9da7406cdf8b3a00698a9dd66d10
2022-02-04 15:36:35 -07:00
Nicholas Ray 4d2ad52374 Remove `getElementsByClassName` usage from sectionObserver
Based on prior discussion [1], using getElementsByClassName probably
isn't worth it.

[1] https://gerrit.wikimedia.org/r/c/mediawiki/skins/Vector/+/756675/8..13/resources/skins.vector.es6/main.js#104

Change-Id: Id7f8aff73a1d2082ebfeaa9488a815d96317c156
2022-02-03 17:33:42 -07:00
Clare Ming 4d8b548f5f Hide sticky header below 1000px port width
Bug: T298836
Change-Id: Ie524f997d2f9847252afc215d3ac589e511ace07
2022-02-03 13:54:16 -07:00
David Lynch 19edeeabe0 Trigger a window resize event when toggling sidebar state
Other page elements outside of Vector should be notified that the
content area is changing size, in case they need to adjust the size of
fixed elements. Triggering window.resize should allow them to adapt
without needing to write Vector-specific code.

A specific case of this: the floating edit toolbar when VisualEditor is
open would be incorrectly sized / aligned if you toggled the sidebar in
edit mode.

Bug: T300826
Change-Id: I79e0fc67b5e35c2fb975a0a3048184de0d63813e
2022-02-03 12:18:42 -06:00
jenkins-bot 63b1bdbb2b Merge "Drop search related feature flags" 2022-01-31 22:05:45 +00:00
jdlrobson d8382ec96b Drop search related feature flags
Given Wikidata is the only project using modern Vector,
and the only project where the search API is not applicable,
this will result in a loss of autocomplete on Wikidata.org
which will fall back to the non-JS mode.

Bug: T290688
Change-Id: Iece5a4efd43e09cd90c842c9c134ca115b35f2b2
2022-01-31 21:00:22 +00:00
bwang 66359e8fa5 Setup jest unit tests and add basic test cases for AB.js and App.vue
Bug: T300561
Change-Id: Ib7c314b094bd823ae233374f63c9094724d6c06f
2022-01-31 20:50:33 +00:00
Ed Sanders 1cd5bf4d41 Use new ve.activationStart hook to hide header earlier when loading editor
Bug: T299907
Depends-On: I0eaeb98719bf7a43e4a87366cfcd204f35b74650
Change-Id: I8e8b635b46e79c63c4dafbd2418c9be94528ec06
2022-01-31 18:32:55 +00:00
Jon Robson 029110810e Language alert box should use Html::noticeBox
Html::noticeBox doesn't output any deprecated classes so
will not conflict with any user gadgets now.

Bug: T299625
Change-Id: Ic9aef5c8ff3fae6a79c7cf82cc3c97714cf40b3d
2022-01-27 15:35:38 -08:00
Nicholas Ray 3c433a5315 Add sectionObserver and tableOfContents component JS to respond to intersection changes
This commits sets up the Table of Contents to bold the active section
when the section is scrolled.

Unfortunately, because our content does not have actual sections but
instead has a flat list of headings and paragraphs, we can't use
IntersectionObserver in the conventional way as it is optimized to find
intersections of elements that are *within* the viewport and the
callback will not reliably fire during certain scenarios (e.g. with fast
scrolling or when the headings are not currently within the viewport).
Furthermore, iterating through a list of elements and calling
`getBoundingClientRect()` can be expensive and can also cause
significant forced synchronous layouts that block the main thread.

The best compromise in terms of performance and function that I've found
is to use a combination of a throttled scroll event listener and
IntersectionObserver's ability to asyncronously find the
boundingClientRect of all elements off the main thread when `.observe`
is called which is the approach this patch takes. Although this is an
unorthodox way to use IntersectionObserver, performance profiles
recorded while holding the "down" arrow and scrolling for 10 seconds
with a 6x CPU throttle are comparable between master and this patch:

master: https://phabricator.wikimedia.org/F34930737
this patch:  https://phabricator.wikimedia.org/F34930738

Bug: T297614
Change-Id: I4077d86a1786cc1f4a7d85b20b7cf402960940e7
2022-01-26 14:11:43 -07:00
Nicholas Ray 76eb7caa2f Update typescript to latest (v4.5.5)
Vector's tsc version is currently reporting errors that the latest
typescript version doesn't report and vice versa. Upgrade to the latest
version to avoid these discrepancies.

Additionally:

Fix tsc errors that are now reported by updated version

Bug: T297614
Change-Id: I0eb67bcc1a5ce214fcf2d6f6433a5de3a845b6a6
2022-01-24 16:35:45 -07:00
bwang 8a957c0163 Use 'toc' skin option and render with new TableOfContents mustache template
Bug: T297611
Change-Id: I8332f7b9c9574d8dece4f7111b299b95533cf386
2022-01-19 14:38:51 -06:00
Ed Sanders da1fb74554 Sticky header: Wait for some repainting to happen after VE teardown
Waiting for one animation frame seems to make the sticky header
re-appear consistently.

Bug: T299114
Change-Id: Ie1230bf861f12e4e18a6adb0f6779c199d6954a1
2022-01-14 14:41:36 +00:00
Jon Robson 5a0932835a Cleanup: Only need to import one variable file
Change-Id: I120a66ec7013d249e8c42e6e631ae568effaa925
2022-01-12 20:58:16 +00:00
jenkins-bot 68b2bb23d1 Merge "Use .vector-search-box-auto-expand-width class to style intermediate search components" 2022-01-11 19:42:02 +00:00
Nicholas Ray 72120a36a0 Use .vector-search-box-auto-expand-width class to style intermediate search components
Before Vue/WVUI lazy loads, we have intermediate search components that
are rendered on the server and that need to be styled based on the
`autoExpandWidth` prop passed to the search component. This commit
refactors VueEnhancedSearchBox to use this class if present.

Additionaly:

* Cleanup fixmes from Id8d3bd4aa74113b91ecaf66cb58cf5625db8a302
* Replace `vector-search-box-show-thumbnail` class with
  `.vector-search-box-auto-expand-width` class in Header.less now that
  the class has been cached in the HTML.

Depends-On: Ic914ecaee591008f987bd6d754fda8628125de7b
Bug: T297531
Change-Id: Ia6b7afa990fa4b04578740b483ba21dbef45a016
2022-01-10 23:35:45 +00:00