Page MenuHomePhabricator

Deprecate printable version mode
Closed, ResolvedPublic3 Estimated Story Points

Assigned To
Authored By
TheDJ
Jun 15 2017, 11:40 AM
Referenced Files
F32198125: image.png
Aug 28 2020, 3:17 AM
F32198131: Aug-27-2020 20-09-37.mp4.gif
Aug 28 2020, 3:17 AM
F32198133: en.wikipedia.org_wiki_Dido_Sotiriou(iPad).png
Aug 28 2020, 3:17 AM
F32198128: Aug-27-2020 20-07-32.mp4.gif
Aug 28 2020, 3:17 AM
F31947934: bs_win7_IE_9.0.jpg
Jul 25 2020, 4:42 PM
F31947938: Screen Shot 2020-07-25 at 9.39.18 AM.png
Jul 25 2020, 4:42 PM
F31947936: Screen Shot 2020-07-25 at 9.37.26 AM.png
Jul 25 2020, 4:42 PM
F31947928: Screen Shot 2020-07-25 at 9.15.29 AM.png
Jul 25 2020, 4:42 PM
Tokens
"Dislike" token, awarded by AVRS."Like" token, awarded by Jdlrobson."Orange Medal" token, awarded by Krinkle.

Description

Printable version had one main purpose: Support browsers that didn't support media queries yet.
That purpose is no longer relevant, as the last browser (IE 5.5/6.0) that required it, is no longer supported.

A secondary purpose has been identified, which was that people didn't really know how to print a web page (ctrl-p or file->print). To slightly accommodate that use case, while not relying on printable version, this link was recently adapted to trigger the print dialog using Javascript.

A 3rd use has been to check how a page will look in print. Many browser's web inspectors have a mode to do this, and for the general public, most operating systems provide a "print preview" feature.

As the printable version feature is not well maintained, has a few quirks and adds complexity that is avoidable, I suggest we start fully removing support for printable version.

Acceptance criteria

  • Deprecate printableversion (per 1.35)

QA Results - Beta

QA Results - Prod

Sign off

Removal continues in T259141: Remove printableversion mode

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Krinkle lowered the priority of this task from High to Medium.Aug 23 2019, 2:11 PM

The ResourceLoader-code that existed for printable and handheld parmeters looked unused, but I was wrong. It is used in the following way:

  • Sidebar links to "Printable view" (example: index.php?title…&printable=yes)
  • OutputPage arbirtrarily forwards printable parameter to ResourceLoader for use in any of its embedded load.php URLs.
  • There is nothing in ResourceLoader or ResourceLoaderContext that reads or varies its logic by this in any way. Hence my assumption that it is only a Skin-level thing.
  • But behold, when ResourceLoader::makeModuleResponse is concatenating the result of various modules in the main styles-only request, there is a call to OutputPage::transformCssMedia which gets its hands on the internal RL state (after reading and processing of LESS/CSS, but before concatenating), and changes any top-level media block (those defined in Resources.php/skin.json) for "print" to "" so that it applies on screen, and discards any top-level block for "only screen".
    • It does this based on reading out wgRequest directly, thus bypassing ResourceLoaderContext, but relying on wgRequest working inside a load.php request, kind of.

Pratically speaking, this means:

  • mediawiki.toc.styles is loaded in a way where its screen.less is removed and print.css unwrapped in its stead.
  • mediawiki.page.gallery.styles is loaded with its print.css unwrapped.
  • ResourceLoaderSkinModule loads legacy-print unwrapped and omits most of its other stuff.

That's pretty much it. It does potentially have other random impact depending on how extensions have written their styles. I imagine they generally don't have print.css as a separate extension.json entry with "print" as media key though, so I assume the above is the 99% that matters.

What are the blockers for deprecating this in 1.35?
This is causing some real problems in the desktop improvements project - the new Vector breaks in this mode (see T253842) and we currently don't have plans to fix that.

Change 610323 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/core@master] Deprecate printableversion=yes

https://gerrit.wikimedia.org/r/610323

I propose adding a banner like so:

Screen Shot 2020-07-08 at 9.58.03 AM.png (1×1 px, 122 KB)

and changing the sidebar link as part of the 1.35 release.

As we update Vector we have no interest in fixing the following:

Screen Shot 2020-07-08 at 9.58.45 AM.png (1×1 px, 202 KB)

Given this is a performance recommendation, I think now is the time to deprecate this.

Jdlrobson renamed this task from Remove printable version mode to Deprecate and remove printable version mode.Jul 8 2020, 9:33 PM
Jdlrobson updated the task description. (Show Details)
Jdlrobson added a subscriber: ovasileva.

@ovasileva super sorry for the late sprint entry but given my recent analysis of the print mode in T253842, I think it's essential we set the intention that this is not supported and aim for a deprecation in for 1.35 (which is cut on 14 July 2020 at 02:00 UTC.)

@ovasileva super sorry for the late sprint entry but given my recent analysis of the print mode in T253842, I think it's essential we set the intention that this is not supported and aim for a deprecation in for 1.35 (which is cut on 14 July 2020 at 02:00 UTC.)

That sounds good, but let me discuss it with Szymon as well - will get back to you later today

@Jdlrobson - does this mean that the link would still exist but it would just trigger the browser print (i.e. all we're removing is the page like https://en.wikipedia.org/w/index.php?title=1937_Fox_vault_fire&printable=yes)

@Jdlrobson - does this mean that the link would still exist but it would just trigger the browser print (i.e. all we're removing is the page like https://en.wikipedia.org/w/index.php?title=1937_Fox_vault_fire&printable=yes)

The link would exist yes and point to browser print. If there is no JavaScript it will be hidden. The page would also exist but have a banner saying it is no longer supported.

@Jdlrobson - does this mean that the link would still exist but it would just trigger the browser print (i.e. all we're removing is the page like https://en.wikipedia.org/w/index.php?title=1937_Fox_vault_fire&printable=yes)

Note that the "Printable version" link already triggers the browser print in production today.

The printable=yet URL comes in when e.g. we're in Grade C mode, or when one chooses to share the link or open it in a new tab. Those capabilities would no longer be supported.

Jdlrobson raised the priority of this task from Medium to High.Jul 13 2020, 9:20 PM

Branch cut is tomorrow so reflecting reality here.

Blocked on review from @Krinkle. I will backport when that's done.

ovasileva set the point value for this task to 3.Jul 15 2020, 4:26 PM

Change 613171 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/core@REL1_35] Deprecate printableversion=yes

https://gerrit.wikimedia.org/r/613171

Change 610323 merged by jenkins-bot:
[mediawiki/core@master] Deprecate printableversion=yes

https://gerrit.wikimedia.org/r/610323

Change 613171 merged by jenkins-bot:
[mediawiki/core@REL1_35] Deprecate printableversion=yes

https://gerrit.wikimedia.org/r/613171

Edtadros subscribed.

Test Result - Beta

Status: ❓ Need More Info
Environment: beta
OS: macOS Catalina
Browser: Chrome
Device: MBP
Emulated Device: NA
Test Artifact(s):

QA steps

❓ AC1: The printable=yes URL comes in when e.g. we're in Grade C mode. The page would also exist but have a banner saying it is no longer supported.
@Jdlrobson, I tried a few Grade C browsers. I could not get the "Printable version" link to appear even with Javascript enabled. Is this as expected? Here is IE 9

bs_win7_IE_9.0.jpg (1×1 px, 85 KB)

✅ AC2: or when one chooses to share the link or open it in a new tab. The page would also exist but have a banner saying it is no longer supported.
Screen Shot 2020-07-25 at 9.15.29 AM.png (1×1 px, 169 KB)

✅ AC3: The link would exist yes and point to browser print.
Screen Shot 2020-07-25 at 9.37.26 AM.png (1×1 px, 215 KB)

✅ AC4: If there is no JavaScript it will be hidden.
Screen Shot 2020-07-25 at 9.39.18 AM.png (1×1 px, 156 KB)

@Jdlrobson, I tried a few Grade C browsers. I could not get the "Printable version" link to appear even with Javascript enabled. Is this as expected? Here is IE 9

Yep expected! If there's no link showing that's good

The bits of this that need to be done by 1.35 are now done (and merged into REL1_35), right? In that case, maybe let's drop the tag saying this is a blocker for 1.35 for the rest of the work?

Jdlrobson renamed this task from Deprecate and remove printable version mode to Deprecate printable version mode.Jul 29 2020, 3:30 PM
Jdlrobson awarded a token.
Jdlrobson updated the task description. (Show Details)

Made a new task for the actual removal since we're doing some QA right now. T259141

Test Result - Beta

Status: ✅ PASS
Environment: beta
OS: macOS Catalina
Browser: Chrome
Device: MBP
Emulated Device: NA
Test Artifact(s):

QA steps

✅ AC1: The printable=yes URL comes in when e.g. we're in Grade C mode. The page would also exist but have a banner saying it is no longer supported.
Here is IE 9

bs_win7_IE_9.0.jpg (1×1 px, 85 KB)

Per T167956#6337927 the missing "Printable Version" link is expected behavior.

Test Result - Prod

Status: ✅ PASS
Environment: enwiki
OS: macOS Catalina
Browser: Chrome
Device: MBP
Emulated Device: NA
Test Artifact(s):

QA steps

✅ AC1: The printable=yes URL comes in when e.g. we're in Grade C mode. The page would also exist but have a banner saying it is no longer supported.
On IE9 The link is not present as expected. When adding the URL parameter above, it displays the banner.

image.png (721×923 px, 397 KB)

✅ AC2: or when one chooses to share the link or open it in a new tab. The page would also exist but have a banner saying it is no longer supported.
Aug-27-2020 20-07-32.mp4.gif (1×1 px, 3 MB)

✅ AC3: The link would exist yes and point to browser print.
Aug-27-2020 20-09-37.mp4.gif (906×1 px, 866 KB)

✅ AC4: If there is no JavaScript it will be hidden.
en.wikipedia.org_wiki_Dido_Sotiriou(iPad).png (2×1 px, 873 KB)