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
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
- 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
- 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
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
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
Changes to the use statements done automatically via script
Addition of missing use statements done manually
Change-Id: I9b8f447ea4d715bc815cc782184bca288ee001a0
preparing html and css to avoid caching issues
caused by differences between zebra and non-zebra HTML.
Bug: T347712
Bug: T351830
Change-Id: I6f8ae635ba38937729b77ea8517ef2eae0ae12f7
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
- 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
Calling this method twice within the same function introduces
uncessary performance decline.
Bug: T351807
Change-Id: I5a28f2a3884ea22a6e0bba666f73bd8596ccafbe
This was being flagged by Pixel
Follow up to I0b1ec445c4d292bbf417a39dbc5d2032b563f525
Bug: T350195
Change-Id: I7e4b7b453a518a94a75e952bdeaf4e84b23396c8
* 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
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
* 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
- Add images to resource/images
- Use images in the config of onGetBetaFeaturePreferences for vector-2022
Bug: T349321
Change-Id: Ib359d49719dd5854c3f060f3484c098d93c35c06
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
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
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
- 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
Read Value from user preference for logged-in users.
Depends-On: I041a0cb21e872700ceeeddd3a39922e456aa7bb8
Bug: T346954
Change-Id: I6afa39624c3cadd31632d63a36b919d641983ae6
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
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
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
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
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
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
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
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
- 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
This brings in CentralAuth for phan analysis, using config patch
8063720d68ee1d2db2c37c1ad55da3fbef688bce in CI.
Bug: T345112
Change-Id: Iddd94b38f04a34dc18df8978c2bf45e8e204a85c
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
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
* 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
- 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
- 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
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
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
The languages alert is misleading when there are no languages and the user has JS disabled.
This change adds a class to the alert if there are 0 languages, and then adds "display: none" to the alert if the client-nojs class is present. This is the same approach being used for the language switcher button.
Bug: T326185
Change-Id: Iee292d661ed1f47700f588053712f5f547022b17
- Update SearchBox.mustache markup to use codex styles
- Scope old SearchBox markup to LegacySearchBox.mustache
- Add handling for thumbnail and autoexpand search variants
- Adds a 'Search' button to SearchBox.mustache matching the initial non vue search box with the Codex design
- Refactor SearchBox CSS so styles are scoped better
Visual changes:
A "Search" button now appears on page load when it previously only appeared after loading in Vue
Bug: T337966
Change-Id: Ibcffe00292ab4f9f5f9919982d578793cf8594de
Changes:
- mw-ui-button to cdx-button
- mw-ui-quiet to cdx-button--weight-quiet
- mw-ui-icon-element to cdx-button--icon-only
- mw-ui-icon to vector-icon
- mw-ui-icon-flush-right/left to vector-button-flush-right/left
- Removes $isSmallIcon param in Hooks.php
85 Visual Changes
- ~36 changes from minor pixel changes from the new button classes in the main menu, language button
- 22 from standardizing the padding of the TOC in page title
- ~10 changes from addition of .cdx-button to the TOC toggle buttons
PERFORMANCE:
This will result in an overall increase of 2.7kb of render blocking
CSS, 1kb will be reclaimed when
I6c1ed1523df8cc9e2f2ca09506f12a595b8b013d is merged.
Co-author: Bernard Wang <bwang@wikimedia.org>
Bug: T336526
Change-Id: Ibd558238a41a0d3edb981e441638f9564f43d226
When AB bucketing via ABRequirements.php in Vector,
the browser has no awareness of this bucketing and buckets users
once more via mw.experiments.getBucket() in AB.js.
mw.experiments uses a different algorithm than ABRequirements.php,
causing a mismatch between the server-side bucketing
and the client-side bucketing.
This patch overrides that client-side bucketing by
adding classes to the HTML element that are recognized
by AB.js
Bug: T335972
Change-Id: I0549a8dee23ebe7cd68465f8403e4f7aac76633e