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

tree: Start expanded with Textual 0.73+ #648

Merged
merged 2 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.13.3
current_version = 1.13.4
commit = True
message =
Prepare for {new_version} release
Expand Down
9 changes: 9 additions & 0 deletions NEWS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ Changelog

.. towncrier release notes start

memray 1.13.4 (2024-07-18)
--------------------------

Bug Fixes
~~~~~~~~~

- A backwards-incompatible change released in Textual 0.73 caused the ``memray tree`` reporter to start with no nodes expanded. This release adds a workaround to restore the old behavior of expanding the first child of each node. (#648)


memray 1.13.3 (2024-07-02)
--------------------------

Expand Down
2 changes: 1 addition & 1 deletion src/memray/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.13.3"
__version__ = "1.13.4"
4 changes: 3 additions & 1 deletion src/memray/reporters/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,9 @@ def repopulate_tree(self, tree: FrameTree) -> None:
self.add_children(tree.root, self.data.children.values())
self.add_elided_locations_node(tree.root)
tree.root.expand()
tree.select_node(tree.root)
# From Textual 0.73 on, Tree.select_node toggles the node's expanded
# state. The new Tree.move_cursor method selects without expanding.
getattr(tree, "move_cursor", tree.select_node)(tree.root)
self.expand_first_child(tree.root)

def action_expand_linear_group(self) -> None:
Expand Down
Loading
Loading