Commit graph

38 commits

Author SHA1 Message Date
jenkins-bot a90cdd6cd8 Merge "Remove MinervaKnownTemplateHacks" 2024-04-25 19:25:36 +00:00
Steven Rawson 22de1919ed Minerva: Fix README render of #$wgMinervaAlwaysShowLanguageButton
f9c055e7f5 removed a feature and some of the documentation but not all
of it, causing bad <pre> rendering instead of intended paragraphs etc.

Change-Id: I89b1054306fb5fcfe3a7503ea7ab9d8b2ed981f7
2024-04-23 22:53:39 +00:00
bwang 95c4454cf9 Remove MinervaKnownTemplateHacks
Bug: T362727
Change-Id: Iccb2e15df25f35d625d88ec4e39a16f97f84b505
2024-04-22 17:33:01 +00:00
Jon Robson c2623ed44f Add soft dependency on Minerva to Vector
Bug: T359607
Change-Id: If293689999a54f067792d172441c7c47d0992ed9
2024-03-21 21:05:47 +00:00
Jdlrobson ca28efc9c7 Drop mw.mobileFrontend references
This restores the previously reverted patchset
If5b76245bf60bfa9cf977cdbf37ee0d6bb65f9d9

Changes since original:
* Added Depends-On to MobileFrontend
* Uses OOUI classes for page issues rather than es6 classes - ES6
classes do not support modifications to class prior to running
super so MobileFrontend's View class is not compatible without
significant refactors.

Depends-On: I24ad75adf8519102ca356d64d99d765ab69180cc
Bug: T348807
Change-Id: I4ff82af0251254c846f2caee330af5af738f6029
2023-11-10 01:30:52 +00:00
Jdlrobson 2ee3e27406 Revert "Drop mw.mobileFrontend references"
This reverts commit 19ea6328b0.

Reason for revert: Breaks page issues and image overlay. I
will break this up into smaller less risky patches.

Change-Id: If5b76245bf60bfa9cf977cdbf37ee0d6bb65f9d9
2023-11-03 19:26:16 +00:00
Jon Robson 19ea6328b0 Drop mw.mobileFrontend references
Bug: T348807
Change-Id: Ib71b43005e5788d0e29917a165281faa84926414
2023-10-31 21:54:26 +00:00
jdlrobson 5a7a9c9c31 Drop wgMinervaPageActions
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
2021-10-21 17:25:37 +00:00
jdlrobson aba173efc6 Remove non-standard components folder
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
2021-10-06 20:13:48 +00:00
Jdlrobson 8651df02bb Replace categories button with HTML rendering
Bug: T246049
Change-Id: Id8c7493a525844b43c1628a1f4f09ae716ece2ba
2021-05-14 20:34:59 +00:00
jdlrobson ed0222b0d0 Remove client side error counting
Bug: T266359
Change-Id: I5350c801e7ecb7b8b28e54410cc57fd3b548b2ef
2020-10-23 11:09:22 -07:00
jdlrobson 2e450e104e Donate link should be in a separate group in main menu
Bug: T219793
Change-Id: I7501c87eaa799e4c8a9052f5e3f650a89f376d1b
2020-06-29 14:38:34 -07:00
Vas Jaremchuk f4e3c8f9d9 Mobile web donate link
Add the Donate link with a heart icon in Mobile menu.

Bug: T219793
Change-Id: I65d1d7408e2df7b3ae307736ac6d498b1d7f7197
2020-06-25 11:00:44 -07:00
Jdlrobson 4f021c79f0 Revert "Drop MinervaEnableSiteNotice"
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
2020-06-04 22:39:36 +00:00
jdlrobson 33e5c1eb79 Drop MinervaEnableSiteNotice
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
2020-06-04 08:38:03 -07:00
Timo Tijhof 5283774bbd docs: Remove mention of TemplateParser $forceRecompile arg
Change-Id: I13fba73146e00608f1aeb2694cfef798f09d185a
2020-03-19 00:24:30 +00:00
James D. Forrester 0892d190b6 Drop support for $wgMinervaCustomLogos being set
Bug: T232140
Change-Id: I56dc8ac8d394ad7561ea09e67da6c51db2bc90f9
2020-03-10 20:40:32 +00:00
Ammar Abdulhamid 898b048d1c Discontinue back-to-top feature
Bug: T237290
Change-Id: I06a6823bd3d1985a1d76384bb65c9d2ddf334a21
2019-12-11 05:12:43 +00:00
Piotr Miazga f9c055e7f5 Remove Share feature
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
2019-10-28 12:54:14 -07:00
jdlrobson 8ee17cf2b0 Remove wgMinervaErrorLogSamplingRate
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
2019-10-03 14:57:14 +00:00
jdlrobson 9150aec131 Feature flag overhaul
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
2019-08-23 10:48:14 -07:00
Jdlrobson 8d703b7758 Remove all main_menu tracking related code.""
This reverts commit de353c06c9.

Bug: T228681
Change-Id: Idfd964c31e09e271dca9ac39f7932df49cdcb5f6
2019-08-01 10:40:09 -07:00
Pmiazga de353c06c9 Revert "Remove all main_menu tracking related code."
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
2019-07-22 18:31:55 +00:00
Piotr Miazga d11c84d08b Remove all main_menu tracking related code.
This code should live in WikimediaEvents extension, not in
Minerva.

Bug: T220016
Depends-On: Ic2d6d1b21b0eb72ad68b0c447bc63f7d1bb021f4
Change-Id: Iaeb12704dcd257f0783f1ebec3def01cb2848228
2019-07-19 15:30:28 +00:00
Stephen Niedzielski edb4385345 Hygiene: extract ToggleList to a reusable component
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
2019-07-04 13:48:13 -06:00
Nicholas Ray 1be4a9e55a Change MinervaSchemaMainMenuClickTrackingSampleRate default in README
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
2019-04-23 01:25:15 +00:00
Stephen Niedzielski 815f3386e3 Update: add secondary page actions submenu in AMC mode
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
2019-04-19 14:51:17 +00:00
Jan Drewniak c0ab8046ac Add config option for showing history link in page actions menu
Bug: T213352
Change-Id: I6a53a7303434b0fd374bc5b6ea2dbc8e760807e6
2019-03-07 21:50:57 +01:00
jdlrobson e8709c9860 README should document all config
Skin features are not documented in README.

Change-Id: Ie83d8dac3d94386e3bd3d96d248f14bf4ce8a90d
2019-02-21 09:52:41 -07:00
jdlrobson 07a3b81c91 Errors can be counted in statsv
Bug: T205582
Change-Id: I8f67b8356ac271872cac39a416ffefce47959177
2018-10-08 15:05:56 -07:00
jdlrobson 33a7484676 Move MainMenu click tracking schema from MobileFrontend to Minerva
Additional changes:
* Rename hook prefix from 'mf.' to 'minerva.'
* Remove now unnecessary RL call

Bug: T204584
Change-Id: I50619e71c5a98e95c8aed3c3f346d4cb8a70abbe
2018-10-02 15:03:17 -07:00
jdlrobson cd528e120b Client side error reporting for Minerva+MobileFrontend
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
2018-08-30 14:35:27 -07:00
Jan Drewniak e27cbf2a49 Reading depth hook should send additional sampling bucket parameter
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
2018-07-31 11:40:29 +00:00
Stephen Niedzielski fde1c1084c Doc: move config type and defaults near identity
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
2018-06-29 17:55:14 +00:00
Stephen Niedzielski 4bf2156a2e Doc: add debug tips for AB testing
Change-Id: I46eff8ebf5ea10a14b9a203fc5dbe7e37d0f25a1
2018-06-29 17:55:03 +00:00
jdlrobson a231525112 Mobile page issues - visual styling changes
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
2018-06-19 14:11:19 -07:00
David Sn 8a19c0cb33 Use png as fallback for svg on non-supported browsers
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
2017-12-04 22:13:23 +00:00
jdlrobson fe8654adff Hygiene: Copy across bits of README.md from MobileFrontend
See:
Ia042ce3db5f4fed20913b54a6c0c80fe52762711

Change-Id: Idc05fa0854b113b0daaca54054cf4acaef50f157
2017-07-20 09:13:36 -07:00