Commit graph

995 commits

Author SHA1 Message Date
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
bwang d2b413a721 Make client prefs fully pinnable
Bug: T351141
Change-Id: Ic4a166fb3234b27dbf3d37891abfdf15781c8867
2023-11-22 14:39:28 -06:00
Piotr Miazga d6945f5f46 Skin shouldn't call SkinMustache::getTemplateData twice
Calling this method twice within the same function introduces
uncessary performance decline.

Bug: T351807
Change-Id: I5a28f2a3884ea22a6e0bba666f73bd8596ccafbe
2023-11-22 14:11:14 +01:00
ksarabia 45332cfcb6 Fix alignment issue in Zebra
Addresses misalignment of client pref in zebra

Bug: T350417
Change-Id: Ib4b80b13dc67d00362abf168853c3ae58ae808b3
2023-11-16 13:53:41 -06:00
Jon Robson 4235a1f355 Theme preferences should not display when feature disabled
This was being flagged by Pixel
Follow up to I0b1ec445c4d292bbf417a39dbc5d2032b563f525

Bug: T350195
Change-Id: I7e4b7b453a518a94a75e952bdeaf4e84b23396c8
2023-11-15 16:42:11 -08:00
ksarabia 1a15dbd4d0 Fix sidebar component order
* This moves down the client pref menu
* For now when page tools is collapsed the client preference menu
is hidden. This will be revisited when we implement pinning
in the next sprint.

Bug: T350417
Change-Id: Ic94d6fd2c4ccb667b0ae602d03c564f88a14b8ec
2023-11-16 00:30:28 +00:00
jenkins-bot 7657f28701 Merge "Allow client side preferences to render in a dropdown" 2023-11-15 22:01:16 +00:00
Jon Robson 5a0678c77d Allow client side preferences to render in a dropdown
Known problems:

- For now, this can only be rendered by manually updating
the isClientPreferencesPinned local variable in SkinVector22
This will be addressed in T351141
- The icon is not correct. This will be addressed in
https://phabricator.wikimedia.org/T351142

Bug: T350195
Change-Id: I0b1ec445c4d292bbf417a39dbc5d2032b563f525
2023-11-15 12:50:54 +01:00
Gergő Tisza f1db8517a5
Update skin[-legacy].mustache type documentation
Depends-On: I8e0cf13093a0c738038a01a0ae120861642a2aa1
Change-Id: I5df124869aa3130573fdb627f5e2588beba3570f
2023-11-14 20:57:25 -08:00
Moh'd Khier Abualruz 412c1f2d83 Create a sidebar for user preferences
* Adds mustache for sidebar
* Adds file to render sidebar

Bug: T350417
Change-Id: I691c8a0487e158e96027109c223569224f03a102
2023-11-14 14:33:01 -08:00
Jon Robson 0a33ffffac Remove Zebra A/B test code
Additional change:
* Remove duplicate A/B test requirement for language in header

Bug: T339957
Change-Id: I0258e71ac0e270682ec1f3bcb0f10198892f058d
2023-11-13 21:56:34 +00:00
Jon Robson 332678a991 Fixes orange bar of doom (echo alert)
* Updates CSS selector for the Echo alert
* Prevents conversion of OBOD to a button via a generic
array of "exception" names.

Bug: T350195
Change-Id: Id9b2763fe4d893fa4b4ce1e740dba59e6d887436
2023-11-13 11:17:51 -08:00
Jon Robson 07a26a9448 Refactor VectorComponentUserLinks to not use hooks
Bug: T350195
Change-Id: I6cbf45587475f0477657a7ce9309b2cd42da33c1
2023-11-09 17:32:10 -08:00
Moh'd Khier Abualruz 9428bd2a0c Add images to Vector 2022 beta feature
- Add images to resource/images
- Use images in the config of onGetBetaFeaturePreferences for vector-2022

Bug: T349321
Change-Id: Ib359d49719dd5854c3f060f3484c098d93c35c06
2023-11-07 18:47:38 +01:00
jenkins-bot 1eb75ab7b1 Merge "Vector legacy: Support dropdown creation via addPortlet" 2023-10-25 10:15:05 +00:00
Jon Robson cb8a500e7a Vector legacy: Support dropdown creation via addPortlet
Vector:
    mw.util.addPortlet('p-twinkle', 'TW', '#p-cactions');
    mw.util.addPortletLink('p-twinkle','#', 'Hello world');

Additional changes:
* Add aria labels to gadget created menus

Additional changes to template
* Remove self closing tag on input[checkbox] in template
* Rearrange vector-menu and vector-menu-dropdown classes
for consistency between two approaches

Bug: T342815
Change-Id: I938928c3625099ad49bec8aafb11f91190a9f494
2023-10-25 10:39:30 +02:00
Umherirrender ae1584ade5 Simplify SkinVector22::isTocAvailable
No need to check $tocData for empty before checking if a key is set on
the array, as empty suppress the error when $tocData is null

Change-Id: I3f1fd4bfdfd7f29e6750d72af75c286668b5f09c
2023-10-22 16:50:22 +02:00
Umherirrender cb8fc5c8c1 Replace empty() with falsy check
empty() should only be used to suppress errors
When the type of the variable is array,
a falsy check is the same (checks for null, false and empty array)
Found by a new phan plugin (T234237)

Change-Id: I84ced7c17157b322f858640362e1013e37773d43
2023-10-22 11:45:42 +02:00
Umherirrender b962638262 Replace empty() with a string compare
empty() should only be used to suppress errors
Found by a new phan plugin (T234237)

Change-Id: I10b562aa04eb9cf974e301567e74f2f620027ba8
2023-10-21 20:26:30 +02:00
Moh'd Khier Abualruz 173c91a0f5 Make Vector feature flags compatible with beta features
- Added Key 'beta' to features config in skin.json. As usual this also supported by global configs.
- Added feature management logic to check for beta feature enabled status and the user's selection of utilising the vector beta features.
- Added VECTOR_BETA_FEATURES to Constants.php which is an array that holds features names that would be enabled.
- Removed final from class declaration of OverridableConfigRequirement class, as it does interfere with the mocking in the current setup

Remaining Work:
- Missing images to be added in the hook to show in beta features under Special:Preferences -- this will be added in a followup

Bug: T347772
Change-Id: I7bf8284e328c66c019c392f57207cab21ce0d4f6
2023-10-19 18:22:57 +02:00
Moh'd Khier Abualruz 22e97fe383 Add multiple font size to logged-in users
Read Value from user preference for logged-in users.

Depends-On: I041a0cb21e872700ceeeddd3a39922e456aa7bb8
Bug: T346954
Change-Id: I6afa39624c3cadd31632d63a36b919d641983ae6
2023-10-17 19:42:30 +02:00
Jon Robson 004b4c96f3 Add multiple font size to frontend
Use integer value going forward as it will be easier
to manage.

Bug: T346954
Change-Id: I041a0cb21e872700ceeeddd3a39922e456aa7bb8
2023-10-17 12:43:02 +00:00
jenkins-bot 48f2a52c96 Merge "Simplify TOC design for pinned TOC on no js small viewports" 2023-10-17 04:11:30 +00:00
Jan Drewniak 8a3e24e346 Simplify TOC design for pinned TOC on no js small viewports
Bug: T340571
Change-Id: Ie34d7d478b3a73cade9f5328439515e419692eb7
2023-10-16 23:31:18 -04:00
Jan Drewniak dcdcecd3db Add config option to disable Readability survery & minor fixes
Adds a config option to control the Readability prototype
survey tool on a per-wiki basis.

Minor fixes:
- Adds missing i18n messages to the tool for slider labels
- Ensures tool only runs on Vector 2022 skin
- Wraps the initialization in an IIFE

Change-Id: Ia65a0043dab5e9a23d4ef401ed83914e4f3d2882
2023-10-16 00:45:59 +00:00
jenkins-bot 6b9055e593 Merge "Allow user preferences to be overriden by query string parameter" 2023-10-13 17:33:12 +00:00
jenkins-bot 48a3efbae2 Merge "Vector sticky header dynamic edit icons order" 2023-10-12 19:18:03 +00:00