Skip to content

cm file view: Add max width to hovercard and fix(?) positioning problem

Warren Gifford requested to merge fkling/cm-file-view-hovercard-width into main

Created by: fkling

This commit adds a max width to the hovercard. Currently a hovercard might use the full window width if necessary, which is bad on large screens.

This also adds a callback function to the component to inform the parent that it was rendered. I hope this fixes the positining issues mentioned in https://github.com/sourcegraph/sourcegraph/pull/39482#pullrequestreview-1053177608 but I wasn't able to reliable reproduce the issue so I can't verify it.

Test plan

  • Enable CodeMirror file view with `"enableCodeMirrorFileView": true".
  • Open a file.
  • Hover over a token (e.g. Go's time shows a lot of text). The hovercard width should be constraint.
  • Repeatedly hover over various tokens. As long as there is space the hovercard should always appear above the line.

App preview:

Check out the client app preview documentation to learn more.

Merge request reports

Loading