~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0

A group's links show their site's icon, kept as the group's own

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/group-host:host/link-icons

What changes

A link's icon. A link in a group's profile (fyi.opensocial.defs#link) has a new optional icon: the site's favicon, a PNG blob of the group's own, of at most 100,000 bytes. The host keeps an icon only when it is one of the group's uploads, a PNG no larger than that, as it checks the avatar. getGroup shows it as the record holds it, and /img/{did}/{cid} serves it to whoever may see the profile, so someone looking at the group never asks the site.

Where icons come from. Each of the console's "Add a link", opensocial profile set --links and the profile_set MCP tool asks a favicon service for a new link's icon (FAVICONS, Bluesky's https://cardyb.bsky.app/v1/favicon?url= by default, empty for none), uploads it as the group, and names it on the link. A site with no icon, a slow one (8 seconds), or an icon that is no PNG or too large leaves the link without one. A link written again at an address the profile already had keeps the icon it had, so profile set --links does not refetch them. The shared step is iconless and iconed in group-host-mcp.

The console. A link shows its icon (LinkIcon), on the group's page and in its settings, or the chain icon where it has none or the icon will not load.

Why

Links read as a row of chain icons, with nothing to tell a chat from a calendar. This follows Bluesky's profile links: the favicon is fetched through its service once, when the link is saved, and kept as a blob, rather than each viewer's browser loading it from a third party. The fetch is done by the one writing the link, as Bluesky's app does, so the host keeps a record as it was sent.

How it was checked

  • group_config: a link with an icon as large as one may be is kept and shown; icons that are no PNG, too large, or not the group's are refused.
  • group-host-mcp protocol: iconless asks only new web links, encoding each address, keeps a known link's icon, and asks nothing with no service or for another record.
  • group-host mcp and opensocial commands: profile_set and profile set --links against a stand-in favicon service: an icon for a site with one, none for one with none, too large or no PNG, and the same links written again keep theirs.
  • The e2e flow "changing a group's profile" now checks the icon of an added link in settings and on the group's page, against the harness's stand-in service (harness/world.mjs), which the console and just look use too.
  • clippy, just lex, just docs, svelte-check and the layer check pass here; the gate and e2e are left to CI.
  • Looked at with just look: the group's page and its links in settings, full, desktop and phone, light and dark.

Shortcomings

  • Links saved before this have no icon until they are added again.
  • The icon is the one the site had when the link was added; it is not refreshed.
  • The look pictures were not critiqued by a fresh agent; the change to the page is the icon in the chain's place.

🤖 Generated with Claude Code

g-lanterns-groups-test-alice-desktop-light.png

g-lanterns-groups-test-alice-phone-dark.png

settings-links-alice-desktop-light.png

Approved

This adds an optional PNG icon blob (≤100,000 bytes) to a profile link. The host accepts it only as one of the group's own uploads, checked through the same path as the avatar. The console, the CLI and the profile_set MCP tool each fetch a favicon once through a configurable service and upload it as the group. Links written again at a known address keep their icon.

I read the Rust, lexicon, config and settings.ts changes, and found no bugs. I did not read the tests, docs, harness, seed or Svelte presentation files, so they are unreviewed. icons reuses image, so the validation matches the avatar's. iconless skips non-object links and non-web URLs and passes through any icon the caller supplied, which icons then validates server-side. A failed fetch leaves the link without an icon.

Two small things, neither blocking:

  • The body says the fetch waits 8 seconds. The host's favicon in mcp.rs uses the shared client, whose timeout is OUTGOING_TIMEOUT (10 seconds). The CLI and the console do use 8 seconds. This is harmless, but the body and docs should match, or the host should set the same per-request timeout.
  • The host's favicon reads the whole response body before checking its size. The service is operator-configured, so this is low risk. You could check Content-Length first, or cap the read.
Merged as 42f3db1