fix: More Notion-like side menu positioning #812
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR changes the side menu to be positioned centered on the first line of a block. Blocks with no text content usually assume the line height of a paragraph block.
This solution is a bit hacky in that the line height values for different blocks are hard coded instead of taking them from a bounding box, though fixing this would add a lot of complexity. Fortunately, it's easy for consumers to change those values via CSS.
Also, Notion does not center the side menu for things like file blocks, instead using the paragraph block line height, as you can see below:

I think this looks really ugly since the block is short enough that I think it should be centered, so I changed this for file & audio blocks also, as well as for when the add file button is showing in all types of file blocks.
Closes #386