Commit graph

3616 commits

Author SHA1 Message Date
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
Translation updater bot f99300440d Localisation updates from https://translatewiki.net.
Change-Id: Ie9a30067c6db120091803ec642646ed5baf5be71
2023-10-17 09:34:12 +02:00
Translation updater bot f4c86a56e5 Localisation updates from https://translatewiki.net.
Change-Id: Ib2b2eee874a5da732f06d44d1fd2e369f59a1122
2023-10-16 09:15:40 +02: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 df863ad3b5 Merge "Fix truncating multibyte chars in section names" 2023-10-13 17:42:53 +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
jenkins-bot eb6071816a Merge "Merge ReplyWidget[Plain/Visual] modules" 2023-10-13 16:22:50 +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 7b336049d0
CommentFormatterTest: OutputPage returns a User, not UserIdentity
Why:

- Code that interacts with DiscussionTools CommentFormatterTest may
  expect a User object, instead of a UserIdentity, because OutputPage is
  typed to return a User object

What:

- Change the mock to return User, not UserIdentity

Change-Id: I1354f5f8132fd0656f274cdf4f17cde7f93d9042
2023-10-13 09:17:39 +02:00
Translation updater bot 0fff06e6c6 Localisation updates from https://translatewiki.net.
Change-Id: I8c87055c1c3c56b48f3d6b85ced5e9426ae1ac68
2023-10-13 08:55:50 +02:00
jenkins-bot 67cb2ee5b6 Merge "overflow menu: Factor code into its own file" 2023-10-12 17:37:16 +00:00
jenkins-bot b4a95a6b5a Merge "overflow menu: Only show edit button in mobile" 2023-10-12 17:33:54 +00:00
jenkins-bot d92515b731 Merge "OverflowMenus: Don't pass 'editable' data to reply button overflows" 2023-10-12 15:26:02 +00:00
Translation updater bot b7a31aa5e5 Localisation updates from https://translatewiki.net.
Change-Id: Ib18fa08fe82b1bcdde650cd96b88f99e6c9a9316
2023-10-12 09:29:08 +02: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
Kosta Harlan ead2baf0f1 overflow menu: Only show edit button in mobile
Why:

- The button should only display for Minerva

What:

- Consult the skin name before adding the "Edit" button to the menu

Bug: T342251
Change-Id: I52cf2ca0663a4de0ee7add82910e745bcabf1c5f
2023-10-12 06:03:03 +00:00
Ed Sanders 52db0af5cf OverflowMenus: Don't pass 'editable' data to reply button overflows
'editable' refers to the section being editable, and is only for
use by heading items, not individual comments.

Change-Id: I3fb5841609c40a928071cea8987cf035ade464c2
2023-10-11 16:55:46 +01:00
Translation updater bot fb8aaca7a7 Localisation updates from https://translatewiki.net.
Change-Id: I008d70230f9d79b3895666d4e1cc4c442dcdbbac
2023-10-11 08:45:22 +02:00
Translation updater bot 7c5d3db814 Localisation updates from https://translatewiki.net.
Change-Id: I61f76bfeff070c0754e462b5ab4d2d3766aa2d36
2023-10-10 08:51:57 +02:00
Kosta Harlan 4c7ba1ba0e
CommentFormatterTest: Mock getConfig method
Why:

- Tests may invoke code that calls `getConfig` on the ContextSource

What:

- Mock the `getConfig` method

Follows-Up: I07b312b8c00f9b5d20e285874ed0a0153949dd18
Change-Id: I5c5b0d7cef24af108aeab461ba06b533eae4b739
2023-10-09 21:37:53 +02:00
jenkins-bot f9f9bf11f3 Merge "Always pass whole OutputPage (as IContextSource) to postprocess functions" 2023-10-09 18:05:54 +00:00
jenkins-bot db961ecd24 Merge "Put mobile ellipsis button menu in an overlay" 2023-10-09 17:27:22 +00:00
jenkins-bot f8b757bcae Merge "ThreadItemStore: Fix rows with itr_items_id=0 corrupted by T339882" 2023-10-09 15:34:55 +00:00
Ed Sanders 4447b6d201 Always pass whole OutputPage (as IContextSource) to postprocess functions
Change-Id: I07b312b8c00f9b5d20e285874ed0a0153949dd18
2023-10-09 15:41:28 +01:00
Translation updater bot 97d385e948 Localisation updates from https://translatewiki.net.
Change-Id: Ibd1d3cabf9f5ffd3e4e884282568eb43364badee
2023-10-09 08:55:50 +02: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 eef701da1e Merge "Add null check for str_starts_with" 2023-10-06 19:37:12 +00:00
Umherirrender 3aadcace2b Add null check for str_starts_with
Only needed for phan, under php8.1 this internal
function is deprecated about null.
The property $subscriptionName is not null when $subscriptionTitle is
not null and current code is safe, but phan cannot see the dependency
between both properties

Change-Id: I9e67309ec25a70c5de91d7f3e8f18447f205a4e4
2023-10-06 18:49:28 +02:00
jenkins-bot 0f1e29a76a Merge "overflow menu: Display menu next to comments on mobile" 2023-10-06 14:49:05 +00:00
jenkins-bot 2c920d2902 Merge "overflow menu: Add hooks for registering and interacting with items" 2023-10-06 14:48:15 +00:00
Translation updater bot 893846be65 Localisation updates from https://translatewiki.net.
Change-Id: Id8d4080125b73cdbdc4d308da0e5a39499c235e3
2023-10-06 09:19:33 +02:00
Kosta Harlan 351891a063 overflow menu: Display menu next to comments on mobile
Why:

- We want to provide contextual actions adjacent to comments, not just
  topic headings.

What:

- Consolidate the logic for embedding the overflow menu button HTML into
  a function, and add this for both topic and comment items.
- For this patch, this is done only for mobile; in a follow-up patch, we
  can add support for desktop
- This doesn't use a feature flag as 1) no one is implementing the
  DiscussionTools hook yet, 2) the 'edit' menu item is disabled at the
  comment level. Merging this change would be a no-op until an extension
  implements the DiscussionToolsAddOverflowMenuItemsHook.

Bug: T342251
Change-Id: I15a151f151e2fa04398876b559d93d45c42f6ef6
2023-10-05 15:50:38 +01: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
jenkins-bot c21ee0057f Merge "Fix mobile section expand icon size after changes in MobileFrontend" 2023-10-05 09:20:31 +00: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
Translation updater bot f01ff88a79 Localisation updates from https://translatewiki.net.
Change-Id: If3e0a39fce3e8020b4ed06ff90996c7092e87051
2023-10-05 09:11:35 +02: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
Translation updater bot 912a4b2245 Localisation updates from https://translatewiki.net.
Change-Id: Iabb6c5d70e3743e547884d834c478c2ef01eddd1
2023-10-04 09:08:02 +02: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