Repository navigation
Ensure editor from local storage is actually installed - #8388
Conversation
…t is Prior to this change, if the user uninstalled the editor they'd selected then we'd throw an error and would fail to resolve the current editor at startup
|
I was under the impression that we differentiated between selected and resolved editor was so that we'd keep track of what the user has indicated that they want to use and what's actually available. If I'm reading this PR correctly we're now going from using any available editor while the preferred one isn't available to making whatever available editor we find the preferred editor just as if the user had explicitly picked the editor themselves. To be clear, I'm not against making that change but I feel like it does beg the question of why we'd need the resolvedEditor at all if we do? Could we not rely entirely on the |
I'm not 100% sure I understand this. If this isn't going into the release, could we discuss the UX implications and scenarios before we merge this? |
Wow yeah, reading that again I half-way don't understand it myself. What I was trying to say was that it felt like this PR was removing the distinction between Historically we used to let the user pick an editor ( So the With this PR we're making it such that if the
👍 I think regardless of which approach we end up taking we should look at consolidating the user-facing uses of |
|
Thanks for all of the helpful historical context @niik. I can now more clearly see how this code came to be.
100%. I'd spoken to @outofambit about wanting to do this when we have the bandwidth for it (see #8322 (comment) for extra context). Which is maybe now? We both figured that it was worth refactoring and simplifying the selected/resolved editor code because currently it seems to be a breeding ground for bugs, and it's not the easiest for us developers to reason about. And in the meantime, I was thinking this could be a stopgap for addressing #8386. Do you think that sounds reasonable @niik? |
tierninho
left a comment
There was a problem hiding this comment.
Based on the repro steps here:
Install Atom and another valid editor (like VS Code)
Set Atom as your editor in Preferences
Uninstall Atom (on Mac, you can simply move to trash)
Reload GitHub Desktop
this fix seems to be working ✅
outofambit
left a comment
There was a problem hiding this comment.
one little thing, but otherwise great!
FYI had a discussion with @billygriffin to discuss this and got a 👍 |
Overview
Closes #8386
Description
This PR verifies that the editor stored in local storage is actually installed (it might have been uninstalled recently by the user, as in #8322). If it is not, we update the stored selected editor based to be one that is installed. Prior to this change, if the user uninstalled the editor that was stored in local storage, then we'd throw an error and would fail to resolve the current editor at startup. For users in an onboarding tutorial, this could mean that the first "Install a text editor" step erroneously shows that no editor is installed.
Release notes
Notes: no-notes
/cc @niik @outofambit @billygriffin