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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Instead, I think we can just use:
```
M.require( 'mobile.startup').OverlayManager.getSingleton()
```
Change-Id: I3c1d5d8ffb95eea7cf076c86e8e9578aff7f95a8
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
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
Change the info icon from an outline ("info") to a filled or inverted
("infoFilled") representation.
Bug: T230693
Change-Id: I10f9421661c5244c6859871793bd75650cb0e1e5
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
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
* 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
userAvatar icon is used by advanced mode. Specify userAvatar as an OOUI
icon dependency.
Bug: T230162
Change-Id: I30bd90433a0f8575d1988c06a2763539a456c166
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