Repository navigation
Stop Console error command links flickering on hover - #19636
Conversation
RStudio E2E - all platformsAll tests passed!
All platforms - commit |
| /* Opacity below 1 lifts an element into its own paint layer; positioning keeps | ||
| both links in that layer on hover, so where their boxes overlap the topmost | ||
| one doesn't flip with each hover change and flicker. */ | ||
| position: relative; |
There was a problem hiding this comment.
This fixes which link paints on top, but not why the links overlap. The overlap comes from line-height: 80% on .consoleErrorCommands (line 21), and it's still there, so the roughly 1px strip where the links overlap now always goes to the later link, "Rerun with Debug".
As a result, pointing at the bottom edge of "Show Traceback" highlights "Rerun with Debug", and a click there reruns the command with debug instead of toggling the traceback. The click handler (ConsoleError.java:111-120) acts on whichever element was hit.
The fix also depends on how browsers stack opacity and positioned elements, which a later style change could quietly undo. Removing the overlap would fix the cause, for example by giving each link row its own line-height instead of 80% on the container. Then neither position: relative nor the comment is needed.
Addresses #10086.
Moving the mouse between the "Show Traceback" and "Rerun with Debug" links on a Console error made them flicker.
Two things combined to cause it:
line-height: 80%, so the links' text hit areas overlapped by about 1px.opacity: 0.5and go toopacity: 1on hover. An element with opacity below 1 is painted, and hit-tested, in a layer above normal inline content. On the overlap, the hovered link dropped below the other one, which then took the hover, and the two kept swapping.Changes to
.errorCommandText:display: inline-block; line-height: normalkeeps each link's hit area within its own row, so a click on the bottom edge of "Show Traceback" no longer reruns the command. The text keeps its baseline alignment with the icons, and the rows are about 1.5px further apart.position: relativekeeps both links in the same paint layer whatever their opacity. Without it, a fraction-of-a-pixel band where the two boxes meet can still swap.Verified manually: no flicker, and the icons line up with the text, in RStudio Desktop and on a dev server in Chrome, Safari, and Firefox.