Commit graph

1389 commits

Author SHA1 Message Date
Bartosz Dziewoński 91d7cdb704 Remove "Read as wiki page" feature on mobile talk pages
Bug: T280417
Change-Id: I8f24531cbe1b6bb3f434c91a9523b0a11110d8e6
2024-01-04 19:34:48 +01:00
jenkins-bot 3a2e10588b Merge "Tweak CSS to deal with Parsoid's <section> tags" 2023-12-19 16:50:41 +00:00
jenkins-bot 078f57b427 Merge "ThreadItem.js: Rename getNativeRange to getRange" 2023-12-18 17:21:34 +00:00
David Lynch 95121b7364 Stop comment-not-found notification always showing when requestedSince
`TEST && false || true` is always true regardless of `TEST`, we want
`TEST && (false || true)` instead.

Bug: T353568
Change-Id: I72fa6b87f43a9d8439883dfedc35fe82974b35de
2023-12-16 09:20:19 -06:00
Ed Sanders 329a268564 ThreadItem.js: Rename getNativeRange to getRange
Makes the class more similar to PHP. The non-native
ranges exist for efficiency, but users will usually
want native ranges.

Change-Id: Ifd7dd034d2e0f3b9af050ecdab3e063df73dde5e
2023-12-15 16:22:52 +00:00
jenkins-bot 264869a561 Merge "ReplyWidgetVisual: Replace deprecated selectLastContentOffset call" 2023-12-08 23:33:00 +00:00
Ed Sanders b60be160ac ReplyWidgetVisual: Replace deprecated selectLastContentOffset call
Change-Id: I80b64ec1d3ecf1985c29a8efc3d072778ffe783f
2023-12-08 11:09:20 +00:00
Ed Sanders a853e6f3d2 Remove { passive: true } from removeEventListener
This option doesn't exist when removing an event.

Change-Id: I2449fec2b2368f829d93eea9a13c13aea1ab75f8
2023-12-08 10:59:40 +00:00
jenkins-bot d69dc24161 Merge "Ignore signatures with invalid timestamps" 2023-12-07 18:00:09 +00:00
Ed Sanders c82783a5b6 Find a heading by title in archives
* Looks for heading IDs matching "h-<heading text>-%" that once
  existed on the target page.
* For such IDs, finds where those items currently exist,
  presumably in an archive.

Pros:
* Doesn't need to know anything about the local wiki's archiving
  conventions, so can be deployed universally.

Cons:
* ID conflicts will return matches in unrelated archives, e.g.
  MassMessages.

Bug: T349653
Change-Id: Ie94efd0503e9f4689d3421babe445f9f4e2b4fb7
2023-12-06 18:39:28 +00:00
Ed Sanders 4733eb0362 Show new location of missing comments in notification
Bug: T304579
Change-Id: I5c9229a25875f0bb73c2a4dbfd0e1ac25f9c893e
2023-12-06 18:39:27 +00:00
Ed Sanders 4051c7faf4 Ignore signatures with invalid timestamps
Bug: T352455
Change-Id: Ie499db4594bfa23b618907383d0ac583849ff582
2023-12-05 13:23:15 +00:00
Ed Sanders 584dc08020 Remove file headers and @copyright tags, not used consistently in this repo
Change-Id: I3c074c7cbae52d1775b14e1e6dae22c4276b8236
2023-12-04 12:30:56 +00:00
jenkins-bot b88b4737e3 Merge "Apply slim button styles to all inline buttons" 2023-11-30 18:43:02 +00:00
Bartosz Dziewoński 978d2c54a4 Tweak CSS to deal with Parsoid's <section> tags
* The :first-child pseudo-selector to suppress top border of the first
  div.ext-discussiontools-init-section ends up suppressing top borders
  of all these divs since they are the first child of a <section> tag
  in Parsoid's HTML.

  Add `.mw-parser-output >` to these selectors, so that they don't apply
  when <section> wrappers are present in Parsoid's HTML.

* Re-implement the logic for suppressing top border with new selectors
  that work correctly with Parsoid's <section> wrappers.

  Note that one of the cases requires using the :has() selector, which
  is not supported by all browsers yet. This should not be a big deal
  in practice, as that case should be rare on Wikimedia projects.

* This can be reverted if T333031 decides to strip <section> tags
  from Parsoid's read view HTML.

Bug: T333031
Bug: T341010
Change-Id: If513c90033e9a77c8885b3b1c937e016064cc5ba
2023-11-30 18:15:35 +01:00
Bartosz Dziewoński 8271401e73 Compatibility with styles for new heading HTML
(split off from I5ab9d3373a6911c1456c30d844b66576b278a1b5)

Bug: T13555
Depends-On: I44587461582d648b56ef0c9c7ae0c322895c69c2
Change-Id: Ia32d3b3ac0de2f17401fc1a26c1fe451f273c688
2023-11-30 18:13:31 +01:00
Ed Sanders bd8793ba99 Apply slim button styles to all inline buttons
Prevents the yet-to-be-used overflow button from affecting
the line height.

Change-Id: I2f76e397f6205edd52a33a87ef1445e5752b16e2
2023-11-30 16:33:58 +00:00
Ed Sanders f2f0ec2f65 build: Update linters and fix
Change-Id: Iec16f3330f94d38bb50492b7dcc9207786b964a4
2023-11-28 16:10:47 +00:00
David Lynch 0888bf2e27 Make hiding of reply links in mw-archivedtalk !important
This was being overridden by a later rule that only affected reply
buttons on mobile.

Bug: T351542
Change-Id: Iad2f6b703827cccf46ad5909d11fe3912d7023d5
2023-11-17 09:52:46 -06:00
David Lynch 26b63503a9 Only change mobile indicator alignment when enhancements are enabled
This was causing a misalignment on mobile pages that loaded the DT
styles but didn't have visual enhancements enabled.

Bug: T351044
Change-Id: Ib5e392943331467c3d29ee2b10d3bbe4995137d0
2023-11-12 19:43:19 -06:00
David Lynch b3a838fc38 Notify when we can't find a comment from a reply-link
This requires something like an invalid timestamp, to produce a reply
link whose associated comment ID is going to not be findable.

Bug: T350633
Change-Id: Ib50c11096b9af9961b74309b60524a4b986e04aa
2023-11-07 11:59:03 -06:00
Ed Sanders e0a841fe0a Use top alignment for buttons on mobile talk pages
Bug: T344629
Change-Id: Ic81a146e57fd00f2a9d83686e91d9424c2e404bd
2023-11-03 18:58:19 +00:00
jenkins-bot ef28fbfc84 Merge "ReplyWidget: don't show the enter hint if the reply button is disabled" 2023-11-01 17:58:36 +00:00
jenkins-bot e729df2bfe Merge "ReplyWidget: don't show the enter hint if the target was in bodyWrapper" 2023-11-01 17:58:28 +00:00
jenkins-bot 048d5364e2 Merge "Replace preg_replace_callback with strtr in CommentParser" 2023-10-31 13:35:19 +00:00
thiemowmde 10dcd1f847 Replace preg_replace_callback with strtr in CommentParser
It does the same as before.

I think performance is not a concern here, and wasn't my motivation
either. But I hope this makes the code easier to read and to reason
with.

I added a pure unit test case (without involving an actual Language
object) to cover the previously uncovered digits feature.

Change-Id: I6a0fc86035817eabb42b55e58183ae094c052aa6
2023-10-31 08:55:40 +01:00
jenkins-bot bfaefe4d4b Merge "Improve performance of CommentParser::getUsernameFromLink" 2023-10-30 23:33:33 +00:00
jenkins-bot c2e2381c06 Merge "Remove obsolete check for window.history.replaceState" 2023-10-30 23:06:12 +00:00
jenkins-bot 08e219a0a4 Merge "Optimize performance of very hot code paths in CommentUtils" 2023-10-30 18:07:58 +00:00
thiemowmde 1491b47b12 Improve performance of CommentParser::getUsernameFromLink
I was curious why running the CommentParserTest takes so long. I
found this is one of the bottlenecks because it's called so often,
but many link titles that are parsed as user names turn out to be
something else. This little hack speeds up the test by 15% and has
probably a similar impact in production scenarios.

Change-Id: I5a0b3a49ba5793c8a345baaa7118fed500c082b6
2023-10-30 17:59:46 +01:00
thiemowmde bbe5bed02d Optimize performance of very hot code paths in CommentUtils
I was curious why running some of the PHPUnit tests in this code base
takes so long. While I could not spot an obvious bottleneck I found
a lot of code that is extremely hot, e.g. called a hundred thousand
times. A few obvious optimizations are possible in this code, e.g.
not calling the surprisingly expensive DOMCompat::getClassList
multiple times.

