Commit graph

979 commits

Author SHA1 Message Date
Ed Sanders ae3be4aaf5 Always hide overflow menu when topic containers disabled
Change-Id: I05fbaa89992cfec8db50407f74061da7d1aabe2d
2022-06-30 23:02:50 +01:00
Bartosz Dziewoński aedb682e06 Use interface language direction for topic metadata wrapper
Bug: T305286
Bug: T311663
Change-Id: I31d9f7997c8894c344548636eea6c9a823698269
2022-06-30 02:32:48 +02:00
Bartosz Dziewoński e48f34e558 New topic hint: Avoid error about section editing when opened from diff
Bug: T311665
Change-Id: I22120a4d4dbe9ff6b9a285932ee9656bdfa0de09
2022-06-29 21:42:52 +02:00
jenkins-bot 9a531f1c68 Merge "Set height of ellipsis button to fix MenuWidget position" 2022-06-29 15:00:49 +00:00
jenkins-bot a78cacc618 Merge "Mobile topic containers: Fix right alignment of ellipsis button" 2022-06-29 14:27:32 +00:00
jenkins-bot 45e7c01b62 Merge "New topic hint: Cleanup CSS" 2022-06-29 14:23:37 +00:00
jenkins-bot c44da3739d Merge "New topic hint: Add clear:both" 2022-06-29 14:22:49 +00:00
Ed Sanders 12dae82c70 Set height of ellipsis button to fix MenuWidget position
Bug: T311558
Change-Id: I6dedf488ec19cef02949f65a5b92e38f4e4c5f85
2022-06-29 12:28:01 +01:00
Ed Sanders 26cdf6789d Mobile topic containers: Fix right alignment of ellipsis button
The icon element should be aligned with the right side
of the content area, like the expand/collapse button, and
the edit pencil in the main namespace.

Change-Id: I191a5984bafc6a478674dd5dccff0594a743ff18
2022-06-29 12:22:53 +01:00
Ed Sanders ff97a06522 New topic hint: Cleanup CSS
* Use sibling selector instead of negative margin to reduce
  space between hint and reply widget.
* Remove upstreamed right-padding for close button.

Change-Id: Ie51cd2208c2bebcbfeff08c249389085523193f0
2022-06-29 11:58:51 +01:00
Ed Sanders 90b2222341 New topic hint: Add clear:both
Bug: T311597
Change-Id: Id7e545b0c18fdd407cb096e3cc3d51415be9839c
2022-06-29 11:58:44 +01:00
Ed Sanders 56989d18a3 Fix hiding of topic container top-border when mw:tocplace present
Change-Id: I382cfeb10c7f8407b559526b0ca06e0dcddd2191
2022-06-28 15:18:13 +01:00
jenkins-bot cd86854235 Merge "Pass useskin/mobileformat when previewing/refreshing page contents" 2022-06-27 21:57:02 +00:00
Ed Sanders d00fa80ff4 Use $.html to refresh page after save
As per If549a0e647ce8.

Change-Id: I6afdc4a80615617678d2d31c2c9e5830b07a6ef0
2022-06-27 17:34:32 +01:00
Ed Sanders 639fabf647 Pass useskin/mobileformat when previewing/refreshing page contents
These are required to render content correctly on mobile.

Change-Id: I421e1f172e208c4bf9d50eee68f1b0220a78dfbe
2022-06-27 17:15:28 +01:00
Ed Sanders 7fc5a0c29d Topic containers: Design iterations
Bug: T310914
Change-Id: I9000f9902d612c58c6b3bc8b762232ca6dd9724f
2022-06-25 12:54:39 +00:00
Bartosz Dziewoński 109a50cb34 Truncate timestamps in comment IDs / names
For comments posted on or after 2022-07-12 (configurable), use a
shorter format, identical to the timestamps MediaWiki uses in URLs.

Changing the format for already existing comments would involve
difficult migrations, therefore we elect not to do it.

Bug: T304595
Change-Id: I387051a6a3a1d84cfae45c3e1516db870cc8b977
2022-06-24 00:49:58 +02:00
Ed Sanders da64c43ccc Show thread metadata in section headers
Bug: T269950
Change-Id: Ifa47ddcbccf288be0bbecd5961eab7c5122aab7b
2022-06-23 17:17:09 +01:00
Bartosz Dziewoński 1ec97b18d9 Fix race condition causing highlights to not be cleared
We cleared the highlight outside the setTimeout(), then set a new one
inside the setTimeout(). If this method was called twice quickly, two
highlights would be created, and the first one of them would become
impossible to clear.

Move the setTimeout() outside of the method to avoid this.

