Commit graph

452 commits

Author SHA1 Message Date
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
Steph Toyofuku feb8cc90dc Allow disabling of night mode on certain pages via config
* Using the new ConfigHelper, support disabling night mode on certain
pages via configuration options
* In addition, adds test coverage for this case and the query parameter
case (in a new integration test file as we now require accessing the
service container for request context)
* Finally, supply a default configuration in skin.json with all the
values set to null

For the easiest possible approach while we evaulate our general feature
management system, this logic is handled inside of getFeatureBodyClass
using the new shouldDisable general function.  In the future, it may
make sense to break this out into its own requirement class, but for now
that feels premature

Bug: T359606
Change-Id: I3e7a4720ec3cc2afd9777e36f59aa56b682258f0
2024-03-28 16:37:30 -07:00
Steph Toyofuku 3387ef3ee4 Add tests for ConfigHelper
This class is being used in both vector and minerva, and we are
currently depending on it working for our night mode rollout, so let's
add some test coverage!  Also fixed a small spacing issue in production
code that was bothering me lol

Note: these are not totally exhaustive - next steps would be to ensure
that the exclusions/inclusions work with arrays and not only single
elements, but hopefully this helps build some confidence ☺️

Change-Id: Iebea43eae6b1517fd778763db4f5db3b0fd9c30f
2024-03-27 16:49:39 -07:00
jenkins-bot e7a6fe9b12 Merge "Type hint UserIdentity in Requirements/Components" 2024-03-18 05:58:30 +00:00
Jon Robson a67a260451 Restore budget test with better guidance and special case FlaggedRevs
Restore the budget test with better guidance on the process to
handling this issue.

Bug: T360102
Change-Id: I1ca80945e2ef49604a85e1bec6004f30ad13924d
2024-03-14 11:47:54 -07:00
Muhammad Jaziraly be0e56bb73 Skip PerformanceBudgetTest::testTotalModulesSize
Unblocks CI for Wikibase extension.
CI failed in I824acad352c366a35a243dac2086e3c5e98bc6eb

Bug: T350338
Change-Id: Id9926ff9a60cb0cac56a612a792d5ffde55c4c63
2024-03-14 09:06:34 +00:00
Umherirrender 558359c06d Type hint UserIdentity in Requirements/Components
Only id or registered state is needed.

Change-Id: I184db486ed2763e0402fe75ed9afb0e71a0d57c6
2024-03-13 21:59:40 +01:00
jenkins-bot c38e0677c3 Merge "Migrate uses of codex-search in Vector to use CodexModule" 2024-03-13 16:27:55 +00:00
Moh'd Khier Abualruz 182bb7519b Migrate uses of codex-search in Vector to use CodexModule
- Loaded new skins.vector.search.codex.scripts module in skin.json, with only the CdxTypeaheadSearch component with codexScriptOnly flag set to true.
- Included skins.vector.search.codex.scripts in the script loading configuration for Vector22 within skin.json.
- Turned off the "interface-message-box" feature within Vector22's skins.vector.styles configuration in skin.json, as Codex now supplies these styles.
- Fix the style selector to add `.cdx-button` to `.vector-limited-width-toggle` in BottomDock.less since using the codex style
- Substituted "codex-search-styles" with "skins.vector.search.codex.styles" in the existing configuration.
- Ensured the availability of skins.vector.search.codex.scripts module for use, marking it in the list of modules in skin.js.
- Modified App.vue to utilize skins.vector.search.codex.scripts instead of @wikimedia/codex-search.
- Update App.test.js.snap to the latest output form
- Update bundlesize.config.json with newest values

Bug: T356677
Change-Id: I7fc223db01171efe6656792530d4b625be4c8edc
2024-03-13 15:58:26 +00:00
Umherirrender 7afaa93ab2 build: Upgrade mediawiki/mediawiki-codesniffer to v43.0.0
Change-Id: Ic8e1a7bc4bab091b0e959deae5258181fc54891b
2024-03-12 20:51:09 +01:00
jenkins-bot 06ed0b8e19 Merge "Create a FeatureManagerFactory" 2024-03-11 07:24:06 +00:00
Umherirrender ea4fd5d182 Create a FeatureManagerFactory
Some feature requirements needs access to the request user or title.
Currently the context is given in the ServiceWiring callback,
access to RequestContext::getMain() should be avoided during service
wiring (T218555).
Create a factory to hold the code from the service wiring and call the
factory with the request context from the skin to get a feature manager.

Bug: T359665
Change-Id: I57515ec02ed454620f729a109d0ace43b447b6ce
2024-03-08 20:28:31 +01:00