2014-08-07 11:38:34 +00:00
{
"@metadata" : {
"authors" : [
2021-02-09 07:44:05 +00:00
"Amire80" ,
2014-08-07 11:38:34 +00:00
"Darth Kule" ,
"EugeneZelenko" ,
2020-04-08 07:07:13 +00:00
"Liuxinyu970226" ,
2014-08-07 11:38:34 +00:00
"Lloffiwr" ,
2014-12-19 21:08:33 +00:00
"Matma Rex" ,
2019-01-24 21:37:48 +00:00
"Metalhead64" ,
2020-04-08 07:07:13 +00:00
"Raymond" ,
"Shirayuki" ,
"Tacsipacsi" ,
"Umherirrender"
2014-08-07 11:38:34 +00:00
]
} ,
2017-10-31 20:59:35 +00:00
"skinname-vector" : "{{name}}" ,
2014-08-07 11:38:34 +00:00
"vector-skin-desc" : "{{desc|what=skin|name=Vector|url=https://www.mediawiki.org/wiki/Skin:Vector}}" ,
[Special:Preferences] [PHP] Add skin version user preference and configs
Add a Vector-specific user preference to Special:Preferences for
toggling skin version, either Legacy Vector or the latest Vector.
The presentation of the new preference section and the default values
for anonymous, new, and existing accounts are configurable via
$wgVectorShowSkinPreferences, $wgVectorDefaultSkinVersion (to be used by
the feature manager in T244481),
$wgVectorDefaultSkinVersionForExistingAccounts, and
$wgVectorDefaultSkinVersionForNewAccounts. These configurations default
to the fullest experience so that third-party configuration is minimal.
See skin.json for details. The configurations are each tested in
VectorHooksTest.php.
When presentation is enabled, the new preference appears as a checkbox;
enabled is Legacy mode and disable is latest. There are a number of
unfortunate details:
- Showing and hiding a checkbox is supported by OOUI. Showing and hiding
a whole section (Vector skin preferences, in this case) is not so this
additional client JavaScript functionality is added in Core (see
Iaf68b238a8ac7a4fb22b9ef5d6c5a3394ee2e377).
- Stylization as a checkbox is wanted. However, the implied storage type
for OOUI checkboxes is a boolean. This is not wanted in the event that
another skin version is added (e.g., '3' or 'alpha'). As a workaround,
the preference is converted from a boolean to a version string ('1' or
'2') on save in Hooks::onPreferencesFormPreSave() and from a version
string to a checkbox enable / disable string ('1' or '0') in
onGetPreferences(). There a number of test cases to help cover these
concerning details.
Documentation for overriding the skin version as a URL query parameter
is provided in anticipation of T244481.
Bug: T242381
Bug: T245793
Depends-On: Iaf68b238a8ac7a4fb22b9ef5d6c5a3394ee2e377
Depends-On: Ifc2863fca9cd9efd11ac30c780420e8d89e8cb22
Change-Id: I177dad88fc982170641059b6a4f53fbb38eefad6
2020-01-23 21:53:09 +00:00
"prefs-vector-enable-vector-1-label" : "Label for the checkbox to force Legacy Vector operation accessible via Special:Preferences. When this checkbox is enabled, the December 2019 of Vector is used. When this checkbox is disabled, the actively developed version of Vector is used instead." ,
"prefs-vector-enable-vector-1-help" : "Detail explaining the operation of the prefs-vector-enable-vector-1-label checkbox." ,
Add opt-out link to Sidebar for Vector/Logged-in Users Without Abstractions
This commit is singularly focused on adding a link to the sidebar for
Vector, logged-in users. It does the bare minimum to fulfill the
requirements of T243281.
Additionally, it will help to answer the question "Do we need to use
abstractions (other than maybe different templates) to separate Legacy
Vector from Vector" by intentionally leaving out any abstractions in
order to make it easier to compare with a follow-up patch
(Ib2ef15180df73360cc1de25b893e49d415d23e1a) which does use abstractions.
It is a good thing to question whether or not we need addtional
abstractions in VectorTemplate and if they will help us as unnecessary
abstractions can have the opposite effect and just lead to further
frustrations down the road.
Therefore, I urge you, the reviewer, to let me know your thoughts! If
abstractions are viewed as not making our lives any easier, the
follow-up patches may be completely discarded and that's totally okay
with me. :) I think it's a good think to talk about now though.
Important changes:
* The VectorTemplate constructor was changed to allow injecting the
config, templateParser, and isLegacy boolean (only the config was
allowed before this commit). According to MediaWiki's Stable Interface
Policy, "Constructor signatures are generally considered unstable unless
explicitly declared stable for calling" [3]. Given that VecorTemplate's
constructor is not marked as stable, it is justified to do this without
warning according to the policy.
* Due to the above, the 'setTemplate' method is no longer needed and was
marked as deprecated.
* VectorTemplateTest was made to adapt to the new VectorTemplate
constructor. Additionally, it now extends from
MediaWikiIntegrationTestCase which my intelliphense server can pick up.
I *think* MediaWikiTestCase is just an alias to
MediaWikiIntegrationTestCase [1] and MediaWikiTestCase file was renamed
to MediaWikiIntegrationTestCase in [2], but I'm willing to change it
back if there is pushback to this.
Open questions:
* What are VectorTemplate's responsibilities? To me, it acts right now
as a controller (because it echos the full HTML string from the
template), a model (because SkinTemplate::prepareQuickTemplate sets data
on it which it later retrieves through `$this->get()`), a presenter
(because it adds data tailored for a web-centric view), and a view
(because it renders HTML strings instead of letting the view/template be
solely responsible for that). Arguably, some business logic might be
mixed in there as well (because it checks to see if a User is logged
in/has necessary permissions to show x which my changes here add to).
This might not be a problem if we keep VectorTemplate relatively small,
but will it remain this way as we progress further in Desktop
Improvements?
* How do we write tests for VectorTemplate without exposing unnecessary
public methods? For example, if I want to test the `getSkinData()`
method to see what state will be sent to the template, how should I do
this? One option might be to use `TestingAccessWrapper` to expose these
private methods which is what
`VectorTemplateTest::testbuildViewsProps()` does. Another option is to
accept this method as public. Is there a better way? Keep in mind that
even with access to this method, there might be many things to mock.
[1] https://github.com/wikimedia/mediawiki/blob/0030cb525be6cabc1d63de80586b2017d4bbe354/tests/common/TestsAutoLoader.php#L64
[2] Ie717b0ecf4fcfd089d46248f14853c80b7ef4a76
[3] https://www.mediawiki.org/wiki/Stable_interface_policy
Bug: T243281
Change-Id: I0571b041bcd7f19bec9f103fa7bccdd093f6394d
2020-03-17 20:21:33 +00:00
"vector-opt-out" : "Text of link that takes the user to the Special:Preferences page so they can opt-out of the latest version of Vector and go back to legacy Vector." ,
2020-05-04 23:37:41 +00:00
"vector-opt-out-tooltip" : "Used as the tooltip for the Vector opt-out link" ,
2014-08-07 11:38:34 +00:00
"vector.css" : "{{optional}}" ,
"vector.js" : "{{optional}}" ,
2020-03-30 20:07:35 +00:00
"vector-action-toggle-sidebar" : "Accessibility label for the button that toggles the sidebar's visibility, as well as audible presentation for screen readers." ,
2021-09-14 22:56:54 +00:00
"vector-language-button-aria-label" : "Accessibility label for language button dropdown menu in modern Vector.\n* $1 - the count of languages available, supports plural" ,
2021-02-09 07:44:05 +00:00
"vector-language-button-label" : "Label for language button in modern Vector.\n\nArguments:\n* $1 number of languages, supports plural" ,
2021-09-14 22:56:54 +00:00
"vector-language-variant-switcher-label" : "Label for the language variant switcher." ,
2014-12-19 21:08:33 +00:00
"vector-action-addsection" : "Used in the Vector skin. See for example {{canonicalurl:Talk:Main_Page|useskin=vector}}\n{{Identical|Add topic}}" ,
2019-01-24 21:37:48 +00:00
"vector-action-delete" : "Used in the Vector skin, as the name of a tab at the top of the page. See for example {{canonicalurl:Translating:MediaWiki|useskin=vector}}\n\n{{Identical|Delete}}" ,
2014-08-07 11:38:34 +00:00
"vector-action-move" : "Used in the Vector skin, on the tabs at the top of the page. See for example {{canonicalurl:Talk:Main_Page|useskin=vector}}\n\n{{Identical|Move}}" ,
"vector-action-protect" : "Tab at top of page, in vector skin\n\n{{Identical|Protect}}" ,
"vector-action-undelete" : "Tab at top of page, in vector skin.\n{{Identical|Undelete}}" ,
"vector-action-unprotect" : "Tab at top of page, in vector skin.\n{{Identical|Change protection}}" ,
"vector-view-create" : "Tab label in the Vector skin. See for example {{canonicalurl:Foo|useskin=vector}}\n{{Identical|Create}}" ,
2019-01-24 21:37:48 +00:00
"vector-view-edit" : "Tab label in the Vector skin. See for example {{canonicalurl:Translating:MediaWiki|useskin=vector}}\n{{Identical|Edit}}" ,
"vector-view-history" : "Tab label in the Vector skin. See for example {{canonicalurl:Translating:MediaWiki|useskin=vector}}\n{{Identical|View history}}" ,
"vector-view-view" : "Tab label in the Vector skin (verb). See for example {{canonicalurl:Translating:MediaWiki|useskin=vector}}.\n{{Identical|Read}}" ,
2014-08-07 11:38:34 +00:00
"vector-view-viewsource" : "Tab label in the Vector skin.\n{{Identical|View source}}" ,
2018-05-24 19:56:08 +00:00
"vector-jumptonavigation" : "Accessibility link for jumping to the navigation links. Visually hidden by default.\n\nSee also\n* {{msg-mw|Navigation}}" ,
"vector-jumptosearch" : "Accessibility link for jumping to the site search. Visually hidden by default.\n\nSee also\n* {{msg-mw|Search}}" ,
2020-09-08 23:20:58 +00:00
"vector-jumptocontent" : "Accessibility link for jumping to the content and skipping the navigation. Visually hidden by default." ,
2020-08-04 12:02:50 +00:00
"vector-more-actions" : "Label in the Vector skin's menu for the less-important or rarer actions which are not shown as tabs (like moving the page, or for sysops deleting or protecting the page), as well as (for users with a narrow viewing window in their browser) the less-important tab actions which the user's browser is unable to fit in. {{Identical|More}}" ,
2021-05-07 21:56:29 +00:00
"vector-search-loader" : "Text to display below search input while the search suggestion module is loading" ,
"vector-anon-user-menu-pages" : "Label describing the anon editor links in the anon user menu" ,
2021-06-02 22:57:43 +00:00
"vector-anon-user-menu-pages-learn" : "Lowercase text of link that goes to Help:Introduction and helps the user learn more about editing" ,
2021-08-25 20:16:33 +00:00
"vector-anon-user-menu-pages-label" : "Accessible version of 'vector-anon-user-menu-pages' link text, prompts user to learn more about editing" ,
2021-08-25 15:24:58 +00:00
"vector-personal-more-label" : "Label describing the user links next to the user links dropdown menu." ,
"vector-main-menu-tooltip" : "Used as title attribute for main menu icon on hover." ,
2021-08-30 22:27:15 +00:00
"tooltip-vector-anon-user-menu-title" : "Used as title attribute for user menu icon on hover for anonymous users." ,
"vector-menu-checkbox-expanded" : "Label for expanded state of dropdown menus for screen reader or assistive technology users." ,
"vector-menu-checkbox-collapsed" : "Label for collapsed state of dropdown menus for screen reader or assistive technology users."
2014-08-07 11:38:34 +00:00
}