Skip to content
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
3 changes: 1 addition & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,12 @@ The design is MVC with local operations on node *positions* (opaque, hashable ha
- `decoration.py`: `DecoratedTree` wraps another `Tree`, delegating navigation and overriding `__getitem__` via `get_decorated`/`decorate`. Behaviour is layered by wrapping: `CollapseMixin` (hides children by overriding first/last child positions; collapse state is a callable or set via `set_position_collapsed`), `CollapseIconMixin` (adds icons), `CollapsibleTree`, `IndentedTree`, `ArrowTree` and combinations. Collapsing is treated as decoration, not part of the data tree.
- `nested.py`: `NestedTree` embeds trees as nodes of other trees, so positions become nested tuples and navigation has to recurse into sub-trees (`outmost_only` and `interpret_covered` flags affect this).
- `widgets.py`: `TreeListWalker` adapts a `Tree` to an `urwid.ListWalker` (with a cache cleared by `clear_cache`); `TreeBox` is the `WidgetWrap` around `urwid.ListBox` that handles key bindings (collapse, expand, focus parent/child/sibling).
- `lru_cache.py`: backport of `functools.lru_cache` for old Pythons.

When adding a tree feature, implement it as a `DecoratedTree` subclass or mixin and compose it, rather than editing `Tree` or `SimpleTree`. Check that `NestedTree` still behaves, since it re-implements navigation instead of inheriting it.

## Change policy

- `main` is the branch for AI-assisted work; `master` is the old human-only line (last release 1.0.5) and stays untouched. One concern per branch off `main`, one PR each into `main`. Ask before pushing.
- `main` is the only branch; the tag 1.0.5 marks the last release before AI-assisted work. One concern per branch off `main`, one PR each into `main`. Ask before pushing.
- Small is beautiful: the smallest clean diff that solves the problem. Prefer deletion, stdlib and existing helpers; no speculative parameters, layers or abstractions.
- Bug fixes come with a regression test that fails without the fix.
- Keep the public API (everything exported from `urwidtrees/__init__.py`, constructor keyword arguments, `TreeBox` key bindings) backwards compatible unless the change says otherwise.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ See the `docs/` subdirectory for autogenetated API docs.
[<img src="docs/examples/example3.png" width="45%">](docs/examples/example3.collapse.py)
[<img src="docs/examples/example5.png" width="45%">](docs/examples/example5.nested.py)

[rtfd-img]: https://readthedocs.org/projects/urwidtrees/badge/
[rtfd]: https://urwidtrees.readthedocs.org/en/latest/
[rtfd-img]: https://img.shields.io/readthedocs/urwidtrees/latest
[rtfd]: https://urwidtrees.readthedocs.io/en/latest/
2 changes: 1 addition & 1 deletion urwidtrees/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.0.5'
__version__ = '1.1.0'
Loading