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

Adding the possibility to resize the content hover widget #176744

Closed
wants to merge 96 commits into from

Conversation

aiday-mar
Copy link
Contributor

@aiday-mar aiday-mar commented Mar 10, 2023

Fixes #14165

This PR adds the possibility to resize the content hover. Some notes about the PR:

  • The height is limited by the current total height of the hover widget given the current width.
  • The width is limited by the width of the screen.
  • The content hover is positioned with regards to the positioning preference (above or below) in the settings. If there is no space, it is placed on the other side. If the widget size has been persisted to a size that does not fit in the current screen, a smaller size than the persisted size is used.
  • As soon as the widget hover is resized, the size is persisted for the duration the VS Code window is active or until refreshing the page. The reason one single persist size is not used, as is the case for the suggest hover, is because of several factors:
    • The content hovers are of different sizes by default, some are wide, some are not. From what has been observed so far the suggest hover has always the same width.
    • Using one persist size would imply having to find the maximum possible width and height achievable in order not to set a width or height higher than these thresholds. Otherwise it may be that we would show a hover bigger than what is necessary to show all the contents. This would add complexity to the code.
    • Using one persist size could cause unintuitive sizing of the content hovers. The user most likely wants to resize content hovers on a per token basis.
  • The above points also explain why the content hover sizes are persisted only during the period of time VS Code is active or not refreshed yet, because otherwise many hover widget sizes would be persisted and take up memory.

Below you may find an example of the content hover resizing. The GIF is a bit out of date, the code has recently been modified in order to have sashes of the right size, ie, so that they are not overflowing over the height and width by 4px.

Screen.Recording.2023-03-23.at.16.16.14.mov

…in order to adapt the height and width to that
@aiday-mar aiday-mar dismissed a stale review via e1e47d7 March 24, 2023 10:38
@alexdima alexdima requested a review from aeschli March 30, 2023 07:05
@alexdima alexdima requested review from jrieken and removed request for aeschli March 31, 2023 07:33
@felixfbecker
Copy link
Contributor

I can't wait for this to land ❤️ It will make reading long TypeScript errors so much easier.

@drupol
Copy link

drupol commented Apr 23, 2023

We are all waiting for that I think :)

@aiday-mar
Copy link
Contributor Author

Hey all, thank you all for your interest. I apologize, it will take a bit more time to release the code, as it requires some refactoring and polishing. Thanks again

@with-heart
Copy link

Thanks so much @aiday-mar for your time and effort implementing this. It will be a nice change once it lands! ❤️‍🔥

@aiday-mar
Copy link
Contributor Author

aiday-mar commented Jun 16, 2023

Current PR that is worked on is the following: #178811. It contains review and refactoring changes. It introduces a generic type that can be used to define resizable content widgets and can be extended by other widgets. This PR will be discontinued.

@aiday-mar aiday-mar closed this Jun 16, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jul 31, 2023
@aiday-mar aiday-mar deleted the aiday/issue#14165 branch August 8, 2023 12:21
@aiday-mar aiday-mar restored the aiday/issue#14165 branch August 8, 2023 12:22
@aiday-mar aiday-mar deleted the aiday/issue#14165 branch August 8, 2023 12:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
editor-hover Editor mouse hover feature-request Request for new features or functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Configure tooltip max width
5 participants