← Back to Roadmap
Snapshot profile details upon blocking
Phase: In development
Our goal is to publish a new variant of the contact
message when we are blocking:
{
type: 'contact',
contact: "@wasdwaSdAwasDWsAsDaSD=.ed25519",
blocking: true,
following: false,
about: {
name: "Alice",
blurhash: "LlMF%n00%#MwS|WCWEM{R*bbWBbH"
}
}
- Change
ssb/utils/to-ssb
such that new blocks (type: contact
) msgs includemsg.value.content.about
withabout.name
- On the
ContactBody
component, if there is nocontactName
, displaymsg.value.content.about.name
instead, and if that doesn't exist, then fallback tomsg.value.content.contact
- Start a repo called
ssb-blobs-blurhash
with dependenciesssb-blobs
andblurhash
andsharp
- As a proof of concept,
sharp
can take a hard-coded fs path to an image file (preferably square) as input and you can play around with sharp APIs, to resize, output, etc and get familiar with sharp - Use
sharp
to produce a blurhash code for the hard-coded image: the sharp pipeline should take the hard-coded image as input, resize it (blurhash likes thumbnail sized images) to be a small square, and output Uint8ClampedArray which blurhash wants forencode
, and then generate the blurhash, and test it online at https://mad-gooze.github.io/fast-blurhash/ -
ssb-blobs-blurhash
has one main methodgenerate(blobId, opts, cb)
(not sure if opts is needed, but good to reserve that) -
generate
will take the blobId, and with ssb-blobs API, get the full Buffer for the image. The idea is to pump all that Buffer intosharp
for processing, and get a Uint8ClampedArray thatblurhash
needs -
generate
should detect the image dimensions and use NxN blurhash "components" (this is a blurhash-specific parameter) if the image is square, but use MxN blurhash components if the image is not square, where M is somewhat proportional to width and N somewhat proportional to height - Manyverse: use
ssb-blobs-blurhash
in the backend to produce ablurhash
code that'll be put in themsg.value.content.about
of a blockingcontact
msg - For a blocked account, fetch their name and blurhash from our snapshot
- Use react-blurhash in Electron
- Display snapshot name and blurhash on the Profile screen
-
sharp
works on Electron - Use react-native-blurhash on Android/iOS
-
https://github.com/achou11/ssb-blobs-blurhash/pull/4sharp
works on Android -
https://github.com/achou11/ssb-blobs-blurhash/pull/4sharp
works on iOS - Write down the message schema in the Interoperability wiki
- Profile should load all details at once
- New block
contact
msg should immediately refresh Profile - Measure with console.time how long blurhash creation lasts on mobile
- Final test on Android
- Final test on iOS
- Final test on desktop