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

Fix: Add soft wrap for ghost text #5540

Merged
merged 3 commits into from Apr 30, 2024
Merged

Conversation

mkslanc
Copy link
Contributor

@mkslanc mkslanc commented Apr 26, 2024

Issue #, if available: #5513

Description of changes:
The current implementation wraps all long text based on the screen width. I am considering whether it makes sense to adhere to the user's wrap settings in this case. In my opinion, it would be beneficial to display and wrap the entire line of ghost text, but this point is open for discussion.

screen-capture.58.webm

(Test completion includes sentences with newlines)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Pull Request Checklist:

@mkslanc mkslanc marked this pull request as draft April 26, 2024 14:08
@akoreman
Copy link
Contributor

akoreman commented Apr 26, 2024

This looks a nice change! Do you see a nice way to communicate to users in the ghost text which line breaks are due to the soft-wrapping and which line breaks are actual line breaks in the suggestion?

@akoreman
Copy link
Contributor

I am considering whether it makes sense to adhere to the user's wrap settings in this case.

Given that it's not possible to scroll the editor while ghost text is shown, I think horizontal overflowing beyond the viewport is annoying and it would be a better user experience to ghost the ghost text soft-wrapped, regardless of whether the user has soft-wrap enabled for the rest of their code or not.

@mkslanc
Copy link
Contributor Author

mkslanc commented Apr 29, 2024

This looks a nice change! Do you see a nice way to communicate to users in the ghost text which line breaks are due to the soft-wrapping and which line breaks are actual line breaks in the suggestion?

I think I could make it work either by tweaking the CSS or by adding a wrapping symbol at the end of the wrapped lines. I'll test something and push the changes in time.

Copy link

codecov bot commented Apr 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.65%. Comparing base (15f6be2) to head (4b5837f).
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5540      +/-   ##
==========================================
+ Coverage   86.64%   86.65%   +0.01%     
==========================================
  Files         593      593              
  Lines       42839    42873      +34     
  Branches     7120     7123       +3     
==========================================
+ Hits        37117    37151      +34     
  Misses       5722     5722              
Flag Coverage Δ
unittests 86.65% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mkslanc
Copy link
Contributor Author

mkslanc commented Apr 29, 2024

@akoreman, this should make it, I think

screen-capture.60.webm

@mkslanc mkslanc marked this pull request as ready for review April 29, 2024 11:41
@akoreman
Copy link
Contributor

Looks good to me, thanks for this contribution 🚀

@akoreman akoreman merged commit 6a26b27 into ajaxorg:master Apr 30, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants