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

All recent projects searchable in Spotlight #1680

Merged
merged 10 commits into from
Apr 23, 2024
Merged

All recent projects searchable in Spotlight #1680

merged 10 commits into from
Apr 23, 2024

Conversation

knotbin
Copy link
Contributor

@knotbin knotbin commented Apr 23, 2024

Description

All recent projects are now fully indexed and searchable in Spotlight. Indexing happens once when a new window is opened to check if recent projects have changed.

Related Issues

Checklist

  • I read and understood the contributing guide as well as the code of conduct
  • The issues this PR addresses are related to each other
  • My changes generate no new warnings
  • My code builds and runs on my machine
  • My changes are all related to the related issue above
  • I documented my code

Screenshots

@FastestMolasses
Copy link
Member

Looking at this again, there's a few issues with this code being tied to the UI. Because this is in the init function, it's only called once. Opening new projects in new windows or changing projects wont cause this to be updated. Also this code is specific to the WelcomeWindow, which I dont think this incoming change fits in with. If indexing fails, there's no way to try it again.

Due to these reasons, I think this feature might be a good candidate for creating a service. VSCode has this in a WorkspacesService, which is responsible for workspace management, recently opened workspaces, event handling and persistence. With a service, we can hook into relevant events to update as needed and we can invoke retries when necessary. This will also help with our separation of concerns between UI and functionality. Thoughts?

@knotbin
Copy link
Contributor Author

knotbin commented Apr 23, 2024

I tested and the indexing happens whenever you open the app, even if the welcome window is not opened

@knotbin knotbin requested a review from FastestMolasses April 23, 2024 14:44
@FastestMolasses
Copy link
Member

All the window views here are initialized at the start of the application. One of the problems is that it only happens once, even if we open new projects, windows, etc. If the indexing fails, then it wont ever be retried. This code in general shouldnt be tied to the welcome window either. For this PR, I'd say it's fine until we get our services defined more, but I'd like to come back to this and move the code into a service to address these issues.

@knotbin
Copy link
Contributor Author

knotbin commented Apr 23, 2024

Got it, thanks. I'll make those changes.

@knotbin knotbin requested a review from FastestMolasses April 23, 2024 15:10
@knotbin
Copy link
Contributor Author

knotbin commented Apr 23, 2024

@FastestMolasses I implemented the requested changes, please let me know if there's anything else you want me to change

Copy link
Member

@tom-ludwig tom-ludwig left a comment

Choose a reason for hiding this comment

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

Thanks for the improvements!

@austincondiff austincondiff merged commit 70cb34a into CodeEditApp:main Apr 23, 2024
2 checks passed
@thecoolwinter thecoolwinter added the enhancement New feature or request label Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

✨ Add Workspaces to Spotlight
5 participants