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

feat(design)!: add tree renderMode #2777

Merged
merged 4 commits into from
Apr 27, 2024
Merged

feat(design)!: add tree renderMode #2777

merged 4 commits into from
Apr 27, 2024

Conversation

damienwebdev
Copy link
Member

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

Previously, "hidden" child nodes were entirely removed from the document.

Fixes: N/A

What is the new behavior?

This introduces a new Input on DaffTreeComponent called "renderMode" that accepts "not-in-dom" or "in-dom", with "in-dom" being the default.

  • "in-dom" - The nodes are now retained in the document, but are hidden via css.
  • "not-in-dom" - The nodes removed from the document. (The old behavior.)

Does this PR introduce a breaking change?

[x] Yes
[ ] No

BREAKING CHANGE: Previously, the now-named renderMode "not-in-dom" was the default. This is no longer the case. If one was rendering immensely large trees and you now notice a significant slow-down, you can change the renderMode like:

<ul daff-tree ... renderMode="not-in-dom">
 ...
</ul>

Which will restore the original behavior.

Other information

BREAKING CHANGE: Previously, the now-named renderMode "not-in-dom" was
the default. This is no longer the case. If one was rendering immensely
large trees and you now notice a significant slow-down, you can
change the renderMode like:

```ts
<ul daff-tree ... renderMode="not-in-dom">
 ...
</ul>
```

Which will restore the original behavior.
@damienwebdev damienwebdev requested a review from a team as a code owner April 26, 2024 18:10
Copy link
Member

@xelaint xelaint left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not all <li> have the hidden class set. Seems like it's only not working for level-1 <li>s

Screen Shot 2024-04-26 at 2 39 59 PM

libs/design/tree/src/tree/tree.component.scss Outdated Show resolved Hide resolved
libs/design/tree/src/interfaces/tree-mode.ts Outdated Show resolved Hide resolved
@damienwebdev
Copy link
Member Author

damienwebdev commented Apr 26, 2024

@xelaint

Not all <li> have the hidden class set. Seems like it's only not working for level-1 <li>s

That's by intent.

The idea is that for a tree like:

image

We currently render:

<li level="1">@daffodil/analytics</li>
<li level="1">analytics-provider-data-layer</li>
<li level="1">@daffodil/auth</li>
<li level="1">@daffodil/authorize.net</li>

We now render:

<li level="1">@daffodil/analytics</li>
<li level="2" class="hidden">Overview</li>
<li level="2" class="hidden">Configuration</li>
<li level="1">analytics-provider-data-layer</li>
<li level="1">@daffodil/auth</li>
<li level="1">@daffodil/authorize.net</li>

The hidden elements remain rendered in the DOM, they just aren't visible.

The "level-1"'s are essentially always visible because they're the "top" level that needs to be interactable to open the tree.

@damienwebdev damienwebdev merged commit 2d8ec58 into develop Apr 27, 2024
13 checks passed
@gray-bot gray-bot mentioned this pull request Apr 24, 2024
@damienwebdev damienwebdev deleted the tree_render_mode branch April 29, 2024 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants