Bug 8544 - Titles in tlctl tables can be needlessly truncated
Summary: Titles in tlctl tables can be needlessly truncated
Status: CLOSED FIXED
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Misc (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: 4.19.0
Assignee: Pierre Ossman
URL:
Keywords: prosaic, tobfa_tester
Depends on:
Blocks:
 
Reported: 2025-03-14 11:12 CET by Pierre Ossman
Modified: 2025-03-27 12:44 CET (History)
2 users (show)

See Also:
Acceptance Criteria:
MUST: * Table title should never be cropped if it is below the default limit (80 columns) * Table title should never be cropped if it is shorter than the width of the table as determined by the headers and contents


Attachments

Description Pierre Ossman cendio 2025-03-14 11:12:08 CET
(moved from 8543)

The width of a table from tlctl is decided from the headers and data. But if the title is longer than both of those, then it gets truncated, even if we are nowhere near the limit of 80 columns:

> Subcluster: "...
> ================
> AGENT      USERS
> ================
> foobar      DOWN
> localhost   DOWN
Comment 5 Pierre Ossman cendio 2025-03-17 10:42:47 CET
All fixed! Tested on RHEL 10 beta.

> MUST:
> 
>  * Table title should never be cropped if it is below the default limit (80 columns)

Indeed. The table now widens to fit the title. It is also still cropped at 80 columns.

>  * Table title should never be cropped if it is shorter than the width of the table as determined by the headers and contents

I don't know how to test this, as it happens when we have lots of headers. I've added a unit test that passes, though.
Comment 6 Tobias cendio 2025-03-25 12:57:24 CET
Reopening for discussion regarding table presentation.
Comment 7 Linn cendio 2025-03-26 13:15:57 CET
(In reply to Tobias from comment #6)
> Reopening for discussion regarding table presentation.
The current implementation makes the table as wide as the table title, if the title is longer than the table. See example below from command "tlctl load list":
> Subcluster: "Default"
> ========================
> AGENT      USERS  STATUS
> ========================
> 127.0.0.1      0  UP
> 
> Subcluster: "TestClusterVeryLongName1234567898012345"
> =====================================================
> AGENT                         USERS  STATUS          
> =====================================================
> 127.0.0.1                         0  UP   
Personally, I think the upper table is more readable, since the lower table is starting to get overly spacious.

This table formatting issue will be separated into a new bug, so this bug does not need further fixes or discussions. Marking as Resolved.
Comment 8 Linn cendio 2025-03-26 13:46:00 CET
(In reply to Linn from comment #7)
> ...
> This table formatting issue will be separated into a new bug
Bug 8556 has been created for this issue.
Comment 9 Tobias cendio 2025-03-27 12:44:30 CET
Tested on Ubuntu24.04 using servers 4.18.0 and 4.18.0post_3954. 

Confirmed using tlctl load module that, contrary to 4.18.0, the new build 

    • does not needlessly crop long titles in the case of thin table content
    • does not crop titles when both the title and table content exceeds 80 characters, if the table content is wider than the title
    • does crop the title when both the title and table content exceeds 80 characters, if the title is wider than the table content

AC:
> MUST:
> * Table title should never be cropped if it is below the default limit (80 columns)
✅︎ Titles are never cropped below default limit of 80, regardless of table content width.
> * Table title should never be cropped if it is shorter than the width of the table as determined by the headers and contents
✅︎ Tested these code bits outside of ThinLinc and could not find any problems with rare corner cases. In addition, the added unit test passes as intended.

Everything appears to be in order -- closing.

Note You need to log in before you can comment on or make changes to this bug.