Keep data-path attribute up-to-date in the file explorer

Use case or problem

I’d like to add emojis in front of directory names without actually adding the emoji to the name. I followed this snippet to do that. It relies on a data-path attribute in the DOM.

For example:

.nav-folder-title[data-path="projects"] .nav-folder-title-content::before,
.nav-folder-title[data-path="archive/projects"] .nav-folder-title-content::before {
  content: "📋 ";

There is a minor inconvenience related to the data-path attribute though: currently it doesn’t get updated as new directories are created or moved. The value remains Untitled.

Proposed solution

Update data-path attributes in the DOM following the changes in the directory structure.

Current workaround (optional)

Restarting (or reloading) the application.

Related feature requests (optional)

I originally reported this as a bug here. I still believe this is rather a bug, but it got closed. More details (with steps to reproduce) are available in that post.


I am developing a plugin and faced this problem too. I hope anyone will pay attention to this topic.
Also, i can attach a recorded reproducing, hope it helps

Licat said it’ll be fixed in the next release.

1 Like