Commit graph

658 commits

Author SHA1 Message Date
Ed Sanders 2960853088 Move subscribe button up on desktop
Bug: T312674
Change-Id: I419883b5f9a4291b4bf575d57195d553fd5e291e
2022-07-27 13:55:03 +01:00
Ed Sanders df1cd6be80 Prepend subscribe links to headings
This ensures they stay aligned with the top of the heading when text wraps.

Bug: T313406
Change-Id: Ifd8f93f63a1b3e3e4bd38a1d74f9afed647f7e68
2022-07-27 13:48:28 +01:00
Ed Sanders 6d9b0ec6b4 Show topic container even if heading is unsubscribable
Bug: T312140
Change-Id: Ie0412b9f238d5ff8e54fd2ea358c1c26e303f4e1
2022-07-23 01:21:52 +02:00
jenkins-bot d15a8c931a Merge "Separate ContentThreadItem and DatabaseThreadItem etc." 2022-07-19 16:03:02 +00:00
jenkins-bot d35ff76d81 Merge "Don't enable visual enhancements CSS on mobile when feature is "unavailable"" 2022-07-12 00:26:22 +00:00
Ed Sanders c3efa2fd89 ImmutableRange: Fix setStart/setEnd to avoid backwards range
The new behaviour better matches the DOM spec.

Change-Id: Ib795e99cdaeedfb1d9e03eb888dd0a243028a61e
2022-07-11 21:40:09 +00:00
Ed Sanders f739160fb4 Fix infinite recursion when checking for the new topic tool on empty pages
Bug: T312689
Change-Id: Iaf5033a55e3840ef65be0c4994f8b6c00fe2551b
2022-07-09 12:48:17 +01:00
Ed Sanders 09a84e81e5 Don't enable visual enhancements CSS on mobile when feature is "unavailable"
Bug: T312683
Change-Id: Ifa66a62f335b5c2eee9c59284a0f4b851a83b94b
2022-07-08 22:42:39 +01:00
Bartosz Dziewoński 2bc76dabd7 Enable transformations in preview mode
We remove the [reply] and [subscribe] links when they should not be
visible (controlled by 'enableSectionEditLinks' option, which is
disabled when previewing).

Bug: T309423
Change-Id: Ie0d3fba2c4d166daac3ea2e117a246c9584284ca
2022-07-07 23:37:56 +01:00
jenkins-bot caefb1ae39 Merge "Show new topic tool empty state on existing pages with no topics too" 2022-07-07 21:52:36 +00:00
Bartosz Dziewoński a98cd369ba Show new topic tool empty state on existing pages with no topics too
Bug: T312599
Change-Id: I316d2f119b9c899ffaeebc7ec288823c826db092
2022-07-07 21:45:44 +00:00
Bartosz Dziewoński 0735258101 LanguageData: Accept abbreviations in $wgLocaltimezone
Bug: T312310
Change-Id: I4a2952ef834450b4c07c129d32292591a15110fb
2022-07-07 03:12:20 +00:00
Ed Sanders eab257e3a0 New topic tool: Always disable when "Add topic" is not visible
Bug: T312210
Change-Id: I2c9eafccf5d240fdaf711be6ed1d2e4a0a11d673
2022-07-06 13:59:41 +01:00
Bartosz Dziewoński 880f9755e0 Separate ContentThreadItem and DatabaseThreadItem etc.
Rename ThreadItem to ContentThreadItem, then create a new ThreadItem
interface containing only the methods that we'll be able to implement
using only the persistently stored data (no parsing), then create a
DatabaseThreadItem. Do the same for CommentItem and HeadingItem.

ThreadItemSet gets a similar treatment, but it's basically only for
Phan's type checking. (This is sad.)

Change-Id: I1633049befe8ec169753b82eb876459af1f63fe8
2022-07-04 23:35:50 +02:00
Reedy 54464f0b0c Add return type to jsonSerialize()
Bug: T311919
Change-Id: Ie77d7bc2902760972b8981a840bef91aae4ce5a3
2022-07-02 17:32:04 +00:00
jenkins-bot 32d4d879a8 Merge "Add some missing typehints" 2022-06-29 15:24:25 +00:00
Ed Sanders 4accd2fc7e Add some missing typehints
Change-Id: Idb111dd907972d9e02dab4b26c3fc106b12b1035
2022-06-29 15:15:52 +00:00
Bartosz Dziewoński af6e4a29eb ApiDiscussionToolsPageInfo: Fix fake headings with null name/id
name and id are supposed to never be null. Calling getName() or
getId() on this object would cause an exception.

Change-Id: I5f95b7d9e4ce4550b550ee758fc86f032b676731
2022-06-29 02:52:31 +02: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 904f1c2f25 Api: Make type/title required args of previewMessage
Change-Id: I0a0d9bfe3510d9bd6076408ba3819c82cd44ec0c
2022-06-27 12:50:10 +01:00
Ed Sanders 7fc5a0c29d Topic containers: Design iterations
Bug: T310914
Change-Id: I9000f9902d612c58c6b3bc8b762232ca6dd9724f
2022-06-25 12:54:39 +00:00
Ed Sanders 63acc121fc Thread containers: Link latest comment timestamp to corresponding comment
Bug: T309751
Change-Id: Id969bd7a76544d6024b8714c45cdfe5c59b71a0b
2022-06-24 21:44:21 +00:00
Ed Sanders b1be63469b Only enable visual enhancements in specific namespaces
Change-Id: I91643d3f07a9ee6f03a18f8e2787ab9cb61bc41d
2022-06-24 16:15:07 +01: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
Ed Sanders d59d5e14f9 CommentFormatter: Escape user input in generated comment
Currently the only user input in a headingItem name is the username
which can't contain a '>', so the regex can't break, but this is
fragile, and we should always do our own escaping.

