Skip to content

Clicking extension toggles (ActionItems) has long-delayed UI feedback

Created by: felixfbecker

When you click a toggle like the one contributed by the Codecov extension to toggle line decorations, it doesn't immediately go into the visual "toggled" state. It calls a command in the extension worker, which calls back to make a request to the GraphQL API to update user settings, upon completion the in-memory settings are updated which updates the context, which reevaluates context key expressions, which brings the button into the toggled state.

This is very bad for the feeling of a responsive UI.

My proposal is to optimistically update the in-memory settings (while kicking off the GraphQL request in the background). If the GraphQL request fails, roll back the in-memory settings.