Since edit filters often contain a brief explanatory comment at the top of their source code, the editor should open at the top rather than at the bottom of the code.
Description
Details
| Subject | Repo | Branch | Lines +/- | |
|---|---|---|---|---|
| ext.abuseFilter.edit.js: CodeMirror place the cursor at 0 | mediawiki/extensions/AbuseFilter | master | +1 -0 |
Related Objects
- Duplicates Merged Here
- T424261: CodeMirror editor for AbuseFilter conditions should start at top of the conditions
Event Timeline
Sorry, I cannot understand this task. Could you add a reproducible link (e.g., a public abusefilter) and maybe also a screenshot with annotations?
https://meta.wikimedia.org/wiki/Special:AbuseFilter/194
This can be reproduced when the filter code is sufficiently long. The likely cause is that the editor focuses on the end of the content when the page is loaded.
Change #1275163 had a related patch set uploaded (by Bhsd; author: Bhsd):
[mediawiki/extensions/AbuseFilter@master] ext.abuseFilter.edit.js: CodeMirror place the cursor at 0
To clarify, the editor doesn't need to focus on the end of the code on load because we don't always append new code. Especially when the user doesn't have the abusefilter-edit permission, the filter is only viewed so the initial view should be at the top.
Also, filter editors often modify code near the top or in the middle, not necessarily at the bottom, unlike typical article editing.
Yes, you are right. The cursor at the end of the filter was an unexpected side effect when constructing the CodeMirror editor.
Change #1275163 merged by jenkins-bot:
[mediawiki/extensions/AbuseFilter@master] ext.abuseFilter.edit.js: CodeMirror place the cursor at 0