fix(IdeMenu): Don't make description position depend on description width #996
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Goes towards fixing #995 (description box can change sides for every suggestion with the IdeMenu, causing seizures for photosensitive users)
This PR makes it so that which side the description box is on is not influenced by the description itself (only applicable when the
description_modeisPreferRight, the default). This means that when scrolling down the list of completions, it will never change sides. The PR also fixes a bug where, if the description menu was on the left, it would sometimes push the completions box to the right, causing more motion.Breaking change
However, a breaking change caused by this is the change in the meaning of
min_description_width. Previously, it was set to 0 by default, and now I'm setting it to 15 (arbitrary choice, open to changing it). Opened nushell/nushell#17280 to update this on the Nushell side. I'm unsure what exactly its purpose was before, but it's now used as the threshold for deciding when to switch the description box to the left.For example, if
min_description_widthis 15, then as long as we have 15 columns available on the right of the completions box, the description box can stay on the right. Once we have 14 or fewer columns available, the description box switches to the left. Settingmin_description_widthto 0 would effectively force the description box to stay on the right.Recordings
Here's a recording of what the default IdeMenu looks like in Nushell (warning: I decreased the playback speed but the recording includes scrolling down the menu, not sure if that can trigger seizures. Recommendation from alicealysia is to decrease window size first if you're photosensitive):
And here it is with

correct_cursor_pos: true: