v3.1.0: Visual treemap with thumbnails, image viewer with annotation, no more clipped buttons - #6
Merged
Conversation
The treemap showed flat coloured rectangles, which told you a file was 'an image' but never which image, so it was of little use for finding anything. Buttons were also being clipped out of sight on narrower windows. Treemap: - Rendered as one composited image instead of thousands of canvas items: cushion shading gives tiles volume, so nested folders read as groups. - Image files are painted with their own thumbnail, decoded off the UI thread through an LRU cache, so the map is browsable at a glance. - Folders get a reserved header band for their name. Previously a folder's label was drawn on top of its first child's label. - Peek preview: hovering shows the picture itself plus size, type, share of the parent and path; it fills in as soon as the decode finishes. - Hit-testing is geometric now, and right-click zooms back out. Image viewer (replaces the old fixed preview window): - Step through every image in the folder with a position counter, walk into subfolders or up to the parent without leaving the viewer. - Annotation in two modes: Basic (pen, marker, arrow, eraser) and Advanced (adds line, rect, ellipse, text, redo), with colour palette, brush size, undo/redo, clear and 'Save as...' export. - Annotations are stored in normalized coordinates, so they survive resizing and zooming and export at the image's full resolution. Clipped controls: - The main toolbar packed everything into one fixed row, so whatever did not fit was silently clipped. It now reflows onto a second row when the window is narrow. The movable widgets are parented to the toolbar rather than a row, since Tk cannot repack a widget into a sibling. - In the viewer, left-packed tools consumed the row before the right-packed 'Save as...' could claim space, so it was cut off. The action group is packed first and drops to its own row when narrow. - The settings dialog is resizable and scrollable, with the buttons pinned to the bottom so they cannot be pushed out of view. It also exposes the new preview and annotation options. Small previews are shown inline in the Tree and Largest Files rows. New modules, all covered by tests: treemap_render, thumbnails, annotate, imagenav. 104 tests pass. Verified by driving the real UI headlessly and inspecting screenshots of every view; each regression test was confirmed to fail when its fix is reverted. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011HEb3UbLzGGY4KuK54H45Q
The Windows runner failed on three assertions in the new tests, not in the app: 101 tests passed there and the same code passes on Linux. The assertions used winfo_ismapped() and winfo_rooty(), which describe where a window manager actually put pixels. A headless runner has no window manager, so nothing is ever truly mapped and a window cannot grow past the virtual screen - the wide-layout cases were being resized back down before the assertion ran. Check pack_info()/winfo_manager() instead: which container each widget is packed into is exactly what the reflow is responsible for, and it holds on any screen size. The reflow is also driven directly now, with the <Configure> handler unbound, so the runner's own window size cannot overwrite the layout under test. Confirmed both reflow tests still fail when their fix is reverted, and the suite passes on a 1024x768 display. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011HEb3UbLzGGY4KuK54H45Q
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.
Summary
The treemap drew flat coloured rectangles — it could tell you a file was "an image" but never which image, so it wasn't much use for finding anything. Buttons were also being clipped out of sight on narrower windows. This addresses both, and adds the image viewer/annotation features.
Treemap — actually visual now
Image viewer (replaces the old fixed preview window)
The clipped-button problem
Small inline previews are shown in the Tree and Largest Files rows too.
Testing
annotate,imagenav,treemap_render; new GUI regression tests for toolbar reflow, treemap rendering/hover, viewer navigation, annotation modes, and drawing.New modules:
treemap_render.py,thumbnails.py,annotate.py,imagenav.py. Version 3.1.0.🤖 Generated with Claude Code
https://claude.ai/code/session_011HEb3UbLzGGY4KuK54H45Q
Generated by Claude Code