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.
Describe the bug
Simple tab switching on any AppUI application is not very responsive. Digging into this, I found:
appui/ui/appui-react/src/appui-react/layout/widget/Tab.tsx
Line 199 in 5f0ebc7
On mouse/pointer release, it increments a click counter and starts that timer. Only when the timer expires does it call
handleClick(), which dispatchesWIDGET_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.