Remove code per spike outcome (T226490#7438685)
- This configuration option is never used in Wikimedia production
- isTalkAllowed content body is merged into isAllowed. Resulting code
is more readable.
- isAllowed('talk') still returns false on main page for anonymous users
which is the current behavior. Even on sv.m.wikipedia.org where talk pages
are shown to anonymous users, we do not show the talk page on the main page.
Add a comment pointing to the associated phabricator ticket
Bug: T226490
Change-Id: I9f34817c5ad654a6a66fe6156850a3e3fee881a7
For skins, all templates should be in the same folder. This
is for security reasons, to limit access of templates to files
that are not templates. This also adds consistency with other skins
where templates are all in the same subdirectory. It also allows
us to reduce the creation of TemplateParser instances.
Note: All styles and scripts should be in the resources folder but this
is not rectified by this patchset. Will be done in follow ups following
more discussion.
This begins this work in the least disruptive way possible and drops
the README note to avoid this pattern growing.
Bug: T292558
Change-Id: I4c2e115451c0a76c742734730712814c1f1d838d
This reverts commit 33e5c1eb79.
I talked to Gergo (tgr) about this and he's convinced me
that probably I want to be more conservative
and incremently roll the sitenotices
out first. With that in mind I'm going to revert this change
and do a config flag instead.
Bug: T254391
Change-Id: If0f214d23a012fb4ae3e1dff1728f746a22f142a
This will make site notices display across the site as intended. The config
flag doesn't seem warranted - site notices should display across all skins
as they may contain important information.
This is preventing wikidata page banners from displaying in Minerva.
If this is controversial I can do a config-only change for Wikivoyages
Bug: T254391
Change-Id: I34c5e762b967ea94e33025e87f3446e8e029bc91
The feature got into Beta in over a year ago and never made into
the beta mode. For most of the time it was disabled for all users.
There is no need to keep this code as it is dead code now.
Change-Id: I9037f58b97373195e9d1b9f57789a6c531f42831
We are counting errors rather than sending them via EventLogging.
This code is thus being shipped unnecessarily to our users and is
not ever enabled in production
Given our work to use Sentry (T106915) let's remove this code.
Bug: T233663
Change-Id: I71ef7377e91e38f9ccc13493d52ab629d433f8f4
Two new feature flags:
1) MinervaPersonalMenu
2) MinervaAdvancedMainMenu
Changes:
* AMC defaults to false on desktop - desktop doesn't have AMC mode it just
enables several skin options.
* WHen inserting a link at the bottom of the page check whether the talk at top
of the page (tabs) is enabled.. not AMC
* Update ServiceWiring to construct menu based on MinervaAdvancedMainMenu
and MinervaPersonalMenu - note when former is enabled but not latter there is
no way to logout. Noted in README.
* Use one entry point for skins.minerva.amc.styles/index.less
* Document files inside skins.minerva.amc.styles to make it clear which features
they are associated with
* Drop history page styles when AMC is disabled - it's not possible to ever get to
these as the history page redirects in non-AMC mode
* Rename the class .minerva--amc-enabled to minerva--history-page-action-enabled
to reflect its real purpose and move styles from skins.minerva.base.styles to skins.minerva.amc.styles
No need to worry about cached HTML as AMC runs without cache...
* Remove isAnyAMCOptionEnabled - it's an antipattern and should be discouraged as it discourages the
art of feature flagging. Nothing is using it after these changes.
* The AMC_MODE flag is disabled. There is no need for this - AMC is not a feature and therefore not a
skin option. It is a mechanism for turning on other skin options. Tests are updated.
Testing:
It should now be possible to enable any feature in `beta` and see it in the beta of the
site.
Bug: T229295
Change-Id: I48959905f5c09721b14a27aa1a5ad82849ac6263
This reverts commit d11c84d08b.
We decided to track both old MobileWebMainMenuClickTracking and new MobileWebUIActionsTracking for some time. Then once everything goes stable and it's proven to work correctly we will merge d11c84d08b.
Bug: T220016
Change-Id: Ib4d52e8b8c870774041284e575564a9933af6136
This code should live in WikimediaEvents extension, not in
Minerva.
Bug: T220016
Depends-On: Ic2d6d1b21b0eb72ad68b0c447bc63f7d1bb021f4
Change-Id: Iaeb12704dcd257f0783f1ebec3def01cb2848228
A list that toggles visibility via the checkbox hack is needed in at
least two spots: the page actions overflow menu and the user menu. This
patch makes several refactors to turn what was previously hardcoded into
page actions a reusable component:
- Start a new components directory. Components are reusable and
composable. The subdirectories are organized by function, not
ResourceLoader module bundling which greatly improves the ability to
see a component's full functionality in one directory instead of
examining the entire codebase. See updates to README.
- Extract pageactions.less into:
- ToggleList.less: LESS for any checkbox hack list.
- DropDownList.less: LESS for lists that open downwards.
- MenuListItem.less: LESS for list items of menus.
The division makes it easier to see concerns, dependencies, and change
code.
- Move pageActionMenu.mustache to a component and extract ToggleList
template.
- Extract ToggleList.js from Toolbar.js.
Bug: T214540
Change-Id: I171831469a6733c458bc5c7ba249a5096ca975b8
The Minerva README.md says the default for this should be 0.5 not 0.
Let's change this to 0 in the README to reflect the value in the
skin.json and avoid confusion.
Bug: T218627
Change-Id: I0e75b25729f99fa889dc230e68d5ee0b8e5f2df2
When advanced mobile contributions mode is enabled and
`$wgMinervaOverflowInPageActions` is set, show a secondary overflow menu
on main namespace articles and user namespace pages. The menu content
varies for each namespace. The new submenu is *disabled* by default,
even when AMC is active. This feature should not be deployed until
instrumentation is available.
The secondary menu is rendered in PHP using the existing menu system
with some changes to the template. The checkbox hack is needed for no-
JavaScript keyboard navigation until :focus-within is supported. CSS
additions are documented in the source.
All client side toolbar execution occurs in Toolbar.js. Enhancements are
documented in the source.
Minor changes to the existing download button:
- Move download and edit button initialization to Toolbar.
- Update copy (not visible) from "Download" to "Download PDF".
- When the overflow menu is present, use the "hasText" / label style.
Wikimedia UI icons are copied from OOUI at d00a0ac and seem useful to
expose as HTTP URIs (not data URIs).
The overflow menu does not show for pages provided by the content proxy
since its entries depend on $tpl->data['nav_urls'] being populated.
Bug: T216418
Depends-On: I0781151a8232b6a7b52f79a34298afcecb8e4271
Change-Id: I4b50a0e519024a7ab91dae6ab40b23cf14a03861
This adds a client side error logger that will store errors
in EventLogging. We will use it to get a sense of the number
of errors inside mobile.
To enable make use of the new configuration variable
wgMinervaErrorLogSamplingRate = 1
Notes:
* the optional `meta` field will not be utilised by the generic
error handler.
* URI length is not trimmed for title. We will consider whether we need
to make any adjustments to the schema values during roll out.
** For stack trace, we limit the length by removing errorUrl (which is logged
separately)
Testing:
Add throw new Error('asasasa'); anywhere in your code and make
sure the code executes. It should trigger an Error event provided
that configuration has been updated.
Bug: T202026
Change-Id: I07f01b4c025b2e5e4cbf88ec05e7c536442c62cc
The hook that enables the Reading depth test should send an
additional paramter that specifies which test bucket the hook
being is calling from.
Bug: T191532
Change-Id: Ifd9f43220c476ece8a0c0cee46b62b58a717c616
The readme describes all of Minerva's configs and includes a type and
what the default value is at the end of each section. Since the
descriptions for some configs is lengthy, moving the type and default
next to each config's name gives a consistent location for the
information and allows for quick look up without parsing.
Change-Id: I1583c11c80d9b775d93f59302eb2666b754fb412
Changes:
* Introduce Jan's beautifully documented $wgMinervaABSamplingRate
Set to 1 to A/B test 50% of the population
* Split out ambox template styles into a separate file referenced
by hacks.less
* Update cleanuptemplates setup script to consider two buckets
Test pages:
* Shqiponja_Partizane
* World_War_II_in_Albania
* Liberation_of_Tirana
* French_Consulate
* Abd_ar-Rahman_IV
* M109_howitzer
* Aimoin
* Transport_in_Brazil
* Transport_in_Cape_Verde
Bug: T191303
Change-Id: I8d11e655ccb847b7999e64dda57b225ad8b1c23a
This will use the srcset attrribute which was introduced with HTML5,
in order to load the svg image on supported browsers.
Should fix the bug after merging change 394820.
Bug: T166684
Change-Id: I2337b750c80e79c816dc817dfe230e063eed0345