Remove "Read as wiki page" feature on mobile talk pages

Bug: T280417
Change-Id: I8f24531cbe1b6bb3f434c91a9523b0a11110d8e6
This commit is contained in:
Bartosz Dziewoński 2024-01-04 19:33:42 +01:00
parent 6ff126eab5
commit 91d7cdb704
5 changed files with 3 additions and 48 deletions

View file

@ -157,7 +157,6 @@
"discussiontools-topicsubscription-notify-subscribed-title",
"discussiontools-topicsubscription-notify-unsubscribed-body",
"discussiontools-topicsubscription-notify-unsubscribed-title",
"minerva-talk-full-page",
"pagetitle",
"skin-view-edit"
],

View file

@ -195,7 +195,6 @@
"echo-category-title-dt-subscription-archiving": "Talk page {{PLURAL:$1|archiving}}",
"echo-pref-tooltip-dt-subscription": "Notify me when someone posts a new comment in a topic I am {{GENDER:|subscribed}} to.",
"echo-pref-tooltip-dt-subscription-archiving": "Notify me when a topic I am {{GENDER:|subscribed}} to is archived or removed from a page, or if notifications about new comments posted in that topic can't be sent for other reasons.",
"minerva-talk-full-page": "Read as wiki page",
"discussiontools-comments-before-first-heading-category": "-",
"discussiontools-comments-before-first-heading-category-desc": "The discussion page contains comments in the lede section (before first heading). This may cause the lede or the comments to be displayed incorrectly, especially in the mobile version and in mobile apps.",
"tag-discussiontools": "-",

View file

@ -209,7 +209,6 @@
"echo-category-title-dt-subscription-archiving": "{{doc-echo-category-title|tooltip=Echo-pref-tooltip-dt-subscription-archiving}}",
"echo-pref-tooltip-dt-subscription": "{{doc-echo-pref-tooltip|title=Echo-category-title-dt-subscription}}",
"echo-pref-tooltip-dt-subscription-archiving": "{{doc-echo-pref-tooltip|title=Echo-category-title-dt-subscription-archiving}}",
"minerva-talk-full-page": "Used as label for link to show the full talk page.",
"discussiontools-comments-before-first-heading-category": "{{ignored}}\n{{tracking category name}}",
"discussiontools-comments-before-first-heading-category-desc": "Tracking category description.",
"tag-discussiontools": "{{ignored}}\nShort description of the discussiontools tag.\n\nShown on lists of changes (history, recentchanges, etc.) for each edit made using DiscussionTools.\n\nSee also:\n* {{msg-mw|Tag-discussiontools-description}}\n{{Related|tag-discussiontools}}",

View file

@ -287,7 +287,6 @@ h1, h2, h3, h4, h5, h6 {
// Visual enhancements disabled
.ext-discussiontools-init-section-bar,
.ext-discussiontools-init-replybutton.oo-ui-buttonElement,
.ext-discussiontools-init-readAsWikiPage,
.ext-discussiontools-init-pageframe-latestcomment,
.ext-discussiontools-init-sidebar-meta {
display: none;
@ -753,9 +752,7 @@ h1, h2, h3, h4, h5, h6 {
}
// DiscussionTools automatically enables most features on mobile.
// When we detect that it's enabled, hide the lede section, and show a "Read as wiki page" button
// to reveal it.
// The button will disable all DT features by removing feature CSS classes.
// When we detect that it's enabled, hide the lede section.
// stylelint-disable-next-line selector-class-pattern
.mw-mf.ns-talk.ext-discussiontools-replytool-enabled {
&.ext-discussiontools-init-lede-hidden {
@ -775,10 +772,6 @@ h1, h2, h3, h4, h5, h6 {
}
}
.ext-discussiontools-init-readAsWikiPage {
display: block;
}
// Always hide the table of content. This is usually hidden by the mf-section-0 rules,
// but can sometimes appear elsewhere (e.g in the lede section overlay)
// stylelint-disable-next-line selector-class-pattern
@ -815,11 +808,6 @@ h1, h2, h3, h4, h5, h6 {
}
}
.ext-discussiontools-init-readAsWikiPage {
/* Not sticky per T309889 */
.minerva-footer-button();
}
.ext-discussiontools-init-new-topic {
.minerva-footer-button();
position: sticky;
@ -859,24 +847,11 @@ h1, h2, h3, h4, h5, h6 {
}
// Tweak to prevent our footer buttons from overlapping Minerva skin elements (T328452).
// In cases where the "Read as wiki page" button is not shown:
.client-nojs .ext-discussiontools-init-new-topic,
.ext-discussiontools-init-new-topic-pinned.ext-discussiontools-init-button-notFlush {
margin-bottom: 32px;
}
// In cases where the "Read as wiki page" button is shown:
// stylelint-disable-next-line selector-class-pattern
.client-js .mw-mf.ns-talk.ext-discussiontools-replytool-enabled {
.ext-discussiontools-init-new-topic-pinned.ext-discussiontools-init-button-notFlush {
margin-bottom: -32px;
}
.ext-discussiontools-init-readAsWikiPage.ext-discussiontools-init-button-notFlush {
margin-bottom: 32px;
}
}
.ext-discussiontools-init-lede-button-container {
margin: 0.5em 0;

View file

@ -1,4 +1,4 @@
var newTopicButton, $readAsWikiPage, ledeSectionDialog;
var newTopicButton, ledeSectionDialog;
var viewportScrollContainer = null;
var wasKeyboardOpen = null;
var initialClientHeight = null;
@ -110,34 +110,17 @@ function init( $container ) {
wasScrollDown = isScrollDown;
}, 200 ), { passive: true } );
}
if ( !$readAsWikiPage ) {
// Read as wiki page button, copied from old MobileFrontend/Minerva feature (removed in T319145)
$readAsWikiPage = $( '<button>' )
.addClass( 'ext-discussiontools-init-readAsWikiPage' )
.attr( 'data-event-name', 'talkpage.readAsWiki' )
.text( mw.message( 'minerva-talk-full-page' ).text() )
.on( 'click', function () {
$( document.body ).removeClass( 'ext-discussiontools-visualenhancements-enabled ext-discussiontools-replytool-enabled' );
} );
}
/* eslint-disable no-jquery/no-global-selector */
if ( newTopicButton ) {
$newTopicWrapper.after( $readAsWikiPage );
} else {
$( '#mw-content-text' ).append( $readAsWikiPage );
}
// Tweak to prevent our footer buttons from overlapping Minerva skin elements (T328452).
// TODO: It would be more elegant to do this in just CSS somehow.
// BEWARE: I have wasted 4 hours here trying to make that happen. The elements are not nested in a
// helpful way, and moving them around tends to break the stickiness of the "Add topic" button.
/* eslint-disable no-jquery/no-global-selector */
if (
$( '.catlinks' ).filter( '[data-mw="interface"]' ).length ||
$( '#page-secondary-actions' ).children().length ||
$( '.return-link' ).length
) {
$readAsWikiPage.addClass( 'ext-discussiontools-init-button-notFlush' );
$newTopicWrapper.addClass( 'ext-discussiontools-init-button-notFlush' );
}
/* eslint-enable no-jquery/no-global-selector */