Skip to content

Wildcard: [Experimental] Add wildcard popover (custom tether calc)

Administrator requested to merge vk/add-wildcard-popover-tether-comp into main

Created by: vovakulikov

Context

This PR is based on https://github.com/sourcegraph/sourcegraph/pull/29488 and implements a new Popover component with context-specific API and tether sub-module for floating panels position calculation (instead of using 3 party lib like floating-ui).

Screenshot 2022-01-15 at 15 47 34

Sidenote about @floating-ui

Problems that I've got in the code insights drill down popover

  • Determine available space and set this as a max-size max-height to popup element. Here we need to point out that @floating-ui has a special setting/plugin for it but this doesn't work really well if we need a floating panel with auto-placement and sizing at the same time.
  • Flipping isn't perfect as well. TLDR; with size, shift, flip plugins at least in code insights popovers this logic picks non-optimal sizes/sides of popover elements.

Todo

  • Add tether calculation sub-package (our own implementation of popover position logic)
  • Re-create Popover component with new api and new tether package
  • Write examples
  • Write documentation and migration guide

Merge request reports

Loading