Skip to content

Add GIF search feature#677

Open
footvaalvica wants to merge 11 commits intoSableClient:devfrom
footvaalvica:dev
Open

Add GIF search feature#677
footvaalvica wants to merge 11 commits intoSableClient:devfrom
footvaalvica:dev

Conversation

@footvaalvica
Copy link
Copy Markdown

@footvaalvica footvaalvica commented Apr 13, 2026

Description

Fixes #60 after all TODOs below have been completed.

Open Problems

  • The backend currently works with Commet's Tenor proxy. It should be migrated to KLIPY as per the original issue.
  • The icon currently being used is Icons.Play. It should be replaced with a proper GIF icon.

The approach for sending GIFs is to download the GIF data and then re upload them as a sticker.

This PR was heavily inspired by cinnyapp/cinny#2392, so if possible @razn-v should give their input and be added as a co-contributor.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

AI disclosure:

  • Partially AI assisted (clarify which code was AI assisted and briefly explain what it does).
  • Fully AI generated (explain what all the generated code does in moderate detail).

The changes to renderItem() to support GIFs were AI generated. It returns GIF Items and ensures they are scaled properly.

@footvaalvica footvaalvica requested review from 7w1 and hazre as code owners April 13, 2026 12:26
@dozro
Copy link
Copy Markdown
Contributor

dozro commented Apr 13, 2026

hey it seems like you're missing a changeset. Can you please add a changeset, as described here https://github.com/SableClient/Sable/blob/dev/CONTRIBUTING.md#documenting-a-change

Thank you :3

@footvaalvica
Copy link
Copy Markdown
Author

thanks for the heads up, I completely missed it. should be done now!

const filename = `${gif.title}.gif`;
const file = new File([uint8Array], filename, { type: 'image/gif' });

// Upload to Matrix
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

up for debate imo is, if we want to reupload the gif to the hs, or use something like https://github.com/maunium/stickerpicker/tree/master/giphyproxy

(as discussed, but afaik not resolved in the sable client matrix room)

Comment thread .gitignore Outdated
# pre-commit
.pre-commit-config.yaml
CLAUDE.md
.github/AGENTS.md
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

?

@hazre
Copy link
Copy Markdown
Member

hazre commented Apr 14, 2026

I think if we going to add this, might as well go with KLIPY, right off the bat. You can get a dev key on their website and later we can contact for a prod key. It seems to be free and we just have to respect their API rate limits.

@hazre
Copy link
Copy Markdown
Member

hazre commented Apr 14, 2026

Unless you doing server level caching, I don't see a reason for a proxy in this case. I guess you can avoid shipping the secrets in the client.

Commet's proxy is just a cloudflare worker, which is fine but we are currently on the free tier of cloudflare which has 100k daily requests limit (if we were to host it ourselves)

@7w1 thoughts?

@dozro
Copy link
Copy Markdown
Contributor

dozro commented Apr 14, 2026

Unless you doing server level caching, I don't see a reason for a proxy in this case. I guess you can avoid shipping the secrets in the client.

The homeserver by default does caching for remote media. Which would be utilized with that proxy. And cached remote media is easily purgeable, while re-uploaded media is harder to manage and will easily get out of hand. Especially for bigger Homeservers the way to go would be the proxy, it would by its nature alone solve the issue of duplicated gifs taking up too much space in the media repository.

btw comments proxy does afaict way differs things than the maunium sticker picker proxy

@7w1
Copy link
Copy Markdown
Member

7w1 commented Apr 15, 2026

Maunium's proxy makes sense to me since it essentially acts like a homeserver and allows other homeservers to cache data and embed smoothly without needing to be reuploaded by everyone.

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.

GIF Search

4 participants