Skip to content
This repository was archived by the owner on Mar 10, 2026. It is now read-only.

avatars!#227

Merged
7w1 merged 14 commits into
7w1:devfrom
melogale:dev
Mar 9, 2026
Merged

avatars!#227
7w1 merged 14 commits into
7w1:devfrom
melogale:dev

Conversation

@melogale
Copy link
Copy Markdown

@melogale melogale commented Mar 7, 2026

I bring in https://github.com/melogale/element-call/tree/avatars as a submodule for now.

Element call disables thumbnails in widget mode by default, and it can't really be overridden except by janky means. Forking element call allows us to set this up kind of cleanly though!

In element call, we add two new capabilities to the host-widget contract.

moe.sable.thumbnails
moe.sable.media_proxy

If neither is set, fallback thumbnails will be used: the letter over color sort.
If moe.sable.thumbnails is set, element call will attempt to use the old unauthenticated media endpoint to grab thumbnails.
If moe.sable.media_proxy or both are set, will shoot for the authenticated endpoint, and hope and pray the client hosting the widget keeps its promise: adding authentication to the request, via a service worker or something.

Sable automatically accepts all capability requests, so these are set, and in fact, we add on authentication to media requests in the service worker!

Since the frames in which widgets run have separate client ids, I simply look through the session list and find a session with the right base url. This is kind of odd: it could end up being for a different user on another tab.

But as things are, the server doesn't care: so long as its authenticated by a user on the server.
Ideally it would use the session info for the tab hosting the widget, but I couldn't come up with a super clean way of doing that doesn't distract from the proof of concept. Let me know if anyone has any ideas for that. Or if we don't care for now.

To test it, make sure you have the submodule and:

cd element-call                                                          
corepack enable                                                                                
yarn install                                                                                   
yarn build:embedded 
cd ..
npm install
npm run dev

Or here!
https://sable.melogale.space

note:

There's at least one little bug here. The avatar size is negative sometimes, for example. Element call not used to avatars in a widget, I suppose. Keep an eye out...

@melogale melogale requested a review from 7w1 as a code owner March 7, 2026 08:59
@melogale melogale marked this pull request as draft March 7, 2026 10:11
@melogale melogale marked this pull request as ready for review March 8, 2026 00:01
@melogale
Copy link
Copy Markdown
Author

melogale commented Mar 8, 2026

There are some fixes for the cinny calls needed. New mr atop this one coming soon...

@7w1
Copy link
Copy Markdown
Owner

7w1 commented Mar 8, 2026

Does this work at all with the cinny call stuff/should I still merge it or are you gonna make a new pr?

@melogale
Copy link
Copy Markdown
Author

melogale commented Mar 8, 2026

Does this work at all with the cinny call stuff/should I still merge it or are you gonna make a new pr?

Yeah it works! I meant in upstream cinny the calls are still a little janky and I'd like to try to fix those.
But this works to give the calls avatars as they are.

Would you prefer some other way of bringing in in element call rather than a submodule? Should there be an official sable element call fork?

@7w1
Copy link
Copy Markdown
Owner

7w1 commented Mar 8, 2026

There probably should be an official fork. I'll probably make a github org soon and then we can store everything under that... anyway ill merge this in later today then.

@melogale
Copy link
Copy Markdown
Author

melogale commented Mar 8, 2026

Yay!

@7w1 7w1 merged commit d41f147 into 7w1:dev Mar 9, 2026
5 checks passed
@7w1 7w1 mentioned this pull request Mar 9, 2026
beef331 pushed a commit to beef331/sable that referenced this pull request Mar 17, 2026
adds a check to make sure the pronoun array is an actual array
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants