Commit Graph
145 Commits
Author SHA1 Message Date
Tobi Lutke 61049e0af4 Merge pull request #109 from bet4it/fix/test-delayed-allocation-sync 2026-11-25 09:50:53 -05:00
Tobi Lutke 448fe520dd Merge pull request #128 from dhh/themed-icon 2026-11-25 09:50:53 -05:00
Tobi Lutke 2c85ea33f3 Merge pull request #115 from huntharo/fix/remote-path-separators 2026-11-25 09:50:53 -05:00
Tobi Lutke 98051f625d Merge pull request #114 from huntharo/fix/upstream-ci-macos-windows 2026-11-25 09:50:53 -05:00
David Heinemeier HanssonandClaude Opus 5.5 ddf1798c22 assets: redraw the icon in Omarchy's app icon style
Omarchy now draws disktree's icon in its own app icon style, a treemap on
an even grid with one block picked out, recolored to follow each theme.
This is its Tokyo Night rendering, so the installed icon matches what
Omarchy shows; the ICO is rendered from the SVG at its previous sizes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 15:48:09 +01:00
Harold Hunt 40a66b40cd test: run the scanner's snapshot tests on Unix only
These run disktree-scan on the test machine and read what it sends, so
the machine is the host. Clients now refuse Windows hosts, so on
Windows they failed with that refusal. The disconnect test reads no
snapshot and still runs everywhere.
2026-10-23 23:06:09 -04:00
Harold Hunt 9631475698 test: root remote sessions at a POSIX path on every client
Four window tests built a local fixture, set app.remote, then looked up
the fixture's own paths. On Windows those are C:\ paths, which a Unix
host never sends and POSIX rules do not resolve. remote_view_over roots
the scanned fixture at the temporary directory on Unix, keeping the
nothing-deleted checks real, and at /srv/fixture on Windows.
2026-10-23 22:39:28 -04:00
Harold Hunt 329e87293f ssh: treat remote paths as POSIX paths on every client
SSH hosts are Unix: the remote command, the embedded scanners and the
delete script are POSIX shell and Linux tools. But remote paths were
joined, split and compared with std::path, which follows the client. On
a Windows client that joined /home/x and child into /home/x\child, so
marks, the trail and the exported delete script named files that do not
exist on the host, and a Unix name containing \ or : failed the whole
scan.

PathStyle (core) holds both rules: Native is std::path for local scans,
Posix is /-separated for SSH hosts. path_of, mark lookup and display,
crumbs, the trail, mark containment and the progress line now go through
it. On Unix clients the two agree, so nothing changes there.

Marks are keyed by exact path text, since PathBuf equality on Windows
treats \ as a separator. The client refuses a Windows host by name, and
checks the header's home and disk root as well as its root. The SSH CLI
refuses a root that is not /-rooted. The round-trip tests that run the
helper locally are Unix-only, since the local machine is the host; new
hand-built streams and a window test cover a Unix host on every client.
2026-10-23 22:04:02 -04:00
Harold Hunt cc026ea761 test: run the live preview dedup test on Unix only
The preview comes from the Unix helper's streaming walk. On Windows
serve sends a finished tree with no preview, so the test's unwrap
failed there. It was hidden on main because cargo test stops at the
first failing test binary, which was the app's.
2026-10-23 22:03:33 -04:00
Harold Hunt 3b972817c8 ssh: accept a Windows host's absolute paths again
serve also runs on Windows, and the round-trip tests there send native
C:\ roots. Accept a path that is absolute on this platform or
/-rooted; \x stays rejected.
2026-10-23 21:17:30 -04:00
Harold Hunt 43d94b07ad ssh: accept only /-rooted remote paths on every client
Path::has_root also accepts \x and C:\x on Windows, which name nothing
on the Unix host the helper runs on. Check for a leading / instead.
2026-10-23 21:04:22 -04:00
Harold Hunt 20847a0de8 ci: fix the macOS and Windows failures on main
Windows clients rejected every path an SSH host sent. The helper is
Unix-only, so remote roots are /-rooted, but Path::is_absolute also
wants a drive letter on Windows. Root discovery, the scan header and
the picker now check remote paths with is_remote_absolute, which
agrees with is_absolute on Unix.

The volume picker test compared against the unresolved temporary
path. Accepting a local root canonicalizes it, and the temporary
directory is /var -> /private/var on macOS and an 8.3 short name on
Windows runners.

spawn_command and wait in remote.rs are only used by the Unix tests,
so clippy -D warnings failed on Windows. Gate them on unix.
2026-10-23 21:00:04 -04:00
Tobi Lutke 9b18b272ca app: show live treemap previews with stable sidebar progress 2026-10-22 18:32:27 -04:00
Tobi Lutke 71868f672a scan: profile SSH indexing and deduplicate hardlinks on the desktop 2026-10-22 18:13:57 -04:00
Tobi Lutke 8d98a855e8 scan: stream live SSH progress and accept deeply nested trees 2026-10-22 17:41:01 -04:00
Tobi Lutke 6a234aa4c3 app: harden source selection and verify chooser lifecycle 2026-10-22 17:05:57 -04:00
Tobi Lutke fb6a7f63b3 app: choose a local or SSH source and root before scanning 2026-10-22 16:56:09 -04:00
Tobi Lutke 1e17fcc86b ssh: discover remote mount roots without starting a scan 2026-10-22 16:47:24 -04:00
Tobi Lutke 8b55208fdc scan: stream SSH walks with bounded memory and strict mount boundaries 2026-10-22 16:41:46 -04:00
Tobi Lutke 2c22ed4d00 build: embed static Linux scanners and deploy them on demand 2026-10-22 16:22:26 -04:00
Tobi Lutke d2cbab6468 app: explore SSH scans read-only and export host-guarded cleanup 2026-10-22 16:22:26 -04:00
Tobi Lutke 48b0284fa7 core: add read-only SSH scanner and checked helper deployment 2026-10-22 16:13:43 -04:00
Bet4 ef1475f864 test: sync noise file so allocation units commit on CoW filesystems 2026-10-17 00:21:53 +08:00
Tobias Lütke 6c8d4ce621 Merge pull request #71 from tobi/release-0.11.0
release 0.11.0
v0.11.0
2026-10-04 15:07:51 -04:00
Tobi LütkeandClaude Opus 5.5 9ad02efa03 release 0.11.0
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 19:02:06 +00:00
Tobi LütkeandClaude Opus 5.5 fcb627634f Keep a snapshot-booted root's subvolumes, and stat directories on macOS
The projection from #56 tested the scanned mount for being a snapshot as
well as the other one. On a system booted from a Snapper snapshot, as
openSUSE is by default, `/` is one, so every mark under `/var` or `/home`
was called another volume's although the scan walks them as its own.
Only the other mount is tested now, as `foreign_mounts` does.

The bulk listing from #53 is thought to report a mount point with the
attributes of the directory it covers, so its device would be the parent
volume's and the walk would cross into every disk, share and system
volume below the root. Directories are stated with `statat` again, as
`lstat` did before; files keep the bulk path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 17:05:04 +00:00
Tobias Lütke 536f037e0f Merge pull request #56 from itsmunzir/fix/cross-volume-projection
fix(space): exclude foreign-volume marks from free-space projection
2026-10-04 13:03:22 -04:00
Tobias Lütke b985693ff0 Merge pull request #53 from joshgosse/scan-speed
Improves scan speed on macOS, better memory profile everywhere
2026-10-04 13:03:18 -04:00
Tobias Lütke 21c81f4d62 Merge pull request #49 from aronchick/fm/disktree-reveal
Reveal a tile in the file manager on right-click
2026-10-04 12:26:38 -04:00
Tobias Lütke c2318a490a Merge pull request #69 from huntharo/fix/finish-scan-waits-for-scan
test: wait for widening scans to finish before assertions
2026-10-04 12:26:33 -04:00
Tobias Lütke f845666b31 Merge pull request #70 from kevin9327/fix/size-rounds-into-next-unit
Show a size that rounds up to 1024 in the next unit
2026-10-04 12:26:30 -04:00
kevin9327 13250c0980 Show a size that rounds up to 1024 in the next unit
human_bytes steps up a unit only at 1024, but above 9.95 it prints no decimal, so anything from 1023.5 to 1024 of a unit rounded to "1024 KiB" instead of "1.0 MiB" (1,048,575 bytes, for one). human_count had the same edge at 1000: 999,999 files read "1000.0k". Both now step up where the shown number would round to the next unit.
2026-10-04 20:10:32 +09:00
Tobias Lütke 7c0661c861 Merge pull request #46 from kuishou68/cocoon-fix-disktree
docs(readme): the t key cycles three modes, not two
2026-10-01 21:46:01 -04:00
Tobias Lütke dd0e987190 Merge pull request #52 from kevin9327/flag-non-unicode-export
Flag a marked path whose name is not valid Unicode
2026-10-01 21:45:58 -04:00
Tobias Lütke b60372b73e Merge pull request #63 from huntharo/perf/scan-admission-budget
feat: add saved Power Efficiency scan worker presets (3% faster, 53% less CPU at 8 threads)
2026-10-01 21:45:54 -04:00
Harold Hunt ddb4cea6c9 test: make finish_scan refuse to wait on no scan and report why it failed
The first-scan test now uses the helper instead of its own copy of the old wait loop.
2026-09-30 22:30:56 -04:00
Harold HuntandAbdulwahab Isam f7782252c8 test: wait for widening scans to finish before assertions
Co-authored-by: Abdulwahab Isam <5349989+ai94iq@users.noreply.github.com>
2026-09-30 17:11:15 -04:00
Harold Hunt 464e476c9e fix: keep a check on the saved Power Efficiency preset
Bold alone lost to the hover fill: with the pointer on another row, two
rows were filled and nothing said which was saved. The saved preset now
keeps a check wherever the highlight goes, and the pointer moves the same
single highlight the arrow keys do. The menu is wider so Drain My Battery
still fits beside the check.
2026-09-29 12:52:40 -04:00
Mohammed Munzir dfd1fdc649 fix(space): exclude foreign-volume marks from free-space projection
The free space meter measures the scanned volume, but the projection added
every marked target's bytes. A mark on another volume -- which -X crosses
into, and a disk mounted inside the tree can hold -- gives its space back
there, so the meter lent one disk another's.

Attribute each target to the volume its bytes return to, by the rule the
scan itself bounds a volume with (mount source and type, not a device
number), and project only what comes back to the scanned volume. Marks on
other volumes, snapshot subvolumes, and paths the mount table cannot place
are reported as "not counted here" rather than added; every marked target
is still removable, and the delete list still totals every byte.
2026-09-28 21:25:34 +03:00
Joshua Gosse 48fc31af48 tree: a node is 88 bytes instead of 120
A home directory of 2.6 million directories and 17 million files is
19.7 million nodes, so every field of Node is paid that many times: its
120 bytes were 2.36 GB of the scan's 3.27 GB peak.

- own_bytes and own_files are no longer stored. After aggregate a leaf's
  own figures always equal its totals, and only the selection line reads
  a directory's, so Node::own_bytes() and own_files() sum the direct
  children when asked. A leaf's bytes is now the measured size and the
  only input; de-duplication zeroes it for a second name, as it zeroed
  own_bytes before.
- dirs is a u32, which packs beside the one-byte fields.
- inode is Option<(u64, NonZeroU64)>: no file has inode or file record
  zero, so None fits in the niche and the pair costs 16 bytes, not 24.
  Node::identity() gives the plain pair.

On the same home directory, peak memory for a scan falls from 3,267 MB
to 2,588 MB and node storage from 2,359 MB to 1,731 MB. Trees are
identical to upstream's with de-duplication off (1.25 million nodes
across ~/src, /Applications and /System/Applications, both size modes),
and the totals are identical with it on. a_node_stays_small holds the
size on 64-bit targets.
2026-09-28 09:38:59 -04:00
Joshua Gosse fdc2eb330d scan: list macOS directories with getattrlistbulk, one call per buffer of entries
On macOS the walk listed each directory with std::fs::read_dir and then
called DirEntry::metadata for every file, an lstat of its full path, plus
one more per directory for the dataless flag and the device. On a home
directory of 2.6 million directories and 17 million files that is some
20 million system calls on top of the listing, each of which makes the
kernel set up per-file state.

macos.rs lists a directory with getattrlistbulk(2), which returns the
name, type, device, inode, modification time, flags, link count and sizes
of a whole buffer of entries per call, the way windows.rs already does
with FileIdExtdDirectoryInfo. The sizes are the ones stat reports:
ATTR_FILE_ALLOCSIZE is st_blocks * 512 (every fork, as st_blocks counts),
ATTR_FILE_DATALENGTH is st_size (the data fork). Checked against lstat on
151,000 files across system apps, app bundles, ~/Library and source
trees, and by a test with sparse, hardlinked, symlinked and
resource-forked files. An entry a file system describes only in part is
read with statat relative to the open directory.

Measured on an M5 Pro with 15 walk threads, warm and otherwise idle,
alternating with upstream/main:

  ~/src (88k directories, 696k files)   4.3-4.5 s -> 2.0 s
  whole home directory (2.6M, 17M)      116.6 s -> 90.4-91.6 s

User CPU for the home scan fell from 24.6 s to 9.6 s, and system CPU
from 630 s to 430 s. Trees are identical to the standard listing's with
hardlink de-duplication off (3.3 million nodes, both size modes); with it
on the totals are identical, and which name of a hardlinked file is
charged varies as it already did between runs.

Linux keeps the standard listing, whose DirEntry::metadata is already a
statx relative to the directory; Windows keeps its own.
2026-09-28 09:38:58 -04:00
kevin9327andClaude Opus 5.5 7777720c47 Flag a marked path whose name is not valid Unicode
export::line wrote a path as plain whenever it had no control characters, but display() shows a name that is not valid Unicode with U+FFFD in place of its bytes, so the delete list and the agent prompt named a path that does not exist as one to use. Such a path now goes to the escaped branch, flagged, like a name with a control character.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 22:36:04 +09:00
Harold Hunt 5a170a1b18 chore: add the scan-worker benchmark behind the Power Efficiency table
`examples/scan_workers` runs one scan with a fixed pool of N workers, the
way a preset does, and prints its counts as JSON.
`scripts/bench-scan-workers.py` builds it, runs an untimed warm-up and
rotating rounds under /usr/bin/time, and samples whole-machine CPU. It
prints the median table with deltas against the largest worker count:
scan time, CPU time, and the scan's share of all cores.
2026-09-28 08:19:49 -04:00
Harold Hunt 5b925614c6 fix: state the measured Power Efficiency tradeoff in the tooltip
Whole-drive scans on an 18-core Apple silicon Mac (medians of three) took
209 s and 433 CPU-seconds with 4 workers, 133 s and 580 with 8, and 137 s
and 1,314 with 18. The tooltip said more than Balanced finishes "only about
20% sooner for about twice the CPU", which those runs contradict: 8 is a
third faster than 4, and 18 is no faster than 8 at over twice its CPU.
Other platforms keep the shape without numbers, since it was not measured
there.
2026-09-28 02:24:51 -04:00
Harold Hunt eabe10f642 feat: show Power Efficiency as a gauge in the settings row
The preset control added a second row to the top bar and a stacked-button
popup that marked the choice with the accent outline, unlike every other
menu in the app. It is now one framed control after Depth: a four-bar
signal gauge whose tooltip names the preset, its worker count and the
cost of going above Balanced (about 20% sooner for about twice the CPU,
with the fans at full speed on macOS).

The menu is built like the sibling menu: a caption header with the CPU
count, name, share-of-CPUs bar and worker count per row, the current
preset in bold, and the arrow keys, Enter and Escape. A preset that would
run no more workers than the one below it on this machine is shown but
disabled, and the arrows step over it. Labels say "workers" throughout.

With the settings back on one line, a long trail could clip the current
crumb's menu chevron. The trail now packs to its end, so it gives up its
start instead.
2026-09-27 22:18:55 -04:00
David Aronchick 010df88bc3 Reveal a tile in the file manager on right-click
Right-clicking a tile in the treemap selects it and shows it in Finder,
File Explorer or the file manager, the same reveal `o` already does.
The platform work is GPUI's reveal_path, which runs detached on every
system. On macOS a ctrl-click arrives as a right-click, so it reveals
too; cmd-click still marks.
2026-09-27 16:22:15 -07:00
kuishou68 9540cace7b docs(readme): the t key cycles three modes, not two
The in-app key reference (views.rs help_overlay) says t switches Size, files or age - what areas and colours say, and state.rs cycles mode_index() over three modes (Size/Files/Age, Age mode colours by last write). The README key table still described the old two-mode behaviour (rank by size or by file count), which contradicts both the app and the Size / Files / Age switch the README itself describes elsewhere.

Align the row with the in-app help text.
2026-09-28 02:44:05 +08:00
Harold Hunt b4e1a22fd9 feat: add saved Power Efficiency scan worker presets 2026-09-27 09:46:00 -04:00
Harold Hunt d448eaa139 Merge origin/main and preserve scan admission integration 2026-09-27 09:31:30 -04:00
Tobias Lütke 158f9cc2f0 Merge pull request #44 from tobi/mount-dedup-fix
Fix repeated mount accounting and external SSD deletion guards
2026-09-26 22:04:35 -04:00