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

Separate taglines and emojis from GetSiteResponse, into their own paged endpoints #4577

Closed
5 tasks done
dessalines opened this issue Mar 28, 2024 · 6 comments
Closed
5 tasks done
Labels
area: api enhancement New feature or request
Milestone

Comments

@dessalines
Copy link
Member

Requirements

  • Is this a feature request? For questions or discussions use https://lemmy.ml/c/lemmy_support
  • Did you check to see if this issue already exists?
  • Is this only a feature request? Do not put multiple feature requests in one issue.
  • Is this a backend issue? Use the lemmy-ui repo for UI / frontend issues.
  • Do you agree to follow the rules in our Code of Conduct?

Is your proposal related to a problem?

Currently, both taglines and emojis are coming back with GetSiteResponse, and returning the entire list. This is wasteful as these lists grow long, and fetching taglines and emojis should be done with paged endpoints.

Describe the solution you'd like.

Create paged endpoints for taglines and emojis.

Describe alternatives you've considered.

NA

Additional context

NA

@fvanzee
Copy link
Contributor

fvanzee commented Mar 31, 2024

I've created a draft PR, which only adds the required new endpoints. I have some questions about breaking changes on the PR description.

@makotech222
Copy link
Contributor

just bringing up the reason it was originally designed this way was because all users need the full list of emojis/taglines in order to display them properly in emoji picker/random tag line list, so there wasn't any reason to also pull them down in paged format for admin purposes. Just store them all the first time you visit site and you're good.

@Nutomic Nutomic mentioned this issue Apr 2, 2024
4 tasks
@dessalines
Copy link
Member Author

I'm not sure how the emoji picker works, but if it sorts them by name or category, then it could also be a paged request, that loads after the picker shows up for that category. Its not scaleable or a good idea to have potentially thousands of emojis come back in the single response on every site load, better to use live-loading with searches like the user and community dropdowns.

@makotech222
Copy link
Contributor

the emoji picker library is actually bugged: once you initialize it, you can't change the emoji list. Its a long standing bug that doesn't look like it will be fixed. Not our fault, but just something to be aware of if you try to paginate it. I can't imagine the Tribute inline component will also be easy to work with a paginated emoji list, since its searching after every key press == lots of network requests.

I think the smarter option is to version the emoji list, and only pull down the whole thing if your locally cached version is different.

@dessalines
Copy link
Member Author

There are already examples of using tribute + network requests for users and communities, it'd be impossible to load them all like you're doing with the emoji picker. I'd say get tribute working first, then figure out if there's a way to incorporate network / async loading into the emoji picker, and if not, we'll need to use a different library.

@Nutomic Nutomic added this to the 0.20.0 milestone May 22, 2024
@Nutomic
Copy link
Member

Nutomic commented Sep 19, 2024

#4580

@Nutomic Nutomic closed this as completed Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: api enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants