Commit graph

493 commits

Author SHA1 Message Date
Ebrahim Byagowi 8e134155b5 Don't use i18n-all-lists-margins module
It's now provided by elements thus not needed.

Depends-On: I404710209d59241991716bb7180bcaabcafffcec
Change-Id: I6c18607b132c93513c0fbe8034c14e98d4091770
2024-07-25 14:16:30 +03:30
Jdrewniak 7b35e6b1e8 Create dark mode launch banner for Vector 2022
Creates a dark mode launch banner, (copied from the MinervaNue skin) to
announce the launch of dark-mode for Vector 2022.

The banner itself is not invoked anywhere by default, but will be
invoked through CentralNotice as a banner as part of a launch campaign.

To invoke the banner manually, execute the following in the dev console:

```
mw.loader.using( 'skins.vector.DarkModeLaunchBanner', function( require ) {
    require( 'skins.vector.DarkModeLaunchBanner')();
} );
```

Bug: T370303
Change-Id: I1ca4aab8c302ef418bc1d12dde0d80c96c3b8d4f
2024-07-22 16:13:56 -04:00
jenkins-bot b158601f8b Merge "[Vector 2022] Indicate support for new heading HTML" 2024-07-12 00:30:07 +00:00
Jon Robson 801c5285eb Dark mode should default to day theme
Given the issues with dark mode we are making this an opt-in
release.

Bug: T369833
Depends-On: I1c8115e95749bcb5e6b55d0ebe31267178042783
Change-Id: Ia017d2b5a31d5a19fee7c1433457a1e394ceeb01
2024-07-11 22:24:51 +00:00
Jon Robson 11654b7bce [Vector 2022] Indicate support for new heading HTML
Add `"supportsMwHeading": true` to the skin definition,
so that MediaWiki 1.43+ will output new heading markup
when using this skin.
https://www.mediawiki.org/wiki/Heading_HTML_changes

The required CSS changes were already made in commit
3c2602b682.

Bug: T367601
Change-Id: I0ceace61899d0b1bd047e5011acaddd4428c944e
2024-07-11 20:58:10 +00:00
Jdrewniak f1150164e1 Add beta tag & feedback link to Appearance menu
Adds the word "(beta)" beside the Color options in
the Appearance menu, as well as a link for user
feedback related to dark-mode issues.

Re-orders the "Color" options to come last in the
Appearance menu.

Bug: T367871
Depends-On: Iac6316cf7010b5ea92672e9ad6f09e8ee57e066b
Change-Id: I46f7554b4bcdcfae0e4ef2e849d52774242e3497
2024-07-02 22:29:07 +00:00
jenkins-bot 2f92e61a13 Merge "Inject service LanguageConverterFactory into VectorComponentVariants" 2024-06-24 18:32:00 +00:00
Jon Robson 0f594e0af7 Make all frontend stored preferences global
Additional change:
* Delete some unused messages

Bug: T341278
Depends-On: I254d7d883771dbd394ba97799d731012f7aaaefc
Change-Id: Ic40da2af8ea46bd42cbebbdbceda2431bd8600ae
2024-06-18 16:37:53 +00:00
bwang 75fce0d5bc Remove external link variables, and replace content-links modules with Codex
Change-Id: I55d062de1624b77bc5214942368a3fbd545635df
2024-06-17 14:35:33 -05:00
Fomafix c9408c027e Inject service LanguageConverterFactory into VectorComponentVariants
Change-Id: I0e1fa5a8f8f6705e2439bdbc914b9d80b0072c30
2024-06-14 11:23:51 +00:00
Jon Robson 0991d5ef79 Make Vector 2022 pseudo-responsive
We want Vector 2022 to exhibit more responsive behaviours when the
window is resized by forcing these on mobile users

The skin--responsive class is added to the body alongside the
viewport. For now we'll add it in Vector 2022.

Depends-On: I5e3cba54a8d52852e4c33cebdeb76d8ce3257017
Depends-On: I604ea436a816939cd6b2d9ef8c352e319ffcbec0
Depends-On: I0a74a18707dca582bac094e38fa5a0db7298033a
Bug: T113101
Change-Id: Ic5365fc82e2f52486abcd6c52f6cc8964f80a5bd
2024-06-10 22:09:37 +00:00
jenkins-bot 1e4e03395b Merge "Add width exclusion notice" 2024-06-05 19:37:29 +00:00
bwang 716aad56af Add width exclusion notice
Bug: T366216
Change-Id: If50e9adcec6f2fa139e793b3a8108f3b4dd689ca
2024-06-05 19:15:11 +00:00
Jon Robson 78136827ce Vector and Vector 2022 no longer share site styles or scripts
Bug: T365771
Change-Id: I508eeb143ecd0a972e2b8790ca2b5982b1d83e71
2024-06-03 18:13:28 +00:00
Bartosz Dziewoński 25cc1d2ad7 [Vector legacy] Indicate support for new heading HTML
Add `"supportsMwHeading": true` to the skin definition,
so that MediaWiki 1.43+ will output new heading markup
when using this skin.
https://www.mediawiki.org/wiki/Heading_HTML_changes

The required CSS changes were already made in commit
3c2602b682.

Bug: T365736
Change-Id: I2fd2ef99e49f1c3d0711a08f7bc72fc3cff9e444
2024-06-03 03:33:12 +00: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
Jon Robson dba9e16be2 Limit table wrapping to configuration flag
We want to limit this behaviour on initial roll out to certain
wikis.

Bug: T330527
Change-Id: If73f6f3d182cc386ebf0e750206afdb05fd3d863
2024-05-29 15:35:45 -07: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
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
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 9bdde667fb Reflect production defaults
Bug: T363814
Change-Id: Iea89208342f09f621acc6219f814271955bbd5fc
2024-05-16 21:09:45 +00:00
Moh'd Khier Abualruz 37e8e4c929 feature(Vector): Add configurable font size exclusions
This patch introduces the ability to configure font size exclusions
for specific pages within the Vector skin, ensuring certain pages
always use a small font size. This change is part of ongoing improvements
to the Vector skin's customizability features.

Changes:
- Updated `skin.json` to include `VectorFontSizeConfigurableOptions`
- Added new i18n string `vector-feature-custom-font-size-exclusion-notice`
- Modified logic for font size exclusion handling in `FeatureManager.php`

Additional Notes:
- Affects testing and beta deployment environments, ensure relevant
  settings are updated in `LocalSettings.php`.
For testing and on beta deployment, these settings should be set in
the LocalSettings.php of the environment, example:

$wgVectorAppearance = [
    "logged_in" => true,
    "logged_out" => true,
    "beta" => true
];
$wgVectorFontSizeConfigurableOptions = [
	"exclude" => [
	"namespaces" => [ -1, 2, 6, 8, 10, 14, 100, 710, 828 ],
		"querystring" => [
			"action" => "edit|submit|diff|info|protect|delete|undelete|diff|history",
			"diff" => ".+"
		]
	]
];

Bug: T364887
Change-Id: I23b9c4fb63f35c7d27544197fead3ad7619c67f1
2024-05-15 19:19:38 +00: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
Jon Robson ca0d404e50 Enable night theme in Vector
- New night theme added via Codex `.cdx-mode-dark();` mixin.
- CSS custom properties separated from skin.less.
- Font-size rem conversion removed since Codex now uses rems.
- bundlesize increased by 1kb ( followup from
Icfcb5c7418061a5727580f0685054356ba4edb72 ).
- Icons that use background-images are inverted for night-theme.
- Linter error fixed for long-lines in clientPreferences.js

Co-Author: <Bernard Wang> bwang@wikimedia.org
Bug: T354889
Depends-On: I1f54bf4f144eaec6ed317c04bd0c851c2f01b42c
Change-Id: I3a8a147b6be67bc830f0d3b816a4b85c26f99cf1
2024-05-02 13:22:59 -05:00
jenkins-bot c3987d472b Merge "Rename client preference menu to appearance menu" 2024-04-29 20:41:19 +00:00
jenkins-bot 50c34aedf5 Merge "Wrap sitenotices in core" 2024-04-29 17:49:40 +00:00
bwang 0109218ab9 Rename client preference menu to appearance menu
Bug: T362808
Change-Id: Id6800d38eebf433cf0c9e3f179dd83df2eefd1fb
2024-04-29 15:38:20 +00:00
Jon Robson 3c01ccc9f0 Wrap sitenotices in core
Depends-On: Ib48b1f54c326a0363841b2f592d8fd4cf7312b9b
Bug: T361966
Change-Id: I14cab105a798a5c9e615892c3305bfbd459a7a51
2024-04-24 17:12:26 -07:00
Moh'd Khier Abualruz 780d475176 feature(Vector): Standardises terminology to 'Dark Mode'
This update standardises the terminology from 'Night Mode' to
'Dark Mode' across interface messages. This change aligns with common
terminology used in the industry.

Changes:
- `i18n/en.json` and `i18n/qqq.json`: Updated labels and descriptions
  for UI elements from 'Night' to 'Dark' to reflect the new terminology.
  This includes changes in labels like 'skin-night-mode-0-label' to
  'Light' and 'skin-night-mode-1-label' to 'Dark'.
- `skin.json`: Updated descriptions in configuration settings to
  mention 'Dark Mode' instead of 'Night Mode', ensuring that
  documentation reflects current terminology.

Bug: T361157
Change-Id: I682a79fd7d9b37b4f908581e8fd28fd40f798c5c
2024-04-24 22:58:35 +00:00
Eric Gardner cb8c7a17fd styles: Remove references to the legacy Codex build
Since Codex switched over to rem units, all differences between the
"legacy" and non-legacy builds of the library have disappeared.

This change removes references to the legacy version of the library
in preparation for the removal of these artifacts from Codex.

Bug: T360806
Change-Id: I158519eddc1738a5daeedb94eb7d2f692e74b84a
2024-04-22 18:41:05 +00:00
jenkins-bot f6c0071bd7 Merge "Add exclusion notice for night mode feature" 2024-04-17 16:44:03 +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
Jon Robson e678a43b6e Extension:DarkMode should persist for anons
Bug: T360534
Change-Id: I41ea40defedbede6c6c430f1e0d90fde6d5c1981
2024-04-16 17:02:06 +00:00
Umherirrender f43b97ff4c tests: Use remoteSkinPath in QUnitTestModule in skin.json
Skins should define a skin path to be relative to $wgStylePath,
not relative to $wgExtensionAssetsPath

Change-Id: Ie3adbd7adcbc1836803b8df7b657363e88061e60
2024-04-01 20:53:23 +02: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
Jon Robson 3f7f355a2e Support legacy message box styles markup in JavaScript
Log a console warning to assist developers in migrating to the new
markup.

Bug: T360633
Change-Id: Iaa1a3fc3b910c5fe491459fc82c61bc329f3408d
2024-03-21 18:19:52 +00:00
Moh'd Khier Abualruz b3ab84f9e5 Vector - Rename the skin night mode classes to more readable classes
The classes:
- skin-night-mode-clientpref-0
- skin-night-mode-clientpref-1
- skin-night-mode-clientpref-2
is being replaced with
- skin-theme-clientpref-day
- skin-theme-clientpref-night
- skin-theme-clientpref-os

Other Changes:
- Change vector-night-mode preference to vector-theme
- Add skin-theme-os-label and other messages to skins.vector.clientPreferences
- Remove skin-night-mode-* messages from skins.vector.clientPreferences

Bug: T359983
Change-Id: I31eb086e623a97df9fbd004425559e05b0cae170
2024-03-20 23:54:47 +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
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
Jon Robson e9f7f3a3ca Remove unimplemented configuration
This was never implemented and will likely cause avoidable
confusion if allowed to persist in the codebase given our work on T359606

Change-Id: Icf36108f24198358e53bf04942751fe3306bc726
2024-03-08 00:56:12 +00:00
Fomafix 9d1819f4ec Inject services in Hooks
Change-Id: Ice931a7596c73781f05265d96e0086729402ae63
2024-03-07 20:23:51 +00:00
Jon Robson 39dfbb0369 Disable Extension:DarkMode on Vector 2022
Bug: T357598
Change-Id: I7a597f5a6b8c670d4373dba110ad39073ddbfbc4
2024-03-06 21:52:54 +00:00
Fomafix 718334ce12 skin.json: Remove "@args": "See SkinVector::__construct for more detail."
SkinVector::__construct was removed in d4befe8c39.

Change-Id: I123c79d8329b0ff531704e0d68f5642e3cced4d9
2024-02-29 21:26:42 +00:00