https://bugs.kde.org/show_bug.cgi?id=492090

            Bug ID: 492090
           Summary: the LSP plugin doesn't make the popup box large enough
                    to show the text in it without wrapping / scrolling
    Classification: Applications
           Product: kate
           Version: 24.08.0
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: kwrite-bugs-n...@kde.org
          Reporter: adam.m.fontenot+...@gmail.com
  Target Milestone: ---

Created attachment 172886
  --> https://bugs.kde.org/attachment.cgi?id=172886&action=edit
screenshot of issue with large window size

SUMMARY

This is a follow up to Bug 492062 by request, since part of the issue described
in that bug (incorrect hard wrapping) was fixed.

The LSP plugin popup seems to use some sizing logic where the maximum allowed
width of the box is something like 100px + 40% of textarea size. (I haven't
looked at the code for that, it's just based on observation.)

This doesn't work well for some documentation. As I showed in the previous
report, even a Kate window with width 1778 px and *no* side panels open is
insufficient to show a mere 72 columns of Rust documentation, and as a result
the LSP plugin adds a horizontal scrollbar.

Horizontal scrolling is really bad UX for several reasons: it requires
continuously scrolling in two different directions for every line of text, in
order to read it; and it tends to react badly when scrolling down on a touchpad
because it's difficult to avoid scrolling slightly to the right or left.

I have several proposals for improving this situation, which I'll give after
the reproduction steps below.


STEPS TO REPRODUCE
1. Open a Kate window to a large size, e.g. 1778 pixels wide. I'm using a size
13 font, for what it's worth.
2. Open some Rust code with the rust-analyzer support enabled for LSP plugin.
3. Hover over a `String` object from the rust std library.

OBSERVED RESULT

The hover box has a horizontal scrollbar.

EXPECTED RESULT

Three possible solutions:

1. Simply make the box a little bit bigger! As you can see in the screenshot,
it's using a pretty small portion of my screen. I see no good reason not to
allow the box to be e.g. 60% of the textarea width.

2. Change the text size in the popup box to be slightly smaller than the normal
text size in the code editor widget, or allow this to be done through a
setting.

3. If all else fails and the text doesn't fit, prefer soft wrapping it to
inserting a scrollbar. Because scrolling is really bad UX, soft wrapping is to
be preferred even if this might make code examples shown in the popup box
technically invalid if you typed them in literally (but copy / paste out of the
box would still work!).

I think _all three_ of these changes are desirable in their own right, and
implementing any of them individually would greatly improve the issue of long
text lines in the language server output.



SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.1.4
KDE Frameworks Version: 6.5.0
Qt Version: 6.7.2
Kernel Version: 6.10.5-arch1-1 (64-bit)
Graphics Platform: Wayland

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to