Commit graph

1340 commits

Author SHA1 Message Date
Bartosz Dziewoński 4e69ae1a18 Fix double margin/padding on the mobile lede dialog
Change-Id: Ib5bf882c04d0979728fbfb65b4e9767ddbb4f6d2
2023-02-01 20:09:28 +01:00
Ed Sanders 34a120d53a Look for Vector 2022 sticky header class in new location
This class was moved from <body> to <html> in Id5afe2c60.

Change-Id: Iad64abb02839c376d2f8955a0889f9ff0658a98c
2023-01-31 15:51:12 +00:00
Bartosz Dziewoński 06919f9444 Always reset ReplyLinksController before re-initializing
Previously we only did it when re-initializing after saving a reply
using our tools, but it could happen for a different reason, such as a
NWE edit.

Bug: T317035
Change-Id: Ia8152fc83f74689802f8dbbc20607c9026a2a5ab
2023-01-24 16:42:43 +01:00
Bartosz Dziewoński a5a026ceba Restore autosave for new topic when only title was provided
Bug: T315730
Change-Id: Ib68ebd23d3c4ef8e577023465236b4391b00bf2c
2023-01-24 14:28:17 +01:00
Bartosz Dziewoński 1fb67ef63d Fix summary when topic title is changed after restoring from autosave
Previously, we would restore the title and the summary generated from
it, but we wouldn't restore `prevTitleText`, so we would lose track of
the fact that it was automatically generated, and stop updating it
because of that.

Instead of adding it to the stored data, let's instead stop storing
automatically generated summaries, and tweak the code to support
generating them when restoring.

Bug: T315730
Change-Id: I96420bc0a3e34373190d2c2c0db2e2175ad3156d
2023-01-24 14:28:17 +01:00
Bartosz Dziewoński f292c703ca Remove some px font-size overrides on topic metadata and buttons
After T314714, they are no longer needed for Vector, MonoBook etc. –
the elements will just use the normal body font size.

This changes the font size slightly on some skins (MonoBook, Timeless),
but I think that's okay.

We still want to customize the font-size for mobile (Minerva), and
we can do that with `em` now.

Bug: T325104
Change-Id: I3fab8588b1b0e3a43aac4c32a3610f64fb3d3fb3
2023-01-24 10:21:31 +00:00
Bartosz Dziewoński 88e4956711 Hide "Add topic" footer on talk pages when empty state is shown
We already have code to hide it (added in a98cd369ba),
but this code (added in b132522fa9) made it reappear.

I think this rule was added in the development of that
change when the class was placed on a ButtonWidget,
to override `display: inline-block` on it, but it was
then moved to another element, removing that need.

Bug: T327536
Change-Id: I2a162dde93d04d76f6d5540edf6d3c4719a67f92
2023-01-23 21:16:11 +01:00
jenkins-bot 87d67d4a1c Merge "Use localStorage for auto-save" 2023-01-21 09:58:30 +00:00
Ed Sanders 9d331d0c86 Use localStorage for auto-save
Bug: T218663
Depends-On: Idcf50a527e2386122d077c497477057657824646
Change-Id: I514e5340d8bce3dd10a1142e7cced49edee5c9db
2023-01-21 09:25:55 +00:00
Bartosz Dziewoński 6d8f92a6b2 Tweaks for new heading HTML structure
Bug: T327328
Bug: T327469
Change-Id: I8c7593e98dc677b28925129dda592dbc24106220
2023-01-20 06:23:23 +01:00
jenkins-bot 8facd83609 Merge "Improve handling for comment separators" 2023-01-17 11:48:43 +00:00
jenkins-bot ba2f6ac2cf Merge "Flip the reply button icon on RTL" 2023-01-17 11:47:38 +00:00
jenkins-bot d81886c5ce Merge "Enable collapsible content in mobile talk page lede content" 2023-01-10 16:37:11 +00:00
Bartosz Dziewoński 3a9997d6ea Improve handling for comment separators
* Detect comment separators at the end of comments too
* Consider TemplateStyles associated with ignored templates

This unexpectedly improves a lot of cases other than T313097 too,
mostly where <br> or {{outdent}} was used within a paragraph:
splitting comments that were previously jumbled together, or restoring
content that was previously ignored for apps / notifications.

Bug: T313097
Change-Id: I9b2ef6b760f2ffd97141ad7000f70919aeab7803
2023-01-10 01:59:52 +00:00
Bartosz Dziewoński 2a38098785 Flip the reply button icon on RTL
Bug: T325664
Change-Id: Id254420db317848e4894c9c683a3b27a98931155
2023-01-10 00:38:17 +00:00
Bartosz Dziewoński 360e3584c6 Delay API requests for preloading metadata until user interaction
Instead of doing them right after page load, only do them on
hover/touch/focus, when we can expect that the user is about to
click/tap/activate a reply link, but which lets us start the work a
fraction of a second earlier.

Bug: T325598
Change-Id: Ida4cb70d8e9ab423ad2dabca7258f92e9fca3157
2023-01-06 01:24:00 +00:00
Bartosz Dziewoński af7097f02f Enable collapsible content in mobile talk page lede content
Bug: T323639
Change-Id: I3cfc8e7337172b44156a7f3bed9ff134c0851475
2023-01-03 18:16:15 +00:00
jenkins-bot 8070ce8a57 Merge "a/b test anonymous ID was being reset because of cookie prefixes" 2022-12-22 15:12:25 +00:00
jenkins-bot 477917e7e7 Merge "Only preload getPageData if there's thread data for the page" 2022-12-19 10:08:58 +00:00
David Lynch 013872ae22 Only preload getPageData if there's thread data for the page
This should avoid hitting the API if the DT JS is loaded off of talk
pages. At worst, if this is overly restrictive, later calls should still
load it when someone actually interacts with a reply widget.

Bug: T325477
Change-Id: If898dd4a21f1d2620c5a1e79908647070c441854
2022-12-19 03:03:02 -06:00
David Lynch fcb6468805 a/b test anonymous ID was being reset because of cookie prefixes
Bug: T321961
Change-Id: Ie37d0dbefaf10bf48c32461cd7d5d1b4c7882725
2022-12-16 14:45:07 -06:00
David Lynch 0db7b997f3 Log an event when the lede button is clicked
Bug: T314596
Change-Id: Ifb5c9eb3cfac8b217546d4945e6f39ce38251e1e
2022-12-15 11:27:26 -06:00
jenkins-bot 459554b18c Merge "Use new stable API for subtitle modification" 2022-12-14 04:09:58 +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
Jon Robson fbd951906a Use new stable API for subtitle modification
Bug: T324876
Depends-On: Id8436324e2ae2fd9f488b65b3b7bfc19611870d1
Change-Id: I4b178f67b6718fa9a84827e1804ec4eb1483f735
2022-12-13 01:13:29 +00:00
Bartosz Dziewoński fda9f159f5 Deemphasize "Learn more about this page" link
* Increase selector specificity to make it work
* Tweak colors, they were lighter than intended
* Use color rather than opacity on text to avoid making it blurry
  (opacity disables subpixel rendering)

Bug: T324702
Change-Id: Ie32a7481ea90b983cd33e6eae981d47db8612c9f
2022-12-07 22:13:55 +01:00
Francois Pignon de107bb6a8 Optimize some jQuery selectors
Bug: T324523
Change-Id: I57a86f3f29cd33e93db31338420af15fdb3113b9
2022-12-05 23:56:09 +00: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
jenkins-bot e27e5ac55e Merge "Clear pageDataCache whenever re-initializing" 2022-12-02 11:58:45 +00:00
Bartosz Dziewoński 7dc35aa3ad CommentController: Fix 'discussiontoolscompare' polling not stopping
The .always() callback can be called after .teardown(), and would
previously restart the polling.

Bug: T313096
Change-Id: I6e4c0f7d47e13bd4a259282a508afcdf0c1bd949
2022-12-01 21:12:37 +00:00
Bartosz Dziewoński 37fda5e181 Clear pageDataCache whenever re-initializing
Bug: T323661
Change-Id: Ia080f4a8e79551bd16a1ce96f6851a76159d8da7
2022-12-01 21:49:08 +01:00
jenkins-bot 64e5c91970 Merge "Hide buttons for print media" 2022-12-01 15:14:33 +00:00
jenkins-bot db1aa31eed Merge "Remove dd overflow hack" 2022-12-01 15:04:09 +00: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
Ed Sanders 7ab0c69f39 Remove support for data-mw-comment
Can be merged once I85ee8e6ed6 has been deployed long enough
for all the caches to have been purged.

Change-Id: Ic9773c2e45a4aa796cb6bca52e58d7db1016a977
2022-11-30 18:31:02 +00:00
jenkins-bot 5a524d0fa3 Merge "Track events for the new comment notice" 2022-11-29 19:40:32 +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
Ed Sanders 79537c9892 Ignore negative page scroll values on iOS
Bug: T323400
Change-Id: Id37f3da183a08f936c6b6d11ed7307bb9d8bd28b
2022-11-29 14:29:50 +00:00
Bartosz Dziewoński ea2e519b05 Hide buttons for print media
Change-Id: I6f4e5ee66de3a8d62727ae226f3b17a95a0ae2df
2022-11-29 00:36:49 +01: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 eb9631164d Merge "Place replies outside transclusions, disallow replying to transcluded comments" 2022-11-24 14:00:40 +00:00
Bartosz Dziewoński 46a9a13116 Remove dd overflow hack
No longer needed after I73d654d1f9127e22365d94909681c1c5f5f39597.

Change-Id: I2a16b725fca512ccbb72f493fd7db28836341e24
2022-11-23 11:28:14 +00:00
Bartosz Dziewoński 86ffa41af7 highlighter: Fix double-escaping of popup notifications
Bug: T323351
Change-Id: Iaa69ccd944114f2a7ff88e01b6e58d70d38cac89
2022-11-18 14:56:36 +01: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 954dc520b7 Merge "Make "Add topic" button sticky" 2022-11-16 19:06:30 +00:00
David Lynch 84620569dd Track events for the new comment notice
Bug: T301582
Change-Id: I40355502a59a7f31e465e52859b303680c1e109f
2022-11-16 11:49:50 -06: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 46d766f30d Remove override for Minerva hiding .tmbox, no longer needed
Depends-On: Ifb0316256bdec5008acc48544ddd3e2bf71b6d41
Bug: T257394
Change-Id: I7b442d2e009f631ec8ac183f4767ffcc1e94954c
2022-11-15 11:26:08 +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
Bartosz Dziewoński 310323b561 Tweak mobile styles for no-JS compatibility
Bug: T321430
Change-Id: I0f20750995d89c0bb4be9a70e594326f15a6de0b
2022-11-14 15:01:35 +01:00
Bartosz Dziewoński f27d173852 Remove some unused CSS
No longer needed since the "Subscribe" button was moved elsewhere
(2960853088).

Change-Id: I758469c6883fe6056dc3859b5b5d43d98771b518
2022-11-14 14:57:13 +01: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 e0855e4f41 Make virtual keyboard detection into a body class
This allows it to be re-used for other features, such as the
upcoming floating "Add topic" button.

Add some support for Android, although not used in this patch.

Change-Id: Ibd1e1ee087ac607c88a7402d0422c633700d1992
2022-11-10 23:30:53 +01:00
Ed Sanders 8cd239b0b4 Move ...-replylink-open class to <body>
This allows elements outside the page container to respond to it.

Change-Id: Id880ada0e24cb803e7b992284a1a95950f3da36f
2022-11-10 23:30:10 +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 af6f6e6149 Merge "Disable "Share feedback..." links by default" 2022-11-08 22:04:08 +00:00
Ed Sanders b4eb7fc9ad Disable "Share feedback..." links by default
Will still be enabled on WMF wikis for now.

Bug: T322494
Change-Id: Ic0b79fdf459d4949d7604f5a213cb1851ca30901
2022-11-08 21:58:39 +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
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
Ed Sanders 317b8244dd Move username completion tool after special character tool in toolbar
Bug: T322455
Change-Id: I19bfe4500850512411615b326b07ba0a47dcfd5f
2022-11-07 13:01:11 +00:00
Bartosz Dziewoński 29fbfb59c3 Tweak mobile "Read as wiki page" button placement
Bug: T320755
Change-Id: Ic647ff922161a6f8804dfd2a87249c6591cfb093
2022-10-31 22:30:56 +01:00
David Lynch 9021a45966 ABtest for mobile, logged out users
Bug: T320993
Change-Id: I3530c540ec20f8806abcd7010b4d4933d1b53cfc
2022-10-31 16:23:59 -05:00
jenkins-bot 61b89e44a9 Merge "Fix new topic tool appearing from autosave in edit mode" 2022-10-26 16:35:07 +00:00
jenkins-bot f8601fc368 Merge "Fix new topic tool appearing from autosave in its own preview" 2022-10-26 16:34:42 +00:00
jenkins-bot ffb5dd6a86 Merge "Add accesskey "s" to the "Reply" / "Add topic" button" 2022-10-26 16:32:58 +00:00
jenkins-bot c9dadbfe7d Merge "Remove support for <span class="mw-headline-number"> in headings" 2022-10-26 16:29:41 +00:00
jenkins-bot d55b8f8d2f Merge "Don't insert comment markers inside <figure>" 2022-10-26 16:28:37 +00:00
Bartosz Dziewoński c6cd20f682 Remove support for <span class="mw-headline-number"> in headings
This feature has been removed from MediaWiki in change
Ic9ed88f419419cf4cc5cc32010539eea8b76314b.

Change-Id: If11b33589f47eab614f5129b38e80d0f3cafa083
2022-10-25 18:59:05 +00:00
jenkins-bot 212db49484 Merge "Add 'specialCharacter' tool to toolbar" 2022-10-25 15:53:48 +00:00
jenkins-bot c728f35e3a Merge "logger: Also log VisualEditorFeatureUsage events via Metrics Platform" 2022-10-24 12:48:25 +00:00
Bartosz Dziewoński d2df103803 Don't insert reply tool outside <section> on mobile
Bug: T319148
Change-Id: I7db0ef1980f4997b77593f3d43d35886ecd8a4ae
2022-10-21 01:20:13 +02:00
jenkins-bot d5bbe213cb Merge "Remove oldid from URL when refreshing page" 2022-10-20 22:44:58 +00:00
Ed Sanders 7364214ea6 Remove oldid from URL when refreshing page
Code mostly copied from VE, but ported to native URL object.

Change-Id: I3e780f33df548c59741b7ae3b5dfb33f657d24a3
2022-10-20 22:02:10 +00:00
jenkins-bot 38bc9bba60 Merge "Separate out mobile init from controller.js" 2022-10-20 21:57:35 +00:00
Bartosz Dziewoński 5ed1c4a482 Add accesskey "s" to the "Reply" / "Add topic" button
Add brackets around the existing shortcut key labels, so that they
don't look quite so out-of-place next to the automatically added
accesskey label.

Bug: T278249
Change-Id: Icc0df5ba036080807ea0eb215f5526c93da78ef1
2022-10-20 22:58:25 +02:00
jenkins-bot c049f07055 Merge "ReplyLinksController: Skip empty reply buttons container" 2022-10-20 14:35:34 +00:00
Ed Sanders 292725e864 Add 'specialCharacter' tool to toolbar
Bug: T249072
Change-Id: I9db0954db05f825adaa311bb3777c5e4493172b6
2022-10-20 12:22:19 +00:00
jenkins-bot 4935197c66 Merge "logger: Use wgWMESchemaVisualEditorFeatureUseSamplingRate config variable" 2022-10-19 19:09:24 +00:00
Func 3cbab3b789 ReplyLinksController: Skip empty reply buttons container
For preview parsing, the span containers are empty.

Not sure why not strip the container along with all generated
contents, but this should be the easiest fix.

Bug: T321185
Change-Id: I9afb2d0f543b79dbac8a652236fe55284de542a8
2022-10-19 23:14:27 +08:00
jenkins-bot f953953c9b Merge "Fire wikipage.content hook on edit notices" 2022-10-18 16:19:57 +00:00
Ed Sanders 481b687c35 Follow-up I394f02912: Use existing class API to move button away from sticky header
Bug: T318474
Change-Id: Iab3a817e305d48e922499aad3620d93cf8aa165e
2022-10-17 14:49:36 +01:00
Ed Sanders d0cd0e57a1 Separate out mobile init from controller.js
Change-Id: I2dfafc1d816c5cae97fd51bc11de9aefbdd73ee8
2022-10-14 17:38:19 +01:00
jenkins-bot f6e271d781 Merge "Remove all hacks for old HTML in HTTP cache or parser cache" 2022-10-12 14:20:52 +00:00
Bartosz Dziewoński 65339e3ad4 Fix new topic tool appearing from autosave in edit mode
Follow-up to 2bc76dabd7.

