Bug 507504

Summary: "Compact" tab-box has no character limit for a window title
Product: [Plasma] kwin Reporter: Antonino Scordino <me>
Component: tabboxAssignee: KWin default assignee <kwin-bugs-null>
Status: CONFIRMED ---    
Severity: minor CC: nate
Priority: NOR Keywords: usability
Version First Reported In: 6.4.3   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: "Compact" tab-box fully displays the window's title

Description Antonino Scordino 2025-07-26 10:22:38 UTC
Created attachment 183529 [details]
"Compact" tab-box fully displays the window's title

SUMMARY
When having a window open that contains a long title (common with web-browsing), the "Compact" tab-box increases its length in order to fit the entire title. This flex causes other window's title to shifted to the left, making them harder to read.

STEPS TO REPRODUCE
0. Have a window with a window title longer than 36 characters;
1. Go to "Settings", open the "Window Management > Task Switcher" page;
2. Select "Compact" in the "Visualization" menu;
3. Switch windows via "Alt + Tab" (or similar shortcut).

OBSERVED RESULT
The window's title is long enough to causes the "Compact" box to increase its length.

EXPECTED RESULT
The window's title is cut after a determinate amount of characters are exceeded.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.4.3
KDE Frameworks Version: 6.16.0
Qt Version: 6.9.1

ADDITIONAL INFORMATION
My propose to close such issue would be to follow the same character limit present in the "Thumbnail Grid", and similar, tab-box(es).
Comment 1 Antonino Scordino 2025-07-26 11:02:02 UTC
This issue lies on the 'TextMetrics' type of 'kwin/windowswitchers/compact/contents/ui/main.qml' on "Plasma Add-ons". 
I honestly thought I had to go through a rabbit-hole to find the culprit.

I do not understand QML, but my guess is that a condition in said type has to be made where, in case 'longestCaption' is greater than thirty-six, the caption should be cut to be the beforehand mentioned character length. 

This should also preserve the application's title (e.g."— Mozilla Firefox", "— Dolphin"). 
Hope this can help whoever is interested in fixing this.