-
-
Notifications
You must be signed in to change notification settings - Fork 318
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
[Enhancement] Add a checkbox to overwrite or add tags when selecting mulitple images #654
Comments
Ok, well firstly it's not as clear cut as you say - in that case how would you remove a tag from all of those photos? Secondly, the dialog clearly says "Existing tags will be overwritten", so this is in no way unexpected behaviour. Unless someone proposes (and, if we're realistic, implements) a UI that allows for the proposed and current behaviours without adding unnecessary complexity, I don't see this changing. I'm going to close this unless/until that happens. |
@d7415 To me this seems like a big usability issue. This makes tagging in the application unusable since users will tag some pictures here and there, and then they'll add new tags which would remove any previous tags (message saying that it'll remove the old tags doesn't really help). Instead of replacing the tags, it should just add new tags. For clearing tags, maybe having a small tag list and user can remove the tag completely? Or adding a dropdown option to clear tags for the selected pictures? |
You're welcome to this opinion. I strongly disagree, and I did not build that UI, so from a very small sample you are in the minority. As I said, I have no objections to this functionality but it shouldn't be at the expense of simplicity or of users expecting the current behaviour.
Which tags? Where is the list? Completely from the selected pictures or from the whole gallery?
This adds an extra step for users expecting the existing behaviour, as they would have to clear the tags and then re-add them. We're also slightly reluctant to add extras options here unless there is a clear benefit. A "clear tags" button with the list of tags could work, but wouldn't help with multiple photos. It sounds like you have lots of tags that each affect many photos, but with very few photos sharing the same set of tags, which may be a use case we're not fully catering for at the moment. Again, my issue is that the initial proposal is replacing existing (desired) functionality with your preferred version. I guess the simplest option might be a configuration toggle. If that sounds like a sensible compromise let us know. I'll leave reopening to someone else as I don't have the time right now to consider the pros/cons of such an approach. |
+1 for @trigun539 i think the existing behavior is useless a checkbox to overwrite or add tags will be great |
@ildyria My PHP is pretty rusty, but I could take a look at this feature if someone can point me in the right direction (which files would need to be changed). |
Some readings: Introduction to the MVC of lychee: https://lycheeorg.github.io/docs/read-more.html Files you will need to modify: If you need to make a more complex function, I highly advise you to create a new function in: To modify the front end, have a look at this: https://lycheeorg.github.io/docs/node.html To add settings to the database, you will need to create a migration file:
which will then be executed with:
(
The create file will be added in this folder: As we have CI to unify our code style, before creating a pull request, you will need to check that you are properly formatting the code. You just need to execute the following command and it will take care of fixing the style:
Lots of information, but once you got a rough idea of how the full things works, it is not that complex (contrary to what @d7415 thinks 😝 ) |
@ildyria just tried to run |
I don't use vagrant, so I can't really help you with that one. However I do know that Laravel support Homestead: https://laravel.com/docs/7.x/homestead and I think our repo comes with it prepackaged (indeed: https://github.com/LycheeOrg/Lychee/blob/master/composer.json#L39) if you use the |
Additionally there is this : https://github.com/LycheeOrg/Lychee/blob/master/Vagrantfile |
@ildyria getting this error when running Lychee. Do you happen to know what I'm missing? The installation seemed to finish successfully. |
are you using vagrant or Nginx because I can't really help you in that case as I am an apache user. :( Did you had a look here: https://lycheeorg.github.io/docs/faq.html#when-i-do-x-i-get-an-error-api-not-found-what-can-i-do ? |
Yes, doing vagrant / nginx / homestead since seemed to be the easier one to setup. I'll take a look on the link you sent. |
@d7415 😃 |
Updated nginx conf file with the settings given on link and seems to be working 👍 |
I answer to this issue only to say that I strongly agree that it is needed. |
Yes but sadly, we are not many dev on the project, so it is hard to allocate time and resources to it. There are so many things that need to be developed... E.G. the ability to specify how you sort an album PER album instead of a global setting. |
@ildyria Got the backend sorted out for this, but frontend still needs some work. Can you send me some idea how the frontend is put together. Seems like it's using leaflet for everything? Is |
The front end is to be compiled from here : https://github.com/LycheeOrg/Lychee-front
Also worth reading: https://lycheeorg.github.io/docs/node.html |
@ildyria I'll take another look |
I'm interested in the "add tag" feature. |
I recently started using Lychee and also realized I need this badly. Lacking time to implement it properly, I "hacked" the public function setTags(SetPhotosTagsRequest $request): void
{
$tags = $request->tags();
// Hack: If editing multiple photos append, if editing one photo replace
$append = count($request->photos()) > 1;
/** @var Photo $photo */
foreach ($request->photos() as $photo) {
if($append) {
$photo->tags = array_unique(array_merge($photo->tags, $tags));
} else {
$photo->tags = $tags;
}
$photo->save();
}
} So basically, if I am editing a single photo it replaces the tags, as before. But if I am editing multiple photos, then it will append the tags (removing potential duplicates). |
@moritzhoewer you can open a pull request, this hack looks pretty good already. You should add some request parameter that allows switching between override / append but otherwise, this looks nice. I can also check it later and open a pull request. |
I just opened #1564 which adds support for this, based on @moritzhoewer's hack. |
Nice, thank you for turning this into a proper feature - with frontend, tests, localization and everything. As I said in the original message, I unfortunately didn't have time to implement more than this hack...it's been a while since I last worked with PHP and I never used Laravel. I could probably have managed with enough time, but it would have taken much longer than it took you 😁 |
Steps to reproduce:
As you can see, the old tags have all been replaced when you add new tags. It should've kept the old tags, otherwise, it'll be really hard to be able to tag pictures.
Thanks
The text was updated successfully, but these errors were encountered: