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

Recursive tree #2409

Merged
merged 18 commits into from
Oct 25, 2019
Merged

Recursive tree #2409

merged 18 commits into from
Oct 25, 2019

Conversation

daveyholler
Copy link
Contributor

@daveyholler daveyholler commented Oct 9, 2019

Summary

Easily render recursive tree structures such as file systems or outlines.
image

Checklist

  • Checked in dark mode
  • Checked in mobile
  • Checked in IE11 and Firefox
  • Props have proper autodocs
  • Added documentation examples
  • Added or updated jest tests
  • Checked for breaking changes and labeled appropriately
  • Checked for accessibility including keyboard-only and screenreader modes
  • A changelog entry exists and is marked appropriately

Copy link
Contributor

@myasonik myasonik left a comment

Choose a reason for hiding this comment

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

Roughly, summing up all of my suggestions, it think the final HTML would look something like this (rough pseudo-code):

<nav aria-label="Foo">
	<ul aria-label="Foo navigation">
		<li><ButtonOrLink>Bar<ButtonOrLink></li>
		<li>
			<ButtonOrLink aria-controls={randomId} aria-expanded={isThisNodeExpanded}>Baz<ButtonOrLink>
			<ul aria-label="Foo Baz navigation" id={randomId}> 
			// or, the label can be "Baz Foo navigation" if that seems more appropriate for the expected use case
				<li><ButtonOrLink>qux</ButtonOrLink></li>
			</ul>
		</li>
</nav>

Again, if this is not actually a way for users to navigate around the site, many of these suggestions are probably only half-way or completely incorrect.

src-docs/src/routes.js Outdated Show resolved Hide resolved
src/components/recursive_tree/recursive_tree.tsx Outdated Show resolved Hide resolved
src/components/recursive_tree/recursive_tree.tsx Outdated Show resolved Hide resolved
src/components/recursive_tree/recursive_tree.tsx Outdated Show resolved Hide resolved
src/components/recursive_tree/recursive_tree.tsx Outdated Show resolved Hide resolved
src/components/recursive_tree/recursive_tree.tsx Outdated Show resolved Hide resolved
src/components/recursive_tree/recursive_tree.tsx Outdated Show resolved Hide resolved
src/components/recursive_tree/recursive_tree.tsx Outdated Show resolved Hide resolved
@daveyholler
Copy link
Contributor Author

The component fully supports keyboard navigation with left, right, up, down arrows, spacebar, and return.

src/components/recursive_tree/recursive_tree.tsx Outdated Show resolved Hide resolved
src/components/recursive_tree/recursive_tree.tsx Outdated Show resolved Hide resolved
src/components/recursive_tree/recursive_tree.tsx Outdated Show resolved Hide resolved
src/components/recursive_tree/recursive_tree.tsx Outdated Show resolved Hide resolved
src/components/recursive_tree/recursive_tree.tsx Outdated Show resolved Hide resolved
@chandlerprall
Copy link
Contributor

This just occurred to me... can we rename this component to EuiTreeView. This matches the design pattern instead of the recursion implementation detail.

@snide
Copy link
Contributor

snide commented Oct 25, 2019

@daveyholler gonna pass you a PR for some quick design / interface changes. Nothing intense. FIgure it'll save you time so you can merge.

@snide
Copy link
Contributor

snide commented Oct 25, 2019

PR4U @daveyholler daveyholler#8

EUI design patterns for tree
Copy link
Contributor

@snide snide left a comment

Choose a reason for hiding this comment

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

LGTM. Fun component. I'm gonna make a follow up issue to allow it to accept an href in certain situations. We can likely use this for the docs nav at some point.

@snide
Copy link
Contributor

snide commented Oct 25, 2019

Confirmed with @chandlerprall this is mergeable.

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.

4 participants