diskonaut icon indicating copy to clipboard operation
diskonaut copied to clipboard

Bug: Small files hidden from view

Open Ben-PH opened this issue 5 years ago β€’ 7 comments

Here is the display using ncdu:

--- /path/to/projects/shader_brot ------------------------------------------------------------------------
                         /..
    1.1 GiB [##########] /target                                                                          
  216.0 KiB [          ] /.git
  116.0 KiB [          ]  Cargo.lock
   20.0 KiB [          ]  LICENSE
   20.0 KiB [          ] /resources
   20.0 KiB [          ] /src
    4.0 KiB [          ]  README.md
    4.0 KiB [          ]  TODO.md
    4.0 KiB [          ]  Cargo.toml
    4.0 KiB [          ]  .gitattributes
    4.0 KiB [          ]  .gitignore

                       β”Œβ”€β”€β”€Item info──────────────────────────────────────────────┐
                       β”‚                                                          β”‚
                       β”‚  Name: target                                            β”‚
                       β”‚  Path: /path/to/projects/shader_brot                     β”‚
                       β”‚  Type: Directory                                         β”‚
                       β”‚                                                          β”‚
                       β”‚     Disk usage:   1.1 GiB (1,180,995,584 B)              β”‚
                       β”‚  Apparent size:   1.1 GiB (1,174,963,573 B)              β”‚
                       β”‚                                                          β”‚
                       β”‚                              Press i to hide this window β”‚
                       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

here is the display in diskonaut:

 Total: 1.4G (2797 files), freed: 0 | /path/to/projects/shader_brot
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                                                                                                        β”‚
β”‚                                                                                                        β”‚
β”‚                                                                                                        β”‚
β”‚                                                                                                        β”‚
β”‚                                      target/ (+2740 descendants)                                       β”‚
β”‚                                                                                                        β”‚
β”‚                                              1.4G (100%)                                               β”‚
β”‚                                                                                                        β”‚
β”‚                                                                                                        β”‚
β”‚                                                                                                        β”‚
β”‚                                                                                                        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                                                        (x = Small files)

I ran the numbers:

  • small files take up 425984B
  • target takes up 0.999639430994373 of the directory (FP errors in that)

Only going by behavior shown, I suspect the % of the directory that target/ takes up is being rounded to a flat 100%, causing the render to exclude the other files.

Ben-PH avatar Jul 05 '20 02:07 Ben-PH

Yeah, that's pretty much it :/

Considering the limitations of rendering in the terminal, we can really only show an approximation of what's going on. My reasoning was that this would be good enough for the tool's main purpose (clearing up disk space).

Even if we didn't round things up, there is no physical room to render something so small in the terminal. I was originally thinking of including a message in these case. Something like "Some files too small to be rendered", but then I figured it might be too much eye-clutter.

Do you have any other idea how to solve this, or any thoughts on what you'd like to see in this case?

imsnif avatar Jul 06 '20 13:07 imsnif

I can see how this bug could be acceptable in the context of clearing disk-space. For me, the core issue is that the information being presented is a "lie by omission", rather than "abstracting away low importance information." To illustrate, cell x = small files cell is revealing the presence of files, without cluttering up the information stream, and I like that. If there wasn't that cell at all, the user would have an information shortfall.

I would like to see something that shows diskonaut is choosing to not render directory content, similar to x = small files. An example solution: a 1-line cell in the bottom right, large enough for a message like this: Some files total size < Rounding Error. TAB to display. The user can hit tab, and those missed files are shown. This would only display when you don't have an x = small files cell.

As for how to solve, you would check: if <is not rendering x cell> && <no more cells to render> && <cells rendered != total dir entries> {<message that some files are within rounding error in size>}

Ben-PH avatar Jul 07 '20 06:07 Ben-PH

I think adding something like <X> files too small to render where the Small files legend is right now can make sense. Especially now that diskonaut has the ability to zoom and see those files. I think having it near the current legend though might be a little confusing.

I think I'd like to see this happen after we take care of https://github.com/imsnif/diskonaut/issues/15. Then we can conditionally show one or the other (or nothing) according to the situation. What do you think?

imsnif avatar Jul 07 '20 13:07 imsnif

That sounds like a sensible approach. The key thing is to show the user that diskonaut is at least aware of the missing files (the ones even too small to be part of the x = small files group

Ben-PH avatar Jul 08 '20 00:07 Ben-PH

I just now discovered this tool, and I really like it. But after 30 seconds of testing, I was looking for a button/key/option/etc to switch to a view that has the small files. Maybe that could be a potential solution for this problem? Or maybe the view could be made to scroll up/down to reveal the rest of the files?

0x5c avatar Apr 20 '21 11:04 0x5c

Oh wow, found #73 and it makes sense now

The zoom works perfectly fine once one realises it's there (I think the suggestion in the other issue to have the message flash is great)

One potential solution to make the presence of small files more obvious is to have a fake-size box that says "there are small directories" even if its size would be exaggerated. One way of doing it would be to have it overlap the proportional boxes. It could even have a different colour.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                                          β”‚                β”‚
β”‚                                          β”‚  go/ (+2155)   β”‚
β”‚                                          β”‚                β”‚
β”‚                                          β”‚  54.4M (13%)   β”‚
β”‚       .cache/ (+2920 descendants)        β”‚                β”‚
β”‚                                          β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                          β”‚                β”‚
β”‚               296.0M (72%)               β”‚ .local/ (+146) β”‚
β”‚                                          β”‚   37.8M (9%)   β”‚
β”‚                                          β”‚                β”‚
β”‚                                   β”Œβ”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                   β”‚ There are small files β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

0x5c avatar Apr 21 '21 22:04 0x5c

Similar idea to the above, here's how Nodescope does it

image

The overall presentation is different, but the idea of an minimal size element for all files two small to be shown is the same.

0x5c avatar Apr 21 '21 22:04 0x5c