Skip to content

Feature: diffs: respect prefers-reduced-motion + prewarm scrollTo target #679

@clemg

Description

@clemg

Prerequisites

Proposal

Hi all!

Saw this tweet and I wanted to try the demo. I found out that prefers-reduced-motion was missing

Also played a bit with very large diffs on the beta branch for diffshub.com and found out that having instant TPs far enough lags a bit the syntax highlighter. Prewarming it (essentially starting the highlight asap when clicking) reduces, from my testing, the FOUC time by about 33% (~75ms) on my machine

At best it highlights earlier, at worst it does as good as today

Motivation and context

I noticed that very large files, even more when far away, might take a few 100s ms to get highlighted, which flashes. It's very visible with reduced motion is on (: settings > accessibility > prefers reduced motion)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions