Commit graph

1021 commits

Author SHA1 Message Date
jenkins-bot c3987d472b Merge "Rename client preference menu to appearance menu" 2024-04-29 20:41:19 +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
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
bwang c69a53a16c Use client preferences for appearances menu
Bug: T361586
Change-Id: I636a557e724f23ea18da135bac59cb304ba81091
2024-04-15 22:36:48 +00:00
Moh'd Khier Abualruz 1fbdc0828a Accessibility settings menu should default to open for all users
Refine Feature Management in Vector Skin, in this patch we simplify the feature management criteria within the Vector skin by adjusting the requirements for the Constants::FEATURE_CLIENT_PREFS_PINNED feature. By removing the Constants::REQUIREMENT_LOGGED_IN constraint, we aim to enhance and unify the user experience by making certain preferences more accessible to users, regardless of their login status.

Changes:
- Updated FeatureManagerFactory.php by removing the Constants::REQUIREMENT_LOGGED_IN from the list of requirements for Constants::FEATURE_CLIENT_PREFS_PINNED. This modification aligns with our goal of making the Vector skin more user-friendly and accommodating to both logged-in and anonymous users, ensuring a broader range of users can benefit from customized features and settings.

Rationale:
The decision to remove the login requirement for accessing certain client preferences stems from an ongoing evaluation of user engagement and feedback, as detailed in Phabricator task T360099. This change is part of a series of improvements aimed at enhancing the accessibility and usability of the Vector skin, making it more adaptable to the diverse needs of our user base. By enabling more features for anonymous users, we anticipate an increase in engagement and a more personalized browsing experience for all users.

Bug: T360099
Change-Id: Ic477cd66df34c1caeb822d8d2162a7299cd648a0
2024-04-01 05:49:36 +02: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 9a362f52cd Merge "Vector - Rename the skin night mode classes to more readable classes" 2024-03-21 00:19:29 +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
Jon Robson 9c063383a3 Permit sharing of code between Vector and Minerva
Bug: T359607
Change-Id: Iab6ca28b8b460be864fb6591adb407ccb20f3718
2024-03-20 19:57:11 +00:00
Jon Robson f28f5850c5 Separate generic ConfigHelper class from LimitedWidthContentRequirement
In preparation for a decision around how we share code, the generic code in
LimitedWidthContentrequirement is moved to ConfigHelper class. A fix
recently applied to Minerva (Ied3ed927202dd9356ebeb7e404230f571a1d910d)
is also incorporated into the new class.

The expectation is this code will be either:
1) be replaced by a submodule
OR
2) Used directly by Vector
after a decision tomorrow.

Bug: T359607
in I3967803bd75cf78d27c1a7c08e62730e46678a68 or removed

Change-Id: I04066acc86594e721e071e9096e1b12e1255b54b
2024-03-20 00:23:51 +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 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
Fomafix 9d1819f4ec Inject services in Hooks
Change-Id: Ice931a7596c73781f05265d96e0086729402ae63
2024-03-07 20:23:51 +00:00
Fomafix bfa48e6a10 Hooks: Use private instead of public for internal functions
Change-Id: Idf0e9b3f57ea8402ce7d4f4e542993cc944cfdd9
2024-03-03 18:50:53 +00:00
bwang 230c837052 Remove language notice
Bug: T353619
Change-Id: I75430c8b1e66158f798fbe27eec4942a089f3931
2024-02-29 17:04:16 -06:00
bwang 14a40c0be6 Override night mode pref with night mode query string
Bug: T357329
Change-Id: I30766bced218208ddfe5c2990d7dac290441a1d0
2024-02-15 13:59:12 -06:00
jenkins-bot 8dff67dc05 Merge "Refactor and clean up FeatureManagement classes" 2024-02-06 01:08:37 +00:00
Doğu Abaris 348e6f6cc8 Refactor and clean up FeatureManagement classes
This commit introduces several changes to improve the structure and
readability of the FeatureManagement code in the Vector skin. Key
changes include:

- In ABRequirementTest.php, improved test method names for clarity.
- In ABRequirement.php, simplified property declarations and cleaned up
  code structure.
- In DynamicConfigRequirement.php, cleaned up property declarations.
- In LimitedWidthContentRequirement.php, cleaned up property
  declarations and added type hints.
- In LoggedInRequirement.php, cleaned up property declarations.
- In OverridableConfigRequirement.php, cleaned up property declarations.
- In OverrideableRequirementHelper.php, cleaned up property declarations.
- In SimpleRequirement.php, cleaned up property declarations.
- In UserPreferenceRequirement.php, cleaned up property declarations.

Each change aims to enhance the codebase's maintainability and
understandability. No functional changes were introduced.

Change-Id: I23283c5a6799b1f03a6a9b5832c34c7dbbcca527
2024-02-06 00:37:14 +00:00
bwang e964cbb785 Add Vector night mode feature flag
Bug: T355065
Change-Id: Ica63eb61ee042e8684168f6787b27a5e58e38bee
2024-02-05 11:33:37 -08:00
Umherirrender 4c5d039f13 Add return type hint to function in ServiceWiring.php
This is a common pattern for service wiring functions

Change-Id: Ia7bb6e22ca56aa263288fbf3afed5fb3c5d2df1a
2024-02-01 19:51:03 +01:00
Umherirrender b74b33f1f1 Use UserIdentity in VectorResourceLoaderUserStylesModule
Context::getUserIdentity was added with 6fbea844

Change-Id: I3d590b1b104af804edeb91dc58155a54114aa4ba
2024-01-23 21:26:35 +01:00
jenkins-bot 6a40112ceb Merge "VectorComponentUserLinks: Replace array_reduce with array_filter" 2024-01-12 02:02:26 +00:00
jenkins-bot ced3d7ec00 Merge "Hooks: Minor cleanup" 2024-01-12 01:46:30 +00:00
jenkins-bot 991c63f3db Merge "Remove empty MakeGlobalVariablesScript hook" 2024-01-12 01:17:47 +00:00
jenkins-bot 5c4e379fb5 Merge "SkinVector22: Minor cleanup" 2024-01-12 01:02:25 +00:00
Umherirrender 4d8c06cadb VectorComponentUserLinks: Replace array_reduce with array_filter
Looks easier to understand:
array_reduce adds the count() of all inner arrays and returns an
integer, 0 when all is empty and the count when items in there.
array_filter removes the empty inner arrays and when the returned outer
array still has an inner array, it is non-empty.

Change-Id: Ib0acb9be8d4d64cfb7d7d124c5a3de500f6b0232
2024-01-12 01:25:54 +01:00
Umherirrender b2f091ea95 Remove empty MakeGlobalVariablesScript hook
Last usage was removed in d983dada

Follow-Up: I2c28a4e253b4dc17578793e1e4ce73e80392d08c
Change-Id: I76947280762b33943bb5df53444067d61116b0e1
2024-01-12 01:13:50 +01:00
jenkins-bot 32d9da47fb Merge "FeatureManager: Avoid $this assignment" 2024-01-11 23:13:35 +00:00
Umherirrender 994e005e3b Hooks: Minor cleanup
- Remove unused local variable
- Use pass-by-ref on foreach value
- Use else instead of a second if
- Use camelCase variable name
- Avoid Skin::getRelevantTitle when not used
- Use RequestContext::getSkinName without getting a skin object

Change-Id: Ib84464d739516b8a17ef48c94cd60676e361bcaa
2024-01-12 00:08:42 +01:00
Umherirrender 829fb38450 VectorComponentPageTools: Remove unused User
Usage was removed in 448a9066

Follow-Up: Idca2ccfe4aeef0a2ac0970f7baf54849a64a4070
Change-Id: I001805e955711c8343097f72370719310f63ed94
2024-01-11 23:00:37 +01:00
Umherirrender 62cf2e94c0 SkinVector22: Minor cleanup
- Remove unused override of getDefaultModules
- Call getActionName() directly
- Remove some use of empty()
- Fix line indent
- Call some functions only once
- Write query parameter as array
- Have all parent:: at function top

Change-Id: I4c807b0a170eef0742586beb87b80eaade4bb4c5
2024-01-11 22:57:41 +01:00
Umherirrender 4fcd95bcb4 FeatureManager: Avoid $this assignment
Just make the callback non-static

Change-Id: I409857dffdbcdd80dfbbe2fb8c64858e9a8f80ef
2024-01-11 22:36:03 +01:00
Moh'd Khier Abualruz f83cca3cc5 [Zebra] Merge skins.vector.zebra.styles module into skins.vector.styles
Merges all of the styles in the Zebra module into the default styles.

- skins.vector.zebra.styles ResourceLoader module is removed.
- FIXME's related to Zebra styles are removed.
- Top-level "&" that were used for scoping to feature-flag are removed.
- `$wgVectorZebraDesign` feature flag is removed.

Bug: T347712
Change-Id: I0177541ae87a5d070d5317629ca38de93613d620
2024-01-09 15:46:11 +01:00
Martin Urbanec aa13694fea Support conditional user defaults
Thanks to T321527, MediaWiki makes it possible for default
values of user properties to vary by user.

Depends-On: I1549c3137e66801c85e03e46427e27da333d68e2
Bug: T354329
Change-Id: Ib7c80f0b065617f9e76315eb4a652486681247cc
2024-01-04 13:12:03 +01:00
Umherirrender f8ffcd20d2 Use namespaced classes
Changes to the use statements done automatically via script
Addition of missing use statements done manually

Change-Id: I9b8f447ea4d715bc815cc782184bca288ee001a0
2024-01-02 20:54:08 +01:00
jenkins-bot 0108ec3f32 Merge "Remove typography survey" 2023-12-07 16:36:31 +00:00
Jon Robson 30ac023458 Correct links to beta feature
Bug: T352826
Change-Id: Ief03307ae1b861d65dd613244802fd5bf7e9cba7
2023-12-06 07:52:28 -08:00
ksarabia 515af497db Remove typography survey
* Removes code related to typography survey

Bug: T349337
Change-Id: Iae871ec0c61d630078108a5710705b4d3d118a54
2023-12-05 14:32:00 -06:00
Moh'd Khier Abualruz 2384a32323 [Zebra] Make .vector-column-start cache compatible
preparing html and css to avoid caching issues
caused by differences between zebra and non-zebra HTML.

Bug: T347712
Bug: T351830
Change-Id: I6f8ae635ba38937729b77ea8517ef2eae0ae12f7
2023-12-04 14:29:06 -06:00
bwang e7ebeec623 Fix incorrect client-pref-pinned classes when client pref feature is disabled
Bug: T351141
Bug: T352257
Change-Id: I2d527ee9a943feabb8c8ea26fd1078fd3721f625
2023-11-29 20:14:49 +00:00
gerritbot febf3e635e Update UserOptionsLookup's FQN
User-options related classes are being moved to the MediaWiki\User\Options namespace in MediaWiki Core; reflect that change here.

Bug: T352284
Depends-On: I9822eb1553870b876d0b8a927e4e86c27d83bd52
Change-Id: I084e01a29884f338fae22d7239d068823a2657c3
2023-11-29 12:42:02 +00:00
jenkins-bot e75b2cda57 Merge "Fix sticky styles for pinnable elements by moving sticky styles into separate vector-sticky-pinned-container element" 2023-11-27 17:56:07 +00:00
bwang b23f6f6722 Fix sticky styles for pinnable elements by moving sticky styles into separate vector-sticky-pinned-container element
Cached HTML change

Bug: T351141
Change-Id: I7d2b4417db15aad7ea788ac7adf131de2c702d27
2023-11-27 17:09:26 +00:00
Moh'd Khier Abualruz e480bfa2b5 Update theme icon for client preferences in user links
- Add appearance.svg file and classes
- Update the icon name in php
- Update icon name in test data and Snapshot

To test: change return value of
  isClientPreferencesPinned() from SkinVector22
  PHP Class to false

Bug: T351142
Change-Id: If61f3019430be3cb9c926b09bc397e27d8e636f2
2023-11-24 15:01:35 +00:00
jenkins-bot 37c2a0016f Merge "Make client prefs fully pinnable" 2023-11-23 16:34:33 +00:00