Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jeremypw
Copy link
Collaborator

@jeremypw jeremypw commented Oct 9, 2024

Fixes #1471

  • Save and restore the active (git) project
  • Ensure the project chooser button and the terminal show the active project
  • Active project only changes in response to user choice
  • Global search continues to search in the project associated with the focussed document
  • When other folders are closed with the context menu then the remaining folder becomes the active one
  • The menu option "Open in Terminal Pane" becomes "Set as Active Project" for git repos.

See also #1518 - "Open in Terminal Pane" is a distinct action from "Set as Active Project" - it just changes the current directory in the Terminal Pane to the folder path whereas "Set as Active Project" has a number of effects including setting the current Terminal Pane directory to the default build path (not necessarily the folder (root) path).

@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
@jeremypw jeremypw marked this pull request as ready for review October 30, 2024 16:51
@jeremypw jeremypw requested a review from danirabbit October 30, 2024 16:52
@jeremypw
Copy link
Collaborator Author

@danirabbit I have tried to address your concerns by decoupling the "active project path" from the "global search path". The main issue now is whether you want to be able to have different active projects in different windows. This could be useful I guess but would require having separate GitManager instances for each window. Only one of the window would be restorable at the moment.

@jeremypw jeremypw marked this pull request as draft October 30, 2024 17:08
@jeremypw
Copy link
Collaborator Author

jeremypw commented Oct 30, 2024

Converting to draft while fixing a bug in choosing active projects with same beginning of name.

@jeremypw jeremypw marked this pull request as ready for review October 30, 2024 19:16
@jeremypw
Copy link
Collaborator Author

jeremypw commented Dec 7, 2024

@danirabbit I would be grateful if you would reconsider the revised version of this PR. The project-wide search now follows the project associated with the focussed document as before, which I believe was you main concern. I have some uncertainty about what to do with "project" folders that are not git repos but this is probably not blocking as it pre-exists. Do we need to distinguish these as far as setting the terminal path or project button for example. At present in this PR the context menu for the project folder does differ but it would be simpler if it didn't so I am happy to revert that.

Copy link
Contributor

@zeebok zeebok 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. Just a couple questions due to my ignorance of the codebase. I can test if you like before merge but I'm comfortable with just merging.

@jeremypw jeremypw requested a review from zeebok February 4, 2025 13:10
# Conflicts:
#	src/FolderManager/FileView.vala
@jeremypw jeremypw enabled auto-merge (squash) February 5, 2025 10:51
@jeremypw jeremypw merged commit e90b56f into master Feb 5, 2025
4 of 6 checks passed
@jeremypw jeremypw deleted the jeremypw/sync-activeproject-startup branch February 5, 2025 10:52
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

4 participants