Bug 464585

Summary: Visually mark hardlinks
Product: [Applications] dolphin Reporter: Simone Gaiarin <simgunz>
Component: generalAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: CONFIRMED ---    
Severity: wishlist CC: i.m.jens, kfm-devel, lowell.bv
Priority: NOR    
Version: 22.12.1   
Target Milestone: ---   
Platform: Other   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=359873
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Dolphin List View: Link Icon
Dolphin List View: Link Number

Description Simone Gaiarin 2023-01-21 09:25:21 UTC
SUMMARY
Add a visual mark to distinguish a hard-link from a normal file. More specifically mark a file whose hard-link number is greater than one. Possibly we could add a small overlay number with the link count over the file icon.
Comment 1 Simone Gaiarin 2023-01-21 09:29:39 UTC
*** Bug 359873 has been marked as a duplicate of this bug. ***
Comment 2 lowell.bv 2023-02-24 19:31:36 UTC
Summery:
- Add a visual mark to distinguish a hard-link from a normal file. 

Suggested behaviour: 
- Visually mark any file whose hard-link number is greater than one. 
    - Mark the corner of the file as done with symlinks.
        - Use an icon or the total number of hard-links.
    - Format the file name to visually differentiate it form other files.
        - Use semi-bold to indicate its a hard-link!
        - Optionally use italicized for all link types.

Use-case:
- Allowing the user to easily know if the file is "hard-linked" elsewhere would empower more intelligent decisions on how to interact with files.
    - A user may want to free space on their disk, deleting a single copy of a hard-linked file will not accomplish this
    - A user may wrongly believe they have a second (hard-linked) copy of the file elsewhere and want to delete the current copy
    - A user may want to make a local change, but the file is hard-linked so it may apply the change globally
    - A user may falsely believe that a file is hard-linked but due to poor application interaction said link was destroyed
        - text editors with "backup" enabled often replace hard-linked files with new copy of the text file destroying the hard-link

Conclusion:
Though the use cases may be considered niche, there are benefits in being able to see at a glance if a file is hard-link or not. This feature would greatly improve the user output that dolphin provides, enabling the user to take the correct action. Currently proper hard-link support is practically nonexistent on file browsers, which makes this feature tedious to use at best, difficult to use or invisible at worst.
Comment 3 lowell.bv 2023-02-24 19:33:38 UTC
Created attachment 156684 [details]
Dolphin List View: Link Icon
Comment 4 lowell.bv 2023-02-24 19:34:07 UTC
Created attachment 156685 [details]
Dolphin List View: Link Number
Comment 5 Simone Gaiarin 2023-02-25 09:22:56 UTC
My personal preference:
- text: normal because a hard link is a normal file at the end
- icon: little number mark

Regarding the text. I would exclude italic because it can mislead the user in thinking it is a symlink. I would exclude semi-bold because the icon becomes too flashy respect the others.
Comment 6 Jens 2023-02-26 00:34:25 UTC
I would like to suggest *not* to create a kind of "counter" overlay icon, though it sounds great on first thought. 
Considerations:
  –  In details/compact view (with smallest icon size) overlay icons are really tiny and a number is almost impossible to read. 
  –  In addition this needs to implement quite a lot of different overlay icons (→ mem load). 
  –  Alternatively a textual overlay (→ e.g. Unicode square/encircled numbers) would complicate the implementation unnecessarily as this needs to be rendered at least each time you change the directory (→ even more mem load/switch time). 
  –  And at last, this most likely will cause a (endless) discussion about, »where should it stop counting?«. 

Instead I think a different colored overlay icon (with normal file name font style for hardlinks, as suggested by Simone Gaiarin) might be a good "first sight hint" (e.g. symlinks→green / hardlinks→yellow). 
If colors might be hard(er) to implement, maybe a different position (symlinks→lower right/ hardlinks→upper left) will do.
In addition a hardlink counter field in the preview (both pane & tooltip) and *maybe* a column (→ details view) could make it even more customizable. (And *if* this needs another column/field to be replaced, I really wouldn't miss the assessment field.)

BTW, I really miss such a feature! It's a pain i.t.a. to create workarounds for this kind of link management. Even Krusader can't help here.