Skip to content

v3.1.0: Visual treemap with thumbnails, image viewer with annotation, no more clipped buttons - #6

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

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

  • Rendered as one composited image rather than thousands of live canvas items. Cushion shading gives every tile volume so nested folders read as groups.
  • Image files are painted with their own thumbnail, decoded off the UI thread via an LRU cache — the map is browsable at a glance.
  • Folders get a reserved header band for their name. Previously a folder's label was drawn straight on top of its first child's label.
  • Peek preview on hover: the picture itself, plus size, type, share of the parent, and path. It fills in the moment the decode finishes, even if the pointer hasn't moved.
  • Hit-testing is geometric; right-click zooms back out; double-click opens the image.

Image viewer (replaces the old fixed preview window)

  • ◀ ▶ step through every image in the folder with a position counter
  • ⬅ Up and a subfolder picker — move around without leaving the viewer
  • Annotation in two modes, as requested:
    • Basic — pen, marker, arrow, eraser
    • Advanced — adds line, rectangle, ellipse, text, and redo
  • Colour palette, brush size, undo/redo, clear, and Save as… export
  • Annotations are stored in normalized coordinates, so they survive resizing/zooming and export at the image's full resolution

The clipped-button problem

  • The main toolbar packed everything into one fixed row, so whatever didn't fit was silently clipped. It now reflows onto a second row when narrow. (The movable widgets had to be parented to the toolbar rather than a row — Tk can't repack a widget into a sibling container, which crashed the first attempt.)
  • 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 now packed first and drops to its own row when narrow.
  • The settings dialog is resizable and scrollable with buttons pinned to the bottom, so Apply can't be pushed out of view. It also exposes the new preview/annotation options.

Small inline previews are shown in the Tree and Largest Files rows too.

Testing

  • 104 tests pass (up from 45). New pure-logic suites for annotate, imagenav, treemap_render; new GUI regression tests for toolbar reflow, treemap rendering/hover, viewer navigation, annotation modes, and drawing.
  • Drove the real UI headlessly end to end: treemap render, thumbnail decode, peek preview, both toolbar layouts, viewer navigation into/out of subfolders, Basic and Advanced annotation, full-resolution export, and annotations surviving a resize.
  • Inspected screenshots of every view to confirm the visuals — that's how the clipped Save as… button was caught.
  • Each new regression test was verified to fail when its fix is reverted.

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

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
Copilot AI lite review requested due to automatic review settings August 9, 2026 19:18

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 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
@MrHakan
MrHakan merged commit e0272dd 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