perfetto icon indicating copy to clipboard operation
perfetto copied to clipboard

UI: Anchor component children overflow parent container width

Open KananSu opened this issue 1 year ago • 5 comments

Issue Description:

Hi, Dear Perfetto Team.

I would like to report a minor issue with the Anchor component. When the children content of an Anchor component is excessively long, it tends to overflow its parent container's width. Image

Suggested Solution:

Adding the CSS property max-width: 100% to the Anchor component can help ensure that long content wraps correctly.

.pf-anchor {
  display: inline-block;
  line-height: 1;
  max-width: 100%; /* Ensures content does not exceed parent container's width */
}

I would be happy to submit a PR to implement this change if it would be helpful. Please let me know if this approach sounds good to you.

Thank you for considering this suggestion and for your continued dedication to the project.

KananSu avatar Mar 14 '25 09:03 KananSu

@stevegolton, can you take a look at this?

aMayzner avatar Mar 14 '25 10:03 aMayzner

Hi @KananSu, thanks for raising the issue.

I don't believe the 100% patch to be the correct solution, as it could cause issues in other layouts.

I think the main problem is the display: inline-block, which IIRC was used to ensure the icon stays aligned vertically with the text.

I think, however, the proper fix is to rewrite the anchor entirely as it has other issues (such as multiline), and is probably over-engineered as it is, but unfortunately this is not a super high priority so I'm going to close this bug.

Thanks for bringing it to my attention, though.

stevegolton avatar Mar 17 '25 13:03 stevegolton

Hi @stevegolton Thank you for taking the time to review and respond to my issue.

I understand that this may not be a high priority at the moment. I appreciate the work you are doing on Perfetto and hope that this issue can be revisited in the future when priorities allow.

Best regards.

KananSu avatar Mar 17 '25 13:03 KananSu

Seems like steve is fixing this with https://r.android.com/c/3548479/8 so reopening.

LalitMaganti avatar Mar 18 '25 09:03 LalitMaganti

It turned out to be an easy fix. Should be landing on autpush shortly.

stevegolton avatar Mar 18 '25 13:03 stevegolton