Commit graph

259 commits

Author SHA1 Message Date
jenkins-bot acb42e4fad Merge "Simplify menu code" 2019-12-19 22:34:52 +00:00
jenkins-bot 357c9599ab Merge "CtaDrawers no longer stay behind in DOM" 2019-12-19 20:59:01 +00:00
jdlrobson 3c5edfa5cd Simplify menu code
Now the main menu is not using JavaScript we can simplify
the menu code to apply only to the Echo navigation drawer.

Bug: T225213
Change-Id: If4831fc700c7df3a2a389b5f95b6fbaea4b7d954
2019-12-19 12:14:13 -08:00
jdlrobson 48adb2c5bf CtaDrawers no longer stay behind in DOM
A new controller is added - drawers.js with methods for controlling
display and removal of drawers. The existing code in references is
moved there and extended to support scroll to hide behaviour

Console warnings will disappear with this change.

Additional changes:
* Standardise the page issues element selector - should be the container
not a link inside it (was a red link so triggering wrong behaviour)

Bug: T214045
Change-Id: Id4719b5209dd7647775e2959e46dbae0c3dde3ac
2019-12-19 19:56:02 +00:00
Jan Drewniak f5bef2ea5c Main menu button works without JS
Converts the main menu button to work without JS using the CSS-only
"checkbox" hack, using the ToggleList module from the dropdown menus.

Bug: T225213
Change-Id: I0eff0439f7284ec74f6304324fab409e8a1b6245
2019-12-19 19:55:39 +00:00
Piotr Miazga e703f00655 Add History icon and Article/Talk tabs to default loggedin experience
Additional change:
Drop the feature file - no value in having to keep talk.js and talk.feature
in sync

Bug: T232594
Bug: T232652
Change-Id: Id8d05b1358f81845d70142ceebf193d8b192ee0a
2019-12-13 21:04:36 +00:00
jdlrobson 5fd00330d8 Dev: MinervaPageIssuesNewTreatment should reflect production value
A vanilla Minerva install should enable this. It is live for all Wikimedia
wikis.

Change-Id: I76b8e68c6674797a05cae57f78f0c8049723f255
2019-12-11 11:07:35 -08:00
Ammar Abdulhamid 898b048d1c Discontinue back-to-top feature
Bug: T237290
Change-Id: I06a6823bd3d1985a1d76384bb65c9d2ddf334a21
2019-12-11 05:12:43 +00:00
jdlrobson acfa96e8e0 Do not use data URI on main menu icons
data URIs increase CSS payload which delays render time. If we want
to render these by default in the new main menu we will need to
stop using data URIs.

Bug: T225213
Change-Id: I876317ac28837fae48f504bb8d2637e0e7b85154
2019-12-06 18:12:03 +00:00
Piotr Miazga 99f3c97c3c Logout users via API Ajax call to prevent extra step on Special:Logout
Currently the Special:Logout page will ask "do you want to logout"
even if we pass the logout token. To avoid that first let's log out
user via API Ajax call.

Bug: T232734
Change-Id: Ia4cc4253b99254d7a893a55d9e05918c5d8c87e5
2019-11-26 14:45:21 -08:00
Nicholas Ray 071aa7a0c9 Enable Simplified Talk Page only on Pages With Expandable Sections
This patch should knock out two bugs we were seeing with the simplified
talk page:

1) Removes the "Add discussion" button and "There are no discussions"
message from appearing on Flow enabled talk pages.

2) Removes the "Read as wiki page" and "Active Discussions"/"There
are no discussions" message we were seeing on Minerva desktop talk
pages.

To address when the "There are no dicussions"/"Active Discussions"
message and "Read as wikipage" button are displayed, Minerva now listens
to MobileFrontend's `MobileFrontendBeforeDOM` hook and turns on the
simplified talk page (via a skin option) when this hook runs.

To address when the "Add discussion" button is added, a check was added
to SkinMinerva which only adds it to a talk page if the content model is
wikipage. Unfortunately, we can't just check the skin option because we
also want to display the button on desktop minerva.

Other changes:

* Moves around the logic in `getTalkPagePostHeadingHTML` for improved
readability

Bug: T237589
Bug: T237597
Change-Id: I83fd5cab174d90b24a5335f2b30c912c3b68040a
2019-11-20 21:41:43 +00:00
jenkins-bot 112e95da93 Merge "Enable Categories button in AMC" 2019-11-08 21:55:20 +00:00
Ammar Abdulhamid c2592508b3 Enable Categories button in AMC
Bug: T237290
Change-Id: Icc1b44070031bab08a2dc18e19cda52ef090946f
2019-11-08 07:01:03 +01:00
Nicholas Ray 2d579183c9 Render talk page as a tab instead of an overlay
Following up on Jon's POC, this will get rid of the talk board component in
favor of linking to the server rendered talk page.

Additional Changes:

* Cleaned up talk selenium tests. Removed talk_steps.rb which doesn't appear
to be used anymore.

* Changed talk add button classes to a single class

* Moved "Add discussion" button to postheadinghtml per design mock

* Added  "...talk-explained", "...talk-explained-empty" messages to
postheadinghtml per design mock

* Due to undesirable jumps in window scroll caused by the section anchor
& Toggler.js code when opening the TalkSectionOverlay (read fixme in
code), a Promise is always returned from OverlayManager route to reset
the scroll position to the top when the section overlay is opened.

* Moved
"mobile-frontend-talk-fullpage",
"mobile-frontend-talk-reply-success",
"mobile-frontend-talk-topic-feedback",
"mobile-frontend-talk-explained"
"mobile-frontend-talk-explained-empty"
messages to minerva as minerva is
the one who initiates those messages now.

* Limited $talk selector to only `.talk` elements since amc talk tab
does not need to be targeted

* After saving a reply from TalkSectionOverlay, the DOM that is not
part of the overlay becomes out of sync since a new reply was created.
To get around this, an `onSaveComplete` callback was passed (similar to
the TalkSectionAddOverlay) to execute a full page refresh. Although this
is clunky, it is the easiest way to resync.

Bug: T230695
Depends-On: I80201394fd7015db6700446142b0b4b20829f12e
Change-Id: I243f1193bce0da9fa710fc3b5379f90b2d079680
2019-11-05 09:51:43 -07:00
jdlrobson 7f68c3d3ad MainMenu is a controller not a View and server rendered (take 2)
There should be no caching implications for this change, as the main menu
has been server side rendered on all wikis since 10th October.

As Stephen pointed out somewhere, this is a bit of a micro-optimisation
Let's simplify this code by always rendering it in the HTML. MainMenu.js
as a result becomes a controller that just decides when to show it.

The geolocation check for Nearby is removed given the fact that all
grade A browsers for mediawiki have Geolocation support.

ev.preventDefault in onSkinClick is dropped since the link to the '#'
(the default behaviour) is wanted

Additional changes
* Browser support suggests "animations" class is redundant now
* `open` event no longer filed - not being used anywhere
* Transparent shield is now managed by the MainMenu controller not
the skin (which was confusing)
* Test geolocation using a simple feature tests
rather than abstracting it away inside Browser
* The main menu button is always hidden under either a translucent shield
and/or the main menu itself when it has been opened
so so it's not possible to ever click it while the menu is open
 - the click handler is thus simplified
removing a check for the class of the button

Bug: T234650
Change-Id: If101eebbdbda1519af922745917237648722820e
2019-10-29 16:37:04 -07: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
Umherirrender 64e7f9b04a Split line with many values in skin.json
Makes it easier to read when there one value on each line

Change-Id: Ib6e8231f718cb6bf17935e45dff696db850569b9
2019-10-25 18:30:37 +02:00
jdlrobson bf8d325388 Use core watchstar code
Apply the mediawiki core watchstar to the
Minerva skin. Note, watchstars in search and other locations will
continue to be provided by the MobileFrontend library (see
follow up patch I7b748dc87089389400b0035c62a3b9a00c2e43f9)

Bug: T234970
Change-Id: I11bbe976412b50dba76a55f37887e4c9235d0be1
2019-10-15 15:33:25 -07:00
jdlrobson ab61dbb173 Echo is removed from Minerva
Managing the transition from old implementation to new:
* A version number is exported from skins.minerva.scripts to
tell dormant code added to Echo in I09c27a084100b223662f84de6cbe01bebe1fe774
to begin running.
* A skinStyle is added for the new `ext.echo.mobile` module.
`mobile.notifications.overlay` will soon cease to exist but is kept registered for
backwards compatibility reasons
- Drop ev.preventDefault call from onSkinClick - it is no longer necessary and will ensure
notifications overlay closes when shield is clicked while it is open.

Integration:
* A server side hook SkinMinervaReplaceNotificationsBadge allows Echo to replace
the current Minerva notification badge
* A to-be-created client side hook is subscribed to to deal with the navigations drawer
like functionality using the mainMenu code
* id and class names are added to the container for the NotificationBadge for compatibility with
ext.echo.init in Minerva's desktop mode (it will work like Vector)

See I09c27a084100b223662f84de6cbe01bebe1fe774 for understanding the bigger
picture.

Depends-On:  I09c27a084100b223662f84de6cbe01bebe1fe774
Bug: T221007
Change-Id: I4c11f1b241d629e1b294ebaec17472fbf944f8c7
2019-10-08 23:21:12 +00:00
jenkins-bot 18b483b6ea Merge "Revert "MainMenu is a controller not a View and server rendered"" 2019-10-04 15:18:11 +00:00
Jdlrobson 93b16db1c5 Revert "MainMenu is a controller not a View and server rendered"
This reverts commit 111757970e.

Although I cannot replicate the performance issue, the menu doesn't seem to be rendering at all on cached HTML so this is a deal breaker. Back to the drawing board..

Bug: T234599
Change-Id: Idadc5a079340f44ec66d20a38259b6b337d2dcee
2019-10-04 15:03:19 +00:00
jenkins-bot 3c6fd24f00 Merge "MainMenu is a controller not a View and server rendered" 2019-10-03 20:30:02 +00:00
jdlrobson 111757970e MainMenu is a controller not a View and server rendered
As Stephen pointed out somewhere, this is a bit of a micro-optimisation
Let's simplify this code by always rendering it in the HTML. MainMenu.js
as a result becomes a controller that just decides when to show it.

The geolocation check for Nearby is removed given the fact that all
grade A browsers for mediawiki have Geolocation support

Additional changes
* Browser support suggests "animations" class is redundant now
* `open` event no longer filed - not being used anywhere
* Transparent shield is now managed by the MainMenu controller not
the skin (which was confusing)
* Test geolocation using a simple feature tests
rather than abstracting it away inside Browser
* The main menu button is always hidden under either a translucent shield
and/or the main menu itself when it has been opened
so so it's not possible to ever click it while the menu is open
 - the click handler is thus simplified
removing a check for the class of the button

Depends-On: I7fd243366cceae780bd46e1aef2c08dae073f647
Change-Id: I3892afb5ed3df628e2845043cf3bbc22a9928921
2019-10-03 13:13:09 -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
Nicholas Ray e3560b1f93 Remove mobile diff page drawer margin on mobile screens
Although alignment of things on tablet is still anyone's guess, this
commit focuses on fixing the alignment of the contents in the mobile
diff drawer on mobile screen sizes only per [1] by setting the margin to
0.

[1] https://phabricator.wikimedia.org/T233151#5537879

Bug: T233151
Change-Id: Ic3a47cf98380c501709df3f443cd43f37ce1abe8
2019-10-01 14:34:10 -06:00
jdlrobson e888b487f4 Merge skins.minerva.talk and skins.minerva.watchstar into skins.minerva.script
Logic is moved from server to client. Config is added via getSkinConfigVariables (e.g.
passed to mw.config ) and a JavaScript if statement.

The IIFE in watchstar and talk files is replaced with a module.exports function to avoid
refactoring at this point and added risk. The file contents remain the same.

skins.minerva.options is left as is, given the code is more experimental and used in
the beta mode - should not be sent to all clients.

Additional change:
* Remove skins.minerva.toggling (that module has been empty for a week now and functionality
moved to mobile.init module)

Depends-On: Ie71adbe18e8dbeb661ddb9d7d3d1d0897891d515
Bug: T233048
Change-Id: Ife777e76d9d77894fb5d09e7c8f0238b00596a7a
2019-09-24 14:19:18 -06:00
Timo Tijhof 30c12b3ddd Migrate from onResourceLoaderTestModules to QUnitTestModule
The hook is deprecated as of this release cycle, see:
<https://www.mediawiki.org/wiki/Manual:Hooks/ResourceLoaderTestModules>.

Moving away from PHP code. This can now be done from JSON, and
encourages use of a single module that is automatically named and
registered as needed.

Change-Id: I382692c70ca8e5f5ea658b07ebea6c47dd541724
2019-09-20 22:14:56 +00:00
jdlrobson 98d91a66f3 Remove watch and watched icons from repository in favor of Wikimedia UI
Note, because of the two versions of the watch icon, this will temporarily
make the watchstar not display for JavaScript users. The accompanying patch
Ic974b4d6dff14b0d72b8ca71b02c5ef73b1b1d93 will restore this.

Bug: T231613
Change-Id: I16ca70f2892d7418ff245e15f838dfc2b092f3aa
2019-09-19 10:39:27 -07:00
Jan Drewniak 6223d571bc New mw-ui-icon spec for Minerva
Redefines the mw-ui-icon module from MediaWiki-core for
better mobile support.

The new spec maintains the same interface and class names as core
(mw-ui-icon, mw-ui-icon-element, mw-ui-icon-before etc,)
but ensures that icon sizing is more consistent and
provides larger and more flexible touch-areas to the
`.mw-ui-icon-element` class, which in practice is used to
make icon buttons.

This introduces a temporary defect in which the hamburger and user
menu icons are a little too close to the edges. This will be fixed in
I5587855d0d9ecf2fac20ce16845e6749c26ab7c2

Bug: T229440
Change-Id: I929090848f3e04647a97f4979ec78682623fa070
2019-09-12 21:47:09 +00:00
jenkins-bot 7daf7ebb12 Merge "Rename UserRights to UserGroups" 2019-09-12 19:37:55 +00:00
Piotr Miazga add29651b0 Rename UserRights to UserGroups
The "User Rights" is called "User groups" on desktop. The Mobile site
should not provide it's onw naming but use the same names as desktop.

Bug: T230694
Depends-On: Ic9b7033e3f52f415ec8aec845a65a8452d0e5d8f
Change-Id: Iaf116a5cc54cc400451550d9fa958adbbccc35c5
2019-09-12 15:58:51 +02:00
jdlrobson 4e5ed825c8 Icon pseudo elements need top: 0 for RTL languages
Document why so it doesn't get removed next time.

Bug: T232260
Change-Id: I09cac0403c913e5ff10dfede9355a08f226f395d
2019-09-09 20:56:15 +00:00
jenkins-bot 53ad4bac32 Merge "New table of contents icon, prepare for arrow->expand rename" 2019-09-09 19:25:29 +00:00
Timo Tijhof 6e4afbf3bb mediawiki.RegExp (deprecated) -> mediawiki.util
Bug: T218339
Change-Id: I6913330609c03a0418af2ab54aa31f27a52dc6d0
2019-09-09 18:10:35 +00:00
jdlrobson fea60ba244 New table of contents icon, prepare for arrow->expand rename
Bug: T231613
Change-Id: I86a4bdac83e1d6caef025ad025962127d74556dd
2019-09-09 10:39:52 -07:00
Nicholas Ray f7baa81b17 Remove skins.minerva.scripts/overlayManager.js
Instead, I think we can just use:

```
M.require( 'mobile.startup').OverlayManager.getSingleton()
```

Change-Id: I3c1d5d8ffb95eea7cf076c86e8e9578aff7f95a8
2019-09-06 14:32:01 -06:00
jdlrobson 497044290a MobileFrontend is now managing the toggling code. Remove.
Depends-On: I6bdeb7198082c4b1d0a32960cc4dc679ff4c6762
Change-Id: I1815a730fc12f68c287d58f2de6f92e05db3abd2
2019-09-06 15:50:00 +02:00
jenkins-bot f095583cc8 Merge "Use avatarIcon instead of profile" 2019-09-05 21:27:17 +00:00
jdlrobson 59b2aabe24 Use avatarIcon instead of profile
Bug: T231613
Change-Id: Ie956ac82869ea5ff91d5d39d6b679a4803e46458
2019-09-05 20:58:06 +00:00
Nicholas Ray f944720ab2 🐛 Bug: Fix iOS input text zoom bug on rcfilters input
On iOS Safari, the screen zooms in when the user focused on
the text input of the rcfilters overlay. This commit adds a quickfix to
address this problem by setting the font-size to its initial value
(assumed to be 16px).

Bug: T231049
Change-Id: I98d28115e570a11d08ba2bd189c0b9151f834e7d
2019-09-04 17:45:23 -06:00
jdlrobson 15323b3d63 Use core table of contents in Minerva
No more using the TableOfContents component in MobileFrontend. It's
just creating more work for us. The end result is exactly the same - we can make
a table of contents using the checkbox hack rule and CSS that looks identical to
the current table of contents.

For now, this change can only be tested on Minerva desktop.
I2ea1c23bc86871e2a095c4c6674a08ff2f04b160
is the patch that goes for the jugular and applies this to mobile Minerva. It's
important we merge the two together to avoid disruption to this feature, as
currently MobileFrontend strips the table of contents from core from the HTML
using the MobileFormatter.

Change-Id: I720e62a578f0c7a14f4b5a698004471c85e54bc8
2019-09-03 19:02:31 +00:00
Stephen Niedzielski 7af07aef20 [icon] [toolbar] update page info icon
Change the info icon from an outline ("info") to a filled or inverted
("infoFilled") representation.

Bug: T230693
Change-Id: I10f9421661c5244c6859871793bd75650cb0e1e5
2019-08-29 20:31:13 +00:00
Stephen Niedzielski 3c55b23d61 [icon] revise icons
Update the icons.

Bug: T229440
Change-Id: I4460efba7b122b2a66e65924f311bb87f84160e5
2019-08-29 13:20:35 +02:00
jdlrobson e5aeeea2a8 Restore contributions icon to non-AMC menu
Bug: T231363
Change-Id: I82b9b06a83454cf4b49d906a8358b338d30f892a
2019-08-27 11:00:52 -07:00
jdlrobson 2e4879b3b4 Fix userSandbox path
Bug: T231358
Change-Id: Id8a23d7d5adb8cce38f00dff6acac8799b6803f0
2019-08-27 10:07:48 -07:00
jdlrobson 062e067d49 Separate AMC icons from non-AMC icons
Currently a bunch of icons are loaded for all users that are only
ever used for AMC. Clean this up and add notes on the necessary steps
if these ever become the default.

Bug: T229295
Change-Id: I4e16028e7121b0b3e1a60b9404183d483db52ad8
2019-08-26 19:12:48 +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 7280d255c0 Dev: Prep for storybook
* Remove ambiguity in imports - say the file extension
'less' for all instances of variables and mixins.
* Separate toast styles from drawer styles so they can be
imported separately
* associate header-action selector with its parent
(.overlay-header) not parent's parent (.overlay) so it can be imported
and rendered without the Overlay.

Change-Id: Ib7e19a440ba095d6424d35305fb41d643ca9764c
2019-08-21 12:20:26 -07:00
Stephen Niedzielski b8d8cab3db [fix] [icon] [AMC] add missing user avatar icon
userAvatar icon is used by advanced mode. Specify userAvatar as an OOUI
icon dependency.

Bug: T230162
Change-Id: I30bd90433a0f8575d1988c06a2763539a456c166
2019-08-08 14:19:27 -06:00
Stephen Niedzielski 10076c1b61 [dev] divide main menu LESS
Split apart the extensive mainmenu.less file into a few component-like
files: MainMenu, MainMenuFooter, MainMenuItem, and NotificationsOverlay.
Two variables, @duration and @easing, were moved to minerva.variables.
The separation is imperfect as some overlap still exists but is far
better than before.

This patch is focused on division without regression. Please limit any
refactor requests.

No user visible changes intended. The only selector that was cognizantly
changed was to duplicate the drawer visibility on main menu and
notifications overlay:

  // Old: mainmenu.less
  .navigation-drawer,
  .transparent-shield {
    visibility: visible;
  }

  // ---

  // New: MainMenu.less
  #mw-mf-page-left,
  .transparent-shield {
    visibility: visible;
  }

  // New: NotifcationsOverlay.less
  .navigation-enabled {
    .notifications-overlay {
      visibility: visible;
    }
  }

The is unfortunately useless. It is best to reproduce these changes
locally by renaming mainmenu.less to MainMenu.less and extract parts to
MainMenuFooter, MainMenuItem, and NotificationsOverlay LESS files until
the result matches.

Bug: T206354
Change-Id: I8d37c5346efcf39a4d76322fd6e6af3fff96ac53
2019-08-07 16:48:31 +00:00