Bug: T317005
Change-Id: I2f982e7e631cc45375143b1ba280850e66e51719
2022-10-11 00:26:55 +02:00
Bartosz Dziewoński 2ad3e4ad26 Fix new topic tool appearing from autosave in its own preview
Follow-up to 9425f75f47

Bug: T317005
Change-Id: I247f33e3658fbb8307a725b7c4fdc5871932b5d3
2022-10-10 23:12:18 +02:00
Ed Sanders 2c160ddb72 CommentItem.js: Ensure timestamps are UTC
This will not be the case if we do a full parse in the
client on a non-UTC site.

Change-Id: I226c4f580e60114992bfc06896ef4868e6ea9124
2022-10-10 14:50:02 +01:00
Bartosz Dziewoński f8d25be872 Remove all hacks for old HTML in HTTP cache or parser cache
Change-Id: I609cbbf5b26eca3a84bae91cc17cbc663925714c
2022-10-09 18:17:35 +00:00
Bartosz Dziewoński 8664de52d1 Don't insert comment markers inside <figure>
…when wgParserEnableLegacyMediaDOM=false. See task for details.

Bug: T320285
Change-Id: I397cb70f915bb8d974fe2796198d252b1be9a368
2022-10-08 23:23:54 +02:00
Ed Sanders 0e5f4460a7 Fix styling of heading input in new topic tool
We accidentally set some proposed mobile styles for desktop.

