Commit graph

934 commits

Author SHA1 Message Date
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 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
Ed Sanders 4fb474d611 build: Update stylelint-config-wikimedia to 0.13.0
Change-Id: I164d6175f8077487e2d8dfbf0bcfbd13f1545cae
2022-05-04 23:25:06 +01:00
jenkins-bot 4f25201193 Merge "highlighter: Set the location hash for new topics on desktop as well" 2022-04-21 23:55:19 +00:00
jenkins-bot 90018a5b55 Merge "highlighter: Ensure items in .ranges and .$element are in the same order" 2022-04-21 23:55:17 +00:00
jenkins-bot d35c96db97 Merge "Mobile empty state adjustments: hide image, bigger button" 2022-04-21 21:48:07 +00:00
Bartosz Dziewoński f411f1c342 highlighter: Set the location hash for new topics on desktop as well
The old section=new wikitext editor does this, and I'd rather support
the same behavior on desktop and mobile than different ones.
Follow-up to 89a1efc9d8.

Change-Id: I5371f932680638ee159f2f713bbca44bba5675aa
2022-04-21 22:36:35 +02:00
David Lynch faff90b96b Mobile empty state adjustments: hide image, bigger button
Bug: T305261
Change-Id: I503a62fafaebfe17e1dd2181e543dcc2dbac9eb1
2022-04-21 11:48:23 -05:00
jenkins-bot 40b9b7a536 Merge "Avoid duplicating page content if there are multiple .mw-parser-output elements" 2022-04-21 01:02:06 +00:00
Bartosz Dziewoński d910663bbc highlighter: Ensure items in .ranges and .$element are in the same order
jQuery#add sorts the nodes in DOM order (and removes duplicates).
We did not sort the ranges, so they could end up in a different
order, causing #update to apply the CSS to the wrong nodes.
This was usually harmless, but it could cause incorrect rendering
when some elements are positioned or hidden.

Change-Id: Ic359db08dafa3d86a5778426a7dc2419c94feabd
2022-04-20 19:41:44 +02:00
Bartosz Dziewoński 0c6013c582 ReplyWidget: Fix text-align when content and user language have different direction
Bug: T306137
Change-Id: Ibb0accc210f3cd922ddfb4f0d95df2f98f684425
2022-04-19 22:05:09 +02:00
Bartosz Dziewoński 1ad185e097 Avoid duplicating page content if there are multiple .mw-parser-output elements
Bug: T306388
Change-Id: Iaee2999f02929d562ae9f78ef50913d515c72bb3
2022-04-19 21:46:59 +02:00
Ed Sanders 89a1efc9d8 Fix highlighting and expanding of new topics on mobile
Set the location hash to that of the new topic, then wait
for the section to expand before drawing the highlight.

Bug: T306399
Bug: T301840
Change-Id: I8bc78b49f359e10279584c16269fcb78a087eae0
2022-04-19 15:41:28 +00:00
Ed Sanders 64c76f54a3 Don't reload the page on mobile
Bug: T301839
Depends-On: I0985dd5e8db6f82df882c6f4de4ef3821a0eef13
Change-Id: Ic02de79627b813c1fa6f0e537288206bfb1dbd1c
2022-04-12 18:23:57 +01:00
jenkins-bot b0be1cbf21 Merge "Revert "Make comment markers inline-block to fix comment wrapping in Safari"" 2022-04-11 19:20:30 +00:00
Esanders 0e5ce694f3 Revert "Make comment markers inline-block to fix comment wrapping in Safari"
This reverts commit b4b6ae4e81.

Bug: T305721
Bug: T298371
Change-Id: I108595da651f5a746043b553c2bcf4bdfc64c437
2022-04-11 12:32:52 +00:00
jenkins-bot e87d2117e9 Merge "Replace mediawiki.Uri with native URL (or polyfill)" 2022-04-08 08:49:35 +00:00
Bartosz Dziewoński cf255f28bf Replace mediawiki.Uri with native URL (or polyfill)
Depends-On: I7c4f9b6449a4317d68f4923fb4f198181bbfe800
Depends-On: I04464c17369ffb0dd4e7c33d2bd4db7b2d050bf4
Bug: T305010
Change-Id: I02da91010304af35f0b1f2bd4d65a84d51f29930
2022-04-08 00:35:37 +02:00
David Lynch 0fc474d66f Log saveSuccess more consistently
Cases where saveSuccess wasn't logged:
* creating a new page with the New Topic tool
* any replies on mobile
* successful replies made through transclusions which then couldn't
  purge the current page

These were all cases where we abandoned the post-save process early to
reload the page.

Bug: T305541
Change-Id: I1366a3e0a4b03ac67f926284f1aa718ae552d852
2022-04-06 11:37:29 -05:00
jenkins-bot 4da9fdc80a Merge "Make comment markers inline-block to fix comment wrapping in Safari" 2022-04-01 15:44:16 +00:00
Bartosz Dziewoński b00b7cd5b5 debughighlighter: Fix date highlighting
Follow-up to 4c29304484.

Change-Id: Id088465c3060bcceb2c2b51d784fa60b9005e867
2022-03-29 23:52:00 +02:00
Ed Sanders 48fdcf1056 Remove data-mw-comment-name attribute from subscribe links
The HeadingItem's name is now present in the DOM, so just traverse
to it and use that instead.

Change-Id: If28e1588742513d606e3d8fcfb259b85acc0a873
2022-03-28 22:30:59 +01:00
jenkins-bot 63c6aceb2c Merge "Implement getTimestampString on CommentItem" 2022-03-26 21:25:13 +00:00
Ed Sanders 215695ad2c Refactor topic subscription logic
This will make it easier to support subscription buttons with
visual enhancements enabled.

Change-Id: I3614eada32885216358143a0cacf65966381679e
2022-03-25 11:57:58 +00:00
Ed Sanders 579b8bb1d4 Implement getTimestampString on CommentItem
Change-Id: I1768e9993debe904d6a228942ad0188486d65c0b
2022-03-24 16:49:35 +00:00
Bartosz Dziewoński c7723baf72 CommentParser: Replace uses of Title with TitleValue
Another small step towards removing the reliance on global state.

Change-Id: Ifb4a5bcbef6606d02f1c7aa7385d72822cb0bad0
2022-03-18 18:24:34 +00:00
Ed Sanders b4b6ae4e81 Make comment markers inline-block to fix comment wrapping in Safari
Bug: T298371
Change-Id: I40da5272fd9c44a5a81e303349d0e8fc404e344d
2022-03-18 14:31:36 +00:00
Ed Sanders 3c66f066c2 Refactor highlights into a class, and add window resize listener
Bug: T303616
Change-Id: Id369cdfc511a7f0f5e19fff4c6424bec2f34ff55
2022-03-14 14:57:19 +00:00
Bartosz Dziewoński 01b253c5b6 Don't allow the root node to be treated like a comment frame
Also fix a bug where headings would be ignored while checking for
comment frames. See task for detailed explanation.

Bug: T303396
Change-Id: I6495826b4b050ea80680e0798ac6ab4497a7c09e
2022-03-10 17:45:08 +00:00
jenkins-bot dd24b0edcd Merge "Improve handling for comments after fake headings using wikitext ;" 2022-03-10 16:21:18 +00:00
jenkins-bot 32d9ef573a Merge "CommentParser: Avoid using a dynamic undeclared property" 2022-03-10 00:22:16 +00:00
jenkins-bot 76478dda26 Merge "Move signatureScanLimit to a constant in JS" 2022-03-10 00:22:14 +00:00
jenkins-bot dfcb2f4fc7 Merge "Fix highlighting of comments when reloading" 2022-03-09 22:44:48 +00:00
Ed Sanders 457f6eb7d1 Fix highlighting of comments when reloading
The CommentController stores a list of the new comments that
triggered the reload warning. Just highlight all the comments
in this list, as we always reload to the revision we got from
the same API call.

Bug: T303261
Change-Id: I960f3cf33e25004bad6ab6df907121a87555aaf4
2022-03-09 14:47:03 +00:00
Bartosz Dziewoński 4c29304484 CommentParser: Avoid using a dynamic undeclared property
Change-Id: Iefa8dea83bc0d31b9c6b3509189eeaa652dd9ea0
2022-03-08 23:30:11 +00:00
Bartosz Dziewoński 08c79142fb ImmutableRange: Add @property annotations for magic props
Phan can analyze them now and reports some issues with types.

* Add some assertions on types where we're sure that we're using an
  Element or non-null, but Phan can't prove it
* Fix incorrect type hints on getFullyCoveredSiblings() and
  getCoveredSiblings(), luckily it was harmless

Change-Id: I8cc12450378efa7434c4d66882378b715edd4a70
2022-03-08 23:29:40 +00:00
Bartosz Dziewoński eb1fe7a8fb CommentParser: Fix redundant uses of getHeadlineNodeAndOffset()
We call CommentUtils::getHeadlineNodeAndOffset() before constructing
the HeadingItem in CommentParser, so the range's startContainer
is always the headline node.

Change-Id: I2afb6ba9100e785cd91f31d82f4cea59fa8b5443
2022-03-08 23:29:34 +00:00
Bartosz Dziewoński 0e576216b2 CommentUtils: Fix confusing types in getIndentLevel()
Change-Id: I548cf4ad54e92c22da64caf53ee028a906cd3b62
2022-03-08 23:29:15 +00:00
Bartosz Dziewoński 584f6a020c Use tagName rather than nodeName when we know the node is an element
`tagName` is only defined on Element, and it returns its tag name.

`nodeName` is defined on Node, and it returns the tag name for Elements,
and a string like '#text' or '#document-fragment' for other types.

We were using both, which made it harder to reason about what types
we're dealing with.

Change-Id: I8e621e5872bdf78c84ec553cfbfcdbf0192f0589
2022-03-08 23:29:05 +00:00
jenkins-bot 1f7ff387a7 Merge "New topic: skip tabbing into the mode tabs until you've focused the body" 2022-03-08 23:18:37 +00:00
jenkins-bot 4b2f9ede8e Merge "Use MessageWidget's showClose option" 2022-03-08 22:41:39 +00:00
Ed Sanders 6869112aad Use MessageWidget's showClose option
Change-Id: I81292bd84ce6feefdb852f6a636109f68e55291d
2022-03-08 01:25:22 +00:00
Bartosz Dziewoński b2ee19b441 Remove check for CDATA nodes
Added in 76289cdf73,
should no longer be needed since we switch to Parsoid's
HTML parser in 3e6ab2c4d2.

Change-Id: Ic0b7ed8089b71f2338e604f68d547759e069f0b2
2022-03-04 22:14:41 +01:00
Ed Sanders 4f91a0b883 Highlight new comments when refreshing
Bug: T300215
Change-Id: I72655e05dccbe96f9dfa4ccca4e91b3edf133d97
2022-03-04 00:40:29 +00:00
Ed Sanders 487be9e202 Show error message as soon as we detect the parent comment has been deleted
Bug: T300504
Change-Id: I654422f7931f50503e51500508aea728adf327a1
2022-03-04 00:40:29 +00:00
Ed Sanders d619308098 Don't show auto-save notifications when dynamically updating the page
Bug: T302327
Depends-On: If94e603458a385ba6eb15c4e29144f72e3ad12ca
Change-Id: I28f965137b986d00ac7a020ca93d8dc5195f5d4f
2022-03-04 00:40:29 +00:00
Ed Sanders da49448f43 Poll for new comments in the section you are replying in
Bug: T300504
Change-Id: I3a887ab2f5260bb4893a3d680103c9d8ec767f45
2022-03-04 00:40:29 +00:00