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

Hide Tab bar if there is only a single library open #9971

Open
mschroen opened this issue Jun 4, 2023 · 17 comments · May be fixed by #12395
Open

Hide Tab bar if there is only a single library open #9971

mschroen opened this issue Jun 4, 2023 · 17 comments · May be fixed by #12395

Comments

@mschroen
Copy link

mschroen commented Jun 4, 2023

Cosmetic improvement:
In order to free more vertical space, I'd suggest to hide the Tab bar if there is only a single open Library (which I believe is a typical situation for most users).

grafik

@ThiloteE
Copy link
Member

ThiloteE commented Jun 4, 2023

I am against this proposal.
Right-clicking on the library tab is an easy way to have access to further library specific configuration options and also it is very convenient to see the name of the library if the tab exists.

@mschroen
Copy link
Author

mschroen commented Jun 4, 2023

Right-clicking on the library tab is an easy way to have access to further library specific configuration options and also it is very convenient to see the name of the library if the tab exists.

Yes there might be some advantages of this visualization. However, (1) the name of the library is also in the Window title, (2) the context menu items could also be accessed via the main menu > Library.
On the pro side, additional vertical space would increase the general table overview.
In any case, this suggestion could be accompanied by a checkbox in the settings such that nobodys workflow gets broken.

@ThiloteE
Copy link
Member

ThiloteE commented Jun 4, 2023

hmmm. I mean ... having more vertical space would indeed really be nice for devices with low screen space like laptops or notebooks ...

But not all configuration options are accessible via menu > library.
While the library can be closed via menu > file > close

Following important feature will be lost: "Reveal in file explorer"

So as precondition to implement this feature, i would suggest to:

  • add "Reveal in file explorer" to menu > library

Then I would agree with your proposal, unless there is severe performance loss.

@calixtus
Copy link
Member

Devcall discussion

Pro:

  • More space for the maintable
  • Reduce duplication with the library title in the tab and the title bar

Contra:

  • Right-click-menu with quicklinks to librarypreferences / console / reveal in file explorer would be lost

Decision:

Add preferences option to hide the bar if only one tab is open and make it default on
Solution strategy probably to change visibility option? See https://stackoverflow.com/questions/33457546/how-to-hide-the-tabbar-in-tabpane

@priyanshu16095
Copy link

/assign-me

@priyanshu16095
Copy link

Image
What is the reference class for this? I am unable to find it.

@Siedlerchr
Copy link
Member

LibraryTab probably

@priyanshu16095
Copy link

I mean the component which contains the names of the libraries.

@Siedlerchr
Copy link
Member

StateManager:

public ObservableList<BibDatabaseContext> getOpenDatabases() {
return openDatabases;
}

@priyanshu16095
Copy link

Please assign this issue to me.

Copy link
Contributor

👋 Hey @priyanshu16095, it looks like you're interested in working on this issue! 🎉

If you'd like to take on this issue, please use the command /assign-me to assign yourself.

@priyanshu16095
Copy link

/assign-me

@github-actions github-actions bot added the 📍 Assigned Assigned by assign-issue-action (or manually assigned) label Jan 16, 2025
Copy link
Contributor

👋 Hey @priyanshu16095, thank you for your interest in this issue! 🎉

We're excited to have you on board. Start by exploring our Contributing guidelines, and don't forget to check out our workspace setup guidelines to get started smoothly.

In case you encounter failing tests during development, please check our developer FAQs!

Having any questions or issues? Feel free to ask here on GitHub. Need help setting up your local workspace? Join the conversation on JabRef's Gitter chat. And don't hesitate to open a (draft) pull request early on to show the direction it is heading towards. This way, you will receive valuable feedback.

Happy coding! 🚀

⏳ Please note, you will be automatically unassigned if the issue isn't closed within 90 days (by 16 April 2025). A maintainer can also add the "📌 Pinned"" label to prevent automatic unassignment.

@priyanshu16095
Copy link

priyanshu16095 commented Jan 16, 2025

For knowing the number of open libraries, should I create a function in the state manager? I can't find it in any other class or the state manager.
I can also use:
int openDatabases = stateManager.getOpenDatabases().size();
it returns an observable list of open databases.

@priyanshu16095
Copy link

Neither of the approaches works because they do not update the value of openDatabases in real time, so I am using a ListChangeListener.

@Siedlerchr
Copy link
Member

I think you can try to use Bindings.size(stateManager.getOpenDatabases()) as well for this https://docs.oracle.com/javase/8/javafx/api/javafx/beans/binding/Bindings.html#size-javafx.collections.ObservableList-

@priyanshu16095
Copy link

priyanshu16095 commented Jan 16, 2025

Using Bindings.size(stateManager.getOpenDatabases()) is also not working fine.
Example video link for ListChangeListener,
https://drive.google.com/file/d/1Qg4dbx3hqh2hrzbcmbs-OculUrgtBdCf/view?usp=sharing

Could you please suggest what else I can do?

This was referenced Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants