viewer-components-react icon indicating copy to clipboard operation
viewer-components-react copied to clipboard

Tree widget: Inconsistent/Overlapping button spacing

Open AntanasBuk opened this issue 8 months ago • 10 comments

IconButtons with "isActive" property have overlapping backgrounds. Image

For: "@itwin/tree-widget-react": "^3.7.0"

AntanasBuk avatar May 14 '25 12:05 AntanasBuk

Is this at 100% browser scaling? I see that the text in Select box is also cut off at the bottom... Also, what's the browser?

grigasp avatar May 15 '25 06:05 grigasp

This is with electron. The problem does not change with different zoom levels. Changing window size shuffles the buttons a bit where they all might have a single pixel overlap, and the letter "g" in Categories becomes more visible in some cases but never all the way (not sure if there is any browser scaling setting anywhere in electron).

AntanasBuk avatar May 15 '25 07:05 AntanasBuk

I just compared it with another Electron app, and it looks like the fonts might be slightly different in those Select boxes: Image

What font styles do you see for that "Categories" span? Image

Also, what iTwinUI version are you using?

grigasp avatar May 15 '25 08:05 grigasp

@iTwin/itwinui, I'm seeing the buttons overlap here, too: https://itwin.github.io/iTwinUI/react/?arg-future.themeBridge=true&story=buttongroup--with-icons

Image

Just set the buttons to be "borderless" and make two adjacent buttons "active".

grigasp avatar May 15 '25 08:05 grigasp

What font styles do you see for that "Categories" span?

Same as yours Image

AntanasBuk avatar May 15 '25 09:05 AntanasBuk

version: @itwin/[email protected]

AntanasBuk avatar May 15 '25 11:05 AntanasBuk

@iTwin/itwinui, I'm seeing the buttons overlap here, too: https://itwin.github.io/iTwinUI/react/?arg-future.themeBridge=true&story=buttongroup--with-icons

I am able to reproduce it.

Screenshot showing overlapping edges of borderless buttons

The overlapping borders is a feature for default buttons, but not strictly necessary for borderless buttons.

Before we try to fix it, I have two questions:

  1. What is the use case for having multiple active buttons in a toolbar? Usually there should only be one active button.
  2. Isn't this widget supposed to be using StrataKit toolbar/buttons, where this problem doesn't occur?

mayank99 avatar May 15 '25 14:05 mayank99

  • What is the use case for having multiple active buttons in a toolbar? Usually there should only be one active button.

In this specific situation the buttons are coming from the app, but some of the standard widget's buttons use the "active" state to show that they're toggled-on.

  • Isn't this widget supposed to be using StrataKit toolbar/buttons, where this problem doesn't occur?

This is the 3.x widget version that uses iTwinUI.

grigasp avatar May 16 '25 04:05 grigasp

I do think there is a UX/design issue (multiple toggled on buttons should generally not be allowed). But we can look into the CSS issue if someone opens an issue in the iTwinUI repo.

mayank99 avatar May 20 '25 16:05 mayank99

we can look into the CSS issue if someone opens an issue in the iTwinUI repo.

@AntanasBuk can you please do that?

grigasp avatar May 20 '25 17:05 grigasp

I'm closing this issue as the underlying problem in iTwinUI has been fixed and there's nothing to do about it in our packages.

grigasp avatar Jun 27 '25 05:06 grigasp