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

Svelte: fixup popover placement and root path rendering #62833

Closed
wants to merge 10 commits into from

Conversation

camdencheek
Copy link
Member

This offsets the file popover so the file names line up. Additionally, it hides the directory name when the file is located in the root directory because it looks awkward.

screenshot-2024-05-21_17-07-40@2x

Test plan

Manual visual testing.

@cla-bot cla-bot bot added the cla-signed label May 21, 2024
@camdencheek camdencheek requested review from taiyab and a team May 21, 2024 21:13
@camdencheek camdencheek marked this pull request as ready for review May 21, 2024 21:13
/**
* Show the popover when hovering over the trigger.
*/
export let showOnHover = false
export let placement: Placement = 'bottom'
export let offset: OffsetOptions = showOnHover ? 0 : 3
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This exposes the offset options, which can be used in conjunction with Placement. The default is the same default as before

placement="right-start"
offset={{
// A number which visually offsets popover header so the file names line up
crossAxis: -37,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a little awkward, but it doesn't need to be perfect so it's okay if it gets out of sync. I think an ideal solution here would probably look like "this point in my popover component defines the ideal anchor point"

Copy link
Contributor

@taiyab taiyab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Visually: LGTM!

@taiyab taiyab requested a review from a team May 21, 2024 21:26
@vovakulikov
Copy link
Contributor

@taiyab @camdencheek not a blocker for this PR but since we're changing file tooltip here, 5c of my feeback.

When I saw it for the first time I thought that the commit badge was in the incorrect place, I would expect it right after the "Last changed @" line, like this

Screenshot 2024-05-22 at 11 18 35

Also, I would try to add an arrow UI to the tooltip that points to the target (file entry in the file tree) similar to what we have in the tooltip (also not a blocker to this PR)

@camdencheek
Copy link
Member Author

@taiyab any thoughts on an arrow for the popover component specifically? Our tooltips have an arrow, but it was never added for the popovers

@taiyab
Copy link
Contributor

taiyab commented May 22, 2024

When I saw it for the first time I thought that the commit badge was in the incorrect place, I would expect it right after the "Last changed @" line, like this

I'd rather try and keep this as consistent as possible to how we (ought to) render the commits in other places too (history list, etc). So, instead of adding the SHA on the "Last changed" line, we just remove the "@" which is causing the confusion.

any thoughts on an arrow for the popover component specifically? Our tooltips have an arrow, but it was never added for the popovers

No need for this (at least for now). Thanks.

@camdencheek
Copy link
Member Author

Closing since we are removing file popovers from the file tree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants