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

Support search by URL #882

Merged
merged 1 commit into from
Nov 10, 2023
Merged

Conversation

micahmo
Copy link
Member

@micahmo micahmo commented Nov 7, 2023

Pull Request Description

This PR addresses the URL search type.

image

This one's a strange beast because, while the others like Posts and Comments, denote the type of object to search, URL denotes a field to search. And in fact, by looking at the Lemmy server code, you can see that it only ever returns Post results.

https://github.com/LemmyNet/lemmy/blob/cb01427dcff14b3d88e30220695fc97978786a9a/crates/apub/src/api/search.rs#L183-L184

Therefore, I attempted to implement this as a smart toggle.

  • When the search type is posts, the user can toggle whether to do a URL search or not.
  • Furthermore, if the entered query is parseable URL, we will automatically select URL as the search type (of course, the user can always switch back to text search).

Hopefully this makes sense and is a reasonable implementation of this feature in our UI.

Issue Being Fixed

Issue Number: #273

Screenshots / Recordings

search-by-url.mp4

Checklist

  • Did you update CHANGELOG.md?
  • Did you use localized strings where applicable?
  • Did you add semanticLabels where applicable for accessibility?

Copy link
Member

@hjiangsu hjiangsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@hjiangsu hjiangsu merged commit 8d684b1 into thunder-app:develop Nov 10, 2023
1 check passed
@micahmo micahmo deleted the feature/search-by-url branch November 11, 2023 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants