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

chadtmiller.com/hud

A remote MCP server that shows atproto records as interactive UI inside MCP Apps hosts

0
0

A knotless pull's pictures draw in its body, private ones too

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/hud:web/markdown-pictures

A knotless pull's, issue's or comment's pictures now draw in its body, in place of their alt text in brackets, on the web and iOS, private repositories' too. It takes knotless's new attachments on getThread (knotless pull at://did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.pull/3n2mmgzi5qkyo, deployed).

Claude Opus 5.5 · high

What changes

RichText takes pictures. An array of { cid, url, width?, height? }: a Markdown image whose URL is com.atproto.sync.getBlob's with one's CID (on whatever PDS), or that picture's own URL, draws as an image block from its url, held to the view's origins, at its ratio. An image anywhere a block cannot go (a heading, a table cell, a link, a <details> summary), one no picture names, or one off the origins keeps its alt text. A picture splits the paragraph it is in; a paragraph's runs lose the space at their ends, and one only of space is none (hud-core/src/ui/document.rs).

knotless-thread binds them. The body takes response.item.attachments, each comment its own attachments. A private repository's URLs carry knotless's hour-long token for the account asking, so the view loads them with no cookie; knotless.dev is already among the view's origins.

The image block gains width. The most CSS pixels it is drawn across, where its picture says (schemas/place.hud.ui.json). In markdown the web draws a picture no wider than that, its place, or its shape at 60vh, so never letterboxed, inside a hairline so a white screenshot keeps its edge on a white tile; iOS the same within its frame, the hairline in markdown only.

Docs. docs/knotless.md says what pictures does, and that a member reads a private repository (the page still said a service token reads none).

Why

Markdown's images loaded nothing because the view loads only from the blob proxy, the image CDN and a view's origins, and a body's images name the author's PDS. knotless now hands readers each picture as Bluesky's AppView hands a post's: a URL any <img> loads and its size, the record left as written. Matching by CID, not URL, also keeps a body's pictures when its author moves PDS.

How it was checked

just check after merging main (rustfmt, clippy, just cov at 100% lines and functions, svelte-check, just lint, just lex); just ios-test. A new test drives the reader through every place a picture may and may not go; RichText's resolver test binds pictures. just gallery --shot with the knotless-thread answer swapped for a public pull with three screenshots and their real getAttachment URLs: they load and draw, desktop light and phone dark, critiqued by an agent that did not draw them (no edge on white and too tall, both fixed, below).

Shortcomings

  • The private case was not seen end to end: the knotless CLI's sign-in may not call getThread, so it is to be looked at on hud.place once this deploys (the accounts pull, Sign in by handle on web and iOS, switch accounts, delete your data).
  • A tile kept past an hour keeps a private picture's expired URL until it is refreshed; one already loaded stays in the browser's cache meanwhile.
  • iOS centres a picture its 560pt cap narrows, where the web keeps it at the left.

pull-desktop-light.png

phone-dark-27.png

Approved

This makes Markdown images that name one of RichText's new pictures draw as image blocks. They match by blob CID or by URL. The URL has to be on the view's origins. knotless-thread binds attachments for the body and for each comment. The image block gains width, and the web and iOS renderers both honour it.

I read all the changed files, and found nothing that must change.

  • Where a picture may go: headings, tables, links and <details> summaries are all excluded, and nested images keep the outermost image's URL and alt text. The test drives each of these cases.
  • Trust: the origin check in source_of runs before a picture is accepted. A getBlob URL on any host only selects a picture by CID, so it adds no untrusted load.
  • settle: it now trims the ends of the runs it settles. This also applies to tight list items that contain no picture. I saw no case where that changes visible output.
  • Docs and schema: docs/knotless.md, the catalog notes, place.hud.ui.json and the iOS and web types all moved together.

I did not run the checks. The private-repository case is untested, as the body says.

Merged as e360d8a