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 type ResizableContentWidget - using it for the content hover widget #178811

Merged
merged 75 commits into from
Jun 21, 2023

Conversation

aiday-mar
Copy link
Contributor

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

Fixes #14165

This PR defines the types ResizableContentWidget which can be used to implement resizable content widgets. The PR also introduces the SingleSizePersistingMechanism and the MultipleSizePersistingMechanism which can be used to define method for persisting the widget sizes. The first class saves a single persisted size while the second class saves persisted sizes on a per-token basis.

In addition to these abstractions, the PR also adds the possibility to resize the content hover. It uses the above abstractions. Some notes about the PR:

  • The height is limited by the current total height of the hover widget given the current width. It is possible that the no cap is put on the maximum rendering height. (TBD)
  • 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.
  • For the time being, 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 hover sizes are persisted on a per token basis. It is possible that this functionality is removed and the hover sizes are not persisted at all (TBD)

Below you may find an example of the content hover resizing.

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

drefcot17th
drefcot17th previously approved these changes Apr 1, 2023
… content widget of the resizable hover widget
@aiday-mar aiday-mar added editor-hover Editor mouse hover feature-request Request for new features or functionality labels Jun 16, 2023
@aiday-mar aiday-mar changed the title Adding a ResizableContentWidget type and using it for the resizable content hover Adding a ResizableContentWidget type, using it for the Hover Widget Jun 16, 2023
@aiday-mar aiday-mar changed the title Adding a ResizableContentWidget type, using it for the Hover Widget Adding a ResizableContentWidget type - using it for the Hover Widget Jun 16, 2023
@aiday-mar aiday-mar changed the title Adding a ResizableContentWidget type - using it for the Hover Widget Adding type ResizableContentWidget - using it for the Hover Widget Jun 16, 2023
@aiday-mar aiday-mar changed the title Adding type ResizableContentWidget - using it for the Hover Widget Adding type ResizableContentWidget - using it for the content hover widget Jun 16, 2023
@aiday-mar aiday-mar merged commit 8220e28 into main Jun 21, 2023
@aiday-mar aiday-mar deleted the aiday/addingResizableContentWidget branch June 21, 2023 10:23
@github-actions github-actions bot locked and limited conversation to collaborators Aug 5, 2023
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
2 participants