felixhayashi / TW5-TiddlyMap

Map drawing and topic visualization for your wiki
http://tiddlymap.org
BSD 2-Clause "Simplified" License
845 stars 127 forks source link

Can't delete filter edges #424

Closed MythosOnGit closed 2 years ago

MythosOnGit commented 2 years ago

Hello. I'm a big fan of TiddlyMap. However, I've recently discovered an issue. Edges of type tw-filter cannot be deleted in the graph.

Reproduction

  1. Create an edge between two nodes of type tw-filter, either by drawing it, or adding a field to one of the nodes.
  2. Click on that edge in the graph.
  3. Click "Delete Selected"
  4. It says "edge deleted", but nothing happens.

Thank you.

flibbles commented 2 years ago

This was deliberately not implemented. tw-filter edge types don't really lend themselves to having their edges deleted through the GUI. The problem is that edges created by filters might be done by something like [tag[myTag]] or something even more complex. Removing them might not be something programmatic, so it's treated more like the tw-body edge types where links aren't able to be removed.

MythosOnGit commented 2 years ago

Are you sure there's nothing that can be done? I have a plugin which introduces several tw-filter types, and this is so far the biggest complaint I'm getting.

Several of my users are only using only the "Add Edge" button to populate edges. Seems like in those cases, "Delete Selected" should be able to work as intended since the filter won't be any different from a title list. If it's any more complicated than that, then skip. That would cover most use cases for me.

flibbles commented 2 years ago

I'll do you one better. I stole some code from my Uglify project and implemented this in a way that I think should handle 99% of all cases. There are combinations of having complex filters and using the graph buttons which might result in some odd filters, but they should still behave as expected.

I've pushed a release, but I can't update the demo site, so you'll have to check it out of the repository.

MythosOnGit commented 2 years ago

Thank you! Just tested it and it works great. I appreciate your going to the effort.