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

Store and restore active-project-path explicitly #1472

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

jeremypw
Copy link
Collaborator

@jeremypw jeremypw commented Oct 9, 2024

Fixes #1471

  • Add a new setting to schema and make source of truth
  • Bind setting to GitManager property
  • Only ProjectChooserButton changes the active project (except GitManager as fallback)
  • Keep existing global search behaviour by managing the global search path separately.
  • Remove some unused or unnecessary related code.

The interface no longer tries to second-guess the active project based on user actions except for selecting (or reselecting) the active project through the chooser.

Global search continues to be carried out in the selected document's project (if it exists), falling back to the active project and ultimately the document itself.

Other actions that use the default action target like "New Branch" will now use the active project as shown in the ProjectChooserButton (and terminal path) regardless of which document is focussed when invoked with the keyboard. These action invoked with a folder context menu will target that folder regardless of the active project. This behaviour can be revisited if required.

Another side effect of this is that the active project is synchronised across open windows. May have to store active project on a per window basis?

@jeremypw jeremypw marked this pull request as ready for review October 9, 2024 16:00
Copy link
Member

@danirabbit danirabbit left a comment

Choose a reason for hiding this comment

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

I think this is actually worse because the project isn't updating when I switch project files, so project-wide search will continue to search in the old selection instead of the project that relates to the open files

@jeremypw
Copy link
Collaborator Author

@danirabbit Hmm, OK. I was trying to make the "active project" more stable and avoid conflict between what the terminal build directory is and what the active project is. May have to rethink the global search. It is not clear what to do if the user opens documents in more than one project at a time. I guess the search should be done in the project associated with the currently focussed document? I am reluctant to have the active project keep switching depending on which document is focussed! The active project, in my mind, is the one that is being developed and built. Agreed you might want to have documents from other projects open for reference but that does not change the focus of development.

@jeremypw jeremypw marked this pull request as draft October 13, 2024 16:13
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.

Active project dropdown sometimes out of sync on restart
2 participants