-
Notifications
You must be signed in to change notification settings - Fork 287
feat: gifs in chat #5159
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
base: main
Are you sure you want to change the base?
feat: gifs in chat #5159
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| limit: '20', | ||
| favoritesEnabled: open, | ||
| }); | ||
| const [debounceNextPage] = useDebounceFn<void>(() => { |
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.
Needed to debounce this because Tenor has a 1RPS rate limit, and without this, whenever we re-fetched after a scroll, it resulted in two calls. In production this could result in hitting rate limits.
| }); | ||
| const [open, setOpen] = useState(false); | ||
| const [query, setQuery] = useState(''); | ||
| const [savedSelection, setSavedSelection] = React.useState<[number, number]>([ |
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.
What does this mean the number, number?
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.
Its the cursor / selection the user has made in the input area, where the selected gif will be inserted :)
| side="top" | ||
| align="start" | ||
| avoidCollisions | ||
| className="flex h-[25rem] w-screen flex-col rounded-16 border border-border-subtlest-tertiary bg-background-popover p-4 data-[side=bottom]:mt-1 data-[side=top]:mb-1 tablet:w-[31.25rem]" |
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.
Have you checked this one on mobile as well?
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.
yeah, works well on mobile :)
Screen.Recording.2025-12-18.at.12.03.01.mov
| return lastPage.next || undefined; | ||
| }, | ||
| initialPageParam: undefined, | ||
| enabled: !!query, |
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.
We can also do some throttling here? maybe it's safer (over the debounce)
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.
What exactly are you thinking of?
The debounce seems to work quite well
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.
Maybe add some staleTime as I don't think they'll likely change much and the query key includes query already.
| return lastPage.next || undefined; | ||
| }, | ||
| initialPageParam: undefined, | ||
| enabled: !!query, |
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.
Maybe add some staleTime as I don't think they'll likely change much and the query key includes query already.
Changes
Make chats a little bit more interesting and fun :)
Screen.Recording.2025-12-16.at.12.44.21.mov
Events
Did you introduce any new tracking events?
Experiment
Did you introduce any new experiments?
Manual Testing
Caution
Please make sure existing components are not breaking/affected by this PR
Preview domain
https://gif-integration.preview.app.daily.dev