There are two counters (ext.echo.unseen and ext.echo.unseen.click) that
are incremented in two different places. It's hard to see how they're
connected unless you know where to look.
Add comments to each of these counters pointing to the other one and
explaining what they're for.
Change-Id: I0699cba85bf797e4f7ef42cc6a7a996aa35510f0
This seems strange, because markseen sounds like a write action, but it
writes to the seentime cache rather than the database. For multi-DC
support, we need writes to the seentime cache to happen in the local
data center, and the easiest way to do that is to make it a GET request
rather than a POST request.
It would be nice if marking as seen could be consolidated into the GET
request for fetching notifications, but I didn't do that because the
code for those fetches is pretty complicated, and some fetches (like
polling) should not mark as seen.
Bug: T222851
Change-Id: If4c504a9dc562b1d4e626e155fba8ebb5cdb0579
* Make sure the badge for desktop when initialised points to the
right thing
* Make sure the dialog takes up the full screen and the Clippable bug
does not interfere with the display of the pane
Bug: T241090
Change-Id: I6c5588ee689633cef413ef27449aeeea341d7a97
Clicking 'mark all as read' would only mark the notifications you are viewing as read
instead of all of them - now it will mark all of them as read.
Bug: T156425
Change-Id: If46a85f91dfddd4ac158e5c3a4f942c9c3d9aac1
Some LESS parsers will get confused with the lack of file extension.
It's better to be explicit and in alignment with recent change in core
I379334d7729e587a2a00.
It was already weirdly mixed in this repo with some imports featuring
extension and some not.
Change-Id: Ib208607c850fa2492b13cd3d449c04ebc2c21a01
Echo is now in complete control. Cleanup after ourselves.
Change-Id: I9a26c7a88f5e3ff19ec5b17b08a0d05c4f9e60ce
Depends-On: I9a6b06158d9083317aea46510c0c47980a25e50a
Bug: T221007
This code will be enabled when Iba1d7863171268066bf7597182c57a0a2041497f
relinquishes the responsibility for rendering the Echo notification badge
and wiring up of the related JS.
It makes 3 assumptions:
1) Minerva will expose a VERSION property on the skins.minerva.scripts module
to tell Echo it can begin control of the functionality
2) A new hook `SkinMinervaReplaceNotificationsBadge` will run on the server side
allowing Echo extension to render the Notifications badge in Minerva.
3) A new client side hook (echo.mobile) will fire whenever the Echo dialog is opened or
closed.
All code relating to Echo inside MobileFrontend and Minerva is
moved here.
CSS for the modules is kept in Minerva as skinStyles
This code remains dormant until Iba1d7863171268066bf7597182c57a0a2041497f lands.
It pre-registers a "to-be-created" hook SkinMinervaReplaceNotificationsBadge that
substitutes the Minerva badge.
It also watches the export value of skins.minerva.scripts for a VERSION value - when
this appears it will take the signal that it should manage the frontend code.
In the new system the mobile specific code is limited to the mobile version of
Minerva. The desktop version of Echo loads on Minerva desktop - presenting an
opportunity in future to consolidate both implementations to use the same component.
The mobile version of Vector and Timeless for example will load the mobile overlay
(with existing styling issues that we don't need to worry about right now given
we don't officially support skins other than Minerva as mobile)
Testers:
* Check require( 'ext.echo.mobile' )(); inside initMobile
inside ext.echo.init does not fire until
Iba1d7863171268066bf7597182c57a0a2041497f is checked out.
Depends-On: I1a66939d2b596094b419de40b370e79f09c85581
Bug: T221007
Change-Id: I09c27a084100b223662f84de6cbe01bebe1fe774
Update usages of the variable for the capitalization difference.
Depends-On: I4d289267991f1f9a8e0710ec6ee5a2131306c510
Change-Id: Ie49e898b33765aa0723501be8c0c30622e7cbd2f
When there are some new notifications during polling,
the unseen state of alert/message icons does not change.
Bug: T226127
Change-Id: I8cdeb9ee920d3ec943e270eb00a6ef7f3a7449e2
New preference added so that user can set
* Displaying (n) total unread count in the title
* Displaying notification snippet for incoming notification
Bug: T229732
Change-Id: I35eb68dedf1e087b4668bfec404935f1244b3d0b
We didn't have any error handling for this scenario previously, but the
recent refactor of this code made it more obvious that it was missing.
Change-Id: I146de3ed2cde1a9bd553fc4825c0e4e06130de65
As now polling is used to update the notification count on header icons.
If there are any new notifications then a snippet containing the header
part of the notification will appear using mw.notify().
Bug: T226130
Change-Id: Id38c8ebedebd4c68b9cef0635043d6f9304784dd
There's no real reason for these to be in MakeGlobalVariablesScript
because they don't really depend on the request context: they were being
omitted if the user was not logged in, but we can just check the user's
logged-in status in JS instead.
Bug: T221151
Change-Id: I2df6d7e061545d342bc3068dccd5ce2f6e85fe78
Remove wgEchoMaxNotificationCount and wgEchoPollForUpdates from the
startup module and put them in the ext.echo.init module.
Change-Id: I03f9a3953aa97ead1a29c13a992a02404a6d0b68
We currently poll for the count of notifications after some fixed amount of time even when the user is not using it.
There is no need to poll at same rate in that case and we can poll at slower rate.
The rate now is decreased by 5 times.
Bug: T227501
Change-Id: Id53a88e0d5659edb0dac77dd3e346e2d88e95f94
* Adds notification count(alert+messages) to the title
* The count is updated immediately when notification count changes
* This functionality is feature flagged(wgEchoPollForUpdates)
Bug: T225259
Change-Id: Ic92c50d9885b0e4325b253338023d37adf8d35d0
Due to using ooui, and a lot of the styles being a lot more generic
in general these days for wider skin support, most of the skin
styles still included with Echo are no longer necessary or may even
be actively breaking things.
Remove a bunch of that, including some of the stuff for T226594 etc,
as we now have a more elegant solution in the skin itself.
Bug: T226684
Bug: T226594
Depends-On: I0ed21a78feb1b1298c30b969a1c80a4323e74043
Change-Id: Id3193a07f023eb0abc30fa24afe10da042fea876
Due to using ooui, and a lot of the styles being a lot more generic
in general these days for wider skin support, most of the skin
styles still included with Echo are no longer necessary or may even
be actively breaking things.
For Modern, basically just remove everything; nothing here seems to
apply anymore. Also frees us up to just fix the badge positioning
in the skin itself, and leave future maintenance up to the skin
maintainers, if anyone cares.
Bug: T226684
Change-Id: Id28bbc01b3b344dfeb39be1380a64c1368924289
A positive text-indent causes horizontal scrollbars, so just hide the
screenreader text by making it transparent, and accept that we're going
to have the hover tooltip issue (T161302) in Monobook.
Bug: T226594
Change-Id: I6cb9ec146c2b469cbfb1fdc57937794d237e46db
In c86a1a5cf, the structure of the badge was changed, and the hack for
hiding the screenreader text in the badge was updated accordingly.
However, the Monobook styles were not updated, and this caused the badge
icons to be positioned off-screen.
Update the Monobook styles for the new badge structure, and use a
different hack for hiding the screenreader text because the one used for
other skins doesn't work in Monobook.
Bug: T226503
Change-Id: I190d2719addfbe50a7108193848bf23eef54bccf
* MVC is used to change the count of notifications on header icons.
* The Widgets are loaded after 60secs or icon click, whichever occurs first.
Bug: T219222
Change-Id: I2d034a76d5c3abe55894dd1dd10e28713344c5bb
Provide visual feedback when focus is set on notification badges.
Also removing outdated `-moz-outline-style` property, which is applied
only in Firefox <= 3.6.
Bug: T186553
Change-Id: Ia523be0f74beb8fc52f8f04a9a7f59d88c7d2082
Now that OOUI's "alerts" icon pack includes all the icons we need, we can use it and get rid of the badgeicons module.
Bug: T139779
Change-Id: I8218530ed2cdd2d81c1fc24509f36ea2b6742bd9
When creating the various notification sources,
the server was indexing them with wfWikiID() but
the client was using wgDBname to find which one
is local and which are remote. On some wikis,
like TWN, wfWikiID() includes a db suffix so
the JS app on Special:Notifications is failing to
find the local source and errors.
Bug: T167336
Change-Id: Id60f723b615fb7db54a6f17b1c1be20dfe98e36c
This boilerplate at the beginning of most files is an anti-pattern from
very early 2011 frontend experiments (I take full blame), where I didn't
understand (or had confidence in) the load order of scripts. I won't
remove it all at once, as that requires careful review of dependencies.
But this one file seemed like low-hanging fruit. The "ext.echo.dm"
contained a file that lazy-created `mw.echo` as empty as empty object,
and `mw.echo.config` as `{ maxPrioritizedActions: 2 }`.
The "ext.echo.init" module loaded on every page already does the same.
Remove this file and depend on that module instead. The same modules
will be downloaded, in the same way, and in the same order as before.
What changes is that the order of execution is now defined instead of
implied, thus making the dm-version of it redundant.
In practice, while fragile, the load order was already consistently
running init before dm. I found this through code coverage analysis in
Chrome DevTools, <https://phabricator.wikimedia.org/F28421786>.
Change-Id: Iaed7cf0e47479ce8ce76aee1bfe479d82b4f61ed
Colours were previously defined only in the monobook- and vector-specific
styles, but with the same styles in each, and appear to work consistently
accross all tested skins (modern, timeless, cologneblue, anisa,
hassomecolours...). Given the UX importance of these colours, better to
apply them as the default for all skins and leave it to any others for
which this doesn't work to resolve any issues on their end.
bug: T181142
Change-Id: Idc22881d6c51aa12adc9a053ce08adfdf0fad2b0
This leads to broken styling in OOUI 0.30, and is only
a marginal improvement in the Apex theme.
Bug: T215509
Change-Id: Id7d000be7c9dcd50e050f067c6f1fbdc06f332af