Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Tags #1161

Closed
thetek43 opened this issue Jun 20, 2020 · 35 comments · Fixed by #5629
Closed

Support for Tags #1161

thetek43 opened this issue Jun 20, 2020 · 35 comments · Fixed by #5629

Comments

@thetek43
Copy link

Is your feature request related to a problem? Please describe.
I really like the Tag feature in the Apple Finder. It would improve my workflow quite a bit, and the default Windows Explorer doesn't have it. Image below:

Describe the solution you'd like

  • The ability to add Tags to files (and folders) with custom names and custom colors
  • Tag list should appear on the sidebar below the drives
  • Adding/Removing Tags via right click -> last row of the menu -> circles with colors. When a tag is selected, it should appear with a checkmark.
  • Tag color in front of file name

Describe alternatives you've considered
There's not many good alternatives to tags... E.g., I could make a Tag for ToDo so that I don't have to write everything in a text file which is pretty annoying.

Additional context
Image from the Mac Finder:
grafik
grafik

@ghost ghost added the needs-triage label Jun 20, 2020
@jaigak
Copy link
Contributor

jaigak commented Jun 20, 2020

But how would we store it? We could store the tags in local settings however the user will lose the tags when the app is reinstalled. We can use roaming settings however that only works for Microsoft account and not local accounts. A better alternative would be to embed the tag in the file's metadata however that may cause some incompatibility with other apps. In macOS, the tag is stored by the file system not by finder. We can't do that since NTFS doesn't support tags. If you really want tags in Windows, give feedback to Microsoft.

@thetek43
Copy link
Author

By roaming, you probably mean %appdata%, right? Afaik, this is available to local users as well - idk. If not just use a C:/Program Files/Files UWP/Data/ folder or something like that.
It was an idea, I don't know how your app works in the background, so sorry if it is not possible. Would be amazing tho :)

@jaigak
Copy link
Contributor

jaigak commented Jun 20, 2020 via email

@thetek43
Copy link
Author

Just looked it up, Windows actually supports tags - they are kind of crappy tho. Check this out: https://www.howtogeek.com/344543/how-to-tag-any-windows-file-for-easy-organization/
Maybe that can be used, but I'm not certain. (Hopefully yes!)

@jaigak
Copy link
Contributor

jaigak commented Jun 20, 2020 via email

@thetek43
Copy link
Author

I would rather say strings for easier use with win explorer. Then you could set a color in the settings of FilesUWP. By default, just a random color, which can then be changed.

@jaigak
Copy link
Contributor

jaigak commented Jun 20, 2020

@duke7553 Could you assign me to this issue?

@lukeblevins
Copy link
Contributor

lukeblevins commented Jun 21, 2020

@Jaiganeshkumaran I'm thinking we DO NOT want to keep a temporary file with JSON for the flags.

Rationale: It is far more efficient to use the BasicProperties.SavePropertiesAsync() method to associate a color value with the filesystem property of the storage items themselves. This won't persist across reinstalls of Windows, but MIGHT stay around if Files (UWP) is reinstalled. I still have to research this part.

Side note: This is already built-in to Windows for use in Outlook, we just have to create a UI for it

@lukeblevins lukeblevins self-assigned this Jun 21, 2020
@thetek43
Copy link
Author

You could also set the tags to "identifier#RRGGBB with RGB being the color set in the settings.

@jaigak
Copy link
Contributor

jaigak commented Jun 23, 2020

@duke7553 Most file properties do persist as long as you have the file in an NTFS volume.

@jaigak
Copy link
Contributor

jaigak commented Sep 5, 2020

@thetek42 The main issue is that the built-in tags feature only works with some files instead of all files. Windows does offer other properties were we could store it instead.

@jaigak
Copy link
Contributor

jaigak commented Sep 5, 2020

Comments property works with most files but for others I'm searching for another property

@jaigak
Copy link
Contributor

jaigak commented Sep 6, 2020

It's much harder than I originally thought. Although tags are there in Windows, it's for a few file types and it doesn't work with others. Microsoft doesn't provide a good documentation about this so it's not reliable. They are other properties however we shouldn't modify them because it may contain other information and even then they are only available for a few files. To make matters even worse, some files have property locks and Explorer doesn't allow you to change any property of the file so I get an exception.

@jaigak
Copy link
Contributor

jaigak commented Sep 6, 2020

@yaichenbaum @gave92 Any idea on which property to use for storing tags? I don't get why some properties are only available for some file types although they are generic.

@jaigak
Copy link
Contributor

jaigak commented Sep 6, 2020

@gave92 Alternate streams is a great idea but we should wait for #177 to be completed

@gave92
Copy link
Member

gave92 commented Sep 6, 2020

@Jaiganeshkumaran I was looking to alternatives to Alternate streams as you'd need to use the fulltrust process to get them (possibly slow to load) and they do not persists if copied outside NTFS. Not sure if there's another way though.
Edit: in addition to the above ADS (or properties added by the StgCreateStorageEx function) are not indexed by windows search, so searching files matching a tag would be super slow.

@jaigak
Copy link
Contributor

jaigak commented Sep 6, 2020

@gave92 It's just colour so perfomance might not be an issue. For other file systems the solution is simple: AppData

@gave92
Copy link
Member

gave92 commented Oct 22, 2020

I'd love to see this feature implemented :)
I did some research and tests on this and I currently found two options:

  1. Store tags inside the files with Alternate Data Streams
  • Pro: tags will not get lost if the file is moved/renamed/modified as long as the file stays on NTFS
  • Pro: fully UWP (I did not know you could read/write ADS from UWP!)
  • Con: ADS are not indexed by Windows Search so looking for all files matching a tag would be painfully slow
  1. Store tags in a database together with filepath
  • Pro: search is super quick
  • Con: db is difficult to keep updated if the file is moved/renamed (especially if from Explorer)
    -> I found a few ways to alleviate this issue but nothing foolproof

What do you all think? Do you see any other options?

@jaigak
Copy link
Contributor

jaigak commented Oct 23, 2020

@gave92 We can use ADS and also it doesn't need to be indexed because Windows Search only supports properties.

@gave92
Copy link
Member

gave92 commented Oct 23, 2020

@Jaiganeshkumaran you can actually store properties in ADS. E.g. you can add the standard "comments" property to any kind of file. Unfortunately as I said this does not help us as those properties will not be indexed :(

So don't you find being unable to search for files matching a tag to be a severe limitation?

@yaira2
Copy link
Member

yaira2 commented Nov 22, 2020

@Jaiganeshkumaran Are you still planning on working on this issue?

@jaigak
Copy link
Contributor

jaigak commented Nov 23, 2020

@yaichenbaum Yes

@yaira2
Copy link
Member

yaira2 commented Nov 23, 2020

@Jaiganeshkumaran That's great! Keep us posted.

@jaigak
Copy link
Contributor

jaigak commented Jan 7, 2021

@Jaiganeshkumaran you can actually store properties in ADS. E.g. you can add the standard "comments" property to any kind of file. Unfortunately as I said this does not help us as those properties will not be indexed :(

So don't you find being unable to search for files matching a tag to be a severe limitation?

Maybe we would have to implement them manually however how would you search for colors?

@gave92
Copy link
Member

gave92 commented Jan 7, 2021

The issue is that for finding all files matching a tag you'd have to scan the entire HDD, load the ADS for each file and check if it has a matching tag ---> tooo slow to make any sense
So you'd have to keep an index of which files has a certain tag:

  • using the Windows Search index is apparently not possible because it does not index ADS
  • using a database inside the app is difficult because you can't keep track if a file is moved/renamed (especially if it's moved using Explorer)
  • any idea?

@carlosvsilva
Copy link

I am also really looking forward for your implementation of tags/colors I think it's of major importance to Files and user experience in Windows.
I only found this resource as a starting point:
https://en.wikipedia.org/wiki/NTFS#Attribute_lists,_attributes,_and_streams
Maybe other file explorers for Windows which suport colored tags can be looked at to see how they do that at a filesystem level.
Thanks

@Svk1190
Copy link

Svk1190 commented Jul 27, 2021

I think that using a database along with an audit policy can be helpful. The apparent problem with the database approach is that we won't know when a file is renamed/moved to a different location by using file explorer. To address this problem we can use an audit policy, which tells Windows to keep track of file changes. So whenever we tag a file, auditing would be switched on for that file only. Even if Files is closed, any operations on the tagged file would be logged and made available to Files. Thus Files can update its database the next time it is opened. And after all tags are removed from file, auditing can be switched off for the untagged file. This can help to persist a tag.

References:

  1. https://community.spiceworks.com/topic/363079-using-event-viewer-to-track-changes-to-files
  2. https://superuser.com/questions/1543894/does-can-windows-10-keep-track-of-file-moves-copies-shortcut-creations
  3. https://docs.microsoft.com/en-us/windows/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder

@Svk1190
Copy link

Svk1190 commented Jul 27, 2021

@yaichenbaum sorry, I am not a developer.

@gave92
Copy link
Member

gave92 commented Jul 30, 2021

You can try out this branch for a working implementation of Tags for Files v1.9. UI is unfinished but:

  • You can tag files with a color badge through the context menu
  • You can find all files with a tag by searching for "tag:<TAGCOLOR>" in the search-box (e.g "tag:orange")

@yaira2
Copy link
Member

yaira2 commented Aug 8, 2021

This issue should be resolved with #5629.

@e11world
Copy link

I've just been following this looking for this one feature and not sure if anyone is working on it. I'm a web designer/developer not sure if I can help but would love to see this feature along with an easier implementation of tags in general.

@yaira2
Copy link
Member

yaira2 commented Dec 13, 2023

@e11world it's already been added, you can find the latest version of Files on our website https://files.community/download

@e11world
Copy link

@e11world it's already been added, you can find the latest version of Files on our website https://files.community/download

I did see it but only 4 of them and no way to add or edit any. Seems merged with tags but they should be different things since tags can be the detailed way of finding items but colors are another quicker way to organize and scan items. I guess needs modifications of how it functions.

@Josh65-2201
Copy link
Member

You can edit anything about them in Files settings > Tags

@e11world
Copy link

You can edit anything about them in Files settings > Tags

Thanks I see it now. Pretty amazing!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants