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

[Feature]: Persisting the sizes on a per-token basis for the content hover #187904

Open
aiday-mar opened this issue Jul 14, 2023 · 0 comments
Open
Assignees
Labels
editor-hover Editor mouse hover feature-request Request for new features or functionality
Milestone

Comments

@aiday-mar
Copy link
Contributor

aiday-mar commented Jul 14, 2023

Currently the implementation of the persistance mechanism of the content hover works as follows:


The content hover has a default maximum size which is defined as follows:

const defaultMaxHeight = Math.max(this._editor.getLayoutInfo().height / 4, 250);
const defaultMaxWidth = Math.max(this._editor.getLayoutInfo().width * 0.66, 500);

Whenever the content hover is resized, the last hover dimensions are stored. Next time the content hover is shown, the maximum dimensions are updated as follows:

const currentMaxHeight = Math.max(this._editor.getLayoutInfo().height / 4, 250, lastHeight);
const currentMaxWidth = Math.max(this._editor.getLayoutInfo().width * 0.66, 500, lastWidth);

The content hover is rendered naturally within these constraints. If the lastHeight and lastWidth are smaller than the default max dimensions, then the current max dimensions are unchanged. Therefore the next rendering of the content hover will be the same as the initial rendering.


The potential issue with this persistance mechanism implementation is that it can cause unexpected resizing of the content hover. The proposal here is to persist the size of the content hover on a per token basis in the editor. In other words, all content hovers dimensions will be persisted on an individual basis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editor-hover Editor mouse hover feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

1 participant