Change-Id: I14e5ae2dc1e9ad7639e61b5471aa9ce270137960
2022-06-20 12:09:02 +01:00
jenkins-bot 80173ed010 Merge "Convert more self:: to static::" 2022-06-15 19:42:57 +00:00
Ed Sanders 1f002f812f Convert more self:: to static::
These are from patches that were already in progress before
we did the first run of conversions.

Change-Id: Id883e693a518130cfcc80bfd0f2874cbd9593446
2022-06-14 22:53:00 +01: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
jenkins-bot cb17181fa4 Merge "Prefer late static binding over self::" 2022-06-09 16:29:48 +00:00
Ed Sanders af54bae2ec Prefer late static binding over self::
While in many cases the class will never be sub-classed, it's easier
just to always use static:: and not worry about predicting which
classes might have problems in the future.

Change-Id: I23072a1701b5acf62bb3379a877de97627d8fcf3
2022-06-09 15:12:48 +01:00
jenkins-bot 636ff45a75 Merge "TagHooks: Make static method for obtaining DiscussionTools tags" 2022-06-08 11:18:42 +00:00
na1307 edb276e047
Show createpage preference only when feature is available
Bug: T310053
Change-Id: I13262ecbe2d2c45c0ffb8706da17bc806ab2a5b7
2022-06-07 18:59:15 +09:00
jenkins-bot b6abc80c35 Merge "Add preference for offering new topic tool when creating new talk pages" 2022-06-06 23:01:40 +00:00
Ed Sanders ab05e4e24f Add test coverage for ApiDiscussionToolsPageInfo::getThreadItemsHtml
Change-Id: I46a58f6a2ec5f0e1b750c67e85d27081f5fab544
2022-06-06 18:40:30 +01:00
David Lynch b4f829e5ca PageInfo threaditemshtml: include content before the first heading
Fake a placeholder heading for this, unless the first heading is already
a placeholder.

Bug: T304856
Change-Id: Icc12712f77e0c14139b289bec8cc3e0cb4834a43
2022-06-06 18:39:22 +01:00
David Lynch f668ee4989 PageInfo threaditemshtml: For empty headings, include their non-reply content
Bug: T304856
Change-Id: Ifbb7a843ce8a7d52a1b51d9fe16869e2f3ccbf1b
2022-06-06 18:37:59 +01:00
Bartosz Dziewoński e0f231b892 Add preference for offering new topic tool when creating new talk pages
Depends-On: I46a8eaf331e86de0c8c94f0f60bdc4b5be6dd83a
Bug: T297990
Change-Id: Iaf6677affe5d0b7f6047bce55c0a575286c8e676
2022-06-06 17:09:50 +00:00
Kosta Harlan bf161db768
TagHooks: Make static method for obtaining DiscussionTools tags
Bug: T309839
Change-Id: I30697ca56d4aa346151c4d31850f545d32399305
2022-06-03 12:46:16 +02:00
jenkins-bot f460ce39bc Merge "Add attributes for Minerva click tracking" 2022-06-02 15:29:50 +00:00
Bartosz Dziewoński 02ced052db Disable (instead of hiding) preferences that would have no effect
Keeping them visible avoid the page shifting unpleasantly,
and makes it easier to find the option you're looking for.

Change-Id: I1e37d5d11c5a19beb799346f4e9842e836224d3a
2022-06-01 21:36:30 +02:00
Bartosz Dziewoński 28124e7f1e Add attributes for Minerva click tracking
Bug: T295490
Change-Id: I05fa96280c8dacc801b071d22086568ee0f11d86
2022-05-27 03:55:09 +02:00
jenkins-bot e89b6d84af Merge "Use new ResourceLoader namespace" 2022-05-24 23:27:52 +00:00
Tim Starling 32dd490e7f Use new ResourceLoader namespace
Extensions using Phan need to be updated simultaneously with core due
to T308443.

Bug: T308718
Depends-On: Id08a220e1d6085e2b33f3f6c9d0e3935a4204659
Change-Id: Iffd8dea36f3b52181f3f3414a761d441d230b7b8
2022-05-24 23:00:00 +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
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 0b57fc6d66 Merge "Replace Action::getActionName by IContextSource::getActionName" 2022-04-20 00:15:27 +00:00
Umherirrender a979257396 Replace Action::getActionName by IContextSource::getActionName
Change-Id: If681252727a161d62444c8edbcd0cf447df1e765
2022-04-15 22:52:30 +02:00
Bartosz Dziewoński a31f022ba5 Remove limit on the number of topic subscriptions per user
We added the limit out of abundance of caution, because we were not
sure how the table is going to grow. We can see now that it's growing
slowly and reasonably.

Bug: T294881
Change-Id: I5da444c5d070926452e96ddbbe728b9e0375e466
2022-04-14 17:52:23 +00:00
Ed Sanders 91446d790e Empty state: Use self closing Html generators
Change-Id: I5352b064ac9e71df9f3f8791139944126b321436
2022-04-08 18:30:48 +01:00