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

Kino.Tree: auto-expand tuples of up to 6 elements #398

Merged
merged 4 commits into from
Feb 19, 2024

Conversation

stefanchrobot
Copy link
Contributor

Closes #387.

Auto-expand tuples of up to 6 elements in Kino.Tree by default.

I've introduced the following changes:

  • Add "kind" (e.g. "tuple", "list", etc.) attribute to tree's data,
  • Use the "kind" attribute to change the logic for auto-expanding data; this now makes it easy to apply the same logic to lists and maps (if desired),
  • Flatten the structure of the tree data: introduce "expanded_before" and "expanded_after" attributes,
  • Refactor the UI code: rename expanded and setExpanded to isExpanded and setIsExpanded to better fit JavaScript conventions,
  • Refactor the backend code: introduce leaf_node and branch_node to ensure that we build consistent data (without introducing more structs/types).
Screenshot 2024-02-18 at 11 49 22

Copy link
Member

@jonatanklosko jonatanklosko left a comment

Choose a reason for hiding this comment

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

Perfect, thank you!

@jonatanklosko jonatanklosko merged commit 6317715 into livebook-dev:main Feb 19, 2024
1 check passed
@stefanchrobot stefanchrobot deleted the auto-expand branch February 21, 2024 09:56
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.

Expand tuples in Kino.Tree by default
3 participants