Page MenuHomePhabricator

Add keyboard shortcuts and possibly a preference to fold reference tags
Closed, ResolvedPublicFeature

Description

Why

  • <ref></ref> tags in wikisource mode make it difficult to read the prose, often disrupting the reader mid-sentence, and requiring the reader to scan a couple lines forward to resume reading the prose

What

  • Add keyboard shortcuts to fold only <ref></ref> tags. As suggested at T381574, this could be:
    • Ctrl-Alt-, – fold all references
    • Ctrl-Alt-. – unfold all references
    • Ctrl-Shift-< – fold all selected references
    • Ctrl-Shift-> – unfold all selected references
  • Possibly add a preference to fold all references by default

See also

Event Timeline

Have you tried the "Improved Syntax Highlighting" beta feature? All extension tags should already be foldable.

MusikAnimal renamed this task from Ability to fold up <refs> to Add keyboard shortcuts and possibly a preference to fold reference tags.May 8 2025, 4:05 AM
MusikAnimal reopened this task as Open.
MusikAnimal updated the task description. (Show Details)
MusikAnimal subscribed.

I was chatting with Novem when he wrote this task. I think he was basically asking for the "especially refs" part of T381574: Collapse tags, especially refs in CodeMirror :)

See also T384908: Highlight reference contents differently than other extension tags which I hope to complete soon.

There's plenty of room for CodeMirror preferences to grow, but I'll need to finish up that dialog that I started at the Hackathon. I've filed T393664: The CodeMirror preferences panel can obstruct the editor and expanded on the idea.

Keyboard shortcuts for folding templates also work for extension tags. I do not like the idea of an extra set of shortcuts.

The use-case is that they want to read prose, but hide references. Some prose is in templates (such as blockquotes, or pretty much all of Wikisource – though they don't use references as much). There's now two requests for this, and I know I'd use it as well. Do we think it is technically complex, or are your concerns purely product-related?

At any rate, I think T384908 will help the situation, once I get around to it. Perhaps once that's done, this task will be of lesser importance.

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

[mediawiki/extensions/CodeMirror@master] foldKeymap: `Ctrl-Shift-,` to fold all <ref> tags only

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

Change #1156280 merged by jenkins-bot:

[mediawiki/extensions/CodeMirror@master] foldKeymap: `Ctrl-Shift-,` to fold all <ref> tags only

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

Bhsd moved this task from Improvement to Done on the MediaWiki-extensions-CodeMirror board.

The new keyboard shortcut has been added for a while, so I am inclined to close this ticket. However, please feel free to open a new one if a related preference option is requested, which will likely wait for T393664.