New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reselect entries when updating roots #1277

merged 4 commits into from Sep 4, 2018


None yet
2 participants

50Wliu commented Aug 13, 2018


  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • All new code requires tests to ensure against regressions

Description of the Change

Previously, whenever the roots were updated (resulting in the entire DOM being recreated), any selected entries wouldn't stay selected. This would happen whenever projects were added or removed or certain tree-view settings were changed. Now, whenever the roots are updated, the selected entries are maintained.

Additionally, if you select multiple entries before closing Atom, those same entries will remain selected the next time you open Atom instead of only the first entry.

Alternate Designs

Well, it would certainly be nice if the entire DOM wasn't erased and recreated.


Entries stay more consistently selected.

Possible Drawbacks

There is one caveat: after merging this PR, the lack of state.selectedPaths on the first run will cause all existing entry serialization (in state.selectedPath) to be disregarded, and the root will be selected. I don't see this as a problem though, considering updateRoots blew away the selection anyway.

Applicable Issues

I couldn't find any.

50Wliu added some commits Aug 15, 2018


This comment has been minimized.


50Wliu commented Aug 15, 2018




This comment has been minimized.


lee-dohm commented Sep 4, 2018

Thanks for this! 💖

@lee-dohm lee-dohm merged commit bc17651 into master Sep 4, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
continuous-integration/travis-ci/pr The Travis CI build passed

@lee-dohm lee-dohm deleted the wl-reselect-after-updating-roots branch Sep 4, 2018

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