Skip to content

Widget tab clicks unnecessarily wait 300ms for double click detection #1617

Description

@ben-polinsky

Describe the bug

Simple tab switching on any AppUI application is not very responsive. Digging into this, I found:

const doubleClickTimer = React.useRef(new Timer(300));

On mouse/pointer release, it increments a click counter and starts that timer. Only when the timer expires does it call handleClick(), which dispatches WIDGET_TAB_CLICK. The reducer then changes the active tab.

I don't believe single clicks, especially for something as basic as tab navigation, should be held up for a possible double click.
I see that double clicking is used for undocked widgets to collapsed/expanded. Would it be acceptable to respond to the first click immediately, then monitor for a possible second click? Because even for an undocked widget, the double click on a different tab does not collapse/expand that widget.

To Reproduce

Click to switch widget tabs on any AppUI application.

Expected Behavior

Switching widget tabs should be near-instantaneous.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions