Commit graph

1058 commits

Author SHA1 Message Date
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
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
Jon Robson 411f9ce69a Allow user preferences to be overriden by query string parameter
Currently only features that are associated with LocalSettings configuration
can be overriden by query string. Going forward we'd like to expand this to apply
to user preference too.

A generic OverrideableRequirement is created.
The existing OverridableConfigRequirement is refactored to extend OverrideableRequirement
The /UserPreferenceRequirement now extends it

This allows http://localhost:8888/wiki/Spain?vectortypographysurvey=1
to work

Bug: T347900
Change-Id: I11efd6b07192d5d2333f4506e9d87a8c0638d657
2023-10-12 19:05:10 +00:00
Moh'd Khier Abualruz 0903ecba9c Vector sticky header dynamic edit icons order
Problem: Edit-links are shown in static order in sticky header always source edit 1st, then visual editor

Patch Changes:
- We now read the configuration from the visual editor extension.
- Based on the order that page views portlet shows of the tabs, we add the icons to the sticky header in the same order as it shows in the portlet.

Bug: T318447
Change-Id: I2d926bf84131b13c881b09c87ccd5d2010c0dffc
2023-10-12 18:54:47 +02:00
Ammarpad 3452647071 Hook: Create HookRunner and interface for own hook
Bug: T348040
Change-Id: I63a7e71a06729dbf607ef9bb275896e42db1b6e0
2023-10-10 22:03:43 +00:00
jenkins-bot 825e1dfad8 Merge "Preferences set to "disabled" return false when isEnabled is called" 2023-10-04 00:56:06 +00:00
Jon Robson 735dad995b Preferences set to "disabled" return false when isEnabled is called
The font size preference sets a preference to disabled rather than 0.

Rather than save this as 0, it would be useful to store this as a string
given in future it will evolve to have values small, medium, large

Change logic in UserPreferenceRequirement to support non-binary options.

Bug: T346987
Change-Id: I399aa1b1be4a45cab0aa3b8addb482e5af6c5bf3
2023-10-04 00:34:16 +00:00
jenkins-bot fd006b5f29 Merge "Add columnStart container and update grid styles" 2023-10-03 19:30:06 +00:00
Jan Drewniak d4246e6ca6 Web typography prototype survey
Creates an interactive prototype for gathering
feedback on users typography preferences.
This prototype is meant to be temporary and is
built soley for feedback purposes for the
WMF Accessibility for reading project.

The prototype code is:
- for logged-in users only
- hidden under the API user preference "vector-typography-survey"
- disabled by default

It is intended to be enabled via a banner that calls
code similar to:
    new mw.Api().saveOption( 'vector-typography-survey', 1 )

Bug: T347208
Change-Id: I8d8914a0fa16d40cb22ed0e61832bc5bbabe1c78
2023-10-02 10:56:40 -07:00
bwang 3cb6e4c505 Add columnStart container and update grid styles
Bug: T323141
Change-Id: Id6d8736922077b26fb972b6e743cf02d048e669d
2023-10-02 12:30:45 -05:00
jenkins-bot 7981c9b23e Merge "Add replace .vector-sidebar-container-no-toc with .vector-toc-available and .vector-toc-not-available" 2023-09-29 17:20:46 +00:00
bwang 11f156d5ff Add replace .vector-sidebar-container-no-toc with .vector-toc-available and .vector-toc-not-available
Bug: T318011
Change-Id: Ib07ace50e762c2e9f59e668ad6746574a60a144b
2023-09-29 16:57:42 +00:00
Lucas Werkmeister ca9ba6cc65 SECURITY: Properly escape vector-toc-toggle-button-label
CVE-2023-PENDING

The line param can contain some markup (since headings can contain
markup), so make that a raw param.

Bug: T340217
Change-Id: I9295a8e0f9f00b62d5206f6d7e40bb657f43651a
2023-09-29 09:08:57 -04:00
Lucas Werkmeister 124a4efa2f SECURITY: Catch MalformedTitleException from vector-intro-page
CVE-2023-PENDING

If the vector-intro-page message doesn’t parse as a valid title, skip
customizing the menu entry label instead of crashing. (Optionally, this
could maybe log a warning or something later.)

Bug: T340220
Change-Id: I2769c1f3115898bbe697ebe9c9c0eaf0ddc0d251
2023-09-28 23:16:30 +01:00
Jon Robson d35db97615 It should be possible to persist Vector font size for registered users
Bug: T346987
Change-Id: I01e0fac5ba781480ee32a8b32f6ef7fafb8d1ca5
2023-09-27 20:04:22 +00:00
Jon Robson 65c48d4eb2 Feature: Client preferences interface
Notes:
* This is functional but intentionally not designed until the design
has been finalized.
* A feature flag is added that swaps out the limited width toggle with
a settings cog
* The preferences module is kept in a separate ResourceLoader module
(skins.vector.clientPreferences) to make it more portable for
when we eventually want to add it to Minerva as well.
* Intentionally have not focused on non-jS version given we will
likely revise this again in a future version/upstream to core.

Bug: T345363
Change-Id: I0c793b73e0676e32f031c6168c292f63908c72e3
2023-09-15 10:03:28 -07:00
Moh'd Khier Abualruz c88d72f1d7 [anon prefs] TOC pinned / unpinned
- Status should persist across page views for anonymous users
- Added 'toc-pinned' as a persistable feature in features.js and FeatureManager.php.
- Handling for cached HTML supporting both new and old class names for pinned/unpinned TOC

Based-On: I0fbe0ab458c5bd55d659d3c35a8fbaa6cd6ec0e1

Bug: T316060
Change-Id: Iad8523037ed364f09962b2d6ca0a3d50d7bd2266
2023-09-14 21:37:50 +00:00
Moh'd Khier Abualruz 7fc6bb0a6a Update label for Page tools navigation region
- Set aria-label to read 'Page tools' in the nav elements

Bug: T330326
Change-Id: I99119aebe98b329d6d1f4e2f8c9f37f77692e8ab
2023-09-05 18:41:38 +02:00
Bartosz Dziewoński 0bb02c9c57 Only show notification after CentralAuth autologin on Vector 2022
This brings in CentralAuth for phan analysis, using config patch
8063720d68ee1d2db2c37c1ad55da3fbef688bce in CI.

Bug: T345112
Change-Id: Iddd94b38f04a34dc18df8978c2bf45e8e204a85c
2023-08-30 08:53:53 -04:00
Jan Drewniak a448233d1d Make Vector feature flag compatible with clientPrefs
Adds the `-clientpref-` string to the Vector font-size
feature flag class, which will now read:

    vector-feature-custom-font-size-clientpref-enabled

Bug: T343928
Change-Id: Iefc575229d52bea820fbee35711650408c917338
2023-08-25 14:58:30 -04:00
jenkins-bot 580b7a022f Merge "Add font size feature flag" 2023-08-24 21:33:39 +00:00
ksarabia 1805561923 Add font size feature flag
Add feature flag that for new (eventually customizable) font size.
Enabled via url param VectorCustomFontSize=1 and font size set to
a hard-coded 16px value for testing purposes.

Bug: T343928
Change-Id: I75801db7506ba2a8212df94bb2079c33a3b64614
2023-08-24 20:57:46 +00:00
gerritbot b5c38e7158 Replace some moved Title class uses, now MediaWiki\Title\Title
Bug: T321681
Change-Id: I7283b3a22bedf6d05d0959cd6edb40b0b15c57b0
2023-08-19 04:23:07 +00:00
Jon Robson e5bf8adad7 Limited width uses new client preferences system
* Update classes to use clientpref-1 and clientpref-0 suffix for limited width
I've limited this to the only client preference for now to reduce
risk.
* For cached HTML retain existing CSS rules, and continue saving
a cookie
* Migrate cookie if found for newly generated pages. This will be
to ensure the old cookie and new cookie are in sync (this should be
a one time operation)

Depends-On: I1e635f843ac9b2f248b1f7618134598e80291b38
Bug: T341641
Change-Id: I120f8f7114b33d2cfbd1c3c57ebf41f8b2d7fec4
2023-08-04 21:31:21 +00:00
bwang eb64a09a7d Separate dropdown/menu references in PHP and templates
- VectorComponentMenuVariants.php is renamed to VectorComponentVariants.php, and returns menu and dropdown data
- Remove TabsMenuContents.mustache in favor of MenuContents.mustache
- Fix the variants dropdown to use the full Menu template

Follow-up: Idf05c1664c026f58487ba34af5ede8a11e695baf
Change-Id: I0e9b1ab3306b04ee0d226048c6885beab4f310c6
2023-07-31 14:03:12 -05:00
Moh'd Khier Abualruz 4b4fc6c6c9 Add hook support for mw.util.addPortlet method
- Hooking into mw.util.addPortlet
- merged in tests from: I3258388d74c103515e3f0680304f9a376e439a35

possible follow-ups:
- tooltips support
- custom attributes support
- Adapting portlets of types dropdown, tab to vector skin. Check patch set 10 for a starting point

Depends-on: I79bad8661e34e653d41e6cb1cd4462ac5c6bc3b1
Bug: T303488
Change-Id: I35a51df6ece2e48e086e722337d4c6bba427eeb4
2023-07-26 13:37:09 +03:00
Jon Robson 0630a96d3a Do not hardcode uls key
The menu may have other items. This is needed by
WikiLambda extension.

Bug: T341500
Change-Id: I6884b04f3137dc1111bdc7642068aa436907caf6
2023-07-21 17:27:51 +00:00
jenkins-bot 565ff35779 Merge "Update html-label to use label-class" 2023-07-13 00:17:13 +00:00
jenkins-bot 5d666f43ab Merge "Make bottom dock expansible via portlet links" 2023-07-12 19:08:35 +00:00
Jon Robson fe03bb50ef Make bottom dock expansible via portlet links
New menu items can be added via
```
var node = mw.util.addPortletLink('p-dock-bottom', '#', 'hello' )
if (node) {
node.querySelector('a').classList.add( 'mw-ui-icon', 'mw-ui-icon-element', 'mw-ui-button' )
}
```

Bug: T336431
Change-Id: I8c5c5414cda9d268631ba0fade90e1a44c104ff1
2023-07-12 12:37:38 -05:00
Noa wmde 2c96f9b3d7 Allow overriding the search pattern highlighting for Wikibase
Use a php hook to override the highlightQuery attribute.
This allows us to turn off search higlighting for all
wikibase repo instances.

Bug: T327510
Change-Id: I0ef27da9cf4ac66151d1a391e9f606100097d7f0
2023-07-11 23:56:29 +00:00
bwang e0eeb1a8c9 Update html-label to use label-class
Follow-up: I64e4780102a743c5ace332a562b4f9d73ea10d16
Change-Id: I255e12f22436b567ec01fafe667138ffd981afed
2023-07-11 16:49:40 +00:00
bwang ecd221fe37 Add option for html label in Menu template
Bug: T340217
Change-Id: I64e4780102a743c5ace332a562b4f9d73ea10d16
2023-07-10 16:42:58 -07:00
bwang 2eb8fe89ea Remove unecessary whitespace and new lines from HTML
Change-Id: I8fe04d458da292e2990543afa232a91b6dd4db59
2023-07-06 14:07:29 -05:00
Moh'd Khier Abualruz 288b802d45 Vector 22 has some missing whitespace internal to HTML elements
Bug: T338691
Change-Id: Ic4657505ff92027d3c83373c7000e452f00ac07e
2023-07-04 19:05:36 +02:00
bwang 6a57506ae8 Separate vector-menu classes from Dropdowns
Bug: T319358
Change-Id: Idf05c1664c026f58487ba34af5ede8a11e695baf
2023-06-27 10:14:29 -05:00
Jon Robson 1e6b647971 Add new classes for dropdown component
Bug: T319358
Change-Id: Iab55dc190aa2ebc48eb9c8b34cf10baae8a89914
2023-06-26 15:31:01 -07:00
bwang 153c6f2668 Remove references to heading in dropdown PHP
Bug: T319358
Change-Id: I9830a4b4b55fdb205c479c09ef807de4f6d68713
2023-06-26 12:49:00 -05:00
Reedy e3c79c7524 VectorComponentUserLinks: Fix typo in comment
Change-Id: I2bf7dd04f856ffea993e029bdd4218e7a0eacf6d
2023-06-23 20:39:42 +00:00