Bug: T311021
Change-Id: Ic8b2cf2a782a429c4ea073871efd215f4b300ed8
2022-06-20 22:51:39 +02:00
Bartosz Dziewoński d73ce24059 Tweak positioning of highlights to make them prettier
* Fix math and styling for RTL
* Make highlights for headings and framed comments cover them fully
* Align the far edges of wide comments

Bug: T309444
Change-Id: Iadbf83e02801fd9bd6336c84015994ee2819ce51
2022-06-20 19:03:50 +02:00
Bartosz Dziewoński a0750129e7 Set rootNode for items from in ThreadItemSet#newFromAnnotatedNodes
It's needed for the fix for T303396 to work correctly (in the case
where there's exactly 1 thread item on the page), and for the
highlight improvements in Iadbf83e02801fd9bd6336c84015994ee2819ce51.

Change-Id: I2b2f5535ebbf792910133622a271ac1491c74de6
2022-06-20 19:03:09 +02:00
Bartosz Dziewoński df22a66e42 topicsubscription: Reduce code duplication
Rather than making our own ThreadItem objects from scratch,
reuse those used by the rest of the code.

Change-Id: I67f5ea3ad26baffe51b66d0c75467ac00185dd0a
2022-06-20 19:02:46 +02:00
jenkins-bot 9058467403 Merge "ReplyWidgetVisual: Pass in memory-wrapped store to VE" 2022-06-17 22:26:06 +00:00
jenkins-bot 39401c4b6b Merge "ReplyWidgetVisual: Handle VE surface 'cancel' event" 2022-06-17 13:24:13 +00:00
Ed Sanders af5b9a9b46 ReplyWidgetVisual: Pass in memory-wrapped store to VE
We switched to our memory-wrapped store everywhere outside the
VE surface, but not in the VE surface itself.

Change the way we construct MemoryStorage objects so that they can
be constructed from a specific mw.SafeStorage instance.

Ensure MemoryStorage's cache is populated with initial storage object
data, and that the cache is copied over when we create derivative
objectes.

Bug: T310438
Change-Id: I652428f114dc5169195887cb8ca719ae196bb76f
2022-06-17 14:05:54 +01:00
Ed Sanders 7befd4a8fc Use new function signature for Target#initAutosave
Depends-On: I6ab00c089c9ae1a8bb05ce9405f1f1f2fd0915ca
Change-Id: I23eb131082260540d2cf5e2cad92c9514333862d
2022-06-15 23:49:49 +00:00
Bartosz Dziewoński 9eb200024e ReplyWidgetVisual: Handle VE surface 'cancel' event
Since change I29f6af4cc7c71a63a6d1bafc53d16b9abd1b60ec, VisualEditor
handles the Escape key to emit a 'cancel' event. We need to listen to
this event to allow Escape to close our editor when the surface is
focussed, in addition to the existing handling for the Escape key.

Change-Id: I8c0f2678d104a76d6a223aca9b57123b9f587ac7
2022-06-15 21:09:06 +02:00
Ed Sanders 0ad9b4c6b2 Move placeholder heading level (99) to a constant
Change the HeadingItem constructor to take a 'null' headingLevel
and store this internally with the constant. Change the JSON
serializer to convert this back to null.

Change-Id: I27508eed75d94b99c5189548919309f8da7deb75
2022-06-14 22:51:49 +01:00
Ed Sanders c2535e26dc MemoryStorage: Setup this.data before calling parent constructor
The parent constructor may trigger read/writes in the future
so this.data should always exist as early as possible.

Change-Id: I79a795a26c4ce1381d2a0b15329f7df1d6ab77ca
2022-06-10 15:10:01 +01:00
Ed Sanders 32e306f6e1 Hide icon in anon warning below tablet width
Bug: T307709
Change-Id: I800153cabc1ba14fd249c106d57162fd0cd9dbe1
2022-06-03 16:33:26 +01:00
jenkins-bot f460ce39bc Merge "Add attributes for Minerva click tracking" 2022-06-02 15:29:50 +00:00
Ed Sanders c8570b95f9 Fix CSS selector after upstream changes to CompletionWidget
Bug: T307712
Depends-On: Ie590eb6b6c38531b959eadc1fcd5ba108180fdc8
Change-Id: Id39e680cbea54d77f061936c8876ecf7ed28e8b2
2022-05-31 20:39:39 +00:00
Ed Sanders 0f0e8fca9a ThreadItem.js: Only search CommentItem's for authors
If the thread contains a sub-heading, this would add
'undefined' to the list of local authors.

Change-Id: I696c56d07f30c6de2550e5f89b8cefcb3c17a259
2022-05-31 20:16:42 +00:00
Bartosz Dziewoński 28124e7f1e Add attributes for Minerva click tracking
Bug: T295490
Change-Id: I05fa96280c8dacc801b071d22086568ee0f11d86
2022-05-27 03:55:09 +02:00
Bartosz Dziewoński d7209b13b9 CommentTarget: Clean up toolbar actions
When moving the edit mode switcher outside of the toolbar actions,
we apparently forgot that we can disable this feature entirely.

Also remove $overlay: true, which isn't needed after the changes
from T307849.

Change-Id: I005cf18853305edd162c613f60b1ac45f42c3093
2022-05-21 20:28:54 +00:00
David Lynch b6f554a945 Ready A/B test code for topic subscriptions
Topic subscription test is going to be all logged in users only, no
transitory enrollment conditions, so we can remove the anonymous user
handling and DB writes.

Bug: T302515
Bug: T304030
Change-Id: I5e57bb9b7958576f3a04373748331a86f4626fb5
2022-05-19 01:09:40 -05:00
jenkins-bot e792fa0159 Merge "CommentTargetWidget: Exclude save commands" 2022-05-19 01:14:11 +00:00
Ed Sanders 1cc94f91bc CommentTargetWidget: Exclude save commands
Bug: T308709
Change-Id: Id614c8ecbdcdab237828d998fe898dcb9517ff47
2022-05-19 00:58:40 +01:00
jenkins-bot 3141a9ed18 Merge "Ignore LRM and RLM in more places in the timestamp" 2022-05-17 19:42:05 +00:00
Bartosz Dziewoński 6a59149132 Ignore LRM and RLM in more places in the timestamp
We previously ignored them before timezone indicator (e9c401e3aa),
but they can end up in other places too, e.g. after the time.

Now we ignore them after every token. This is way overkill, but it
shouldn't hurt.

Bug: T308448
Change-Id: I20f7aaa34dba23f2a2faf1be258c1aea32ab770f
2022-05-17 02:00:22 +02:00
jenkins-bot df0e84c0d1 Merge "Remove code for handling legacy HTML with data-mw-comment-name" 2022-05-15 20:20:43 +00:00
jenkins-bot 37b28fb36b Merge "Fix reply links sometimes not working after visiting action=edit&section=new with new topic tool enabled" 2022-05-15 13:45:06 +00:00
Ed Sanders bfb3c24ecc Remove code for handling legacy HTML with data-mw-comment-name
This can be merged a few weeks after the commit that introduces
it (If28e1588742), once all the HTML caches have been purged.

Change-Id: I96d2de081a23137fe11a66c8213535219ebfb230
2022-05-14 20:23:45 +00:00
Bartosz Dziewoński 28db9b8350 Fix error message when trying to reply to transcluded comment on a protected page
If the user can't edit, tell them why, instead of trying to
advise them to use the edit button that they cannot see.

Bug: T303110
Change-Id: Ibc41732a55443331e432987e630976610901c599
2022-05-13 01:56:51 +02:00
jenkins-bot 521760ecdc Merge "Redesign "new comments" warning" 2022-05-12 17:21:23 +00:00
Ed Sanders cf3e7c49d8 Redesign "new comments" warning
Bug: T300560
Change-Id: I5abf22b5a11c2639392a3d571c987ed5afaac2d6
2022-05-12 18:02:32 +01:00
Bartosz Dziewoński f534e78cde Fix reply links sometimes not working after visiting action=edit&section=new with new topic tool enabled
getPageData() had an optimization where, when it was called with
isNewTopic=true, it would skip querying 'linterrors' and
'transcludedfrom' data and return fake empty responses.

The issue is that they were cached, and then returned when it was
called with isNewTopic=false later.

Remove this optimization, as we make those queries anyway on init.

Change-Id: I1990b16f574c1aec385bd0fa46a9f39c6c2c1df2
2022-05-12 03:38:31 +02:00
Bartosz Dziewoński d7c390a6ca ReplyWidget: Fix 'returntoquery' handling for anon links
mw.util.getUrl() already encodes the values, encodeURIComponent()
isn't needed.

Also, slice off the leading '?' – while MediaWiki seems to accept it,
it looks like it is never present in any other place using this
parameter (this is fine even if there are no query parameters).

Bug: T308198
Change-Id: Iee3747ab53e3b0a5a0b43a7701205ac0c7f07e7f
2022-05-12 03:23:29 +02:00
Ed Sanders b76cf89b9b Add missing 'undo' button on mobile
Bug: T308033
Change-Id: If3126cb213fb4a22a419b9b85fdca32b20863f03
2022-05-11 17:37:08 +01:00
Ed Sanders 95ec3e7920 Dismiss "new comment" highlights when clicking
Bug: T307807
Change-Id: I40ae5fdbadfb223b1484ebf6041d29263aafa347
2022-05-06 17:44:21 +01:00