Repository navigation
Treemap revamp: framed folders, open in place, smooth navigation - #30
Open
horus-leonardo wants to merge 16 commits into
Open
horus-leonardo wants to merge 16 commits into
horus-leonardo wants to merge 16 commits into
Conversation
The row keeps a running sum, min and max, so each candidate costs O(1) instead of a pass over the row. Signposts mark layout and draw for Instruments, and an env-gated benchmark times layout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Folders open by detail level (1-8, default 3) and room, or by hand, and small children gather into one smaller-items block. The state lives in AppState; children are sorted and summed in one pass, zero sizes left out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Categories use system colors on the window background, so they follow light, dark and Increase Contrast. Color by Folder gives each child of the shown folder its own color. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A click acts at once: it opens a closed folder in place and selects it, and the chevron closes it. A double click drills into what the first click hit. A card beside the cursor shows size, path and makeup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One fill per item with rounded, pixel-snapped edges and 1 pt gaps replaces a stroke that antialiased twice and looked jagged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drill, Back, breadcrumb, open and close move items to their new place over 250 ms. Idle costs nothing, Reduce Motion stays instant, and fading items go without text so the frames stay fast. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Navigation sits on the left and view controls on the right. The View menu gets detail, color, Back, Rescan and the inspector, calling the shared AppState. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Off, only files and smaller-items blocks are drawn, one gap apart, for those who prefer the flat look. One spacing rule now covers frames. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every folder plus the 200 largest other items, with Open, Close and Enter actions, rebuilt only when the layout changes. README and CLAUDE.md describe the new treemap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every control has a tooltip and tree controls stay off without a scan. Back is disabled instead of removed so the toolbar keeps still. Empty columns show a small icon, a title and what to do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A lighter scrim cut to the rounded shape, an accent ring and a shadow. Only the selected folder's own item dims, and the ring travels to the next selection. Dark mode lifts each nested frame instead of darkening. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Without folders shown, folders become groups the renderer, hit testing, transitions and VoiceOver skip, so selection needs no special path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
During a transition the ring and dim wait at the destination, and a click opens a folder in place only when it has room and contents. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Selecting or opening in the treemap leaves the sidebar alone. Drilling in expands the folder, and a pick from the skipped-folders list reveals it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The inspector leads with one large size, and paths truncate in the middle like Finder. macOS 27.2.1 no longer hangs, so the unanimated toggle and its CLAUDE.md note go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Delete dead state and duplicated snapping, keep only timing in the benchmark, rasterize the base canvas asynchronously, match the README, and tighten comments. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
horus-leonardo
force-pushed
the
feat/treemap-revamp
branch
from
November 26, 2026 21:48
be335f4 to
5df5bc9
Compare
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
I'm always short on disk space, and I open MacDirStat almost every day to free some and check what matters. I made these changes so it could be my daily driver.
This PR reworks the treemap. Folders become frames with a title, and you can open them in place, select them, and drill in with an animation. It builds on choices you already made: your squarify layout, your ten categories and your selection dim all stay.
Addresses #22. The detail levels come from that issue, which you called a fair request, so take them as one possible answer.
One dependency to know about: this branch drops the size picker's side effect of taking you from the welcome screen back to the treemap. #28 replaces it with an explicit Back button. If you take this branch, it works best together with #28. If you'd rather not take #28, tell me and I'll keep the old path here instead.
The PR is cut into slices that you can take separately. You can take all of it, take some slices, change anything, or decline it, with no hard feelings.
mainSame folder, same window size.
Dark mode
At a glance
/goes from 1,300 ms to 352 ms.#28 and #29 conflict lightly with this branch. If either goes in, I'll rebase this one.
Slices
The letters are stable IDs, so we can say "take A, B, C, drop F".
A · Linear squarify (no visible change)
Your squarify loop stays. The row keeps a running sum, min and max, so each candidate costs O(1) instead of a pass over the row. Children are sorted and summed in one pass, and zero sizes stay out, since they make the worst ratio infinite.
On
/(55,220 items) the layout goes from 1,300 ms to 352 ms. Depends on nothing; it could be its own PR.B · Framed folders, detail level, open and close (the core)
Main draws all 12 levels at once, so a big disk is thousands of squares, and a folder can't be selected as a whole. #22 asked to see the big folders on the first few levels.
Level 1 and level 3 on a whole disk.
AppState, next to yoursizeMetric.Every visual slice needs this one.
C + D · Look and color modes
Your categories now use system colors on the window background, so they follow light, dark and Increase Contrast. A folder gets its own shape, so it no longer reads as a lighter file.
A folder is not colored by its main category, because a folder of 51% video and 49% code would show as video.
Needs B. D can be dropped alone.
E · Click, open in place, drill down
Like SpaceSniffer, a single click opens a folder, so you can go 3 levels down in one folder and 10 in another.
Needs B.
F · Transitions
Main already wraps navigation in
withAnimation, but a Canvas draws each frame from scratch, so nothing moves. This slice makes that intent visible.Needs B. It can be dropped whole.
G · Selection: your dim, with a ring that travels
Your dim stays, restyled to match the new shapes.
Needs B.
H · Hover card and status bar
Main shows the hovered item only in the status bar. A card beside the cursor adds the category mix without crowding the treemap.
A file card, and a folder card.
Needs B.
I · Show Folders off: main's flat look, refreshed
Some people will prefer main's flat look. Folders become undrawn groups, as your layout engine already emits them, so selection and the dim work without a special path.
/takes about 44 ms for 16,143 items.Needs B and C.
J · VoiceOver
Main's Canvas is a single element to VoiceOver. One element per item would flood it, so the list is capped.
Needs B.
K · Sidebar sync
Main expands the sidebar on every selection, which with open in place would mean on every click.
Independent.
L · Toolbar, View menu, breadcrumb
With drill-down, navigation and view controls are separate jobs, so they sit on separate sides of the toolbar. ⌘+ and ⌘− now mean detail, so the zoom buttons go; scroll and pinch zoom stay.
Detail, color and Show Folders need B, D and I; the rest stands alone.
M + N + O · Empty states, inspector, small fixes
The empty states and the inspector follow the same small, quiet style as the rest of macOS.
Fresh launch: small empty states, treemap controls disabled.
Each piece stands alone. The inspector restyle conflicts with #29.
P + Q · Performance, tests, docs
Commits
16 commits, each one builds and passes the tests on its own. Most map to one slice; a few carry part of a neighbor where splitting them wouldn't build.
Defaults I picked, yours to change
Show Folders on, detail level 3, Color by Type, a click that opens, 250 ms transitions, 400 ms tooltips, and Rescan of the shown folder.
Left alone on purpose
volumeAvailableCapacity. Which one is right is your call.Testing
swift testpasses 75 tests, andswift buildhas no warnings.Thanks for MacDirStat. It was a pleasure to build on. Take all of this, some slices, change anything, or close it; any of those is fine, and I'm glad to split out a slice or rebase on request.
🤖 Generated with Claude Code