Some changes have recently been released to address this issue. All of the changes require Jenkins 2.138.4 or newer. The main fixes are in Pipeline: API Plugin version 2.34 and Pipeline: Graph Analysis Plugin version 1.10, but in most cases you will need to change your Pipelines to be able to take advantage of the fixes:
If you are currently setting the build result to unstable using currentBuild.result = 'UNSTABLE', you need to update to Pipeline: Basic Steps Plugin version 2.16 and start using the unstable step instead. See the changelog here for details. You may also be interested in the new warnError step.
In case you are curious why we can't make currentBuild.result = 'UNSTABLE' work as-is, the problem is that currentBuild is implemented as a GlobalVariable rather than a regular Pipeline Step, so there is no way to associate the setting of the build result with the current Pipeline stage, especially if a parallel step is being executed.
If the build result is being set to unstable by the junit step from the JUnit Plugin, then update the JUnit Plugin to version 1.28 and the visualization should be fixed.
If the build result is being set to unstable by the publishIssues or recordIssues steps in the Warnings NG Plugin, then keep an eye on this in-progress PR which will update those steps to use a new API that will fix the visualization.
If the build result is being set to unstable by a Pipeline step in some other plugin, then file a new issue with the component set to that plugin, and ask the maintainer to start using the new WarningAction API from Pipeline: Basic Steps Plugin version 2.16 wherever they change the build result.
In case of problems, the new behavior can be disabled by setting the system property org.jenkinsci.plugins.workflow.pipelinegraphanalysis.StatusAndTiming.DISABLE_WARNING_ACTION_LOOKUP to "true", or by setting the static variable of the same name to true via the Jenkins script console.
Note that the Blue Ocean steps view will not yet display the status of individual steps using the new API correctly, keep an eye on this in-progress PR which will fix that issue. Once that PR is merged and released, I plan to mark this issue as closed.