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

Improve merging of tags by simple drag and drop #144

Closed
kamtschatka opened this issue May 9, 2024 · 4 comments
Closed

Improve merging of tags by simple drag and drop #144

kamtschatka opened this issue May 9, 2024 · 4 comments
Labels
feature request New feature or request

Comments

@kamtschatka
Copy link
Contributor

Currently merging of tags requires a lot of clicking, which can get tiresome, when you have to merge a lot (i guess the most common reason is, because inference creates a lot of tags)

I think a good way to allow merging in a fast way, would be drag and drop on the "Tags" page.
You see a list of all the tags and if you want to merge one with the other, you simple drag the one you want to get rid of onto the one that should stay and it gets merged right away.

@MohamedBassem MohamedBassem added the feature request New feature or request label May 10, 2024
@MohamedBassem
Copy link
Collaborator

I like the idea :) I'll guess it's time for me to learn how make things draggable :D

@kamtschatka
Copy link
Contributor Author

I have spent quite some time looking at react-beautiful-dnd and hello-pangea, but seems like they only allows dragging in horizontal or vertical lists, so that does not work for the tags as they are in both directions (gave me some weird hover effects)
I also had a look at dndkit, but that seems to not support combining. I am checking out react-draggable soon, unless someone else knows a library that can be used for dragging/dropping tags onto each other to combine them.

@kamtschatka
Copy link
Contributor Author

kamtschatka commented May 13, 2024

OK, i got it to work with react-draggable (merged a tag just before taking the screenshot, that is why the toast is open):
image

Basically I added the "Allow Dragging" checkbox to enable dragging. The reason is that having a link in the TagPill does not really work with the drag and drop and additionally I want to prevent people from merging tags accidentally, so I added the checkbox.

So a few questions:

  • Is the use of react-draggable OK?
  • Any suggestions for the feature/how the UI should look like?

Currently the code is quite messy, since it involved a lot of trial and error, so I have to first clean it up, but if you give some feedback, I'd clean it up and create a PR.

Disclaimer: I'm not a UI developer, I work on real user monitoring during the day, so I hope it won't shock you too much^^

kamtschatka pushed a commit to kamtschatka/hoarder-app that referenced this issue May 15, 2024
Added drag&drop functionality
Allowing sorting the tags by name, as this is more intuitive
kamtschatka pushed a commit to kamtschatka/hoarder-app that referenced this issue May 17, 2024
minor renamings
removed some unnecessary code
kamtschatka pushed a commit to kamtschatka/hoarder-app that referenced this issue May 17, 2024
extracted out the drag and drop functionality to be more encapsulated and reusable
kamtschatka pushed a commit to kamtschatka/hoarder-app that referenced this issue May 17, 2024
improved the usage sorter to additionally compare by name if the usage is the same
kamtschatka pushed a commit to kamtschatka/hoarder-app that referenced this issue May 17, 2024
replaced checkboxes with toggles floating on the right
kamtschatka pushed a commit to kamtschatka/hoarder-app that referenced this issue May 17, 2024
minor renamings
removed some unnecessary code
kamtschatka pushed a commit to kamtschatka/hoarder-app that referenced this issue May 17, 2024
extracted out the drag and drop functionality to be more encapsulated and reusable
kamtschatka pushed a commit to kamtschatka/hoarder-app that referenced this issue May 17, 2024
improved the usage sorter to additionally compare by name if the usage is the same
kamtschatka pushed a commit to kamtschatka/hoarder-app that referenced this issue May 17, 2024
replaced checkboxes with toggles floating on the right
MohamedBassem pushed a commit that referenced this issue May 18, 2024
)

* Improve merging of tags by simple drag and drop #144
Added drag&drop functionality
Allowing sorting the tags by name, as this is more intuitive

* Improve merging of tags by simple drag and drop #144
minor renamings
removed some unnecessary code

* Improve merging of tags by simple drag and drop #144
extracted out the drag and drop functionality to be more encapsulated and reusable

* Improve merging of tags by simple drag and drop #144
improved the usage sorter to additionally compare by name if the usage is the same

* Improve merging of tags by simple drag and drop #144
replaced checkboxes with toggles floating on the right

---------

Co-authored-by: kamtschatka <simon.schatka@gmx.at>
@MohamedBassem
Copy link
Collaborator

@kamtschatka implemented it in #154!

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

No branches or pull requests

2 participants