Changing the way Echo's front-end architecture works to work with
model-view-controller methodology.
Change-Id: I97862402c41bc04dd41cd08d79f19ff677340249
Notifications were being marked as read in response to a click event
in JavaScript, but that causes a jarring effect in the UI, and it's
not reliable (the browser could abort the AJAX request).
Instead, add ?markasread=XYZ to the end of every primary link URL,
where XYZ is the event ID.
Bug: T133975
Depends-On: Icb99d5479836fea25a47451b5a758dd71f642f71
Change-Id: I8047d121584b43e6172463a50ad0e0de5f7fa73c
Split the moment hack out into its own file and put it in
ext.echo.ui, so it gets picked up by both the desktop and
the mobile modules.
Bug: T133134
Change-Id: Ic5b3e63fb6941a310d85ea7776447d1d7153cf91
We were using momentjs here before (causing bug T123845),
but we switched to using a hack for short timestamps.
This hack didn't call convertNumber(), so we stopped performing
number formatting for languages that don't use Western Arabic
numerals (0-9).
Strictly, that regression "fixed" T123845 because it caused
0-9 to be used in all cases, including the case that that bug
asked for. This patch fixes the regression but preserves the
desired behavior for arwiki, since convertNumber() respects
$wgTranslateNumerals.
Bug: T123845
Change-Id: Ic9acb12f534e0f049e22577afe276f8bf68f691d
The flyout loads no more than 25 notifications
from a given source. Using those in-memory notification
objects to count how many are currently unread (and
update the badge) produces a result of at most 25.
This patch extracts the responsibility or counting the
unread from the Model/Item/Groupitem structure into
a new UnreadNotificationCounter class. It receives
estimated updates from other components and synchronizes
with the server after markRead/markUnread operations
have completed.
Bug: T129726
Change-Id: I9af4defc00dd491ed2b355eb4e85073476e08ce7
This is to wrap the mobile notifications in MobileFrontend with
a pendingElement and organize the API calls specifically for the
mixed popup in mobile.
Also added a specific 'ext.echo.ui.mobile' module so we don't
load unnecessary files for mobile.
Bug: T124188
Change-Id: I4a8be19a79b9e38c21907bb9d4123540a648c535
Split and refactor Echo network handling and create a proper API
layer for the UI to use consistently. Split Echo's API methods into
its own module so they can be loaded along with the initialization
script and manage the API requests.
Change-Id: I0526a14bb8cc0d9729a303e24ab6e43259cc86bb
Use 'm' instead of 'minutes', 's' instead of 'seconds', etc, for
shorter timestamp rendering in the notification list.
Bug: T125970
Change-Id: I9479c5406a4bf44ef560bef2c8f204a9f60cafc6
* Add the ability to use bundled expandable
notification groups
* Display bundled cross-wiki notifications following
the design
Bug: T115419
Bug: T115423
Bug: T115422
Change-Id: I8c3eba6d627c3f06d51d74fc9774e3fc2d02915d
This is in preparation for dealing with cross-wiki notifications
where we may need several types of operations to extract bundled
notifications from local and external APIs.
Also, renamed files:
* mw.echo.dm.AbstractAPIHandler -> mw.echo.dm.APIHandler
* mw.echo.dm.APIHandler -> mw.echo.dm.LocalAPIHandler
* All API-related handler files moved to their own folder
for better organization.
Change-Id: Ib730c780ea52c93a6026c5d0b22012b6f39bb50d
Don't just remove it when all notifications are read, but when all
specifically talk notifications are read even if there are other
unread notifications in the popup.
Change-Id: I5aa65a4060d64f374b47fe91d8e53c92ded5fab2
And add a FIXME for our existing metric possibly being wrong if the API
request finishes before the ext.echo.ui module is loaded.
Change-Id: I918187dd276193b7602f60527b423ca06cb7e2d0
The orange bar is replacing the 'talk' link; when it is removed, it
should actually be replaced back to being a regular 'talk' page
and not be completely removed from the page.
Change-Id: I930d321952e85ee79acbbd162ab763b4eea63ff1
We really only care about measuring the timing of the first click,
because that is the one that loads OOjs UI and fires an API request.
Bug: T113387
Change-Id: Ib37d31b07c45d546c75251a57a848e3ae0f4bf1b
We need the button to remain a standalone <a> element so it preserves
the exact same styling as the output we're getting from the PHP. the
only way to do this is to create the widget as the entire <li> and then
replace the original.
Bug: T112218
Change-Id: Ib6fd4369d46cb7f37b14675d63bbce9950abcd48
The logger code for clicktracking is only needed after something has
been clicked, so we don't need it in init.
* Move EventLogging initialization into Logger.js
* Add ext.eventLogging dependency server-side if needed
Change-Id: I46ff3c62b05c24dd2bb18a1574df17f9d2823125
If users are likely to open the flyout whenever they have unseen
notifications, we should preload some more resources to make those
intial openings faster instead of lazy-loading everything.
On the server-side, we will increment the MediaWiki.echo.unseen metric
whenever we serve a page when the user has unseen notifications. Then on
the client we will increment MediaWiki.echo.unseen.click if they opened
the flyout while having unseen notifications.
By comparing the two graphs, we can determine how likely users are to
click on the flyout whenever they have unread notifications, and how
useful preloading extra resources will be.
Change-Id: I14e9aa7f03d6ef275042b8a2c4cb0e5b5a64c0d7
There is no need to load the entire of Echo's ui module (especially
since that includes ooui widgets and their styles) on every page load.
There's only need to load the entire module if and when a user clicks
the Echo notification badge.
Also, make the echo.dm model accept an external fetchNotifications
promise so we can send the API request alongside loading the echo UI
and "feed" it into the DM for processing.
CSS adjusted to make the "jump" between the nojs and the js buttons
seem less jumpy.
Bug: T112401
Change-Id: I516e655ffd198511d694489a0702c5c713a5fd68
Since the nojs "base" version uses the automatic title creation
of the personal tools, the message keys were adjusted accordingly,
and the old unified message was removed.
Bug: T108190
Change-Id: I1f242f530aa68562aa4dc885156586c22c4df618
Make sure that when the seen state changes, the badge icon adjusts
in case there are two different icons for seen and unseen states.
Also organize a bit the unseen/unread status in initialization.
And separate and update the icons in the popup head to always fit
the status and icon of the badge.
Bug: T111432
Change-Id: I891a36c6eace9302b370a3efaf5aa6f57192c17f
Split the notifications into 'alert' and 'message' badget with two
different flyouts. Also clean up styling and module behavior.
** Depends on ooui change Id4bbe14ba0bf6c for footers in popups.
** Depends on ooui change Ie93e4d6ed5637c for fixing a bug in
inverted icons.
** MobileFrontend must also be updated to support the new modules
in this patch I168f485d6e54cb4067
In this change:
* Split notifcations into alert and messages and display those in
two different badges.
* Create two separate flyout/popups for each category with their
notifications.
* Create a view-model to control notification state and emit events
for both the popup and the badge to intercept and react to.
* Clean up module load and distribution:
* Create an ext.echo.ui module for javascript-ui support and ooui
widgets.
* Create an ext.echo.nojs module that unifies all base classes that
are needed for both nojs and js support, that the js version
builds upon.
* Create a separate ext.echo.logger module as a singleton that can
be called to perform all logging.
* Clean up style uses
* Move the special page LESS file into nojs module so all styles
load properly even in nojs mode.
* Transfer some of the styling from JS to LESS for consistency.
* Make the 'read more' button load already with the styles it
needs to look like a button, since its behavior is similar in
nojs and js vesions, but before its classes were applied only
by the js, making it inconsistent and also making its appearance
'jump' from a link to a button.
* Delete and clean up all old and unused files.
* Moved 'Help.png' icon from modules/overlay to modules/icons for
later use.
Bug: T108190
Change-Id: I55f440ed9f64c46817f620328a6bb522d44c9ca9