Skip to content

Bug: MacDirStat jumps back to Treemap after deleting in Duplicates #5

@BlackMaple1203

Description

@BlackMaple1203

Thanks for the great app!

Description:

After hitting the delete button in Duplicates section, the app jumps right back to Treemap section, rebuild the whole folder, and find duplicates from scratch, as shown in the video below.

CleanShot.2026-05-07.at.22.45.32.mp4

This is a simple case, building the treemap and duplicates finished instantly. However, in larger scenarios, those two actions take a large amount of time and is repeated after every deletion.

Bug Fix:

The behavior is likely to be caused two explicit code paths working together.

The handler in duplicates section did not update the duplicates list locally. After a successful trash operation, they called the view model’s full scan entry point again. That method, [ScanViewModel.swift:79], is a full reset-and-rescan path: it clears the current root, treemap cells, duplicate groups, extension summaries, and then sets isScanning to true before scanning the directory from scratch again.

However, the main UI is wired to switch back to the treemap whenever scanning starts, as in [ContentView.swift:102] the onChange handler for isScanning does this directly.

After fix:
https://github.com/user-attachments/assets/6a7dd611-87c8-4953-87e7-f64df6296abf

Happy to pr if possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions