Commit graph

576 commits

Author SHA1 Message Date
jenkins-bot f393fa5f03 Merge "Remove a TODO note about wrappers" 2021-02-11 00:09:50 +00:00
jenkins-bot d5b2389ffa Merge "Fix replying outside wrappers for partially indented comments" 2021-02-11 00:09:48 +00:00
Ed Sanders b581883e7c Show relevant user in local suggestions on user talk pages
Bug: T273324
Change-Id: I60e550efbea3d9e250dcaf13080407094a23aad3
2021-02-09 21:51:28 +00:00
Bartosz Dziewoński 3a1b8e09ea Remove a TODO note about wrappers
Yes, this is still needed, removing it causes failures in tests
(and the old outputs look better).

Change-Id: I5bcedb0295a1f0ac4f6e51eaa9a9e072d8236f3c
2021-02-08 22:23:54 +01:00
Bartosz Dziewoński 9d2b35828d Fix replying outside wrappers for partially indented comments
Top-level comments that start or end with a list (inconsistent
indentation) would not have triggered the logic for detecting
wrappers.

Bug: T273692
Change-Id: Idcb4eed73e391f5f86eca2eb05cb3cea0d86f30a
2021-02-08 22:18:37 +01:00
jenkins-bot 3da91953da Merge "Adjust new comment highlight timings" 2021-02-08 18:51:06 +00:00
Bartosz Dziewoński 3c7c9c6e3a Adjust new comment highlight timings
The new timing exactly matches MediaWiki's post-edit notification.

Bug: T268994
Change-Id: I8233f56ad6e0d95285fee7f514fce914e7897905
2021-02-08 16:49:50 +01:00
Ed Sanders d05109b24d Truncate user generated part of IDs to 80 characters
This ensures that IDs fit in a 255 character database field.

Bug: T273658
Change-Id: I3cfe4fce6a865b4343f0f01121cd696aa5f98b22
2021-02-03 15:04:58 +00:00
jenkins-bot 63a5916e53 Merge "Update warning about missing topic title immediately" 2021-02-02 12:11:21 +00:00
Ed Sanders 6c3dd3aaa9 Move Hooks to HookUtils
Now that all the real hooks have been separated out

Change-Id: Ibdb42f98614fc551068f8f8e5297dcc99251ab46
2021-02-01 22:35:11 +00:00
jenkins-bot fb415e374d Merge "Update 'save_failure_type' map for EditAttemptStep schema" 2021-02-01 18:28:13 +00:00
Bartosz Dziewoński 069050ad12 Update warning about missing topic title immediately
Since it's no longer tied to the "Reply" button, we can move the code
from ReplyWidget to NewTopicController, where it belongs.

Bug: T272543
Change-Id: I8c90ffb772573d22d26c608d45877ee948fd232d
2021-01-29 23:14:45 +01:00
jenkins-bot 50f749d676 Merge "Handle category links at ends of comments affecting indentation" 2021-01-26 17:21:34 +00:00
jenkins-bot 373282dfb4 Merge "Don't show error message popups when failing to restore auto-save" 2021-01-26 17:21:32 +00:00
jenkins-bot 2b648dad64 Merge "CommentController: Even better handle clicking links while already commenting" 2021-01-26 17:04:04 +00:00
jenkins-bot 76da6af031 Merge "Move some setup code from CommentController to controller.js" 2021-01-26 17:02:22 +00:00
Bartosz Dziewoński c781b127c9 Handle category links at ends of comments affecting indentation
* Ignore rendering-transparent nodes between discussion comments.
* Improve isRenderingTransparentNode() so that <link> nodes
  representing TemplateStyles are not considered transparent,
  otherwise this would undo ae920b831f.
  Using a regexp from Parsoid.

Bug: T272746
Change-Id: I0b3c3251156ba6c4826abf5ba44ea93f80ebc01d
2021-01-26 04:55:03 +01:00
Bartosz Dziewoński 344038ae41 Don't show error message popups when failing to restore auto-save
Several of the messages talk about clicking the reply links, which
seems unhelpful. Also, showing a fullscreen popup on page load seems
very unhelpful too. (Itoldyouso that we shouldn't use popups.)

Bug: T268069
Change-Id: Id1312cf06200fb45a28b39481a99cc2c96603fa4
2021-01-26 03:03:19 +00:00
Bartosz Dziewoński d354b34fa6 CommentController: Even better handle clicking links while already commenting
If the user is clicking on a new topic link, and a reply widget is
open, attempt to close it instead of doing nothing.

Bug: T272545
Change-Id: I1903f5ae4c9e98c4b3a4703ad0e44d772894592a
2021-01-25 23:42:15 +01:00
Bartosz Dziewoński 718457130e Move some setup code from CommentController to controller.js
We'd like the [reply] links to behave differently if other
CommentControllers are already active, but each CommentController
doesn't know anything about others; only the main controller.js does.

Change-Id: Ic21b2d40d213a325509822f703709f52aa8dc8d7
2021-01-25 23:33:58 +01:00
Bartosz Dziewoński 60272fc348 Fix cookie loading hack
If the module is loaded on a page where DiscussionTools is
not supposed to be enabled, wgDiscussionToolsFeaturesEnabled
will be undefined, and the code will crash before it can set
the cookie that enables it for future page views.

Bug: T272850
Change-Id: Ia1c40cfc3cbee62823f1806bd20229883905677a
2021-01-25 15:17:20 +01:00
jenkins-bot 7bf858066f Merge "NewTopicController: Clear section title on teardown" 2021-01-20 00:31:07 +00:00
jenkins-bot e0fafcee3d Merge "CommentController: Better handle clicking links while already commenting" 2021-01-20 00:28:11 +00:00
Bartosz Dziewoński 2337600f38 NewTopicController: Clear section title on teardown
Bug: T272393
Change-Id: I633adc17c18e50b921400ec2fcab57649da147dc
2021-01-20 00:23:10 +00:00
jenkins-bot 1c9f038aac Merge "Padding and border around new topic tool" 2021-01-20 00:04:31 +00:00
jenkins-bot 8d999c5ebf Merge "Separate dialog for abandoning a new topic" 2021-01-20 00:04:29 +00:00
Bartosz Dziewoński 37b574f165 Separate dialog for abandoning a new topic
Bug: T269190
Change-Id: Ie4f486b0641edea369702631556d8ea31f991370
2021-01-19 21:40:21 +01:00
Bartosz Dziewoński 2798ee73f4 CommentController: Better handle clicking links while already commenting
Bug: T272389
Change-Id: If28a6cce250dca4810de3f51c0a2a4587d00649e
2021-01-19 21:21:47 +01:00
Bartosz Dziewoński 9ee2341310 Fix skipping past our own reply buttons for wrapped comments
Bug: T272318
Change-Id: I7c80a0be3af76d4db19f9934c5869be07e4bc52c
2021-01-18 20:42:23 +01:00
jenkins-bot e17467b09c Merge "Fix exception when trying to use non-existent 'typeof' attribute" 2021-01-18 18:58:35 +00:00
Bartosz Dziewoński 8f42c74985 Fix skipping to the end of paragraph, now it considers nested tags
Add yet another tree walking utility: CommentUtils::linearWalk().
Unlike TreeWalker, it allows handling the beginnings and ends of nodes
separately – kind of like parsing a XML token stream, or kind of like
VisualEditor's linear model.

(Add unit tests for this utility. The simple.html test case is copied
from [VisualEditor/VisualEditor]/demos/ve/pages/simple.html.)

Use this utility to stop skipping when we reach either a closing or
opening block node tag. Previously we'd skip over such tags inside
nested "transparent" nodes (like <a>, <del>, or apparently <font>).

Bug: T271385
Change-Id: I201a942eb3a56335e84d94e150ec2c33f8b4f4e0
2021-01-18 18:20:20 +00:00
Bartosz Dziewoński 1fa9a020ad Update 'save_failure_type' map for EditAttemptStep schema
Remove unused error codes, update the ones that changed, and sort in
the order in which the types are listed on the schema page.

Bug: T272162
Change-Id: Ib16f7e11ff81d43443b08cf704ce5196420671e4
2021-01-15 19:54:45 +01:00
Bartosz Dziewoński c20e7765ea Fix exception when trying to use non-existent 'typeof' attribute
Bug: T272090
Change-Id: I4d1e7457441f28d789dec8b7fd2dc3ba10fd995e
2021-01-14 22:11:32 +01:00
Ed Sanders c42e86f0f6 Config: Explicitly check feature availability in the client
Don't assume a feature is available because the code has
loaded and the user option is set. Export the logic from
Hooks.php to the client.

Change-Id: Ica0e58de7ed0d59e3b09645193eb2b691ae41c39
2021-01-14 19:04:18 +00:00
Ed Sanders e16a519a05 Padding and border around new topic tool
Bug: T269157
Change-Id: I4f56f9dc0eca71ea4ed452df49e861aac47e3de8
2021-01-13 20:54:59 +00:00
David Lynch 27a995d5a2 A/B test bucketing for beta enrollment
If DiscussionToolsABTest is enabled (set to `all` or a feature), logged
in users who have never used the tool before will be assigned to an a/b
test bucket. If they're in the test bucket, they get the feature
enabled.

If they manually set their beta feature preference, we don't override
that but do maintain their bucket for logging purposes.

Bug: T268191
Change-Id: I9c4d60e9f9aaef11afa7f8661b9c49130dde3ffa
2021-01-13 10:32:00 -06:00
jenkins-bot dce452fe6b Merge "Give new-section a specific init_type to distinguish it" 2021-01-12 22:02:13 +00:00
Ed Sanders 706f4438fc Add "new topic" user preference
Bug: T270119
Change-Id: Ie27ea645602f7533610826cbc0cc422e3682d863
2021-01-12 20:15:46 +00:00
David Lynch 5696495754 Give new-section a specific init_type to distinguish it
Bug: T265099
Change-Id: I0117a41ec44263162621a34cf045b13650c6918c
2021-01-12 20:15:41 +00:00
Bartosz Dziewoński d76143bc08 Ability to add new discussion sections
1. Extend the JS modifier to allow adding top-level comments
   (that is, replies to headings). PHP modifier doesn't do this
   because we'll save the changes using paction=addtopic instead.

2. Subclass CommentController to allow adding a new heading and a
   top-level comment underneath it at the same time.

3. A lot of ugly code in ReplyWidget to customize the interface
   for this case. Much of it should probably be moved to
   CommentController/NewTopicController.

Bug: T267595
Change-Id: I9c707bb7f7aae1b92c72fb4dee436490f8c8409b
2021-01-12 20:15:28 +00:00
jenkins-bot 446d4dc3ec Merge "ReplyWidget: Ensure scrollbar doesn't appear in source mode (for real)" 2021-01-08 23:17:01 +00:00
Ed Sanders 823d61a69c Use content direction for styling reply links
Change-Id: Ib14ff4b69a20a2e928925a790a8892b6b2e29794
2021-01-08 17:08:45 +00:00
jenkins-bot 4673cae615 Merge "Move the '@' prefix into the PingNode, rather than plain text" 2021-01-04 21:56:26 +00:00
jenkins-bot 8a6bb8efd0 Merge "Ignore outdent templates at the beginning of comments" 2021-01-04 21:48:27 +00:00
jenkins-bot fa9d729728 Merge "Change which nodes are ignored at the beginning of comments again" 2021-01-04 21:47:40 +00:00
Bartosz Dziewoński bca14cbe03 Move the '@' prefix into the PingNode, rather than plain text
Depends-On: I49733aa6aa2c1e61a88e7c88e84f1f4338acfac1
Change-Id: I9586d07ded0e41afdcfbd6e46364bb1f837cf1c0
2021-01-04 21:43:42 +00:00
jenkins-bot f4106e8dc7 Merge "Fix detecting decorative comment frames with whitespace" 2021-01-04 21:41:30 +00:00
Bartosz Dziewoński 6e37a172ae Fix detecting decorative comment frames with whitespace
As a result of 0fc71f60cd, "empty" text
nodes (containing only whitespace) at the end of the comment may be
inside the comment's range, and trying to ignore them caused the
ranges not to match and the frame not to be detected.

Now the code works whether they're inside the comment's range or not.

Add a test case for wrapped discussion comments with HTML comments and
with whitespace.

Bug: T250126
Bug: T268407
Change-Id: I2217ff5a635fd1c9c9e803f46795b1bfb3d17535
2021-01-04 20:31:33 +01:00
Bartosz Dziewoński f44806c0c8 ReplyWidget: Ensure scrollbar doesn't appear in source mode (for real)
Follow-up to d5a1b7bc2b.

The rule hiding the scrollbar was applied to the wrong element.

Bug: T267609
Change-Id: I596f29ba191032a82c579c63e9aa526eb4e887aa
2021-01-03 17:22:13 +01:00
Ed Sanders fb6146053a Convert highlighter.css to less
Change-Id: I41f6d9536a589b6423f4fc619d5058335083a570
2020-12-23 16:50:32 +00:00