Blob view: Line numbers and margins take up too much width on small screens
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Taking the proposal scrrenshot from #450774 (closed):
- The unscrollable line number column takes up 25% of the screen width
- The margins take up another 9%
- Only about 65% is left for the source code
This makes reading code on the go unnecessarily painful as one has to scroll left and right constantly.
This is partially a cause of this forum post about the diff view, with the line numbers wasting lots of width on whitespace.
I've observed that this hurts UX bad enough for me to end up using a GitHub mirror to view a file rather than viewing it natively in GitLab.
Proposed solutions:
- The line number section should not reserve space for 9 digits when files rarely go above 5 digits in number of lines. Even taking the blame button into account, it is reserving way too much whitespace. It could be made to only be as wide as the blob needs it to be + the blame button. (So a 30-line file gets a line number part for 2 digits, while a 15000-line file gets 5 digits.)
- The line number section could be made to scroll with the code, at least on small screens where the tradeoff is worth it.
- The viewer widget could be made to touch the screen border on small screens, again because the tradeoff on small screens is worth it.
Edited by 🤖 GitLab Bot 🤖