~ 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

Notifications tiles for Bluesky and Grain

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/hud:views/notifications

Bluesky and Grain each get a Notifications tile, from their own AppView's listNotifications, opened from each app's page and launcher. A Bluesky like or repost shows the post it is about; a Grain one its gallery, with a thumbnail.

Claude Opus 5.5 · high

What changes

views/bsky-notifications.json (app.bsky.notification.listNotifications): each row is the author's avatar, name and time, what they did, and what it is about. A like or repost shows the post it likes, from a query join of app.bsky.feed.getPosts over the notifications' record.subject.uri, and opens its thread; a reply, mention or quote shows its own text and opens its own thread; a follow opens only its follower. Launched with limit: 25, so every liked post on a page fits one getPosts call.

views/grain-notifications.json (social.grain.notification.listNotifications): the same header; the comment replied to, the comment, and the gallery's title, its thumbnail beside. A row opens its gallery (getGallery); a follow, its follower.

Entry points: a Notifications launcher in each view, and a Notifications row in bsky-app's and grain-app's where-to-go lists on one's own page.

Query joins (hud_core::join, tools.rs, view.rs):

  • A query view's join that reads its response runs on every page, as a records page's that reads records does: a page more of notifications fetches its own liked posts. The bundled views whose joins read response today (profiles, a gallery, a chat, a repository) have no cursor, so nothing else changes.
  • An $each holds each value once (ten likes of one post ask for it once), and is cut to the param's maxLength in the method's lexicon (getPosts takes 25), the first asked, not the call refused. xrpc::ask_with takes the lexicon documents already fetched, so the cut costs no second lookup.

Docs: docs/views.md ($each, pages, bundled views and joins, launchers), docs/app-pages.md (both apps' where-to-go).

Why

Notifications are each app's: Bluesky's and Grain's answers differ in shape and in what they open, and a name in a view opens that person's page in the view's app, which a merged tile would lose. One view per method keeps them data; a merged feed would need a mechanism merging two services' cursors.

Bluesky's answer carries the like or repost record, not the post it is about, so the post comes by a join; without the two join changes a page more drew no liked posts, and a busy page refused the join outright.

How it was checked

just check (fmt, clippy, the tests, svelte-check, lint with docs, lex). New tests: both views draw an answer their lexicon allows and open what each row is about (tools.rs); $each asks each value once, no more than the param's maxLength, and a join reading response runs per page (join.rs). Made-up answers for both tiles in the gallery (harness/gallery/made.mjs, held to their lexicons, the join's getPosts answer too); just gallery --shot in desktop and phone, light and dark, critiqued by an agent that did not draw them: its points on the reason wrapping and an orphaned time were fixed.

Shortcomings

  • Not run against a live account: Bluesky's and Grain's answers here are made up as their lexicons say. Grain's view follows its AppView's code (grain-serve/src/read/notification.rs).
  • A Bluesky reply or mention with no text (pictures only) shows its header alone and opens nothing; a Grain story notification opens nothing (no view draws a story).
  • Neither marks notifications seen (updateSeen) or shows which are unread.
  • The rows put the time after the name with no "·": a wrap: "cut" Row squeezes its middle children to nothing after a first one shorter than its 3ch floor (web/renderer/src/tree/Row.svelte), which the dot was.

Review

The design of the two join changes (join.rs's params_of and cut_to_lexicon, QueryJoin::per_page), then the views.

bsky-notifications.png

grain-notifications.png

Approved

This pull adds a Notifications tile for Bluesky (app.bsky.notification.listNotifications) and one for Grain (social.grain.notification.listNotifications). Each app's page and launcher opens its tile. It also changes query joins in two ways:

  • A join that reads response now runs on every page, not only the first.
  • $each drops repeated values and is cut to the param's lexicon maxLength.

The join changes look right:

  • params_of keeps the order and stops at MAX_PARAM_ARRAY once repeats are dropped.
  • cut_to_lexicon reads maxLength from the query def that ask_with uses next, so the lexicon is looked up only once.
  • per_page now counts response too. That can't change any existing view: no other bundled view with a cursor has query joins (the views that read response in a join are profiles, a gallery, a chat and a repository, and none of them pages). The pull's own new test covers this.
  • In tools.rs, with_said now gets all of the mode's joins on a later page, but joined holds only the ones that ran, which matches how records pages already work.

The views do what the tests claim:

  • A Bluesky like or repost opens record.subject.uri and draws the joined post. A reply, mention or quote opens its own thread through the inner list. A follow's subject is a DID, so it opens nothing.
  • A Grain row opens getGallery only when it has a galleryUri.
  • The Grain service DID matches the other Grain views, and galleryThumb is in the bundled lexicon.

The docs (views.md and app-pages.md) and the gallery's made-up answers are updated with the change. Every check on the head commit passes: check, test, docs, e2e and e2e-spaces; web and lexicons were skipped because nothing they watch changed.

I read all 14 changed files except the bulk of harness/gallery/answers.json, which is generated gallery data held to its lexicons by the answers step. I have nothing to ask for.

Merged as 2f3af9b