Repository navigation
Shorten the collapse icon and ArrowTree line construction - #109
Merged
Merged
Conversation
_construct_collapse_icon builds the frame and icon parts in one loop, ArrowTree.decorate returns early and drops a repeated indent check and dead assignments, _construct_connector loses its dead initialisations, and CollapsibleIndentedTree.decorate and CollapseIconMixin lose leftover TODOs and a stray tuple. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Shortens
urwidtrees/decoration.pywithout changing behaviour or rendering; found by an audit for over-engineering.CollapseIconMixin._construct_collapse_iconbuilds the left frame, icon and right frame in one loop instead of three copied blocks.ArrowTree.decoratereturns early forNone, drops a secondself._indent > 0check inside a branch that already made it, and drops dead assignments and an always-trueNonecheck.ArrowTree._construct_connectorpicks the character first and drops its dead initialisations.CollapsibleIndentedTree.decorateandCollapseIconMixin.__init__lose leftoverTODOs, a dead assignment and a stray tuple (cols.append(...),).Rendering every position of a set of trees through every decorator with indents 0 to 8, all arrow and icon options, collapse states and
NestedTreegives byte-identical output onmainand this branch (about 88,700 records), under urwid 3.0.4 and 2.1.2, including the cases that raiseNoSpaceError.Review findings and resolution
review-correctness
_construct_first_indentto returnNonewould now get aTypeError: left; the method never returnsNoneand nothing overrides it.review-design
CollapsibleIndentedTree.decoratecould return itsColumnsdirectly, and_construct_connectorhad dead initialisations: both done.CollapseIconMixin.__init__is left without a docstring: left; the placeholder said nothing.🤖 Generated with Claude Code