Change-Id: If22bbc1aedd2c36db1ab2343de5737009050b7bb
2023-10-30 17:29:32 +01:00
Ed Sanders 7ab38effce Fix vertical position of [(un)subscribe] links
Bug: T349866
Change-Id: Iaa740ce89c294dbd5274fc505ac6f61b00333eae
2023-10-30 16:03:55 +00:00
jenkins-bot 30875d1ac2 Merge "Remove old -ellipsisButton CSS class" 2023-10-30 10:25:51 +00:00
thiemowmde b2dd787039 Remove obsolete check for window.history.replaceState
I think we can remove this by now with the current browser support
matrix.

Change-Id: I6fc7b9c3d9b13ab920da75dd35ca8fdf01a318ee
2023-10-30 09:43:46 +01:00
Ed Sanders f2265f918f highlighter: Show a different message for missing heading links
These are not widely used anywhere, but linking to an #h- heading ID
that doesn't exist should say "topic not found" rather than
"comment not found".

Change-Id: Ifd269cc72e640f36431f85c751874ca06229ba9f
2023-10-28 15:28:30 +01:00
jenkins-bot ee8a898f69 Merge "Use VE shortcut-generation code for replywidget button labels" 2023-10-26 16:47:18 +00:00
David Lynch 0b64a1a52c Use VE shortcut-generation code for replywidget button labels
Now that the base ReplyWidget depends on VE.

Change-Id: I6bd2bf1b0867a0aeae8e94e35a2e765cad3e72f4
2023-10-26 16:29:08 +00:00
Volker E 728db90e88 styles: Use new forward-facing breakpoint tokens
Replacing legacy breakpoint variables with new Codex
design system `@max-width-breakpoint-*` tokens.

Bug: T331403
Change-Id: Ib1ff07a7692948b1fd22e9620c132133d392dab9
2023-10-24 23:43:06 -07:00
David Lynch e638c8a9ea ReplyWidget: don't show the enter hint if the reply button is disabled
Saying that ctrl-enter would submit the post at a moment when it
wouldn't may be confusing to users.

Bug: T326500
Change-Id: Ib513c8a6c36a0f607cc2034fc830dbfcdf10f554
2023-10-24 11:56:14 -05:00
David Lynch 2b69ceca51 ReplyWidget: don't show the enter hint if the target was in bodyWrapper
This stops VE UI inspectors from triggering the hint.

Bug: T326500
Change-Id: I3f62a3eb539d87cdee9d3587f9f10317ae0802bc
2023-10-24 11:55:16 -05:00
Ed Sanders 7aee0a48f0 highlighter: Replace "comment" with "thread item" in several places
We support highlighter HeadingItem's despite saying CommentItem
in a bunch of places.

Also potentially show the "not found" notification if the URL hash
starts "h-" as well as "c-".

Change-Id: I51894902bfca405bbdec89806bb9c1d76e0b40ef
2023-10-21 15:54:25 +01:00
Ed Sanders c68081ada5 Remove old -ellipsisButton CSS class
Change-Id: I7e6fbcf6f81e9c94b7099824eaa94de34819bf70
2023-10-18 22:34:33 +01:00
Kosta Harlan 36c0b20c66 overflow menu: Display next to comments on desktop
Why:

- Per T338534, we want to display the overflow menu next to topics and
  comments. Supporting topic-level placement is a little more
  complicated, so just go with comments for now.

What:

- Rework the is-mobile check to allow the code to run on desktop/mobile,
  while excluding topic-level replacement on desktop (T342627)

Bug: T338534
Bug: T342625
Change-Id: I520c377120e16aa3a6fedcc8c39075958a942e4c
2023-10-18 11:37:18 +00:00
jenkins-bot 2cca063357 Merge "Distinguish between MobileFrontend and Minerva" 2023-10-17 20:24:28 +00:00
jenkins-bot 4729a2757d Merge "Fix topic subscription icon in Minerva" 2023-10-17 19:49:34 +00:00
jenkins-bot eca326ede5 Merge "Support ignoring "mw-notalk" before/after/between comments" 2023-10-13 17:44:20 +00:00
jenkins-bot f669b6365d Merge "Don't clear comment highlight when clicking on another link" 2023-10-13 17:44:19 +00:00
jenkins-bot 0b7b34616f Merge "Avoid a Chrome bug causing text to be cut off in topic subject input" 2023-10-13 17:40:07 +00:00
Ed Sanders 81e690df8c Distinguish between MobileFrontend and Minerva
Change-Id: I7490190a6ddd3def502335b6dc2ec0d39477256b
2023-10-13 14:39:17 +01:00
Ed Sanders 2095c5113b Fix topic subscription icon in Minerva
Change-Id: Ic8940696fcabd677e896aeeb7c14cdc2a5df1382
2023-10-13 14:23:10 +01:00