CodeEdit icon indicating copy to clipboard operation
CodeEdit copied to clipboard

🐞 Noticeable delay occurs when changing Settings

Open austincondiff opened this issue 2 years ago • 1 comments

Description

Changing any setting causes a slight delay before the UI is updated to reflect the change. This is problematic when interacting with a stepper control when it is common to click several times consecutively or a text field when it is common to type characters consecutively. The UI doesn't have time to respond resulting in a sluggish UI.

To Reproduce

  1. Open Settings
  2. Navigate to the Text Editing page
  3. In the Font Size field, click the up arrow to increase five times in a row
  4. Notice that the UI does not update immediately resulting in it feeling sluggish to interact with

Expected Behavior

The UI should respond to user action immediately.

Version Information

CodeEdit: 0.0.3-dev (32)

Additional Context

This might be because it is writing to settings.json in our Application Support folder. I think it waits until it has been updated (not sure, just a theory). I think we should be handling this more optimistically and not be so dependent on writing to the file.

Screenshots

https://user-images.githubusercontent.com/806104/234976310-d53e977e-31a7-4ac0-b4e2-ab9890172bba.mov

Related issues

  • #1246

austincondiff avatar Apr 27 '23 19:04 austincondiff

We've discovered the root of the problem. The MonospacedFontPicker is causing this. When this is removed, performance is fine when changing a font size. If the user has a lot of fonts installed, for whatever reason it effects other fields in the form. If the Other Fonts picker is taken out of this view, everything seems to be fine.

Things we might try:

  • Only include the other fonts Picker when the monospaced fonts picker menu is open
  • Explore if there is a way to lazy-load these menu items
  • Rewrite the picker using AppKit

austincondiff avatar May 20 '23 14:05 austincondiff