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

Remove project filter #1172

Closed
wants to merge 4 commits into from
Closed

Remove project filter #1172

wants to merge 4 commits into from

Conversation

jeremypw
Copy link
Collaborator

@jeremypw jeremypw commented Feb 23, 2022

In master, the presence of the filter when the listbox is bound to a model gives rise to a run-time warning:
GtkListBox with a model will ignore sort and filter functions (though the filter does in fact work).

To avoid this code managing the contents, filtering and sorting of the listbox is moved to the ChooseProjectButton from GitManager and the listbox is no longer bound to a model.

A better solution may be possible with Gtk4, using a FilterListModel.

@davidmhewitt davidmhewitt added the Needs Design Waiting for input from the UX team label Mar 30, 2022
@danirabbit
Copy link
Member

danirabbit commented Aug 31, 2022

I know this anectdotal, but I have nearly 60 projects open currently, so the search and scroll I think is useful 😅 I guess the proper way to suppress this warning is to set the filter on the model instead of the list

@jeremypw
Copy link
Collaborator Author

Thanks for the review! I found more than a few projects open at once unwieldy so I did not envisage so many would be kept open (probably my machine is too slow). I'll rethink this.

@jeremypw jeremypw marked this pull request as draft August 31, 2022 19:19
@jeremypw
Copy link
Collaborator Author

jeremypw commented Sep 1, 2022

@danrabbit The latest version now suppresses the warning without otherwise changing the UX. I think some more thought needs to go into what "Active Project" actually means; at the moment if you have a document in one project focuses and use the button to change the active project, the active project immediately reverts to the first one as soon as the document is refocused. The changed active project only persists if the sidebar or other non-document widget is focused to close the popup or if there are no documents open.

Should "Active Project" follow the focused document as currently?
Should documents not in the active project be closed/hidden if the active project is changed?
Should the sidebar collapse projects not active?

@jeremypw jeremypw marked this pull request as ready for review September 1, 2022 14:05
@jeremypw jeremypw requested a review from danirabbit September 1, 2022 14:05
@jeremypw
Copy link
Collaborator Author

jeremypw commented Sep 1, 2022

So the main use for "Active Project" is as the target for shortcuts performing Git actions:

  • New Branch
  • Global Search (global within the active project)

Maybe this should be made clearer in the UI? Is there anything else this concept could be useful for?

@jeremypw
Copy link
Collaborator Author

jeremypw commented Sep 1, 2022

Just realized that #1114 does in fact give another use to the Active Project (when selected with the Chooser button) - it collapses the other projects and hides their documents. Fortunately it does not conflict much with this one.

@danirabbit
Copy link
Member

Yeah, I really liked your branch that swaps out the tabs when you change the project selection.

Originally, my thought was to only show the file tree from the active project in the sidebar since I have like 40 collapsed tree headers to scroll through to find my open project 😅

@jeremypw
Copy link
Collaborator Author

jeremypw commented Sep 1, 2022

There is a valid use for having documents from more than one project open at a time - I do this quite often to copy code from one to the other. Another thought I had was to make non-active documents read-only and non-focusable which would mean you have to use the ProjectChooser button, rather than the active project automatically changing to match the focused document.

@jeremypw
Copy link
Collaborator Author

jeremypw commented Sep 1, 2022

To be honest I am not sure this PR is worth the diff as it only suppresses a terminal warning which has no ill effect as far as I can tell.

@jeremypw jeremypw closed this Sep 1, 2022
@danirabbit
Copy link
Member

Yeah, it's hard to strike the balance of what would be a better way to filter out things you don't want to see

@jeremypw
Copy link
Collaborator Author

jeremypw commented Sep 1, 2022

It can be revisited in the Gtk4 port anyway.

@jeremypw jeremypw deleted the suppress-listbox-warning branch June 23, 2023 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Design Waiting for input from the UX team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants