kworkflow / patch-hub

patch-hub is a TUI that streamlines the interaction of Linux developers with patches archived on lore.kernel.org
GNU General Public License v2.0
8 stars 6 forks source link

fix: ui: correct loading screen rectangle dimensions #90

Closed lorenzoberts closed 2 weeks ago

lorenzoberts commented 3 weeks ago

This PR fixes a bug where the loading screen message doesn't appear in smaller terminal sizes. The idea behind the solution is to consider both the text size and frame dimensions to calculate the desired rectangle percentage. I've also added an automated test for this calculation.

Closes #75

Screenshots after the solution: Really small length, really small width: Captura de tela de 2024-11-02 12-05-04 Small length, small width: Captura de tela de 2024-11-02 12-04-56 Small length, big width: Captura de tela de 2024-11-02 12-04-45 Small width, big length: Captura de tela de 2024-11-02 12-04-26 Big sized terminal: Captura de tela de 2024-11-02 12-04-09 Full screen terminal: Captura de tela de 2024-11-02 12-03-49

If there is no length and width to show the message there is nothing we can do: Captura de tela de 2024-11-02 12-05-23

davidbtadokoro commented 2 weeks ago

Hey @lorenzoberts. Really, really neat fix!! Thanks for the great explanation and print screens you've added to the PR message, as they help me validate the change, as well as give the PR more context. You've not only fixed the bug but also made the loading screen more dynamic and adaptable to the terminal, so kudos!

Cleanly applied into the unstable branch :+1: