Adjust calculating collapsed breadcrumbs for a medium size variant
There have been reports of flickering breadcrumbs, when the first item is switching between collapsed and non-collapsed state:
Users are experiencing a flickering issue in breadcrumbs where short folder names (typically 3-letter words like "app", "foo", "sre", "iglu") continuously toggle between the actual name and "..." ellipsis. This makes the breadcrumbs unusable as users cannot click on them.
See gitlab-org/gitlab#546417 (closed) for more context.
When we implemented a medium size of breadcrumbs, the hardcoded value for buttonWidth in makeBreadcrumbsFit() was note adjusted.
The small size dropdown toggle measures 24px, 26px with the boarder. It's the same for the dropdown toggle, when the dropdown is of size medium. Despite the same toggle size, breadcrumb-item-sm that includes the dropdown toggle measures 46.328px in width, while breadcrumb-item-md with the same toggle measures 47.05px.
Note: It's quite hard to reproduce. I was able to do it on the GDK under this url: http://gdk.test:8080/gitlab-org/iglu/-/tree/master/src/test/java/com/example