Skip to content
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

fix(sidebar/#2084): Don't show sidebar if no folder is open #2711

Merged
merged 25 commits into from
Nov 24, 2020

Conversation

bryphe
Copy link
Member

@bryphe bryphe commented Nov 13, 2020

Issue: The first-run experience on some platforms isn't ideal - the explorer can take long to load, or in the case of MacOS, ask the user for permission to their documents folder - not a great first-time experience!

Defect: If no folder was opened, we'd try and default to the user's documents folder - but this isn't really ideal for the above reasons.

Fix: Create a 'no-workspace-opened' state, and don't show the sidebar in that case. Once a folder is explicitly specified, or we have one from persistence, then we can go ahead and show it. In addition, for the file explorer, add an empty experience (an open folder button) if the user opens the sidebar.

Fixes #2084

TODO:

  • Update the extension host integration - if there is no workspace, we shouldn't call $initializeWorkspace with the initial directory.
  • Clean up the empty experience
    • Add descriptive text
    • Center button
  • Wire up the 'open-folder' gesture to initiate an effect to open the native file dialog
  • Ensure 'open folder' button is available via keyboard
  • Command+P behavior when no workspace is open
    • Just show active buffers

@bryphe bryphe added the WIP label Nov 13, 2020
@bryphe bryphe mentioned this pull request Nov 20, 2020
bryphe added a commit to revery-ui/revery that referenced this pull request Nov 23, 2020
This is a very basic, naive implementation of `openFileDialog` - enough to open single files and folders to unblock onivim/oni2#2711
@bryphe bryphe removed the WIP label Nov 24, 2020
@bryphe bryphe merged commit e61ffa6 into master Nov 24, 2020
@bryphe bryphe deleted the fix/explorer/2084/default-no-folder branch November 24, 2020 03:27
bryphe added a commit that referenced this pull request Nov 25, 2020
__Issue:__ Onivim may crash on OSX with `Cmd+P` when launching from finder for the first time

__Defect:__ The default directory for Onivim was set to the `Documents` folder. However, Onivim may not actually have permission to access this folder due to OSX's sandboxing. 

__Fix:__ If we don't have permission, don't set a workspace and fall-back to `Cmd+P` opening active buffers.

#2711 helped this particular scenario, by setting up state and UI for the case where no workspace is opened / the working directory is not valid. However, there is still the case that we may have persisted the `Documents` folder, and we could still get that or another invalid folder coming from persistence. Therefore, we need to check permission for the folder prior to changing directory.

__TODO:__
- [x] Remove getWorkingDirectory in QuickMenuStoreConnector
- [x] Test on OSX w/ no persistence set
- [x] Test on OSX w/ persistence set to 'documents' folder
- [x] Test on Windows w/ no persistence set
- [x] Test on Linux w/ no persistence set

Fixes #2742
bryphe added a commit that referenced this pull request Nov 25, 2020
With #2711 , we now have an 'Open Folder' button when no workspace is opened:

![open-folder](https://user-images.githubusercontent.com/13532591/100265104-96203580-2f04-11eb-9db3-79154c03192d.gif)

This just implements a small tweak to always have the `Workspace: Open Folder` option available in the command palette, even when one is currently opened (for changing folders).

Fixes #730
@bryphe bryphe mentioned this pull request Dec 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should not open the sidebar by default if no specific folder is open
1 participant