-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
dav-wolff
wants to merge
1
commit into
immich-app:main
Choose a base branch
from
dav-wolff:tag-search
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: add searching by tags #15395
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dav-wolff
force-pushed
the
tag-search
branch
2 times, most recently
from
January 17, 2025 06:35
c62c943
to
8d65b47
Compare
jrasm91
approved these changes
Jan 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Comment on lines
+220
to
+235
async function getTagNames(tagIds: string[]) { | ||
const tagNames = await Promise.all( | ||
tagIds.map(async (tagId) => { | ||
const tag = await getTagById({ id: tagId }); | ||
|
||
if (tag.name == '') { | ||
return $t('no_name'); | ||
} | ||
|
||
return tag.name; | ||
}), | ||
); | ||
|
||
return tagNames.join(', '); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we have a tag service/cache that can do this from a single request which loads all the tags once
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds the feature to search for photos by one or multiple tags in the web, and support for it in the server.
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 fromweb/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.(fixed now)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.