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

Tree widget: Incorrect category used for element visibility in filtered tree #1100

Open
saskliutas opened this issue Nov 28, 2024 · 4 comments
Labels
bug Something isn't working tree widget Tree widget or its components related issues

Comments

@saskliutas
Copy link
Member

There might be cases where incorrect category is used when determining or changing element visibility in filtered tree. For example ,if we have tree like:

Subject
|- Model
  |- Category A
    |- Element A
      |- Element B (from Category B)

Filter path to Element B will be:
Subject -> Model -> Category A -> Element A -> Element B

At the moment when we try to determine/change visibility of Element B we go up in filter path and look for category. In this particular example we will find Category A and use it. However, Element B is in Category B and it should be used instead in all visibility operations.

Need a way to find real element category instead of the one that is shown in tree as an ancestor.

@saskliutas saskliutas added bug Something isn't working tree widget Tree widget or its components related issues labels Nov 28, 2024
@grigasp
Copy link
Member

grigasp commented Dec 13, 2024

One of the easiest solutions to this would be to start showing categories for child elements. That way, we'd have the category node in filtering path and could use it for determining display status.

It would also remove the confusion described in this issue: #1018.

@vermanas @jjbeckman13 @jason-crow, I'm interested in hearing your thoughts.

@jjbeckman13
Copy link

That approach seems reasonable to me

@grigasp
Copy link
Member

grigasp commented Dec 13, 2024

That approach seems reasonable to me

I think we could even show/hide the category based on whether it matches parent node's category - this would avoid making the hierarchy deeper in majority of cases, e.g. this situation:

- Category A
  - Element A
    - Category A
      - Child element B
        - Category A
          - Child element C

When the categories match, we'd see this:

- Category A
  - Element A
    - Child element B (from Category A)

When the categories don't match, we'd see this:

- Category A
  - Element A
    - Category B
      - Child element B

I could see a couple points of possible confusion, though:

  1. When the parent/child hierarchy gets deeper, it may not be clear what the category is:

    - Category A
      - Element A
        - Category B
          - Child element B
            - Child element C (category is "Category B" - is that clear?)
    
  2. When categories of some children match their parent, and some - don't:

    - Category A
      - Element A
        - Category B
          - Child element B
        - Child element C (category is "Category A" - is that clear?)
    

@grigasp grigasp changed the title [Tree widget] Incorrect category used for element visibility in filtered tree Tree widget: Incorrect category used for element visibility in filtered tree Dec 20, 2024
@grigasp
Copy link
Member

grigasp commented Dec 20, 2024

A note regarding the proposed solution.

If we create the intermediate category node as an instance node, we'd have to way to control its visibility, as it would only have to affect elements under that specific node and not the others. A solution could be creating a Category navigation property grouping node and making it look like a category instance node.

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

No branches or pull requests

3 participants