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

TreeWidget: UI issues on mobile #1155

Open
ValdasSorys opened this issue Jan 27, 2025 · 10 comments
Open

TreeWidget: UI issues on mobile #1155

ValdasSorys opened this issue Jan 27, 2025 · 10 comments
Labels
tree widget Tree widget or its components related issues

Comments

@ValdasSorys
Copy link

Issues found while trying to update to "@itwin/tree-widget-react": "3.2.4" (previously version 2.3.4 was used) on a touchscreen device (Android/iOS):

  1. Most of the time need to press multiple times to expand/show/hide node. Video:
Simulator.Screen.Recording.-.14.Pro.16.4.-.2025-01-27.at.13.07.43.mp4
  1. Scrolling becomes broken after opening some nodes. Video:
Simulator.Screen.Recording.-.14.Pro.16.4.-.2025-01-27.at.13.09.46.mp4
  1. “Please provide additional filtering…” message doesn’t fit (also it becomes possible to scroll horizontally (shouldn’t happen), message is cut off even if scrolled horizontally):
  1. Filtering UI doesn't fit:

Code for the tree from our side:

interface CustomModelsTreeProps {
  viewport: Viewport;
  selectionStorage: SelectionStorage;
  imodel: IModelConnection;
}
function CustomModelsTreeComponent({ viewport, selectionStorage, imodel }: CustomModelsTreeProps) {
  const { modelsTreeProps, rendererProps } = useModelsTree({
    activeView: viewport, hierarchyConfig: {
      elementClassGrouping: "enable",
    },
    selectionPredicate: ({ type }) => type === "element",
  });

  return (
    <VisibilityTree
      {...modelsTreeProps}
      selectionMode="multiple"
      density="enlarged"
      getSchemaContext={getSchemaContext}
      selectionStorage={selectionStorage}
      imodel={imodel}
      treeRenderer={(props) => <VisibilityTreeRenderer {...props} {...rendererProps} />}
    />
  );
}
@grigasp grigasp added the tree widget Tree widget or its components related issues label Jan 27, 2025
@grigasp
Copy link
Member

grigasp commented Jan 27, 2025

Thanks. I split this into 4 different issues, as they'll need to be investigated individually.

@ValdasSorys
Copy link
Author

@grigasp I looked in a bit more and issues 2. and 3. can only be reproduced on iOS (not reproduced on Android, where same web code is used). Also, not sure if related but this error seems to be spammed when scroll glitches out on iOS (issue 2.) Error: Invalid value for <svg> attribute height="1rem".

@ValdasSorys
Copy link
Author

Also any idea when the fixes would be released??

@grigasp
Copy link
Member

grigasp commented Jan 31, 2025

Also any idea when the fixes would be released??

Didn't get a chance to look into them yet. I hope someone on the team will have time to do that next week. The time it'll take us to fix this will depend on what we find...

  • Issues 1-2 likely come from our underlying iTwinUI Tree component. Need to investigate to confirm, but either way they seem like small fixes.
  • 3rd issue is interesting... You mention it's only reproducible on iOS. Can you post a screenshot showing how it looks like on Android?
  • 4th issue will require significant work to make the dialog render nicely on small screens. I guess one thing you could do is set filterButtonsVisibility to hide (see https://github.com/iTwin/presentation/blob/master/packages/hierarchies-react/CHANGELOG.md#150) when rendering nodes. That would hide the filtering capability from users for the most part.

@ValdasSorys
Copy link
Author

Sorry, I used incorrect numbers for issues. Issues 1 (needing to click multiple times) and 2 (scrolling glitching out) can only be reproduced on iOS. Issues 3 (the message not fitting) and 4 (filtering ui not fitting) can be reproduced on both iOS and Android.

@grigasp
Copy link
Member

grigasp commented Jan 31, 2025

Sorry, I used incorrect numbers for issues. Issues 1 (needing to click multiple times) and 2 (scrolling glitching out) can only be reproduced on iOS. Issues 3 (the message not fitting) and 4 (filtering ui not fitting) can be reproduced on both iOS and Android.

Okay. So I think we can pretty quickly fix 1-2. 4th will take time (I'd say end of Q1 at best). 3rd needs discussion, I'll ping you on #1158

@ValdasSorys
Copy link
Author

ValdasSorys commented Feb 3, 2025

I couldn't find where to apply filterButtonsVisibility (also would it be possible to completely disable the filtering UI, even from the message that appears when elements don't fit?).

Also we are trying to implement custom tree header (hideable/different UI), but can't implement focus mode as it isn't accessible when not using ModelsTreeComponent (could needed stuff be exported?).

@grigasp
Copy link
Member

grigasp commented Feb 3, 2025

I couldn't find where to apply filterButtonsVisibility

Yeah, it looks like it's not exposed through tree widget APIs. Which top-level tree widget components are you rendering in your app?

also would it be possible to completely disable the filtering UI, even from the message that appears when elements don't fit?

That would basically make it impossible for users to get to their data. So I don't think we want to allow that.

Also we are trying to implement custom tree header (hideable/different UI), but can't implement focus mode as it isn't accessible when not using ModelsTreeComponent (could needed stuff be exported?).

It is accessible through ModelsTreeComponent.ToggleInstancesFocusButton, isn't it?

@ValdasSorys
Copy link
Author

ValdasSorys commented Feb 3, 2025

I am using VisibilityTree (treeRenderer - VisibilityTreeRenderer). From my testing seems like ModelsTreeComponent.ToggleInstancesFocusButton only works when using ModelsTreeComponent (not VisibilityTree).

@grigasp
Copy link
Member

grigasp commented Feb 3, 2025

I am using VisibilityTree (treeRenderer - VisibilityTreeRenderer).

#1174

From my testing seems like ModelsTreeComponent.ToggleInstancesFocusButton only works when using ModelsTreeComponent (not VisibilityTree).

#1173

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tree widget Tree widget or its components related issues
Projects
None yet
Development

No branches or pull requests

2 participants