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

Add customisation options to prevent inline completer resizing aggressively #16507

Merged

Conversation

krassowski
Copy link
Member

References

Code changes

Adds new completion inline settings :

  • minLines
  • maxLines
  • reserveSpaceForLongest
  • spacerRemovalDelay

User-facing changes

None by default, but:

  • maxLines adds a collapser for preview of remaining lines
    collapser
  • minLines adds additional empty lines
  • reserveSpaceForLongest: adds additional empty lines to match the space of the longest completion

Backwards-incompatible changes

None

This fixes the issue caused by the increased number of
lines in the placeholder due to the use of `max-width: 0`;
the `max-width: 0` was used to prevent the placeholder from
expanding in width (due to the necessity of using `display:
inline-block` to animate font size reduction effectively;
instead the lines placeholder is now rendered with a single
character in each line which preserves the functionality
but frees use from both issues.
to prevent randomly selecting the ghost text/line spacer
in another cell. Also fixes waitForTimeout being called
out of sequence.
timeout customization, and min height across suggestions
@krassowski krassowski added the bug label Jun 19, 2024
@krassowski krassowski added this to the 4.2.x milestone Jun 19, 2024
Copy link

Thanks for making a pull request to jupyterlab!
To try out this branch on binder, follow this link: Binder

@github-actions github-actions bot added pkg:completer tag:Testing tag:CSS For general CSS related issues and pecadilloes Design System CSS labels Jun 19, 2024
Copy link
Member

@fcollonval fcollonval left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @krassowski

@krassowski krassowski merged commit 0805154 into jupyterlab:main Jul 3, 2024
85 checks passed
@krassowski
Copy link
Member Author

@meeseeksdev please backport to 4.2.x

@krassowski krassowski deleted the inline-completer-min-max-lines branch July 3, 2024 14:43
Copy link

lumberbot-app bot commented Jul 3, 2024

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
git checkout 4.2.x
git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
git cherry-pick -x -m1 080515495117111e4b2adb5bde408bfa8060bb5f
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
git commit -am 'Backport PR #16507: Add customisation options to prevent inline completer resizing aggressively'
  1. Push to a named branch:
git push YOURFORK 4.2.x:auto-backport-of-pr-16507-on-4.2.x
  1. Create a PR against branch 4.2.x, I would have named this PR:

"Backport PR #16507 on branch 4.2.x (Add customisation options to prevent inline completer resizing aggressively)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove the Still Needs Manual Backport label once the PR gets merged.

If these instructions are inaccurate, feel free to suggest an improvement.

krassowski added a commit to krassowski/jupyterlab that referenced this pull request Jul 3, 2024
krassowski added a commit to krassowski/jupyterlab that referenced this pull request Jul 3, 2024
krassowski added a commit that referenced this pull request Jul 18, 2024
ImpSy pushed a commit to spotinst/jupyterlab that referenced this pull request Jan 7, 2025
…sively (jupyterlab#16507)

* Add a test for ghost text spacer

* Fix the lines placeholder taking up too much space

This fixes the issue caused by the increased number of
lines in the placeholder due to the use of `max-width: 0`;
the `max-width: 0` was used to prevent the placeholder from
expanding in width (due to the necessity of using `display:
inline-block` to animate font size reduction effectively;
instead the lines placeholder is now rendered with a single
character in each line which preserves the functionality
but frees use from both issues.

* Update snapshots

* Improve tests: make the ghost locator editor-specific

to prevent randomly selecting the ghost text/line spacer
in another cell. Also fixes waitForTimeout being called
out of sequence.

* Use `text-wrap: none` to prevent height inflation in spacer

* Implement minimum and maximum size for inline completer,

timeout customization, and min height across suggestions

* Simplify the tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Design System CSS pkg:completer tag:CSS For general CSS related issues and pecadilloes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inline completer should not resize the cell editor aggressively when streaming
2 participants