Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Response pane gutters are taking excessive space on screen in Insomnia 9 #7323

Open
1 task done
DusanLesan opened this issue Apr 25, 2024 · 2 comments
Open
1 task done
Labels
B-bug Bug: general classification S-unverified Status: Unverified by maintainer

Comments

@DusanLesan
Copy link

DusanLesan commented Apr 25, 2024

Expected Behavior

The app should minimize wasted space, allowing users to fit as much important information as possible.

  1. CodeMirror-gutter CodeMirror-linenumbers element should take space for a single-digit number and expand as needed
  2. CodeMirror-gutter CodeMirror-lint-markers element should not take up any space if the functionality is not active

Actual Behavior

When I make a request that returns smaller response, the app UI takes unnecessary space for displaying the response. These elements take too much space.
image

Is there an existing issue for this?

Insomnia Version

9.0.0

What operating system are you using?

Other Linux

Operating System Version

Linux arch 6.8.7-arch1-1 #1 SMP PREEMPT_DYNAMIC Wed, 17 Apr 2024 15:20:28 +0000 x86_64 GNU/Linux

Installation method

AUR

@DusanLesan DusanLesan added B-bug Bug: general classification S-unverified Status: Unverified by maintainer labels Apr 25, 2024
@gatzjames
Copy link
Contributor

gatzjames commented Apr 26, 2024

Hi @DusanLesan thanks for the feedback.
The space is there for visual hints to appear when there are errors or when line numbers grow to triple digits see example
image
I think the issue about saving space is valid.
I haven't seen a code editor that jumps around as lines get added. That would be a weird experience and a bit surprising to the user.
Looking at how other code editors solve this issue we could add an option to show/hide line numbers in the app settings.

@DusanLesan
Copy link
Author

DusanLesan commented Apr 26, 2024

I haven't seen a code editor that jumps around as lines get added. That would be a weird experience and a bit surprising to the user.

@gatzjames When the new request is made, the whole pane would refresh to display new data and the gutter width would be re-calculated at that time. I would expect gutter increasing in width would not affect rest of the UI and only the pane with the content (space for text in preview would get reduced, but the layout would remain unaffected). I have no idea when these errors are displayed, but I personally would not mind the whole gutter for errors being added or removed as the errors are detected.

Here is what neovim does:
image
There is a minimum of 3 chars and the linecount space is further expanded as needed.
Note the way nvim notifies about removed lines in git in lower right window: simply change number color. That could be a alternative solution to display those errors

output.mp4

Even if the code is editable, and the number of lines drastically changes, I do not find it jarring for the line-number width to change

[edit]: I just saw errors in request body pane. I now understand how it could be a issue to add/remove error gutter as you are typing and errors are introduced and then fixed. Solution would be to have gutter as you put cursor in the editable pane, but remove it when you remove cursor and there are no errors. However, my biggest issue is with response preview pane that is not even editable. I do not need any error validation there and gutter would not be even needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B-bug Bug: general classification S-unverified Status: Unverified by maintainer
Projects
None yet
Development

No branches or pull requests

2 participants