Skip to content

Re-implement TreeView and NodeWidget to render as a flat list #3

Description

@Yoeri-z

The current implementation is primitive and needs a proper rewrite. While TreeSlivers could be considered, this package was specifically created to avoid the rendering issues they introduced, so a custom approach aligned with the existing TreeNode model is preferred.

To support a flat-list rendering model, the following steps are needed:

  • Introduce a new list in the TreeController that contains nodes in depth-first order.
  • For each node, track: its depth (already done), its index in the flat list, and the index of its last descendant.
  • Render the tree using this flat list, using depth to determine indentation.
  • Implement expand/collapse by compressing or expanding the items in range from nodeIndex + 1 to lastDescendantIndex.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions