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

Choose project popover #1030

Merged
merged 34 commits into from
May 25, 2021
Merged

Choose project popover #1030

merged 34 commits into from
May 25, 2021

Conversation

jeremypw
Copy link
Collaborator

@jeremypw jeremypw commented May 16, 2021

Fixes #991 (partially)
Alternative implementation to #1023, similar to that used for FormatBar.

Open questions, given that the number of open projects is likely to be small compared with number of formats:

  • What to do with non-active project folders and documents

A potential future development would be to maintain a list of recent but not loaded projects that could also be displayed in the list.

@jeremypw
Copy link
Collaborator Author

ChooseProjectPopover

@hanaral
Copy link

hanaral commented May 16, 2021

From the screenshot it's even better than what I was thinking! I think there may be some debate as to whether it should adapt to the number of projects i.e if >8 then make it scrollable otherwise crop the popover to fit the number of entries
I'm in favour of making it adaptable

Jeremy Wootten added 3 commits May 16, 2021 17:42
@jeremypw
Copy link
Collaborator Author

@hanaral Yes, unless/until we display recent but not loaded projects as well as loaded projects the list is unlikely to contain more than 3 projections in my opinion. Trying to work with more than that at once would be unwieldy.

@hanaral
Copy link

hanaral commented May 16, 2021

I do still think it would be useful to have it, in case Code is used by other projects that need their tools to scale.
Apart from that, do you think you could fix the button's UX in this PR too? It just needs to be the same size as the other headerbar button widgets, and use a symbolic bit icon rather than the coloured (although a single colour icon could also work, similarly to the settings popover)

@jeremypw
Copy link
Collaborator Author

We need to raise an issue in the icons project for a symbolic (git) project icon.

I'll fix the button height - I copied the code from the formatbar but I must have missed something.

@jeremypw
Copy link
Collaborator Author

CodeHeaderBar

Added margins to match the custom title (FormatBar), use hexpand = true to avoid width changes when changing project.

Only problem with this is that it pushes the undo button to the right, next to the FormatBar.

@hanaral
Copy link

hanaral commented May 17, 2021

I think it might just be necessary to expand to like 8 letters and then ellipsise the rest, considering it could just show the full name on hover.

@jeremypw
Copy link
Collaborator Author

@danrabbit in your issue report #991, what is in the right-hand half of the button - I cannot quite read your illustration. Is it the current branch name with a popover list of available branches? Have you decided about closing/hiding/collapsing non-active projects? Should documents from non-active projects remain open?

@jeremypw jeremypw marked this pull request as ready for review May 19, 2021 13:48
@jeremypw jeremypw requested a review from danirabbit May 19, 2021 13:48
@jeremypw
Copy link
Collaborator Author

@hanaral The button now displays max 24 chars, which should be enough for most repos, and ellipsizes if not. May as well show the full path to the repo in the tooltip as when dealing with forks there may be two repos with the same name.

@jeremypw
Copy link
Collaborator Author

Ellipsized project name

LongProjectName

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.

Working my way through here, this is a good direction!

I appreciate the search entry since I often have a lot of projects open

One regression I noticed is that I can no longer use global search on projects which aren't using Git

In my mockup I had an idea of maybe a linked button for choosing the git branch, but that idea can wait for a follow up since there is already a way to change the branch.

src/Widgets/ChooseProjectButton.vala Outdated Show resolved Hide resolved
src/Widgets/ChooseProjectButton.vala Outdated Show resolved Hide resolved
src/Widgets/ChooseProjectButton.vala Outdated Show resolved Hide resolved
src/Widgets/ChooseProjectButton.vala Outdated Show resolved Hide resolved
src/Widgets/ChooseProjectButton.vala Show resolved Hide resolved
src/Widgets/ChooseProjectButton.vala Outdated Show resolved Hide resolved
src/MainWindow.vala Outdated Show resolved Hide resolved
src/Widgets/HeaderBar.vala Outdated Show resolved Hide resolved
@jeremypw jeremypw dismissed danirabbit’s stale review May 23, 2021 07:32

Can now search non-git projects

@jeremypw
Copy link
Collaborator Author

@danrabbit Do we need to address what to do with non-active projects and documents or can we leave that to another PR?

One problem as it is, is that if you change the active project with the button it immediately reverts back to the original project as soon as the current document is refocussed, because the active project is kept in sync with the current document.

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.

Yeah, let's leave that case for follow up. Merging this would unblock a lot of other work already, so I'm happy to get it in and we can iterate :)

@danirabbit danirabbit merged commit 379d8f7 into master May 25, 2021
@danirabbit danirabbit deleted the choose-project-popover branch May 25, 2021 18:02
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.

A method to indicate the current project
3 participants