Commit graph

828 commits

Author SHA1 Message Date
jenkins-bot 05e717f3ef Merge "VisualEnhancements: in some languages put an arrow by the reply button" 2022-12-13 19:47:12 +00:00
daniel a6a12730fc Don't write to parser cache from maintenance script
The parser cache for parsoid output isn't yet ready for full load.
Don't flood it when running batch operations.

Change-Id: I77f3de30b0500f0e5c593f4d31dceef7720f848e
2022-12-13 16:26:03 +00:00
David Lynch c706562ce9 VisualEnhancements: in some languages put an arrow by the reply button
New config: DiscussionTools_visualenhancements_reply_icon_languages

Config is set up with a provide_default merge strategy so we can remove
items from it quickly if need be.

Bug: T323537
Change-Id: Ib748897a2162bb233000f7364e30b268932f4c4a
2022-12-13 00:11:08 -06:00
Ed Sanders c2dc05b085 Add 'collapsible-headings-collapsed' body class
Used by MobileFrontend in I78cfb22fbe7d to prevent sections from
auto-expanding.

Bug: T321618
Bug: T322628
Change-Id: I6dafd5b9cb170bfa57f185849db6450162173399
2022-12-07 16:51:22 +00:00
daniel 683edf3947 Track parsoid render reason.
Call ParserOptions::setRenderReason to allow us to track why we render
and in particular, why we write to the parser cache.

Change-Id: If42f802f4cf2da39b06cbb8a30c4dc7d9a663001
2022-12-05 20:54:55 +01:00
jenkins-bot 984f804f17 Merge "Don't collapse the lede section when it has comments" 2022-12-05 19:04:37 +00:00
jenkins-bot 8a6bc91f46 Merge "Consider MediaWiki:Talkpageheader message when adding "Learn more" button" 2022-12-05 19:04:35 +00:00
Bartosz Dziewoński a2a06d0316 Reverse default sorting on Special:TopicSubscriptions
Bug: T324245
Change-Id: I87c43bda9a40fdf66c3f4f2d8bc66e211107a557
2022-12-01 22:18:18 +01:00
David Lynch 51ed8a21f6 Avoid error building threaditemshtml if there's an empty final section
If the final content on a page is a heading, there would be an error as
we tried to access nextSibling on a non-existent node.

Also tidies up the case where there's an empty section that's not the
final section. It would have `othercontent` set to an empty string,
which was pointless -- the empty `replies` field is sufficient.

Bug: T321317
Change-Id: Ia58e97214e715c1f6b02c2e045d13f2df7393b80
2022-12-01 11:44:28 -06:00
Bartosz Dziewoński b4475801fd Don't collapse the lede section when it has comments
Bug: T324139
Change-Id: I14e1dae0fef4177f5a6a223bc9b663e99c9f741c
2022-11-30 20:25:22 +01:00
Bartosz Dziewoński e72f58ca78 Remove some redundant PHPDoc comments
Inspired by this Wikitech-l discussion:
https://lists.wikimedia.org/hyperkitty/list/wikitech-l@lists.wikimedia.org/thread/NWXPNHRNLEVXHSWX33H473OAWQP6CDOA/

To keep this simple for now, I am only removing redundant PHPDoc
comments on constructors, and only when all the documentation for
parameters completely duplicates type hints.

More could be done, but that can happen later when we have better
tooling. Redundant comments on constructors that take a dozen services
are by far the most annoying for me and I want them gone now.

Change-Id: I86cbf7d6e48035cfa06f780c8fb1b02e68709a0c
2022-11-29 18:47:18 +00:00
Bartosz Dziewoński 74fbe19838 Consider MediaWiki:Talkpageheader message when adding "Learn more" button
We also need to move the code to the other hook to avoid adding it twice now.

Bug: T324046
Change-Id: I186d15f6e6537b47b019c9707d7ae8ef080f4ae2
2022-11-29 18:46:40 +00:00
Bartosz Dziewoński be012ced04 Only match article path until first '?' when parsing links
Bug: T324028
Change-Id: I7aca1a8f20695b9ecd3f63f2d0a3f5684616655e
2022-11-29 17:16:03 +00:00
jenkins-bot ea54a8facc Merge "Use 'BeforePageDisplay' instead of 'OutputPageBeforeHTML' for once-per-page things" 2022-11-28 15:23:52 +00:00
Bartosz Dziewoński 8452f94cf9 Use 'BeforePageDisplay' instead of 'OutputPageBeforeHTML' for once-per-page things
Also fix a CSS selector to handle content added in multiple
'OutputPageBeforeHTML' hook calls.

Bug: T323376
Bug: T323833
Change-Id: I480d9bf544d61f0cb7bfd04cadfbf053e7e1b70e
2022-11-25 16:12:16 +00:00
jenkins-bot 36af2d1002 Merge "Allow replying to some comments with accidental complex transclusions" 2022-11-24 14:00:45 +00:00
jenkins-bot eb9631164d Merge "Place replies outside transclusions, disallow replying to transcluded comments" 2022-11-24 14:00:40 +00:00
Bartosz Dziewoński 7dd4855979 Fix Phan failure due to core changes in Action
Caused by I8188172aeb7ec775eeb2060a1e163112e9e5ed66.

Change-Id: Ieafc280c76b20e4efbe23cf3e2b193a4a6490b50
2022-11-23 11:27:54 +00:00
Bartosz Dziewoński 3042148bfe Dedupe ApiDiscussionToolsTrait::parseRevision and HookUtils::parseRevisionParsoidHtml
After recent changes (I101c1e84739a2ac1f562f2f7bdc4b8f53d9f3b23 and
Ifbde590ccb6bf3203a2f664cb0d8a73b8d507b78) these methods became
basically the same.

Change-Id: Iedc201e798a5a34713296b20b97ae6cc8b991b66
2022-11-21 21:01:19 +00:00
Derick Alangi 672ca86016 ApiDiscussionToolsTrait: PageInfo & Compare don't need HTML for editing
ApiDiscussionToolsPageInfo and ApiDiscussionToolsCompare in direct parsoid
or VRS modes tries to fetch HTML using VisualEditor thus stashing the
HTML gotten which we don't want, we only need it for viewing in these cases.

This seems like something that was/is already happening in RESTBase. So for
APIs in DiscussionTools that need the HTML for viewing, just get it from
parser cache and not stash it.

Bug: T323357
Change-Id: I101c1e84739a2ac1f562f2f7bdc4b8f53d9f3b23
2022-11-21 16:29:13 +01:00
Bartosz Dziewoński 9601fde487 HookUtils::parseRevisionParsoidHtml doesn't need HTML for editing
Bug: T323357
Change-Id: Ifbde590ccb6bf3203a2f664cb0d8a73b8d507b78
2022-11-21 13:37:16 +01:00
Bartosz Dziewoński e0be640c35 Don't add lede button if mobile DiscussionTools not enabled
Bug: T323341
Change-Id: I60d93a3e72918d303a45b2a75f4fa549aea8d917
2022-11-18 15:55:54 +01:00
David Lynch 714830f615 Don't run OutputPageBeforeHTML for the talkpageheader
Ideally this would just not run the hook for any interface messages, but
that condition isn't obviously available.

Bug: T316175
Change-Id: Ibd354eb7a0fb7a316dcbf09e64b80f2d9b4008c8
2022-11-17 21:15:51 -06:00
Bartosz Dziewoński 4cebf20e76 CommentFormatter: Fix condition for lede button to consider table of contents
(Also fix some related CSS that was accidentally moved in
Ie5198e902ec3fa7a7eba56cef6c6f0ef71ef7314)

Bug: T323241
Change-Id: I1fa67965a1b6b827c500a9de63f5b5295bee840d
2022-11-16 22:18:11 +01:00
jenkins-bot 1a35468eb3 Merge "CommentFormatter: Fix condition for lede button to consider new wrappers" 2022-11-16 21:09:04 +00:00
jenkins-bot 954dc520b7 Merge "Make "Add topic" button sticky" 2022-11-16 19:06:30 +00:00
Ed Sanders b132522fa9 Make "Add topic" button sticky
Bug: T316175
Change-Id: Ie5198e902ec3fa7a7eba56cef6c6f0ef71ef7314
2022-11-16 12:23:34 +00:00
Bartosz Dziewoński 0432eaf1e3 CommentFormatter: Fix condition for lede button to consider new wrappers
Bug: T323171
Change-Id: I3125f98e57bf410f19ece07b8376c92ae619d0ea
2022-11-15 23:39:45 +01:00
Bartosz Dziewoński 3a0b05f564 Allow replying to some comments with accidental complex transclusions
When a comment almost exactly matches the range of an
accidental complex transclusion consisting only of
pages from the 'Template' namespace and wikitext fragments,
I think we can safely allow replying to the comment.

Even if this turns out to be incorrect in some cases,
the failure will be more graceful after the changes in T313100:
instead of potentially duplicating contents from a template,
the worst case now is that the reply will appear in the wrong
place (at the end of the transclusion).

Bug: T313093
Change-Id: Ie8da09d74a652d893fd8c3e2435ef6cb70fad64a
2022-11-14 19:17:36 +01:00
Bartosz Dziewoński 469b7720af Place replies outside transclusions, disallow replying to transcluded comments
Bug: T313100
Change-Id: I3993c96ec8d3d0add33d779860d158327985107d
2022-11-14 19:17:18 +01:00
jenkins-bot 0655cdbf56 Merge "Move visualenhancements metadata and some buttons outside of <h2>" 2022-11-14 15:29:12 +00:00
Bartosz Dziewoński 08e1073f58 ThreadItemStore: Handle race conditions when finding/inserting outside of transaction
Bug: T322701
Change-Id: Icea63dd562c1812a372f3a947ba1244e72d07a16
2022-11-10 23:33:24 +00:00
Bartosz Dziewoński 04cfffe323 Move visualenhancements metadata and some buttons outside of <h2>
We wrap a `<div>` tag around the `<h2>`, and move some elements there.
The markup is inspired by and compatible with my proposal for T13555.

The "ext-discussiontools-init-section" class is moved to the `<div>`.

A small patch is needed in MobileFrontend to preserve the section
collapsing functionality: I11bff21e81046898ca63f3f432797129fa70ad88.

The following elements are now outside of `<h2>`:
* Metadata bar
* Subscribe button
* Ellipsis menu (only shown on mobile)

The following elements are sadly still inside of `<h2>`:
* Subscribe links (only shown on desktop)
* Section edit links from MediaWiki core
Trying to move them mucks up the CSS too much. I hope we can resolve
this later as a part of the work on T13555.

Depends-On: I11bff21e81046898ca63f3f432797129fa70ad88
Bug: T314714
Change-Id: I0bbdcfa02c334858737855349d7a35746de1d8f2
2022-11-10 23:35:40 +01:00
Ed Sanders 79521f89cf Add button to reveal lede section on mobile
Bug: T312309
Depends-On: I9c3035c9dbe7545a05efb2286dffe0145d3557b4
Change-Id: I9d74914ddbcc9def74e85106a68574a807b0b731
2022-11-10 22:10:04 +00:00
jenkins-bot d1911e4f11 Merge "ThreadItemStore: Fix setting parent IDs when parent already existed" 2022-11-08 19:01:42 +00:00
jenkins-bot c83bad9de8 Merge "Embed pageThread JSON in jsConfigVars instead of infusing HTML" 2022-11-08 18:59:48 +00:00
jenkins-bot c0e757c716 Merge "ABtest for mobile, logged out users" 2022-11-08 18:41:38 +00:00
jenkins-bot 811c32c518 Merge "ABtest for mobile, logged in users" 2022-11-08 18:41:23 +00:00
Ed Sanders a00131a18f Embed pageThread JSON in jsConfigVars instead of infusing HTML
Bug: T322651
Depends-On: I86d461756398780dc24949013f35b7730a481052
Change-Id: I85ee8e6ed6eba97b94f4e4c415fbc5286c234cce
2022-11-08 16:20:39 +00:00
jenkins-bot 0251155359 Merge "Topic subscription feature is unavailable if Echo is not installed" 2022-11-08 03:11:14 +00:00
Bartosz Dziewoński 759e6b757a ThreadItemStore: Fix setting parent IDs when parent already existed
Bug: T322599
Change-Id: I697de586fb3c1b1901f434f6fbef501cec3164df
2022-11-08 01:38:41 +01:00
Ed Sanders d6160c76fa Topic subscription feature is unavailable if Echo is not installed
Bug: T322498
Change-Id: I072e9363fceb4beae820b7742dec4249b4f58905
2022-11-07 12:28:45 +00:00
jenkins-bot 98285f3b27 Merge "ThreadItemStore: Update existing rows if possible rather than insert+delete" 2022-11-03 14:12:49 +00:00
Bartosz Dziewoński c4c455c550 ThreadItemStore: Update existing rows if possible rather than insert+delete
Bug: T321121
Change-Id: I678b093aef95febb33cf4b0140b0625ef3241779
2022-11-03 00:53:19 +01:00
jenkins-bot 140939b3dd Merge "Avoid unsafe wrapping of Message::parse() into paragraph" 2022-11-02 18:37:29 +00:00
jenkins-bot 0d24c4881a Merge "Revert "Add config to separate out visualenhancements on mobile"" 2022-11-02 09:17:53 +00:00
Timo Tijhof 18e523281c Avoid unsafe wrapping of Message::parse() into paragraph
Bug: T322173
Change-Id: I8405a33129ab17edcb7a02440146684170f1c0a7
2022-11-02 00:19:46 +00:00
Bartosz Dziewoński c53b44d1bc Revert "Add config to separate out visualenhancements on mobile"
No longer needed.

This reverts commit d5161bf086.

Bug: T318868
Change-Id: I909266903271cecba050d171a3ec66ef0a12b8a9
2022-11-01 21:09:37 +00:00
David Lynch 9021a45966 ABtest for mobile, logged out users
Bug: T320993
Change-Id: I3530c540ec20f8806abcd7010b4d4933d1b53cfc
2022-10-31 16:23:59 -05:00
David Lynch 2b0d2deb4a ABtest for mobile, logged in users
Bug: T320993
Change-Id: I46597f2846811c52cbaba1a1db31bff575a41246
2022-10-31 16:23:46 -05:00