Change-Id: I3d7092137708196599ccf44fed948757b9aef276
2022-10-03 17:20:10 +02:00
Sam Smith 2f6305b7b5 logger: Also log VisualEditorFeatureUsage events via Metrics Platform
The VisualEditorFeatureUsage 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 directly (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/T309602#7973206

Bug: T309602
Change-Id: Ib919ae0e3f404c85cef17637ea91bb95d5030cf1
2022-10-03 12:02:23 +01:00
Sam Smith b90a2675b0 logger: Use wgWMESchemaVisualEditorFeatureUseSamplingRate config variable
... for the sampling rate for the VisualEditorFeatureUse schema.

Bug: T312016
Depends-On: I259757db0c4441a3fcfce505d5bc82dcf2acf58c
Change-Id: I1c7f9c06384549deac2787f5df93c0078b6402af
2022-10-03 11:46:43 +01:00
Bartosz Dziewoński 5f32c90225 Fire wikipage.content hook on edit notices
Bug: T319133
Change-Id: I36efb9326a9bf0efc5ef646d49361b314fdd0b5a
2022-10-02 11:38:33 +02:00
Bartosz Dziewoński 8d727dc26d Fix reply link/button margins on RTL wikis
Follow-up to c232df01a4.

Change-Id: Ie8c463108d2e0cb172d270d6205677459adbb86a
2022-10-01 21:52:32 +02:00
Ed Sanders c2594914f9 Don't re-color :visited links that act as buttons
Bug: T319019
Change-Id: I26820229820768390827e79ec09c86eeed424531
2022-09-30 13:40:26 +01:00
Ed Sanders f9d8b7afd5 Reduce padding around reply button slightly to improve vertical alignment
Change-Id: Ia420f1d6bf1038bfe803c62aba636f046d74bb29
2022-09-29 14:42:11 +01:00
Bartosz Dziewoński 4d1722d1e6 Fix double <div class="mw-parser-output"> after saving
Follow-up to d00fa80ff4. .html()
replaces the inner HTML, .replaceWith() replaces the outer HTML.

Change-Id: I8da2d24d439acc5e83ef1f42959fefef27bbea71
2022-09-29 01:26:33 +02:00
jenkins-bot f910e54802 Merge "Empty state banner: Improve selector for hiding top border" 2022-09-28 16:30:45 +00:00
Ed Sanders 79d4879b3a Empty state banner: Improve selector for hiding top border
Pages can be empty (blanked) without outputting the noarticletext
class, so just suppress the top border if the banner is the first
child of the document.

Change-Id: I808160a7f73a9a976d25e77f4bd47727a57b70c0
2022-09-28 17:04:42 +01:00
jenkins-bot f4f83bfb2f Merge "Show mf-section-0 in preview" 2022-09-28 15:45:29 +00:00
jenkins-bot 8a2e02e8e1 Merge "Suppress top border when section follows <h1>" 2022-09-28 15:40:07 +00:00
Ed Sanders df96154538 Show mf-section-0 in preview
Bug: T318758
Change-Id: I12039696bfe0f06e21b28ed32fdfc23442033805
2022-09-28 14:38:20 +01:00
jenkins-bot 99c772d4ee Merge "Add mw.track call when comment setup fails" 2022-09-27 22:32:08 +00:00
Ed Sanders f6df39c11a Always scroll "Loading..." text into view
If the widget has just been opened, it should already be in view,
but when we are recovering from auto-save it might not be.

Scrolling it into view lets the user know sooner that a draft is
about to be recovered.

Change-Id: I2b8232edc20e71b04a3f106107c0c7bc6333f66a
2022-09-25 13:28:14 +01:00
Ed Sanders 688cdc24ae Move "Return to comment" below sticky header when present
Also ensure that when we click the button, we scroll the widget fully
into view below the sticky header.

Bug: T318474
Change-Id: I394f02912cd6ab2773552a7364691ef89a17369c
2022-09-25 13:28:12 +01:00
jenkins-bot 43f95c18c3 Merge "Tweak topic container margins on desktop" 2022-09-22 15:32:34 +00:00
Ed Sanders a9488a9ead Suppress top border when section follows <h1>
Bug: T318198
Change-Id: I550dd240fe629d0159448ea49d49195de0166a25
2022-09-21 21:39:40 +01:00
David Lynch 9ee2301f1e ThreadItemSet.newFromAnnotatedNodes needs to wait to compute names
Computing the name, for headings, requires determining the oldest
comment. This must not be done before all the replies are added to the
thread.

Follow-up to e24550fae9. It was
already *technically* incorrect before then because it was generating
the name based on the first comment in the thread, but that was only
not the oldest in very unusual cases so it was fine. That commit caused
the thread summary to be cached when first requested, however, which
made future requests for oldest/newest comment and authors to be
incorrect.

Bug: T318057
Change-Id: If0bd6caf88e72cd3f91e7f0633c40b445f5e2246
2022-09-19 14:13:51 -05:00
Ed Sanders 39502b4f9a Use margin to position comment marker to avoid Chrome bug
Bug: T317135
Change-Id: I627d92fabaa9d9e477279041d3c40a7c6bfe37c8
2022-09-14 10:01:53 +02:00
Ed Sanders 516ea4a970 Tweak topic container margins on desktop
Bug: T314449
Change-Id: I021dbd33f211fcdc5ef2fea1d99212df772053b4
2022-09-14 09:59:39 +02:00
David Lynch 968250bb02 Add mw.track call when comment setup fails
Bug: T310390
Change-Id: I6df98032469931276ea096a008fdf8f63893dff5
2022-09-14 01:23:07 -05:00
jenkins-bot f152ca001d Merge "Reduce size of topic headings to 18px on mobile" 2022-09-10 11:53:39 +00:00
jenkins-bot 639ad57914 Merge "Suppress top border of first section on mobile" 2022-09-10 11:53:37 +00:00
Ed Sanders 9af812720c Reduce size of topic headings to 18px on mobile
Also reduce spacing around headings and meta bar.

Bug: T311612
Change-Id: I40e01caea22c6b89122a29f87282e4147961f6a7
2022-09-10 12:46:34 +01:00
Ed Sanders 7a579fd67b Suppress top border of first section on mobile
The :first-child that would usually do this doesn't work
due to the hidden .mf-section-0.

Change-Id: I772414f563543f6a39ec61e87a9c46cb3ef6690d
2022-09-10 12:44:32 +01:00
jenkins-bot 183fba9171 Merge "Update mw:tocplace CSS hack" 2022-09-09 21:12:43 +00:00
Ed Sanders e24550fae9 Refactor thread summary getters
Replace getThreadSummary with individual getters that call
calculateThreadSummary once.

Change-Id: Ie8a8b4d7cb5121847b78dbc20bca2c8d48c7d857
2022-09-06 23:19:13 +02:00
jenkins-bot 1c624210f4 Merge "Table of contents style tweaks" 2022-09-05 21:43:06 +00:00
Ed Sanders 5c7cf02457 Table of contents style tweaks
* Make "X comments" appear on a new line deliberately
* Remove parentheses around "X comments"

Bug: T309463
Change-Id: I803eee9db59c633f129f15e436242a12bcc627f0
2022-09-05 12:57:31 +01:00
jenkins-bot cb4eb9f9e9 Merge "ReplyWidget: Ignore pending updates after tearing down" 2022-09-03 20:23:22 +00:00
Bartosz Dziewoński 9b317c6f22 ReplyWidget: Ignore pending updates after tearing down
When using ReplyWidgetVisual, this would just crashes in #getValue.

When using ReplyWidgetPlain, if the timing is right, this might update
our auto-save after the value was cleared in the teardown code,
breaking the way we restore the reply after showing new comments.

Bug: T316074
Change-Id: I23c5f17a6ff9a6ec9c73a176e4cc60e3ad96e7f1
2022-09-03 06:55:42 +02:00
jenkins-bot f8b5ada93d Merge "Remove clear:both from topic containers" 2022-09-03 00:25:27 +00:00
Ed Sanders 664d5d041a Fix fetching of oldest comment in a thread
The implementation in Parser doesn't descend into sub-thread.
Re-use the getThreadSummary method in ThreadItem and traverse
the thread properly.

Bug: T298617
Change-Id: I318d9012eb83f37ccbe463923524ef2e9f995ced
2022-09-01 21:22:09 +00:00
Ed Sanders 2883829678 highlighter: Use upstream getTargetFromFragment
Bug: T315872
Depends-On: I605a24c708e60ccffde9dce524485f61fd5c7b06
Change-Id: Ie689c57ce23b6298e089c7bf9bc53409abc45016
2022-08-31 13:10:10 +00:00
Ed Sanders b4eaa05c1c Update mw:tocplace CSS hack
Bug: T311502
Depends-On: Ie63eed07b9bca1bfa07d4c256aba3728cedd8f93
Change-Id: I989e178419aec75b673308ca26f967176116e260
2022-08-30 14:41:34 +01:00
jenkins-bot e680735d63 Merge "Remove all stuff about legacy IDs" 2022-08-27 05:34:48 +00:00
jenkins-bot b9e3043415 Merge "Enhance vector-2022 table of contents" 2022-08-26 20:57:39 +00:00
jenkins-bot f9dc5dd135 Merge "Support nested-directionality content" 2022-08-26 18:46:57 +00:00
Ed Sanders 4a092df740 percentDecode: Pre-escape query string separators (&,=)
Change-Id: I1f648f192749fdd1d9d1217a87bd0a78ba064f7d
2022-08-26 13:33:38 +01:00
Ed Sanders c232df01a4 Support nested-directionality content
Bug: T315037
Change-Id: I93f258a5d5fea174902b77d5d0728cfd68a66867
2022-08-26 12:46:26 +01:00
Ed Sanders 40bd58859e Prefix browser title while replying/starting a new topic
We already do this while editing so that users can quickly see which
tabs they are actively working on.

This extends the functionality to the reply and new topic tools.

Bug: T262066
Change-Id: Iae662ad26072617aad71e519bb6c3cbb19ef1246
2022-08-25 16:12:54 +01:00
Ed Sanders 776fca861f Update categories list when reloading page
Change-Id: I0f6b61eec33dca26e128bd60bb027a5a42a3f9ee
2022-08-24 13:13:12 +01:00
Ed Sanders dec755c802 Fix updating of subtitle when reloading page for new comments
The subtitle prop and some others were missing from the action=parse
request. Use the same props as the VE edit API.

Change-Id: I8e9cc735d3ee50dfe0fbe0349713d88654ad9fd1
2022-08-24 13:05:07 +01:00
Bartosz Dziewoński cfa45a5f4c Remove all stuff about legacy IDs
We can no longer change IDs so easily, because they're stored in the
permalink database, so remove this mechanism to make sure it's not
accidentally used in the future.

Change-Id: I392ee1f49c48fc2f23d05e9a37c643438b4f2b9a
2022-08-24 01:01:09 +02:00
Bartosz Dziewoński 434944b197 Enhance vector-2022 table of contents
Bug: T307823
Depends-On: I034a579b7ef51950726c9ac056d6c940a7d7d472
Change-Id: Icafc13e1c846549429fe2b3b4a1721c02ab7428d
2022-08-23 19:46:44 +00:00
Ed Sanders 9adafd43a1 Show latest comment info in subtitle
Bug: T306675
Change-Id: I1400dbb50cdf8a0a5e23ce533c84fad96f3fae16
2022-08-23 19:31:40 +00:00
jenkins-bot e309fba4c2 Merge "Update permalinks when refreshing the page" 2022-08-22 23:03:40 +00:00
Ed Sanders 7cfa070b86 Remove clear:both from topic containers
Bug: T315581
Change-Id: I94533854dd985cb30278c5a001510feeab7ab41d
2022-08-22 21:25:37 +01:00
Ed Sanders 837591f12e Don't pass an empty string to getElementById to avoid Firefox warning
Bug: T315614
Change-Id: I6d4eedd75a23f6ada26aedca54da80c5e33ea4f0
2022-08-22 16:36:09 +01:00
Ed Sanders c221a2fb7b Update permalinks when refreshing the page
Bug: T315830
Change-Id: I56620e9d31799640241430ceba6da959a0c8405e
2022-08-22 12:15:34 +01:00
jenkins-bot ab8b1fe815 Merge "Logging: platform as phone/desktop depending on whether MF is active" 2022-08-19 22:45:04 +00:00
jenkins-bot 3267a1deed Merge "Fix headings changing height when JS loads on mobile (FOUC)" 2022-08-19 00:56:13 +00:00
Ed Sanders c56bf250ac Fix headings changing height when JS loads on mobile (FOUC)
The bottom margin used to collapse into the next heading, but
MobileFrontend changed how section hiding was done.

Change-Id: Ide10e9f17ad38d672958e2c3a43c2eb2cfdd82ae
2022-08-19 00:50:08 +00:00
David Lynch acadaf7f1e Logging: platform as phone/desktop depending on whether MF is active
Change-Id: I3ecf4b56b11008dbe6d30a0a868affa028786d95
2022-08-18 14:48:29 -05:00
Ed Sanders 0e95e45e88 Add space after namespace on talk pages
Bug: T313636
Change-Id: I481e885b54a1aeb9dd69a08dc614ab5f4f94b41e
2022-08-18 16:02:27 +01:00
jenkins-bot 4b0349a178 Merge "Initialize on live preview and real-time preview too" 2022-08-10 15:14:05 +00:00
jenkins-bot 91a94fe9bb Merge "Pass empty string to unused argument of pushState/replaceState" 2022-08-09 20:48:12 +00:00
jenkins-bot 89607c6e25 Merge "Implement percentDecode for finding link fragment targets" 2022-08-09 20:18:58 +00:00
Ed Sanders b3b543040b Implement percentDecode for finding link fragment targets
Relying on :target getting set means we can't use
history.pushState to change the URL without scrolling.

Should conform to https://url.spec.whatwg.org/#percent-decode

Change-Id: I4ccc3fd745884849a781a9f7fc8b00b8b689e20a
2022-08-09 20:06:28 +00:00
Ed Sanders 9f27c55f8c Pass empty string to unused argument of pushState/replaceState
Per https://developer.mozilla.org/en-US/docs/Web/API/History/replaceState
this argument is treated as unused in all the browsers we support.

Change-Id: I515193fdafaaf1c19701bc77e590d6f66b1cf4bf
2022-08-09 13:37:57 +01:00
jenkins-bot a4d9455743 Merge "logger: Also log EditAttemptStep events via Metrics Platform" 2022-08-06 05:01:19 +00:00
jenkins-bot 7ba6443a05 Merge "Clear floats above the new topic empty state" 2022-08-05 08:16:27 +00:00
Bartosz Dziewoński 0c80eeb88b Fix ReplyLinksController#teardown
Follow-up to 31c57d594a. This was
causing an exception, preventing the page contents from updating after
saving changes.

Change-Id: I8c9ab51385172056be9032ec0087f64ff34b6709
2022-08-03 20:46:19 +02:00
jenkins-bot 7ee49a2138 Merge "Make comment markers inline-block to fix comment wrapping in Safari (in headings only)" 2022-08-03 14:22:51 +00:00
Bartosz Dziewoński 2bb0a11d55 Clear floats above the new topic empty state
It should appear below any page content, at full width.
Currently it gets squished by floats on some pages.

Change-Id: I4c4107d438dfd06eec21badce5f216aa2c137272
2022-08-02 19:37:12 +02:00
jenkins-bot b1934c8a84 Merge "Don't infuse reply buttons if not in use" 2022-08-02 12:58:17 +00:00
Ed Sanders a0fa7c466f Don't infuse reply buttons if not in use
Change-Id: I704cbf3f1a681c474ce5d44b7c5af5c8dbb82f3b
2022-08-02 13:27:43 +01:00
Bartosz Dziewoński 35db93d9f5 Disable OOUI reply buttons for real, not with CSS hack
We already infuse them, so might as well do this...

Change-Id: I962c052d3f5b5c15b3a15e6e4533bd87624eb6e2
2022-08-02 00:32:24 +02:00
Bartosz Dziewoński 293df2438f Make "Add topic" button in Vector sticky header disabled after click
Bug: T307726
Change-Id: I3077357d7753d9259c5c32b71dd23a0e21bde6de
2022-08-02 00:32:24 +02:00
Bartosz Dziewoński 549fcc062b Fix focussing the reply button/link after closing the reply widget
Change-Id: I0db0fc8a93512751f8a9bcc96b048c1ab1f24f95
2022-08-02 00:32:24 +02:00
Bartosz Dziewoński 31c57d594a Do not duplicate item JSON in page HTML
Rather than setting it on both the reply link and the reply button,
set it on their parent element.

Update ReplyLinksController to handle this.

Change-Id: I650e9c0ebd354a82b8f66a63c5b4c02b2e29b105
2022-08-01 22:14:50 +00:00
jenkins-bot 47158f28dc Merge "Fire new 'wikipage.tableOfContents' hook to update TOC after save" 2022-08-01 19:49:39 +00:00
Ed Sanders 980b2c38bc Make reply links into buttons when visual enhancements enabled
Bug: T255560
Bug: T309904
Change-Id: I3932f576086a43df89ff97a1b3dafdc27c54f71c
2022-08-01 20:59:53 +02:00
jenkins-bot 9ceccd2d48 Merge "Fix styling of new comment notification on mobile" 2022-08-01 18:28:10 +00:00
jenkins-bot d247842772 Merge "Ignore "tracked" templates at the beginning of comments" 2022-08-01 14:52:39 +00:00
jenkins-bot 96868976bf Merge "Re-enable keyboard sequences for template, table etc. in new topic tool" 2022-08-01 12:28:15 +00:00
Ed Sanders 54eabe1f4f Fix styling of new comment notification on mobile
* Keep buttons on the same line
* Reduce font size to align borders

Change-Id: I1cc44ae1bd8b5e45d9a5b2ea4f9352163d12e8e6
2022-07-31 23:00:05 +01:00
Bartosz Dziewoński ddd391b6db Ignore "tracked" templates at the beginning of comments
This improves the behavior when replying to these comments
and the message snippets shown in notifications.

Bug: T313097
Change-Id: Ia10400472c9e999fa526c7437a03b72461c37b74
2022-07-31 03:56:36 +02:00
Bartosz Dziewoński e5abfdbe8a Re-enable keyboard sequences for template, table etc. in new topic tool
They were only disabled in the reply tool, because their wikitext
markup doesn't work when indented. This is not a concern in the new
topic tool.

Rename our sequences that display the wikitext warning to avoid these
items showing up in the command help dialog, and remove overrides for
global ve.ui.commandHelpRegistry. (As a result, the dialog now lists
the blockquote command, which was previously missing even though it
was enabled, but only with the 'Ctrl+8' shortcut and not 'Type ":"'.)

Also remove filtering rules for external paste.

Bug: T311653
Change-Id: I4557c376fcf099d81e91ae5c2b18301d97921180
2022-07-31 02:40:12 +02:00
Ed Sanders 434e11df87 Enable new comment notifications on mobile
Since writing this feature we added the ability to update
the page dynamically on mobile, so this shoud just work now.

Bug: T301929
Change-Id: Iceb5d8c90a892807745ba7133b7dd389293d3327
2022-07-31 00:07:14 +01:00
Ed Sanders 4da2ecf32f Hide section collapse button in preview.
In general we are hiding non-content elements in the preview
and this matches the behvaviour of the article editor.

Change-Id: I6669d8cc737214d464b662ccc6900ccce229b3d7
2022-07-29 14:09:56 +01:00
Bartosz Dziewoński f4a9d5b8f9 Fire new 'wikipage.tableOfContents' hook to update TOC after save
Bug: T294950
Depends-On: Icaeda68ded94a04edef7a3629385eeb232048684
Depends-On: I1644a74370b42b04d0db167879f7de2207ebfcf5
Change-Id: Ic3ef4e332ade8918778b6aaaa8eaf7e98f0a8d7d
2022-07-28 23:37:29 +02:00
Bartosz Dziewoński 9425f75f47 Initialize on live preview and real-time preview too
Bug: T309423
Change-Id: I661dfb2b9159fe56edffabd9fba00cd2c56343cd
2022-07-28 19:06:32 +02:00
Ed Sanders 2f44d99184 Simplify CSS selectors for [reply] and [subscribe] links
:first-of-type selectors refer to the node name, so just
use :first-child and :last-child for the open and close brackets.

Change-Id: I2e8ca7e99d1262522ed2d3b5133093817af8ad29
2022-07-27 16:22:11 +00:00
Ed Sanders 2960853088 Move subscribe button up on desktop
Bug: T312674
Change-Id: I419883b5f9a4291b4bf575d57195d553fd5e291e
2022-07-27 13:55:03 +01:00
jenkins-bot 61f76003d1 Merge "Show empty state on mobile when there is only non-discussion content" 2022-07-26 13:24:29 +00:00
Ed Sanders 1d1df63cab Show empty state on mobile when there is only non-discussion content
Bug: T313801
Change-Id: I4e9910ef7d63c6ce330da1a896f518a9a22a12cd
2022-07-26 13:52:22 +01:00
Bartosz Dziewoński e7bbc9864c ReplyWidget: Scroll save error into view after showing it
Bug: T298263
Change-Id: Ibe488bf9184dc9d9c3c8b2c3491c0baf6676ba16
2022-07-25 18:16:13 +02:00
Bartosz Dziewoński dc342291b5 highlighter: Fix exception when trying to highlight an unknown comment
If some content is loaded without re-initializing DiscussionTools
(this currently happens on live preview), then a link to a comment is
clicked, we will not find the comment, which previously caused an
exception. Just ignore this, other code paths in highlighter already
handled this situation in this way.

Bug: T309423
Change-Id: Ie46fd782b8a45907dc6fc604691575c4b55d08ce
2022-07-22 17:47:09 +02:00
jenkins-bot 6e57e3ba78 Merge "Show a "Return to reply/new topic" button when widget is scrolled off the screen" 2022-07-18 16:09:54 +00:00
Ed Sanders 2c2e57fd47 Show a "Return to reply/new topic" button when widget is scrolled off the screen
Bug: T310967
Change-Id: I3d1626162eb5c66ac35560792a81ce09455e86a8
2022-07-18 13:20:12 +01:00
Bartosz Dziewoński 2d3b497a21 Avoid localized digits in internal timestamps in JS
Unlike PHP DateTime, and unlike the .toISOString() method,
the Moment.js .format() method will output localized digits.

Bug: T312828
Change-Id: I49a250b1ad74d9395bf3f994379613cc121b5be4
2022-07-13 02:33:24 +02:00
Bartosz Dziewoński f51d26fd3a Parse 'DiscussionToolsTimestampFormatSwitchTime' config value as UTC
When the input to moment() doesn't define a timezone, it
defaults to the local timezone (as defined on the device,
not in user preferences).

Bug: T312828
Change-Id: I8d2e1c2f6feb5584af4bbf9fef39567eb87780ff
2022-07-12 14:10:09 +02: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
jenkins-bot 3bb23f30f8 Merge "Remove some unused or redundant styles" 2022-07-07 20:50:17 +00:00
jenkins-bot 1e479288be Merge "Prevent the "Subscribe" button focus outline from being cut off" 2022-07-07 20:50:15 +00:00
jenkins-bot 31c35992f4 Merge "CommentController: Scroll before focusing in showAndFocus" 2022-07-07 20:26:23 +00:00
Ed Sanders d367b1fc50 ReplyWidget: CSS tweaks for monobook
Use 12.8px for interface, and 12.7px for content.

Move mode tabs away from the reply body so the underline can be seen.

Change-Id: I9cb9a611ca64595152f800e1e15b640402f6cb74
2022-07-07 16:24:49 +01:00
Ed Sanders 9f670d0ee0 ReplyWidget: Don't add border-radius when hovering mode tab
Change-Id: Ied05b70119ea724c126e88d30aa62e0f7526ba12
2022-07-07 16:24:06 +01:00
Ed Sanders 2a31eed846 CommentController: Scroll before focusing in showAndFocus
This removes the need for a setTimeout before scrolling.

Change-Id: I1c47d5635f66ed523b492c384464e2e6accabf01
2022-07-07 13:43:16 +01:00
Esanders d6a8c75899 Hide the lede section on mobile when DiscussionTools is enabled (2nd attempt)
Previously this was reverted in I28a5c774f5f after the initial
commit I3736b488046 caused T312177.

Bug: T311760
Change-Id: Iba65615378b183f0c970afff565f45cc878f1d71
2022-07-06 16:03:27 +01:00
Ed Sanders 72bb4aed13 Revert "Hide the lede section on mobile when DiscussionTools is enabled"
This reverts commit 69bfc6d6a2.

Reason for revert: Caused T312177

Bug: T312177
Change-Id: I28a5c774f5f9d0391a8addf5b31b9c229fb40948
2022-07-06 00:31:54 +01:00
Bartosz Dziewoński 5c3277a196 Format number of comments in reply tool new comment warning
Bug: T312033
Change-Id: If8e95b9554eddec2f00c492885575266b02cc1af
2022-07-04 17:57:41 +02:00
jenkins-bot 00d63026a3 Merge "Halve the initial height of the reply widget on mobile" 2022-07-01 22:20:06 +00:00
jenkins-bot 4ed36bc03b Merge "Reply widget mobile: Reduce space between footer and footer-links" 2022-07-01 22:19:25 +00:00
jenkins-bot 8a0703f29d Merge "Reply widget mobile: Move reply/cancel buttons up into empty space of "advanced" bar" 2022-07-01 22:19:22 +00:00