If the "View history" tab changes size such that becomes too large where it before was not, an endless animation loop of collapse-expand-collapse-etc can be triggered. A resize could be caused by an ordinary zoom (frequently resizing the pixel width of the element by a few pixels), by a change in browser text size preferences (likely to significantly change the width), or by a user script modifying the text content of the element.
This appears to be caused by expandCondition in Vector.js using a cached version of the element's width (collapsibleTabs.data's expandedWidth passed as the eleWidth argument), while collapseCondition is checking .width() each time.
This happens when you enable Editing mode: show both tabs is enabled in preferences in VisualEditor and visit https://www.mediawiki.org/wiki/User:Martin_Urbanec?uselang=fr at certain screen resolutions. Demonstrated in image below:
Option 1 - Remove the animation and fix the collapsibletabs code:
Rationale: The animation plays at times when it's not meaningful, eg. after page load. The tabs should be collapsed immediately, without animation.
About half of the code is removed, including callbacks, resulting in a simple, less error-prone logic.
Analysis of the bug, solution: T71729#6183821 Remove animation
Option 2 - Keep the animation, fix the collapsibletabs code:
Rationale: Keeps the old functionality (animation) while safeguarding against the oscillation.
Solution: T71729#6183821 Easy fix
Option 3 - Make the tabs responsive
Rationale: No more collapsing, the tabs wrap into any number of rows.
Mostly CSS solution with a one-liner resize event handler.
Solution detailed: T71729#6183822
This bug resurfaced as a more prominent regression after the MW-1.35-notes (1.35.0-wmf.34; 2020-05-26) deployment:
T253819: Regression: Dancing Search Bar in MediaWiki when menu is hidden
The difference is: the "More" ("Plus" / "Mehr") menu is not visible: