Bug 458162 - Improve tab behavior
Summary: Improve tab behavior
Status: RESOLVED INTENTIONAL
Alias: None
Product: kate
Classification: Applications
Component: general (other bugs)
Version First Reported In: 22.08.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-22 09:27 UTC by popov895
Modified: 2022-08-22 18:42 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Tabs in Okular (150.52 KB, image/png)
2022-08-22 09:27 UTC, popov895
Details

Note You need to log in before you can comment on or make changes to this bug.
Description popov895 2022-08-22 09:27:52 UTC
Created attachment 151495 [details]
Tabs in Okular

SUMMARY

Kate is a great editor/IDE (thanks to the devs, the editor has got new great features since 22.08) and everything about it is fine, except for the tabs: sorry, but the current behavior of the tabs looks odd. There are 2 options in the settings that seem odd to me: changing them affects each other and makes the tab setting unclear. Here they are:
- Limit number of tabs
- Allow tab scrolling

The first option is the most odd. Firstly, I have never seen the same option in any other editor, and I was a little taken aback to see it in Kate. Secondly, the behavior of tabs when their number exceeds the specified limit looks funny (try setting the limit to 1): they just disappear instead of opening in a new window.

The second option works only if the first option is not set to Unlimited. Moreover, with this option turned off, under certain conditions, the width of the window may grow, which is unacceptable!

I dare to suggest you to use the tabs behavior from Okular, it looks reasonable and perfect to me (see attached image):
1. Tabs fully fit into the window
2. Tabs need to elide their text to fully fit into the window
3. Even the elided text on the tabs doesn't allow them to fully fit into the window, so we need to add scrolling here

SOFTWARE/OS VERSIONS

Operating System: Fedora Linux 36
KDE Plasma Version: 5.25.4
KDE Frameworks Version: 5.97.0
Qt Version: 5.15.5
Graphics Platform: X11
Comment 1 Christoph Cullmann 2022-08-22 10:38:30 UTC
I fail to see what you suggest. I use the tabs with limit extensive, they work like they should.

Per default the settings are done in a way that is reasonable, the only thing that might make sense to change is the default for the "elide".
Comment 2 Christoph Cullmann 2022-08-22 10:45:11 UTC
On the other side, no, for me, elide makes it per default even less usable, as the stuff is close to non-discernible.

We fixed that elide doesn't work without limit.
If you like the Okular variant, you just need to tick one checkbox and you have it.

To remove configuration options just breaks other people's workflow.
Comment 3 Waqar Ahmed 2022-08-22 12:23:49 UTC
> I dare to suggest you to use the tabs behavior from Okular,

We have or _can have_ the same behaviour if you modify the settings a bit.
- Want smaller tabs? => Disable "Expand Tabs"
- Want scrolling => enable it
- Want eliding => enable it

So I am confused, about whats not possible.

> There are 2 options in the settings that seem odd to me

They are not that odd in a way and they exist for a reason:
- Tab limiting is there for two reasons. Performance and to have a usable tabbar. Of course, "usable" is subjective here. If you have a lot of tabs, say 100 or more and you use sessions, tabbar really slows down kate startup because of all the resizing and layouting that has to happen. Thus having a small number of tabs really helps. About "usable". If you have a lot of tabs, at least for me, it becomes very hard to use the tab bar to switch to a document that's not visible on the tabbar. Limiting the tabs keeps the tabbar usable to a degree, yes not all documents are there anymore though, that's a downside.
- "Allow Tab Scrolling" - Sounds weird, why shouldn't one always allow scrolling? Well, this is similar to the "usable" point above. Once you limit tabs, for e.g., 10, I want all 10 tabs to always be visible and not scroll away. Thus I keep scrolling disabled.

That said, there is one more thing that should be mentioned. Our _real_ tabbar is the "Documents" plugin. If one is using Kate for serious work, one should use that instead of the tabbar, it has way more features and allows for much easier document switching.

We have had discussions where we came close to entirely removing the tabbar, but the only reason it is still there is because we(kate devs) wanted to have something other editors also have.
Comment 4 Christoph Cullmann 2022-08-22 12:26:28 UTC
As said, I think the default settings are already like for Okular, beside the elide (and that we didn't support it properly, but that was fixed in the other bug).

We do per default not expand and scroll.

We altered that before 22.08 exactly to be more consistent with other applications, like what a normal browser would do.
Comment 5 popov895 2022-08-22 12:37:22 UTC
Yes, it seems reasonable to keep the "Elide tab text" option for those who want to see the full tab titles, but the rest of the options are unnecessary crap, which only creates disorder and breaks the normal function of the tabs.
Comment 6 Christoph Cullmann 2022-08-22 12:46:09 UTC
(In reply to popov895 from comment #5)
> Yes, it seems reasonable to keep the "Elide tab text" option for those who
> want to see the full tab titles, but the rest of the options are unnecessary
> crap, which only creates disorder and breaks the normal function of the tabs.

Hi, this is a very one-sided opinion.
If you dislike the other options, don't touch them.
Some people use them and like them.

Perhaps you need to understand that Kate and most other software is not just developed for "you", but for others, too.
A lot of the options we have doesn't make any sense for me myself, but a lot for others that use it.
I fail to see why providing a broad set of options with reasonable defaults is an issue.

Please refrain from further "unnecessary crap" talk, that won't help and lowers the motivation to work on any bug you report, even if they are justified.
Comment 7 popov895 2022-08-22 16:36:49 UTC
Sorry for "unnecessary crap" and thanks for your for your explanations.

(In reply to Waqar Ahmed from comment #3)
> Limiting the tabs keeps the tabbar usable to a degree, yes not all documents are there anymore though, that's a downside.

It seems to me that in this case it makes sense to rename this option from "Limit number of tabs"  to "Maximum number of visible tabs" (or something like that), IMHO, it's more understandable name.

(In reply to Waqar Ahmed from comment #3)
> Once you limit tabs, for e.g., 10, I want all 10 tabs to always be visible and not scroll away.

That's what the "Elide tab text" option is for. Currently, disabling tab scrolling causes the width of the application window to constantly grow with each new tab opened. What should happen when opening a new tab while the width of the application window is the same as the width of the screen? Should the width of the application window become larger than the screen width? Or something else?

I'm also bothered about the different behavior of tabbar in KDE applications (Kate, Okular, KDevelop, ...), which breaks the user experience.
Comment 8 Waqar Ahmed 2022-08-22 17:28:25 UTC
> Currently, disabling tab scrolling causes the width of the application window to constantly grow with each new tab opened. What should happen when opening a new tab while the width of the application window is the same as the width of the screen? Should the width of the application window become larger than the screen width? Or something else?

This is how its implemented in Qt. Maybe there is a better way of handling this case, no ideas atm. 

> "Maximum number of visible tabs"

This is a bit misleading, because one might think there are tabs that are not visible which is not the case. The tab limit really means the number of tabs won't grow beyond that number and that's why imo the title is clear.  Note that there _are documents_ that are not visible but open i.e., they dont have a view, but documents and tabs are different.
Comment 9 popov895 2022-08-22 18:36:34 UTC
(In reply to Waqar Ahmed from comment #8)
> Note that there _are documents_ that are not visible but open i.e., they
> dont have a view, but documents and tabs are different.

You have me totally confused. How can a document be open and not visible? Do only visible documents have tabs? How can I access these "hidden" document?

Now Kate looks too complicated for me. Does KWrite have the same behavior with documents and tabs?
Comment 10 Christoph Cullmann 2022-08-22 18:42:32 UTC
(In reply to popov895 from comment #9)
> (In reply to Waqar Ahmed from comment #8)
> > Note that there _are documents_ that are not visible but open i.e., they
> > dont have a view, but documents and tabs are different.
> 
> You have me totally confused. How can a document be open and not visible? Do
> only visible documents have tabs? How can I access these "hidden" document?
> 
> Now Kate looks too complicated for me. Does KWrite have the same behavior
> with documents and tabs?

If you limit the number of tabs, that is the case, obviously, as if you have only maximal 10 tabs but 100 documents not all documents can have tabs.

But I think this discussion leads nowhere.

You get the exact behavior as Okular with turning elide on.
Even without that, the behavior is very close and Okular is not the gold standard for tabbing.

If you dislike our options, that is your choice.

If neither Kate nor KWrite fit your needs, that is perfectly fine, there are plenty of alternatives.