What is the problem?
There are some circumstances when switching from Visual to Wikitext diff will lead to duplicate diff content or showing both the inline and wikitext diffs on the same page.
I have only been able to reproduce this on multi-content diffs and on commons.
Steps to reproduce problem
Case one:
- https://commons.wikimedia.org/w/index.php?title=File%3ATamar_Class_Lifeboat_with_Y-Class_Showing_Photo_By_Robert_Kilpin.jpg&diff=680321681&oldid=17716809&diff-type=inline
- Click the inline toggle to switch to two-column mode
- Switch to "Visual"
- Switch back to "Wikitext"
Expected behavior: You see a wikitext, two-column diff
Observed behavior: You see both two-column and inline diffs and two duplicate "mediainfo" sections
Case two:
- https://commons.wikimedia.org/w/index.php?title=File%3ATamar_Class_Lifeboat_with_Y-Class_Showing_Photo_By_Robert_Kilpin.jpg&diff=680321681&oldid=17716809&diff-type=table
- Click the inline toggle to switch to inline mode
- Click the inline toggle again to switch back to two-column
- Switch to "Visual"
- Switch back to "Wikitext"
Expected behavior: You see a wikitext, two-column diff
Observed behavior: You see two duplicate "mediainfo" sections
Case three:
- https://commons.wikimedia.org/w/index.php?title=Commons%3AAccount_creators%2Far&diff=689132041&oldid=285904457&diff-type=inline
- Click the Inline toggle to switch to two-column mode
- Switch to "Visual"
- Switch back to "Wikitext"
Expected behavior: You see a wikitext, two-column diff
Observed behavior: You see both inline and two-column diffs
Environment
Browser: Firefox 102. Chromium 116.
Wiki(s): https://commons.wikimedia.org MediaWiki 1.41.0-wmf.26 (f511adf) 00:18, 12 September 2023.
Screenshots
Example with inline and two-column diff shown at the same time:
Example of duplicated "mediainfo" sections:
Example of inline and two-column diff on the same page:
QA Results - Beta Commons
AC | Status | Details |
---|---|---|
1 | ✅ | https://phabricator.wikimedia.org/T346299- Case 1 here |
2 | ✅ | https://phabricator.wikimedia.org/T346299- Case 2 |
3 | ✅ | https://phabricator.wikimedia.org/T346299- Case 3 |