Skip to content

Open Quickly #119

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

Merged
merged 19 commits into from
Mar 20, 2022
Merged

Open Quickly #119

merged 19 commits into from
Mar 20, 2022

Conversation

pkasila
Copy link
Member

@pkasila pkasila commented Mar 20, 2022

Fixes #42

  • Implements overlay for "Open Quickly"
  • Creates a new module with OverlayPanel
  • OverlayPanel automatically closes when it's out of focus (as "Open Quickly" and other overlays do in Xcode)
  • Some changes in how navigation is handled (just workaround at the moment)

Video demo

demo_openquickly.mov

Screenshots

image
image

@lukepistrol lukepistrol added enhancement New feature or request UI This is UI related labels Mar 20, 2022
@pkasila
Copy link
Member Author

pkasila commented Mar 20, 2022

I'm experiencing difficulties optimizing "Open Quickly".

The problem is that, because we are using NavigationLinks in the sidebar if the NavigationLink has not appeared in the sidebar (because folders containing them aren't expanded), then navigation to file won't work because there won't be NavigationLink in the UI hierarchy which is responsible for the specified ID.

And we cannot add a view to NavigationView to handle this behavior because it will lead to views rebuilding twice instead of once and, I guess, memory leaks. (Right now this branch contains this way and it's horrible in terms of memory usage when there are many files opened)

And expanding all the parent directories to the file is not really the way it should be done, because there can be a lot of subdirectories and files which will mess up the whole sidebar content. Especially if we are speaking about searching inside caches and modules directories.

Obviously, I cannot use NavigationLink in the OpenQuicklyPanel, because it's a different window not related to the main one. I'm selecting file by changing WorkspaceDocument.selectedId property (more specifically using WorkspaceDocument.openFile(item:)).

So, what should we do about that? Because it may not allow us to make lookups and other features as well.

@pkasila
Copy link
Member Author

pkasila commented Mar 20, 2022

Right now I'm working on a solution for this problem without changing how we implement SideBar. So, I'll write if it won't work.

@lukepistrol
Copy link
Member

To be honest I'm not quite happy yet with how the sidebar is implemented yet. I would rather have a main window which hosts the editor/placeholder and the sidebar should be embedded as a package. But as of now (using NavigationLink) it needs to be as it is now. One option would be to ditch the List {} and implement a completely custom one imitating the native look.

@pkasila pkasila marked this pull request as ready for review March 20, 2022 15:43
@pkasila pkasila requested review from austincondiff and lukepistrol and removed request for austincondiff March 20, 2022 15:43
Copy link
Member

@lukepistrol lukepistrol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Does it fix the issues described earlier?

@pkasila
Copy link
Member Author

pkasila commented Mar 20, 2022

Looks good! Does it fix the issues described earlier?

No, I've tried, but I think it would be better for someone to fix them in #123.

@lukepistrol
Copy link
Member

Ok so for now some files will not open if not present in the sidebar. Correct?

@pkasila
Copy link
Member Author

pkasila commented Mar 20, 2022

Ok so for now some files will not open if not present in the sidebar. Correct?

They will open because I've made a small workaround with WorkspaceCodeFileView inside NavigationView at the initial state. So, right now if the user opens anything through the sidebar or "Open Quickly" everything works fine.

@lukepistrol
Copy link
Member

Perfect!

pkasila added 2 commits March 20, 2022 20:24
…anel` (it can be used by any other overlay). Make `OverlayPanel` close on `windowDidResignKey` as Xcode does
@pkasila pkasila merged commit 36a6f3c into CodeEditApp:main Mar 20, 2022
@beh-art423
Copy link

Fixes #42

  • Implements overlay for "Open Quickly"
  • Creates a new module with OverlayPanel
  • OverlayPanel automatically closes when it's out of focus (as "Open Quickly" and other overlays do in Xcode)
  • Some changes in how navigation is handled (just workaround at the moment)

Video demo

demo_openquickly.mov

Screenshots

image image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request UI This is UI related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

✨ Open Quickly Overlay
3 participants