Page MenuHomePhabricator

Collapse templates in editor
Open, LowestPublic

Description

Presently most of wikis are using info box templates (http://en.wikipedia.org/wiki/Wikipedia:Infobox_templates) as an important tool. These templates are having two inadequacies for novice and non technical editors.

1)First is these templates usually occur at the top of edit page and a novice user gets confused with all wiki markup in those templates so please do enhance it with either wiki markup or template itself will not show up when page is opened for editing unless clicked as show.

2a) The second request is for a novice wiki user a template concept itself is new in that presently novice user has no way to understand that these info boxes are template pages and there are intricate templates within templates and there is no way for new user to understand that these templates are being reflected from some third page. The enhancement request is to give automated feature in tools which a new user can use to build a new info-box template

the way in vector skin new usability initiative we have given feature for creating tables in the same manner.

2b) Some easy way for new user to understand and reach easily to hidden template that lists the left side list in info-box template.

keywords: code folding

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 11:38 PM
bzimport set Reference to bz28684.
bzimport added a subscriber: Unknown Object (MLST).

This bug is basically asking for template collapsing, something we've half-implemented in WikiEditor but never got working properly in all browsers.

Is this bug more apropriate for MWextension VisualEditor ?

This is not likely to ever get implemented, with VisualEditor in the works.

There are a few gadgets that might be useful for people though:

https://www.mediawiki.org/wiki/User:Remember_the_dot/Syntax_highlighter
https://en.wikipedia.org/wiki/User:Cacycle/wikEd

Niharika subscribed.

I'm going to take community tech off of this ticket because we do not have the bandwidth to take this on right now.

Bhsd subscribed.

The default folding style in CodeMirror 6 is line-based. Either we should only focus on multi-line templates, or we may need to write our own implementation for template folding.

I have worked out one way to implement: There will be an icon displayed above the cursor inside a template. By clicking it, the template parameters become hidden and replaced by three dots, while the template name remains visible. Clicking the dots will unfold the template. Regarding the key bindings, foldAll (Ctrl-Alt-[) is likely to fail on a very long page, while others should work as expected.

I can claim this task if people are overall satisfied with my workaround.

IMG_4454.jpeg (122×472 px, 27 KB)

IMG_4455.jpeg (120×342 px, 20 KB)

Would it be possible to keep the | for the collapsed version? I feel it looks like the template name has been shortened without it.

Would it be possible to keep the | for the collapsed version? I feel it looks like the template name has been shortened without it.

Sure! I can do that.

Screen Shot 2024-02-20 at 9.28.29 PM.png (108×415 px, 13 KB)

Screen Shot 2024-02-20 at 9.29.02 PM.png (54×301 px, 9 KB)

That sounds great to me, @Bhsd! Side note -- the images at T30684#9531934 are not public, probably due to T310833.

Side note -- the images at T30684#9531934 are not public, probably due to T310833.

Thank you for pointing it out! I will claim this task then.

Change 1006475 had a related patch set uploaded (by Bhsd; author: Bhsd):

[mediawiki/extensions/CodeMirror@master] CodeMirror 6 template folding

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

Change 1008585 had a related patch set uploaded (by MusikAnimal; author: MusikAnimal):

[mediawiki/extensions/CodeMirror@master] tests: add selenium tests for CodeMirror 6 template folding

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

Change 1008585 abandoned by MusikAnimal:

[mediawiki/extensions/CodeMirror@master] tests: add selenium tests for CodeMirror 6 template folding

Reason:

test added back in parent patch

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

Change 1006475 merged by jenkins-bot:

[mediawiki/extensions/CodeMirror@master] CodeMirror 6 template folding

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

Change rEMFR10098251fc14 had a related patch set uploaded (by Bhsd; author: Bhsd):

[mediawiki/extensions/CodeMirror@master] CodeMirror 6 template folding: foldAll

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

Change 1010280 had a related patch set uploaded (by MusikAnimal; author: MusikAnimal):

[mediawiki/extensions/CodeMirror@master] CM6: put template folding behind feature flag and rework config settings

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

Moving to my team's board so this can get some proper QA. First however, it'd be good to get some review on r1010280 as this was deemed a blocker to rolling out CM6 further.

I have not forgotten about r1009825 and will be reviewing that soon :)

Change 1010280 merged by jenkins-bot:

[mediawiki/extensions/CodeMirror@master] CM6: put template folding behind feature flag and rework config settings

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