Commit graph

336 commits

Author SHA1 Message Date
jenkins-bot 84864d21de Merge "Drop styles for cached HTML" 2023-06-16 16:32:31 +00:00
daniel c8f785d7bb Clean up hook handler registration
Bug: T339167
Needed-By: I83bc81d1b3033c38b9313884a9c70a187fdde227
Change-Id: I980f2d45e6bb8c6a04058e68c758f71bbcf709de
2023-06-14 22:03:19 +02:00
Jon Robson 24d69726f3 Drop styles for cached HTML
Performance: This reclaims 1.3kb of CSS.

Bug: T336526
Change-Id: I6c1ed1523df8cc9e2f2ca09506f12a595b8b013d
2023-06-14 10:52:44 -07:00
Jon Robson 68239ae344 Use Codex for button styles, start transitioning icons to use Codex icon mixins
Changes:
- mw-ui-button to cdx-button
- mw-ui-quiet to cdx-button--weight-quiet
- mw-ui-icon-element to cdx-button--icon-only
- mw-ui-icon to vector-icon
- mw-ui-icon-flush-right/left to vector-button-flush-right/left
- Removes $isSmallIcon param in Hooks.php

85 Visual Changes
- ~36 changes from minor pixel changes from the new button classes in the main menu, language button
- 22 from standardizing the padding of the TOC in page title
- ~10 changes from addition of .cdx-button to the TOC toggle buttons

PERFORMANCE:
This will result in an overall increase of 2.7kb of render blocking
CSS, 1kb will be reclaimed when
I6c1ed1523df8cc9e2f2ca09506f12a595b8b013d is merged.

Co-author: Bernard Wang <bwang@wikimedia.org>
Bug: T336526
Change-Id: Ibd558238a41a0d3edb981e441638f9564f43d226
2023-06-12 16:26:28 -07:00
Ed Sanders fe6720c7f8 Remove config and AB test code for edit buttons in sticky header
Bug: T337955
Change-Id: I8ebeeca1712e335d886faa498849fcb3f7f6e1ab
2023-06-01 18:00:07 +01:00
jenkins-bot ef47d485d7 Merge "Cleanup skin.json and ToC template" 2023-05-21 10:04:36 +00:00
Umherirrender 0583639a6a tests: Make PHPUnit data providers static
Initally used a new sniff with autofix (T333745)

Bug: T332865
Change-Id: Ia03ad50ac5d34e9c012a8fad068adabd2e5d8669
2023-05-20 11:11:30 +02:00
Func 8c578a984e Cleanup skin.json and ToC template
The ConfigRegistry was removed as unused but somehow reintroduced
mistakenly in the commit 80b60c15.

The fallback to anchor for old parser cache should be good to drop.

Change-Id: I0b6effd0fd4c535298fa280da734b13d26a5d968
2023-05-17 22:15:37 +08:00
Jon Robson 0acb55fc8e Run A/B test enrollment code for any A/B test
Currently the A/B test enrollment code is limited to the
sticky header experiment. Instead of doing that, always check it
inside skin.js and run it if necessary.

Now it's possible for this to run twice, keep track of whether
the init function has been called and make sure it doesn't get called
more than once.

Bug: T335309
Change-Id: Icfef13b019319d07686a06e06846789faf790ed6
2023-05-11 14:36:42 -07:00
bwang 6f13caa775 Remove VectorTableOfContentsBeginning flag
Bug: T334969
Change-Id: I9e931b7cdc443e73a41c92f5368f81b35285437e
2023-05-08 22:25:03 +00:00
bwang d8bcb73647 Update user menu and watchstar buttons to be consistent with spec
Depends-on: Ibd762c810e1d89047e39ce3af792b43689bf11e3
Bug: T335909
Change-Id: I5b42780416b466cc3fc33d29220aef2979ac3239
2023-05-03 15:47:00 -07:00
bwang dd2284cf16 Update instances of Button.mustache to use to use VectorComponentButton
Bug: T334881
Change-Id: Iec3fc67c498d230ae7c0dc0ba4316006ccd9626a
2023-05-02 18:00:41 +00:00
Nicholas Ray 29b982999f Remove language switching alert box temporary feature flag
Remove everything related to the `wgVectorLanguageInHeader` feature flag and
rely on the LangaugeInHeader feature instead.

Bug: T297237
Change-Id: Ida2c588e03f759d2eefc7c67ff44dcdd9a100f9a
2023-04-27 14:57:18 -06:00
Moh'd Khier Abualruz c076c85070 popupNotification Fix memory leaks
Bug: T335153
Change-Id: I90e88ef0c6cb880205f4fb6505d997826d923690
2023-04-25 14:51:25 +02:00
Moh'd Khier Abualruz ecdf2ced2c popupNotification Javascript tests
Bug: T333345
Change-Id: If65a86b2d6a8345f127a0803fd64cfa9f13a8630
2023-04-20 14:09:33 -07:00
Jon Robson a76e198523 Remove A/B testing element from OverridableConfigRequirement
Superseded by ABRequirement. Having this code here is confusing
and might lead to non-standard A/B tests being defined.

Change-Id: Ifd9d2b7249250a73e7f6e4f9d6b51c322ef2759d
2023-04-19 01:41:53 +00:00
Jon Robson 2499e834bb Remove Eslint disable and TypeScript ignore rules, bump coverage
Follow up to 87dd101a
* bump coverage to reflect improved test state
* remove ts-ignore statements
* Drop eslint-disable-next-line compat/compat rules in ES6 code
* Drop TypeScript checking on Jest files
* Identifies an existing usage of ES7 includes method in place
where ES6 browsers need to be supported.
* Update App.vue booleans to default to false. Note this doesn't
impact our usage of the search app as we always pass these values
in.
* Drop unused eslintEs6.json configuration file

Change-Id: Ib6f1ef77bf4e27ecdcc54b5fb963818437f8195c
2023-04-13 00:20:44 +00:00
Jon Robson 87dd101a69 Consolidate and fix eslint errors, dropping ts-ignores
* Upgrade @wikimedia/types-wikimedia to allow us to drop several
@ts-ignores
* Merges eslint rules now that ES6 is default everywhere
* Runs autofix command
* Fixes various prefer-const errors

Change-Id: Iee5bcb93f10a76d80dbeec813f6387c13438263e
2023-04-11 16:56:31 -07:00
Jon Robson c3e57e0ecd Merge skins.vector.es6 into skins.vector.js
With T178356 ES6 is the default, so these can now be
managed in the same module. Keeping them in the same module
will hopefully allow us to make more optimizations on the long
term.

Change-Id: I3fe9e50143b85b4cdc3d9171a60c3720a7c26b4b
2023-04-11 23:18:46 +00:00
Jon Robson 96baf5db50 Eslint: Modernize tests for ES6
Change-Id: I3600afd2eeacddc8e1c983eaad0a96e0755c7ba5
2023-04-11 23:18:38 +00:00
Jon Robson 28ada2dc78 Refactor: Separate A/B test configuration from site configuration
Making it easier to add configuration variables to JavaScript
in future. This will be used for the pointer indicator.

Change-Id: I65396a3867e7e92d7385ebaa573fb48105ecb9fd
2023-04-11 22:40:45 +00:00
bwang 070349dd2e Remove Storybook and jsdoc and its dependencies
Bug: T321102
Depends-On: Ia21c14f72631e607e0d626408557eacb83529a03
Change-Id: I3535398826e67825965c024805fd5e921fe5298c
2023-04-04 21:27:45 +00:00
jenkins-bot 4994a6df8e Merge "Adjust table of collapsing auto-collapse algorithm for articles with few top level sections" 2023-04-04 16:19:00 +00:00
Moh'd Khier Abualruz 098811f200 Adjust table of collapsing auto-collapse algorithm for articles with few top level sections
Bug: T333021
Change-Id: I9eef0fc0715f5f1917c205b7b7987b0ed76f31a2
2023-04-04 10:35:12 +02:00
Umherirrender d2b8ce8a3e build: Updating npm dependencies
* eslint-config-wikimedia: 0.22.1 → 0.24.0
* grunt-banana-checker: 0.9.0 → 0.10.0
* @wikimedia/codex: 0.7.0 → 0.8.0
* @wikimedia/codex-icons: 0.7.0 → 0.8.0
* @wikimedia/codex-search: 0.7.0 → 0.8.0
* @wikimedia/mw-code-qunit: 6.4.1 → 7.0.0

Change-Id: I3982576a6e8e932efa0ae00be58af343b29ef59c
2023-04-03 23:44:22 +02:00
bwang 8d9b148cf7 Setup header and sticky header to be able to be full width
- Move the header and skip link out of .mw-page-container-inner and the grid
- Wrap the header and sticky header with a .vector-header-container element, allowing us to easily update header styles in the future
- Update sticky header to use a <div> to fix a11y error. Update searchToggle.js to use .vector-header-container rather than <header>

Bug: T332449
Bug: T330438
Change-Id: I038fc17cbb88a29dbe8d7841b824761a91d38405
2023-03-30 16:37:15 -05:00
Jan Drewniak 40bbb8c3a9 remove Page Tools config & HTML
Removes the config option for Page Tool menu,
its associated logic, along with the associated HTML from
the mustache templates.

Hardcodes the `vector-feature-page-tools-enabled` class
into the HTML element to prevent breakage.

Bug: T332090
Change-Id: I6466d80c6970bcc8e28d897b6bdff911a90e3655
2023-03-30 11:32:36 -04:00
jenkins-bot e82d0b002f Merge "Enable the pinning for anonymous users when page tools is enabled." 2023-03-14 00:39:18 +00:00
Nicholas Ray 448a90665d Enable the pinning for anonymous users when page tools is enabled.
Bug: T331657
Change-Id: Idca2ccfe4aeef0a2ac0970f7baf54849a64a4070
2023-03-13 23:49:59 +00:00
Ed Sanders d290b98f56 Fix inconsistencies in sticky header font-size and spacing
* Ensure 8px spacing between all icons and buttons
* Move buttons to separate container, so they aren't
  grouped with -icons.
* Reducing horizontal padding of quiet labelled buttons
  to 5px to match spec.

Bug: T326571
Change-Id: I71c3aee82152f048c347f80747972d526039a8f0
2023-03-13 23:29:35 +00:00
jenkins-bot 7932f6894d Merge "Removes old style rule" 2023-03-10 20:52:42 +00:00
ksarabia aba94865c2 Removes old style rule
This patch removes the old style rules for .vector-toc-pinned after one
week of cache.
Also removes 'data-name' which was no longer used

Bug: T325032
Change-Id: I7c8d8e51a61646151706b71a1733b1daac5dbd45
2023-03-10 14:31:44 -06:00
Moh'd Khier Abualruz 022954aff5 [vector] Menus: Make Tabs template fully-data driven to support upcoming navigation restructure work
- Template changes to use data driven links
- Template changes to use data driven list items
- Update unit tests
- Stop the hook from clearing data

Bug: T329794
Depends-On: Ide47c7ca7acabc21a94991d803f3683240a85f67
Change-Id: I523d7555b603b5382aa59eb25091338c7cc050ec
2023-03-10 10:57:37 +01:00
jenkins-bot ba00ff199f Merge "Fixes missing account login in OfficeWiki" 2023-03-09 21:58:38 +00:00
ksarabia 108aeb2d88 Fixes missing account login in OfficeWiki
Addresses missing login button and dropwdown by adjusting Hooks.php

Bug: T329463
Change-Id: I0fa630f5fef7fdd651fda1331762ffefbb1c5b75
2023-03-09 15:39:50 -06:00
jenkins-bot e47d30a119 Merge "Add hash fragment support to table of contents" 2023-03-09 19:46:39 +00:00
Jon Robson f6d45621bc Drop unused template and associated code
Bernard pointed out this is currently not used.

Bug: T329794
Change-Id: Ia491c56f6cb57c93328d0e523d5c8aa634d92356
2023-03-09 10:53:33 -08:00
Nicholas Ray 17433b63fc Add hash fragment support to table of contents
Per T325086, the TOC should expand and activate the section that corresponds to
the window's hash fragment.

Additional changes:

* Moves logic  that runs on page load to determine the
intersection from section observer to main.js, since the hash fragment can
take precedence over the scroll position (e.g. when scrolled all the way to the
bottom).

* Make section observer's pause() cancel any pending intersection calculations
so that it doesn't interfere with other async logic.

* Moves onHeadingClick and onToggleClick logic to activate and expand a section
to tableOfContents.js to facilitate unit testing this behavior with clicks and
hash fragment changes.

Bug: T325086
Change-Id: I8a2cf0e6a96467fae97608450b321c181155e424
2023-03-09 00:33:37 -07:00
jenkins-bot 5f6932c605 Merge "Increase scroll-padding-top for page sections" 2023-03-01 19:46:33 +00:00
ksarabia 74addde337 [WIP] Removes the TOC class in body and adds in html
Adds new constants for TOC and registers feature.

Bug: T325032
Change-Id: I5e0f5f3a6d186b245bdbc98c2bb9e4cc17a03fdb
2023-02-28 17:21:16 -06:00
Jan Drewniak cfc454f615 Increase scroll-padding-top for page sections
This introduces a general scroll-padding-top value of 50px
for Vector 2022's HTML element.

This changes makes it so that when navigating sections via the
TOC, the section headings are 50px lower on the screen.

This change has been synced with the ToC active sections as well,
so that active sections become active at the same offset.

Bug: T314419
Change-Id: I99e5fe2047f5ad1e61ef51b6ba7e76a6cac36fc5
2023-02-28 14:48:31 -05:00
bwang 392a2f0e97 Only render TOC related HTML when TOC is available
Bug: T328719
Change-Id: I3484a790ce8ebadf21054ac1d222d5632b2dc5a4
2023-02-27 16:31:03 -06:00
jenkins-bot eaf0e2d57e Merge "Table of contents: FIXME cleanup" 2023-02-24 20:55:28 +00:00
Jon Robson c06c547b02 Table of contents: FIXME cleanup
Follow up to Ib42d532d4e900c01061e1c5e39c03b17f0619c46

Hoist hook binding into main.js and update tests

main.js now only tests hook wire up.
tableOfContents calls reloadTableOfContents directly.

Bug: T316025
Change-Id: Ia06feab7cfb47a64ac3519bd7bd0428dc661045a
2023-02-24 01:16:20 +00:00
bwang 6b3ef91c74 Ignore noisy rule for a11y test
Change-Id: Ic17f788b1fa463d1f9a843e5047479e03acd90a7
2023-02-23 15:01:48 -06:00
bwang 0e5ef398b2 Rename IconLink to Link
Now that there is a Link.mustache, I think other components like Button, Link should use the Icon template, and not include icon in the name, as its possible to have a link or button that doesnt use an icon as well.

Change-Id: I6d8a17dd956f09bb3df7a2503f55d255599874f8
2023-02-22 22:00:24 +00:00
Moh'd Khier Abualruz efe33d5d76 Ensure ToC is always accessible via landmark region (<nav>)
- We had to add nav element to wrap TOC in all places
- Make sure proper nav is only displayed so landmark do not get confused
- Remove Eslint block on rules compat/compat for no support IE 11, this was blocking commit
- Run lint:fix:js and lint:fix:styles
- Fix maxSize in bundlesize.config.json

Bug: T324505
Change-Id: I36d26240b87de33318ff1edf97a410872a438103
2023-02-21 22:19:52 +01:00
bwang 159d298aaa Reduce verbosity of menu dropdown with aria-hidden
Bug: T325026
Change-Id: I9cd919b083dcbd0ca417cde3488968be9e2c503e
2023-02-16 15:21:53 -06:00
Jan Drewniak e4af2b5df3 Prevent addPortletLinkHandler from looping over links twice
- Prevents the addPortletLinkHandler function from looping
over the same links multiple times by indexing
the HTMLElement instead of just the ID, which is an
optional parameter.
- Conditionally adds the icon class if the ID parameter
exists.
- Refactors the function to calculate the width of the
vector toolbar.
- Adds Jest tests to account for the dual icon scenario
and updates existing Jest tests.

Bug: T327369
Change-Id: I2a0934405efebd0e95919bc523d711866236a7e6
2023-02-16 20:05:54 +00:00
bwang fca03c873b Update user links dropdown id
- Update naming convention to use dropdown instead of menu

Follow-up: Iac0586893fec26a8a6c2c904ce08fbf1e19b339c
Change-Id: Ie51f7fc280eeef8470613c07850dad83e4435ee8
2023-02-16 11:21:56 -06:00