Page MenuHomePhabricator

VisualEditor: Surface should respect the default state of collapseable templates
Open, LowPublic

Description

A user on English Wikipedia requests that templates such as navigation boxes that display as collapsed by default when viewing should display as collapsed by default when editing.

"Currently, navigation boxes are always uncollapsed when editing. This can be quite annoying when having to deal with big ones like {{The Beatles}}, e.g. on "I'm a Loser", also it might be confusing editors into believing that this part of a page can easily be edited."


Version: unspecified
Severity: minor

Details

Reference
bz51664

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:48 AM
bzimport set Reference to bz51664.

First of all, this requires fixes for bug 51565 to be deployed, and then we need to fix the NavFrame and CollapsibleTable scripts in en:wp:MediaWiki:Common.js to use the same hooks.

(In reply to comment #1)

First of all, this requires fixes for bug 51565 to be deployed, and then we
need to fix the NavFrame and CollapsibleTable scripts in
en:wp:MediaWiki:Common.js to use the same hooks.

That change has been made on enwp by TheDJ/hartman (cc'd)

https://en.wikipedia.org/w/index.php?title=MediaWiki:Common.js&diff=570114240&oldid=569893356

The templates are yet not collapsing; is there more development needed in VE product or in Common.js ?

I think 'collapse' need more special handling in VE (possibly even in parsoid); in order to be WYSIWYG.

  1. The user can change the collapse state of templates in the VE dialog editor, and that change should be reflected in the VE after the changes are applied.
  2. The user should be able to collapse and uncollapse a collapse-able template in order

2.1 to visualise how the page will look in each mode
2.2 hide/unhide collapse-able templates that are consuming precious screen real estate (this should be a separate enhancement)

Perhaps this feature should be dependent on bug 30352.

Created attachment 13417
Related render problems

This is a related problem, which would not be noticable if it was not for this bug.

https://en.wikipedia.org/w/index.php?title=Anarchism&veaction=edit

When in normal view mode (not VE), expand all of those sidebars
A large area of whitespace opens up above "Internal issues and debates", and the images appear there.

In the VE, that whitespace is filled with text, which causes the images to be pushed further down in the content, eventually slipping into the References section, and on Firefox the images even overlaps the References section.

I haven't investigated what is causing the VE vs non-VE rendering differences, but collapse is clearly the reason this rendering difference is a significant problem that all VE users face, rather than a minor glitch that only appears when the user is silly enough to alter all sidebars to be expanded.

Attached:

bug_51644_extreme_example.png (702×1 px, 438 KB)

This should now magically work for elements made collapsible using class="mw-collapsible", as a result of 8cdfcc5fd4b, which refactored that code to hide them using only CSS.

This should now magically work for elements made collapsible using class="mw-collapsible", as a result of 8cdfcc5fd4b, which refactored that code to hide them using only CSS.

Does that make this fixed, or are there elements we'd want to support which use a different class/mechanism?

Navboxes and probably almost everything else still use class="collapsible"

And worse, they are often 'autocollapse' which means they won't benefit from this. I am going to propose a change on en.wp soon, to limit the usage of autocollapse to ONLY navboxes, so at least other parts of the pages will not have this problem. But i'm not sure how to get social buy-in for completely removing autocollapse behaviour of navboxes.