Skip to content

v3.0.1: Fix toolbar crashes outside the tree view + treemap hit-testing - #5

Merged
MrHakan merged 2 commits into
mainfrom
claude/overhaul-standalone-exe-bni8pv
Aug 9, 2026
Merged

MrHakan merged 2 commits into
mainfrom
claude/overhaul-standalone-exe-bni8pv

Conversation

@MrHakan

@MrHakan MrHakan commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Summary

A review pass over the v3.0.0 release turned up three real, user-facing defects. Each one is now reproduced by a regression test that fails without the fix (verified by reverting the fix and watching the test go red).

# Symptom Cause
1 Zip/Delete crash — AttributeError: no attribute 'tree' v3.0.0 remembers your last view. If you left it in Treemap, the always-visible toolbar buttons crash on the very next launchself.tree is only created by the tree view.
2 Zip/Delete crash — TclError: invalid command name ...treeview Switching views destroys the previous view's widgets; the selection helpers kept a stale reference to the destroyed treeview.
3 Treemap tooltip + click-to-zoom silently dead Canvas hit-testing resolves to the topmost item, and a tile's name label wasn't mapped back to its tile — so aiming at the label (the natural target) lost the hit.

Fixes

  • Selection now goes through _selection_context(), which returns the widget and node map owned by the view currently on screen, or nothing. Stale references are dropped on teardown, and the toolbar shows a hint about which view to switch to instead of raising.
  • Zip / Delete / Open-in-Explorer now work in the Largest Files view too — that's where you actually find the space hogs, so it was an odd gap.
  • Async deletion carries its originating widget and map, so navigating away mid-delete can't touch a destroyed widget; in-memory sizes update correctly either way.
  • Treemap labels map back to their tile → hover and zoom restored.
  • Treemap redraws are debounced: a window resize now triggers one re-layout instead of one per <Configure> event (measured: 30–40 resize events → 0 synchronous redraws).

Testing

  • New tests/test_gui.py (7 tests) exercising each regression against a real Tk display; skips cleanly where none exists (verified: 1 skipped with no DISPLAY).
  • CI installs xvfb on Linux so these actually run; Windows runs them directly.
  • 44 tests pass (37 logic + 7 GUI).
  • Verified headlessly end to end: real deletions from both views (files removed from disk, model sizes correct), a view switch mid-delete, treemap hit-testing across every labelled tile, and resize debouncing.

Patch release 3.0.1.

🤖 Generated with Claude Code

https://claude.ai/code/session_011HEb3UbLzGGY4KuK54H45Q


Generated by Claude Code

Review of the v3.0.0 release surfaced three real, user-facing defects.
All three are reproduced by new regression tests that fail without the fix.

1. Zip/Delete crashed with AttributeError when the app opened in a view
   that has no selection. v3.0.0 remembers the last view, so anyone who
   left the app in Treemap hit this on the very next launch: self.tree
   was only ever created by the tree view, but the toolbar buttons are
   visible in every view.

2. Zip/Delete crashed with TclError after switching views. Switching
   destroys the previous view's widgets, and the selection helpers kept
   reaching for the destroyed treeview.

3. The treemap tooltip and click-to-zoom were lost whenever the pointer
   was over a tile's own name label - the most natural place to aim.
   Canvas hit-testing resolves to the topmost item, and the label was
   not mapped back to its tile.

Fixes:
- Selection is now resolved through _selection_context(), which returns
  the widget and node map owned by the view currently on screen, or
  nothing at all. Stale widget references are dropped when a view is
  torn down, and the toolbar explains which view to switch to instead
  of raising.
- Zip/Delete/Open-in-Explorer now also work against the Largest Files
  view, which is where oversized files are actually found.
- Async deletion carries the originating widget and map, so navigating
  away mid-delete can no longer touch a destroyed widget; the in-memory
  sizes still update correctly either way.
- Treemap labels map back to their tile, restoring hover and zoom.
- Treemap redraws are debounced, so a window resize triggers one
  re-layout instead of one per <Configure> event.

Testing:
- New tests/test_gui.py (7 tests) covers each regression against a real
  Tk display, and skips cleanly where none exists.
- CI installs xvfb on Linux so those tests actually run; Windows runs
  them directly. 44 tests pass.
- Verified end to end headlessly: real deletions from both views, a view
  switch mid-delete, treemap hit-testing, and resize debouncing.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011HEb3UbLzGGY4KuK54H45Q
Copilot AI lite review requested due to automatic review settings August 9, 2026 13:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

The Windows runner failed on an assertion in the new test, not in the app:
43 tests passed there and the meaningful check (no synchronous redraw
during a burst) held on both platforms. The flaky assertion assumed Tk
emits <Configure> when a packed canvas's requested width changes, which
Windows does not guarantee.

Drive the scheduler directly instead, and assert the whole contract: 40
events collapse into exactly one redraw and the pending handle is
cleared. A separate test asserts the <Configure> handler is actually
bound, so the wiring is still covered.

Verified the rewritten test fails when the debounce is removed.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011HEb3UbLzGGY4KuK54H45Q
@MrHakan
MrHakan merged commit a8b4664 into main Aug 9, 2026
2 checks passed
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.

3 participants