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

feat: add searching by tags #15395

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

dav-wolff
Copy link
Contributor

@dav-wolff dav-wolff commented Jan 16, 2025

Adds the feature to search for photos by one or multiple tags in the web, and support for it in the server.
image

This is my first time contributing to immich so apologies if some things aren't up to standard.

The tags section in the search modal web/src/lib/components/shared-components/search-bar/search-tags-section.svelte duplicates some code from web/src/lib/components/forms/tag-asset-form.svelte. I couldn't use that component directly, as it is a full screen modal. Should I add a new component instead that is used by both?
Also of note is that I slightly changed the behavior of the tags section to clear out the text whenever a tag is selected. This makes it much easier to select multiple tags using the keyboard. Maybe this should also be added to the full screen modal?

On the side of the server, having the tagIds functionality split up in searchAssetBuilder is a bit awkward. This is because as far as I can tell kysely requires CTEs to be added before calling selectFrom, but innerJoins to occur afterwards. I don't see a way to avoid this.

Also I noticed a bug in the adjacent hasPeopleCte where it yields false positives. Should I open a separate PR for this? (I did)

I would also like to add this functionality to the mobile app, however I haven't gotten around to it yet and I have no experience with flutter, so I'd prefer to do this in a separate PR at a later date if I can get it working.

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

Successfully merging this pull request may close these issues.

2 participants