Commit graph

1361 commits

Author SHA1 Message Date
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
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
Ed Sanders 185396a8e5 Merge ReplyWidget[Plain/Visual] modules
Only a fraction of a percentage of users are still using
ReplyWidgetPlain, and keeping these modules separate:
* Adds to code complexity
* Adds to ResourceLoader module bloat
* Causes bugs when we use VE dependencies in the
  core ReplyWidget class

The disadvantage is that ReplyWidgetPlain will now be
loading all of the VE dependencies, but this will make
switching to visual mode faster.

Bug: T348834
Change-Id: Ifb0cfd43fdab761c3321ad01fa9fefca26473f86
2023-10-13 11:58:12 +01:00
Kosta Harlan 60bcf84dbb overflow menu: Factor code into its own file
Why:

- We'll reuse this functionality on desktop, so it makes sense to
  extract it to a standalone file

What:

- Remove relevant code from mobile.js and place in overflowMenu.js

Bug: T342251
Change-Id: I98f1253e8d6db31c1f71203b50911b6f1b92778b
2023-10-12 06:03:11 +00:00
Bartosz Dziewoński edc28d3d7c Put mobile ellipsis button menu in an overlay
This avoids unexpected interactions where choosing an option in the
menu behaves like tapping the heading.

Bug: T348217
Change-Id: I7c38bb51fa99606e708d3ff5a2f3d6101dec2fae
2023-10-07 03:05:23 +02:00
Bartosz Dziewoński f1edc47050 Support ignoring "mw-notalk" before/after/between comments
Since 92f5cfd8 we support "mw-notalk" to suppressing comment detection
in pages or sections.

Until now, it only worked when the comment timestamp was surrounded by
a marked element. However, when a marked element was directly adjacent
to a comment, it would sometimes become a part of the comment range.
This can no longer happen now.

Existing use cases for this were the {{outdent}} and {{tracked}}
templates, which we handle specially since 50ad5bb2 and ddd391b6.
It's a bit ugly to hardcode specific templates like that, and this
provides a better solution for the future. The added test case
displays some other potential uses.

Bug: T324132
Change-Id: I7ffd299ef5957b35da8d01f9a0ed5a7a9a78be83
2023-10-07 00:32:27 +00:00
jenkins-bot 2c920d2902 Merge "overflow menu: Add hooks for registering and interacting with items" 2023-10-06 14:48:15 +00:00
Kosta Harlan c6c7dd2fb0 overflow menu: Add hooks for registering and interacting with items
Why:

- We want to allow extensions to register interactive menu items in the
  overflow menu.

What:

- Create a PHP hook to allow extensions to provide menu items
  for rendering in the overflow menu
  - The hook allows for registering resource loader modules required by
    the menu item
  - The hook passes in some contextual information, like the thread
    item data, context source object, and if the page is editable
- Create a JS hook that fires when a user selects one of the menu items
- Example implementation: Ie9afbedb4f24cbd75eb48bb21dc9f6d8d732d853

Misc:

- Remove b/c code that existed to handle a transitional period where
  JSON encoded overflow menu data did not necessarily exist in the
  parser cache
- Rename code instances of ellipsis button / data / menu to refer to
  "overflow menu"
  - Some renames will have to wait until parser cache is updated; these
    are noted with TODOs

Bug: T342251
Change-Id: I5f2a51791f8ba7619d1399a4b93111e9bb44e172
2023-10-05 15:50:33 +01:00
Ed Sanders 3b9128bdff Permalinks: Fix scroll restoration on mobile
Change-Id: Icc60f089764a31f352fc89982d832653b7f14e07
2023-10-05 14:13:55 +01:00
jenkins-bot f10e95fccb Merge "Permalinks: Factor out copyLink clipboard functionality" 2023-10-05 10:37:34 +00:00
jenkins-bot 4bd631a4e7 Merge "Factor out permalink code into separate file" 2023-10-05 10:33:38 +00:00
Ed Sanders d4819367aa Permalinks: Factor out copyLink clipboard functionality
Change-Id: I8092e8f831b67a32b652a5cb88808f6e463d9b4c
2023-10-05 11:04:01 +01:00
Ed Sanders 58cb277ced Factor out permalink code into separate file
Change-Id: Ib56a0b9766529f517ae8c5f743f891b06f3cf690
2023-10-05 10:55:00 +01:00
Bartosz Dziewoński fe07a8914e Fix mobile section expand icon size after changes in MobileFrontend
Reverts I0af2707141 due to I5ca0870862f5.

Change-Id: Ib9a0a38774b85b2b80fbac7a0d9b81b7045c9e59
2023-10-05 09:15:00 +00:00
David Lynch 2b3f430ad2 Mobile reply buttons were overlapping the expanded advanced options
Follow-up to 5b6018b244 which put an
element between the advanced box and the actions wrapper. We can have
the rule use the subsequent sibling selector rather than direct sibling.

Bug: T348143
Change-Id: Ibe1b25bf15d320b17601a0d9471d4b7e6ca4ef19
2023-10-04 10:20:45 -05:00
Bartosz Dziewoński d27d9ab7b0 Don't clear comment highlight when clicking on another link
When the user clicks anywhere on the page after following a permalink
(e.g. from a notification), we would remove the comment highlight and
the hash from the URL. Don't do it if the click is on another link:
this avoids inserting extra history entries when clicking on several
permalinks in a row.

Change-Id: I5d77dae4608f74b2be09b9cb92e39a8662529a9f
2023-10-03 22:07:12 +02:00
jenkins-bot 364cf45156 Merge "Permalinks: Don't prevent default when clicking links" 2023-10-03 14:50:29 +00:00
jenkins-bot a475754d68 Merge "Permalinks: Replace hard-coded notification with i18n string" 2023-10-03 14:49:01 +00:00
jenkins-bot 0e6ca97067 Merge "Show a hint for ctrl-enter for comment submission if just enter is used" 2023-10-03 14:41:11 +00:00
Ed Sanders d24ef5396a Permalinks: Don't prevent default when clicking links
The gadget version doesn't do this, and we already have code
to prevent your scroll position from changing.

Allowing default rewrites the address bar and highlights the
copied comment.

Change-Id: I9aec2b2be7498a268d7b2eb3d2b4a4f76e658042
2023-10-03 15:32:30 +01:00
Ed Sanders 8405305f2a Permalinks: Replace hard-coded notification with i18n string
Change-Id: Id68006b67a055c32e2ecccdac94a37e03c0d722e
2023-10-03 15:31:48 +01:00
David Lynch 5b6018b244 Show a hint for ctrl-enter for comment submission if just enter is used
Bug: T326500
Change-Id: I7dc0e2ed7ccc101e896c18969b1f7d679150190b
2023-10-03 09:04:59 -05:00
Ed Sanders b63884f561 Turn comment timestamps into permalinks
Bug: T275729
Change-Id: Ica9cfd9743a67fce170e8b078016fa79bf6fbb84
2023-10-02 14:53:47 +01:00
jenkins-bot 82bab7a4e6 Merge "Show new topics subscription button on history pages" 2023-09-26 17:40:55 +00:00
jenkins-bot ae2f2dcde8 Merge "topicsubscriptions.js: Factor out initNewTopicsSubscription and expose" 2023-09-26 17:40:54 +00:00
Ed Sanders a77fd29c67 Fix visibility of preview of new topic on mobile
Bug: T335220
Change-Id: I048e73c7579d822c28e9c648c26401c00b2c471b
2023-09-25 18:17:15 +00:00
jenkins-bot 50811cf28c Merge "Fix interaction of "Add topic" button with categories" 2023-09-18 16:42:35 +00:00
Bartosz Dziewoński 0c1ec851bf Fix interaction of "Add topic" button with categories
For real this time. I hope.

Follow-up to 52de4b0b1b.

Bug: T335219
Change-Id: I0f073cf660f221c1e996f7f46d161316e0b0b79e
2023-09-17 23:49:14 +02:00
Ed Sanders 2aafd08c4b Require CTRL+Enter to submit a comment, regardless of the input
Bug: T326500
Depends-On: I408adfe2b04f0d0a3e819e615e0db91c85997a9c
Change-Id: I5a4c482348b5e7dd9a4780bc4aedd8253a82ca72
2023-09-17 20:18:05 +00:00
Bartosz Dziewoński 461809a060 Avoid a Chrome bug causing text to be cut off in topic subject input
Bug: T345489
Change-Id: If153da43bf3dc5d6d3f78aee75c3765381acad50
2023-09-06 00:45:32 +02:00