Steps to reproduce:
* Start making changes to a page in the classic editor.
* Use the normal "Show preview" or "Show diff" button at the bottom
of the editor. The page reloads and now shows a preview/diff at
the top, above the editor.
* Now start using the realtime preview feature on the right side of
the editor.
You will notice that the preview/diff above the editor starts to
flicker, but is never updated. (There is no need to update it. The
realtime preview that is updated is the one in the right pane.)
The original code was added via T293347. I believe the flicker
exists since then. It's effectively a misconfiguration. I hope the
comments make this clear.
This is also a direct follow up to T307046 where the diff view was
fixed (it just disappeared before), but flickers since then.
Bug: T293347
Bug: T307046
Change-Id: I481610389cec902268a8fd09f6b0452131752d54
Add a deprecation log message for the autoMsg and autoSafeMsg
functions in WikiEditor. The console output details what needs
to change, and adds a link to on-wiki search for the affected
string.
Depends-On: I2835341867df85552579ea6927cd39a6f889fa6b
Change-Id: I2aea96c8a4097f34b02301083f9db0be95042243
WikiEditor has a clever functionality where you can enter a message
key directly by using [key]Msg syntax in the object definition. While
that may have been a clever approach, it led to tons of messages
in this extension having to be marked as RawHtmlMessages because
they could potentially be parsed as HTML. Thus I am replacing all
of these instances with using mw.message explicitly instead, with
the necessary method attached.
The autoMsg (and its cloned autoSafeMsg) functions have had FIXME
comments attached since 2018 saying that these methods are
unnecessarily complex and should be replaced with using mw.messages
directly.
This solves a lot of problems for translators in Translatewiki, and
hopefully makes the code more straightforward and easier to understand
for those reading it down the line.
I would like to remove the autoMsg and autoSafeMsg functions
altogether, but their functionality is still in use in a few
extensions (and potentially on-wiki code), so we would have to
clean up that first.
Bug: T154891
Bug: T294760
Change-Id: I2835341867df85552579ea6927cd39a6f889fa6b
These config settings were specific to the Cite extension,
and are misleading on wikis that don't have that extension
installed. Move the functionality to the Cite extension
instead.
Bug: T339973
Depends-On: Ib3fdc897dd3330f69c5832003d4c3cb1e6dba2f3
Change-Id: Ib619706ddfca724990e1db2d51f12a2eb05f6a72
This reverts commit 929e8463fb.
Reason for revert: we're still seeing double-logging of some events, so this is apparently still needed until we can track down what's causing that.
Change-Id: Ifc32dfc7aa2ca67169759ecd8c278f1aea2dbef8
This reverts 843efa2f46,
no longer needed after I6028fa4a34916a6cd20161009cf5893492286c2d.
Bug: T334263
Depends-On: I6028fa4a34916a6cd20161009cf5893492286c2d
Change-Id: Ie4506d46d350fb53d6d0264763c2d55fc142997e
Replacing 'mediawiki.ui/variables.less' @import with
new skin-aware 'mediawiki.skin.variables.less' standard.
Also
- replacing several static values with new Codex design token featuring
skin variables.
- reinstate static values only on resizeable drag bar. This is not a
standardized component yet and will be revisited with further Codex
component definitions in future.
Bump required MediaWiki core version to v1.41.0.
Bug: T319381
Bug: T332541
Change-Id: I323561894ddf23aa89f51439fc9df2b7642eaca5
PHP EditAttemptStep logging code is not moved.
* Use the new mw.track() handlers from WikimediaEvents
* Ensure that 'integration' and 'editor_interface' are set on all
events, since they're not hard-coded in the handler any more
(and there are no client-side init events that add defaults)
This must be merged together with WikimediaEvents change
Iace4d53a972396ca5b8713000570cc47c9986034 (but we can't use
Depends-On, because CI requires code here to be removed first).
Bug: T332438
Change-Id: I0ef0a96aafdf89a4ebe32131a85b18c25744bb2c
Delete almost all code realting to the onboarding popup (blue
pulsating dot) and Beta Feature. Leave only one line to delete
any existing localStorage item that was used to remember the
dismissal of the onboarding popup.
Bug: T327515
Change-Id: I8d05e143858a2269dd6f3302dcc6cee6b0855ffd
Visiting a ?action=edit URL can, depending on user settings, result in
the MobileFrontend overlay appearing on top of WikiEditor. In these
cases, don't log anything.
Bug: T320281
Change-Id: Ib98d2cd6f2e541423e5aeebd3093bad97d6fcc4f
There were analytics validation errors because events were being logged
without a session ID. The session ID is only set on document-ready, as
it's fetched from a hidden input on the document.
Change-Id: Iaa24d430b780eaad54b78cb0d2ef0670fa2e32b1
The EditAttemptStep instrument is a candidate for migration to the
Metrics Platform [0]. The first step of the migration is to log events
both using the Event Platform (i.e. via mw.eventLog.submit()) and using
the Metrics Platform Client (i.e. via mw.eventLog.dispatch()).
The Metrics Platform Client can mix in additional information -
so-called context attributes [1] - based on the stream configuration.
The majority of the default values mixed into each event via the
mw.eventLog.Schema defaults mechanism are already known to the Metrics
Platform Client.
Note well that the Metrics Platform Client will not log an event without
one or more streams being configured to receive that event. Therefore,
this change is a NOP.
An example stream configuration is given in [2].
[0] https://wikitech.wikimedia.org/wiki/Metrics_Platform
[1] https://gerrit.wikimedia.org/g/mediawiki/libs/metrics-platform/+/aed6738b845/js/src/StreamConfig.d.ts#31
[2] https://phabricator.wikimedia.org/T309013#7953227
Bug: T309013
Bug: T320281
Change-Id: Ia08bac484fb3a2209879531def859a01290120fd
The #wikiPreview element can contain other child elements such
as the already-removed one of .previewnote but also (on category
pages) category lists, which we don't want.
This changes to only clone the specific content element. We could
just create this in JS, but don't at this point have access to
the lang direction.
Bug: T315558
Change-Id: Ifcd02e9cf005e00c8dd69df162893fb673117231
Add `position: relative` to .ext-WikiEditor-realtimepreview-preview`
per this suggestion (T315049#8174670) by Matma Rex.
Bug: T315049
Change-Id: I70813f68ffd74fab4978127ecee9bd557d467ebb
Set inManualMode to the result of the current prefers-reduced-motion
setting.
Add another property (reducedMotion) for later UI/message work
Bug: T314787
Change-Id: Ifeb8b996430830499945e73eca2dcfe0355c8046
Because the manual-mode bar gets hidden when an error message
is displayed, it's necessary to re-show it after the preview
is reloaded from the error message. This was done in the
below patch, but that didn't account for all conditions.
Follow-Up: I26150c190a9d3816e35ba369536e6d0ac11e4b1a
Bug: T307240
Change-Id: I0e9698faebd3f4df41221d6ba0b0f5f82ae3ae5b
Add following logging events:
* preview-realtime-error-stopped: triggered when realtime preview
auto-load is stopped.
* preview-realtime-reload-error: triggered when realtime preview pane
shows an error message and the reload button shown in this message is clicked.
* preview-realtime-reload-hover: triggered when the reload button
that shows on hover in the realtime preview pane is clicked.
* preview-realtime-reload-manual: triggered when the reload button in
the realtime preview pane manual bar is clicked.
Bug: T306176
Change-Id: I0785b0a8e88125a9bb30ff5c64c8a7c50b556c63
* Call the parent constructor.
* Add CSS class to the widget's existing $element, rather than
creating a new one. Doesn't really change anything, just looks
neater.
Change-Id: I67a72b5e2ef0912c7c7f7a44c87b31c08e1f7fcb
Move the resize handler from the RealtimePreview constructor to the
getToolbarButton() method, to prevent it being used when the button
is not used (e.g. if the gadget is misconfigured).
Bug: T309330
Change-Id: I7abc335112648605404785528b37a81d946e900e
Save the current caret position in the textarea before enabling
or disabling Realtime Preview, and restore it afterwards.
Bug: T311496
Change-Id: Ib906e96e4e8b94b4e1fd82f6201005394c8a27c5