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(daffio,design): highlight active tree item in sidebar #2926

Merged
merged 3 commits into from
Jul 23, 2024

Conversation

griest024
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?

Fixes: #2854

Does this PR introduce a breaking change?

[ ] Yes
[ ] No

Other information

The way the options must be set is unfortunate. There is no way to set the options from the DaffTreeItemDirective because of angular/angular#50700 (comment)

@griest024 griest024 added package: daff.io @daffodil/daff.io package: design @daffodil/design status: awaiting review This PR is awaiting review labels Jul 21, 2024
@griest024 griest024 requested review from a team as code owners July 21, 2024 20:08
@xelaint
Copy link
Member

xelaint commented Jul 22, 2024

So the tree technically doesn't handle the "active" state unless ROUTER_LINK_ACTIVE_CONFIG is set in the implementation?

Is there a different way to do this?

@griest024
Copy link
Member Author

So the tree technically doesn't handle the "active" state unless ROUTER_LINK_ACTIVE_CONFIG is set in the implementation?

Is there a different way to do this?

no it does but the "overview" link will be active when a child guide is selected so you'll see 2 active items at once

@xelaint
Copy link
Member

xelaint commented Jul 22, 2024

Also, getting this error in console in design-land:

template.html:1 ERROR Error: NG0311: Directive _RouterLinkActive does not have an input with a public name of daffTreeItem.
    at validateMappings (

@griest024
Copy link
Member Author

Also, getting this error in console in design-land:

template.html:1 ERROR Error: NG0311: Directive _RouterLinkActive does not have an input with a public name of daffTreeItem.
    at validateMappings (

I cannot repro that

@xelaint
Copy link
Member

xelaint commented Jul 22, 2024

So the tree technically doesn't handle the "active" state unless ROUTER_LINK_ACTIVE_CONFIG is set in the implementation?
Is there a different way to do this?

no it does but the "overview" link will be active when a child guide is selected so you'll see 2 active items at once

Why are the links below overview treated as child guides of overview? Shouldn't they be sibling to overview?

@griest024
Copy link
Member Author

@xelaint I'll use cart as an example. the cart driver guide is at /docs/packages/cart/drivers. the cart "overview" guide has the link /docs/packages/cart. The angular router considers /docs/packages/cart/drivers to be a "child" of /docs/packages/cart and therefore considers /docs/packages/cart to be active on the route /docs/packages/cart/drivers unless exact: true is set.

@griest024 griest024 force-pushed the feat/design/tree/selected branch from 4b82dda to 49513a5 Compare July 23, 2024 13:45
Copy link
Member

@damienwebdev damienwebdev left a comment

Choose a reason for hiding this comment

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

lgtm

@xelaint
Copy link
Member

xelaint commented Jul 23, 2024

I'd expect a parent tree item to be open if there is an active/selected tree item within it. Should this be done in this PR or create a separate issue for it?

@griest024
Copy link
Member Author

I'd expect a parent tree item to be open if there is an active/selected tree item within it. Should this be done in this PR or create a separate issue for it?

separate PR

@griest024 griest024 merged commit d59140a into graycoreio:develop Jul 23, 2024
8 checks passed
@gray-bot gray-bot mentioned this pull request Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: daff.io @daffodil/daff.io package: design @daffodil/design status: awaiting review This PR is awaiting review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] Add selected functionality for tree component
3 participants