Commit graph

463 commits

Author SHA1 Message Date
bwang 5d83c55f5e Update tables code to only target unwrapped tables
Bug: T367248
Change-Id: If4267e083cd6721bdb80d32a84c1fd9306096b50
2024-10-03 13:16:59 -05:00
Jon Robson 0e2e1a9a17 Remove PerformanceBudgetTest
This test has not served the original purpose it intended and is
now more of a nuisance than supportive to our goal of monitoring
performance across MediaWiki.

For now, we are going to remove this test in favor of a new test
that we are currently finalizing in T360590 that we hope to land
after the next MediaWiki release.

Bug: T373017
Change-Id: I0eb22ebbed67ded008de7ca75f9f8f399a214ef8
2024-09-25 22:58:32 +00:00
Sergio Gimeno d11e77a5ec PerformanceBugetTest: increase budget for GrowthExperiments styles
Should unblock merges in GrowthExperiments repo

Bug: T373017
Change-Id: Iadc09e048c46d6d0cf255dbc82932cd07c33d5a2
2024-09-25 15:39:30 +02:00
Jon Robson 1dd7fcc32b Bump size of Vector performance budget to accomodate FlaggedRevs styles
Styles for message boxes are now loaded on page load.

This is temporary until I2808de0fa9826ae0eb5dc09ad62f0a901479110e lands.

Bug: T373602
Change-Id: I34730117cfdb2204883224c9d9f2bd902025cdb2
2024-09-21 00:37:03 +00:00
Ebrahim Byagowi 475f80cf76 Use browser native URL instead of mw.Uri
Bug: T374314
Change-Id: I66be10c017e853ea130b0919789b22c4c3f12622
2024-09-13 07:08:12 +03:30
Hannah Okwelum 8f25cfbde2 phpunit: Remove use of internal KeyValueDependencyStore class
ResourceLoader uses the KeyValueDependencyStore by default. And, in
PHPUnit context, MediaWiki's MainStash defaults to HashBagOStuff. It makes sense to remove this since both are the default already.

Additionally, since we are in the process of merging KeyValueDependencyStore into DependencyStore, the internal
KeyValueDependencyStore class name will no longer exist.

Neeeded by Ia581ac107cb139afb0740a36f4f22f047d0de1ad.

Bug: T343492
Change-Id: Ib3c41ff5d615ba75ec25af4858746eaf708c8750
2024-09-11 00:43:25 +00:00
jenkins-bot c0332419e4 Merge "Revert "Allow gadget/browser extension extensibility of empty search state"" 2024-08-27 17:59:27 +00:00
Jdlrobson 0e030b1310 Revert "Allow gadget/browser extension extensibility of empty search state"
This reverts commit 98bee1c71f.

Reason for revert: This wasn't ready for merging. Caused T373463.

Change-Id: Id02bc3528216d1a43e6b505b44362059ab0ffc69
2024-08-27 17:15:51 +00:00
jenkins-bot 43c6c7f95c Merge "Allow gadget/browser extension extensibility of empty search state" 2024-08-26 16:51:06 +00:00
Jon Robson acb79c5e1b Improve documentation for how feature manager classes work.
This changes nothing about the existing classes, it just improves
how they are documented.

The FIXME comment was making things confusing.

Make sure every feature class is accounted for and audited and
throw a RuntimeException if we forget to document it.

Change-Id: I9d8f6553fe6b8c2ae80d8b2490c8895a8334a537
2024-08-08 20:19:48 +00:00
Jon Robson 98bee1c71f Allow gadget/browser extension extensibility of empty search state
Add hook that renders when search displays for first time to allow
experimentation.

Code can call
```
mw.hook( 'search.display' ).add((node)=> { node.innerHTML = 'hello world' } );

Bug: T371294
Change-Id: Ib3ec73b8ed66877c11e0d8d290a6b564a013702b
2024-08-08 21:19:27 +01:00
Steph Toyofuku b8e9eaf6ed Show night mode gadget disable message on the correct section
Currently, this selector is not specific enough, and so if there is an
additional client pref that is disabled on the page, we'll put the night
mode gadget message in the wrong spot.  Target the skin-theme section
correctly this time, and add a test to ensure this is fixed properly

Bug: T369846
Change-Id: I3495aa9ebf3be510f62a8f19440968fe444be892
2024-07-11 11:44:56 -07:00
Bartosz Dziewoński ce55e8d8e0 Compatibility with new heading HTML (table of contents)
Bug: T13555
Bug: T358452
Change-Id: Idafd8e242acbff20d4fed9f5606ebe480d1eb8a5
2024-07-03 20:54:48 +00:00
jenkins-bot 2f92e61a13 Merge "Inject service LanguageConverterFactory into VectorComponentVariants" 2024-06-24 18:32:00 +00:00
Fomafix c9408c027e Inject service LanguageConverterFactory into VectorComponentVariants
Change-Id: I0e1fa5a8f8f6705e2439bdbc914b9d80b0072c30
2024-06-14 11:23:51 +00:00
Michael Große b32116de30 Add styles performance budget for GrowthExperiments extension
We have CI failing on this test for GrowthExperiments with the styles
budget being exceeded. On changes that do not touch production code at
all.

I do not know how this can happen in the first place, or whether fixing
it this way is sensible, but we need to unblock our CI.

Change-Id: I178cb7ff6f111a11e9b6060960548e65d1c7d3c0
2024-06-14 13:01:43 +02:00
Steph Toyofuku 578e8aaf18 Raise performance budget for GrowthExperiments extension
Bump the GrowthExperiments extension-specific performance budget from
5000 to 7500 since we seem to be running right up against the limit.
Adding a bit of extra wiggle room since this seems to be causing issues
for the growth team, although we should potentially work with them as
the existing comment suggests to lower this

https: //wikimedia.slack.com/archives/C8W3HEHLG/p1718263715588799
Change-Id: Ide1cc5cc1e78dc86b90d731f54a913893ba8c8bd
2024-06-13 14:44:02 -07:00
Umherirrender e8ffe82549 tests: Use renamed class BundleSizeTestBase
Follow-Up: I131e0d85bd14e75aaebd6f212b2e64a45d4c73a2
Change-Id: I55d7a3f0aa281e813e92f676c225fc825c256f13
2024-06-12 20:39:06 +02:00
Umherirrender d3b251de52 Use namespaced classes
Changes to the use statements done automatically via script
Addition of missing use statement done manually

Change-Id: I84dc0ec8a909fce94db2b958eadac9caf661972b
2024-06-10 22:28:40 +02:00
bwang 711f67ce00 Avoid wrapping floated tables using computed styles
Bug: T366314
Change-Id: I71657b7f1f26bcf52f5ade5b7668955a1f4df24b
2024-06-07 16:49:30 +00:00
Ed Sanders 7e7486c4a5 build: Update eslint-config-wikimedia to 0.28.0 and autofix
Change-Id: I350941a711d2304fc968b3ba1f1e0afa5878578e
2024-06-06 16:22:05 +01:00
bwang 716aad56af Add width exclusion notice
Bug: T366216
Change-Id: If50e9adcec6f2fa139e793b3a8108f3b4dd689ca
2024-06-05 19:15:11 +00:00
James D. Forrester ab7d8ada65 PerformanceBudgetTest: Increase WikiLambda's budget post-Codex 1.6.1
Change-Id: Id2ce4de5efc7bfa67334eecfea0bdda85ac11640
2024-05-31 09:45:51 -04:00
Steph Toyofuku 84be3de748 Minor fixes to gadget disable logic
Two small changes per comments on
https://gerrit.wikimedia.org/r/c/mediawiki/skins/Vector/+/1036766:
* remove both night mode classes in a single function call
* slightly rework alterDisableLink logic to account for the possibility
that the message is empty when we check it

Bug: T365083
Change-Id: I1633df85e768b7da2f1f542fb793089f34bcc6b7
2024-05-30 16:48:55 -07:00
jenkins-bot 3fb0bb484b Merge "Disable night mode if gadget detected" 2024-05-30 22:53:51 +00:00
Steph Toyofuku 4a0c2cb684 Disable night mode if gadget detected
While our implementation of night mode is in beta, we want to respect
the existing night mode gadget and disable night mode in favor of the
gadget, providing a notice with an option to disable the gadget and
reload the page

Additionally, raise the max bundle size to account for the additional
code added

Note: the tests still aren't exactly where I'd like them to be, but
hopefully they raise confidence a little bit with reviewing this patch

Additional changes:
* Upgrade to latest version of TypeScript types and remove several
@ts-ignore statements

Bug: T365083
Change-Id: I9583ee7ebf8c810ddd504193d568034c954d28f2
2024-05-30 20:23:38 +00:00
Bernard Wang 503559a05c Restrict table logic to nonfloated wikitables
Bug: T330527
Change-Id: I386a88481210f459d2174ff69e0f84d40fc9e3bd
2024-05-30 11:52:20 -05:00
jenkins-bot 03fd09ff1b Merge "remove redundant HTML roles" 2024-05-29 21:06:23 +00:00
Novem Linguae 158269333d remove redundant HTML roles
Fixes 9 warnings generated by https://validator.w3.org/nu/

- The navigation role is unnecessary for element nav.
- The main role is unnecessary for element main.
- The contentinfo role is unnecessary for element footer.

Bug: T365938
Change-Id: Ibdbe70900f9a85d904252ad8ac26e4bb6e813a1c
2024-05-29 15:25:33 -05:00
Jon Robson caa650a881 Limit responsive tables to .wikitables
Bug: T330527
Change-Id: I61280270c6257ceaf5a6d74bb01be37063474bc7
2024-05-28 16:27:16 -07:00
thiemowmde 79dae4ad7a Remove redundant test cases and comments from tests
* Remove stray @package comments. They appear to be auto-generated
  as they just repeat the namespace name (but the wrong one).
* Remove redundant test that effectively doesn't do anything other
  than testing if the constructor doesn't fail. This is already
  covered by other tests.

Change-Id: Icb1136b7018a88310a37a3989d18a678e6cb9ddf
2024-05-27 09:18:05 +02:00
jenkins-bot 4235ff0efd Merge "Wrap tables with JS" 2024-05-24 22:46:24 +00:00
bwang e42b235669 Wrap tables with JS
Depends-on: Ia271a57776e6f38384c5855727ab82fd7af83241
Bug: T330527
Change-Id: I756f8e1bcd86867bee52962a0d1c2dbb34ca75eb
2024-05-24 15:49:54 -05:00
weebney 6dcb40447d Fix missing span tag on ToC items
There is a missing span tag in the table of contents where text is placed directly into a div, breaking convention.

Change-Id: I12280e2c6a6e688b36a906d5b5a5c5deba42c977
2024-05-24 11:29:06 -07:00
Jdrewniak 607e6b39c5 Revert "Add exclusion behaviour for "width" option in Appearance menu"
This reverts commit ff5a61e9c6.

Reason for revert: The behaviour introduced in this patch needs some more consideration.

Bug: T364015
Change-Id: Ieab4ca4084df4f1b5c942fe81c7fb99b058e0623
2024-05-23 23:51:46 +00:00
James D. Forrester ac3c525420 PerformanceBudgetTest: Add WikiLambda dependencies to unbreak merge
Rough numbers for now.

Change-Id: Ie487fc56eb199f94e0b72f59d5c54f623570773b
2024-05-22 13:25:01 -04:00
Jon Robson f797b8760d Adapt bundlesize based on installed extensions
Allocate specific space for each installed extension based on
whether it is installed. This should reduce false positives (assuming
we have accounted for every installed extension)

If we haven't we'll follow up with additional budgets as we learn
about them.

Bug: T365480
Change-Id: Ie487fc56eb199f94e0b72f59d5c54f623570773a
2024-05-22 05:37:28 +00:00
jenkins-bot c570ec099d Merge "Optimize styles" 2024-05-17 18:30:33 +00:00
Jan Drewniak ff5a61e9c6 Add exclusion behaviour for "width" option in Appearance menu
- Adds the notice "This page is always wide" and disables
  the inputs for the "width" options in the Appearance menu
  when pages are excluded via configuration ( `$wgVectorMaxWidthOptions`).
- Changes layout behaviour so that pages in the
  $wgVectorMaxWidthOptions['exlcude'] configuration
  stretch the entire viewport width.
- Stops the width settings in the Appearance menu from
  being hidden on smaller resolutions.

Bug: T364015
Change-Id: Idee294adf3b309e03834276ea75e4ae43b0cffcb
2024-05-17 17:58:19 +00:00
Jon Robson 1d17b4624f Optimize styles
1) Icon optimizations
* Load styles for expand icon in
JavaScript since it relates to table of contents and that is only
enabled with JavaScript
* Drop vector-icon--x-small class since it only applies to this icon
* Remove some FIXMEs to an issue that has already been fixed
upstream

2) Move styles that do not need to be render blocking to skins.vector.js
* Move sticky header to skins.vector.js since it doesn't work without
JavaScript
* Move popupNotification to skins.vector.js since this is never server
side rendered.

Change-Id: I98e6c0826b514aaefcf88f66275bba37125129b1
2024-05-17 16:26:16 +00:00
Jon Robson 176a6397ce Correct behaviour of ConfigHelper, add tests
Bug: T365084
Change-Id: I220990554d0a07642dd03a0c7bd53f9bd7ff55ec
2024-05-16 08:04:45 +02:00
Jdlrobson b7743a1dbe Revert "Add exclusion notice for "width" option in Appearance menu"
This reverts commit 89c250c18e.

Reason for revert: We need some more time to test this one and
the resulting behaviour. After discussing this morning we decided
to remove from the next train release.

Bug: T364015
Change-Id: I0dfc17d9c8a8697b8b4f590acdbc2d2c54de9429
2024-05-13 21:33:49 +00:00
ksarabia 5c9fc606dd Deploy limited width settings
* Main page set to true for exclude.
* Makes it default to all wikis.

Bug: T357706
Change-Id: I72d2e9e4eb2e11b1c9bfbdacbd6e298ec205040d
2024-05-10 17:34:08 -05:00
Jan Drewniak 89c250c18e Add exclusion notice for "width" option in Appearance menu
Adds the notice "This page is always wide" and disables
the inputs for the "width" options in the Appearance menu
when pages are excluded via configuration ( `$wgVectorMaxWidthOptions`).

Bug: T364015
Change-Id: Ie99b41c9130f496ab23b60c95e551a9ea602d5a0
2024-05-09 16:47:07 -04:00
Fomafix d7735c8d57 Use context of FeatureManagerFactory in FeatureManager
Change-Id: I5e77b6ce2df1245e8a5c710b7e84813f04a77ae2
2024-05-07 18:49:06 +00:00
Fomafix 6320921bd4 Inject service UserOptionsLookup into FeatureManager
Change-Id: I3a056731c4a4e970cae0b974dab574bdbb0401f5
2024-05-06 20:07:58 +00:00
Jon Robson 55e6dfd81c Fixes: exclusion logic for anonymous users
Bug: T364159
Change-Id: I7c7e9cff7b99f8e37f3f1ffb93464fd3f31c799b
2024-05-06 12:20:40 -04:00
bwang 0109218ab9 Rename client preference menu to appearance menu
Bug: T362808
Change-Id: Id6800d38eebf433cf0c9e3f179dd83df2eefd1fb
2024-04-29 15:38:20 +00:00
Jan Drewniak a3801497b9 Add exclusion notice for night mode feature
If night-mode is disabled on a certain page via the
exclude list in skin.json, then the following class:
".skin-theme-clientpref-excluded" will be added to the HTML element.

In this scenario, the related client-preferences
menu options are visible, but disabled, and a notice
is rendered below the options informing users of this state.

Bug: T361158
Change-Id: I46d335d079a2d27c7a4122e23ac7e479c286b886
2024-04-16 22:38:35 -04:00
jenkins-bot b98e0a0017 Merge "Allow disabling of night mode on certain pages via config" 2024-03-29 08:03:00 +00:00