chadtmiller.com/hud
A remote MCP server that shows atproto records as interactive UI inside MCP Apps hosts
place.hud.hudkit 0.3.0 Latest 5 packages
title: Playground section: HUD order: 8 summary: Writing a view at /playground, beside what it draws.
The playground is a page for writing a view. You edit a place.hud.view document on the right, and the left shows what it draws from real data, the way a tile draws it. It's at /playground on any HUD, with sign-in on or off, and you don't need to be signed in.
It starts from a bundled view and a call that shows it off, or from a blank list of posts. Any change after that is yours. The view is always given inline, so it's untrusted, as any view a model writes (trust and origins). So the playground's copy of a bundled view leaves out what only a bundled view may say at its top (app, records, profile and the like). It keeps origins and thumbnails, so the AppView's pictures draw. Four bundled views do something in their layout that only a bundled view may: the chats call procedures to send messages (bsky-chat, bsky-chat-with, bsky-chats), and bsky-feed tells its feed what was read. Those start with their problems shown, for you to take out.
Drawing as you type
The page calls place.hud.previewView a moment after each change (the methods). What a change costs depends on what it touches.
| Change | What happens |
|---|---|
A mode's layout | The view is drawn again over the answer already read. Nothing is read again but what the tool reads to draw (handles, the collection's lexicon, the Bluesky posts a document shows), and those are cached |
The call, or anything else in the view (joins, query joins, items, cursor, summary) | The call is made afresh with the view, and its answer is kept for the next layout change |
| A view that isn't valid | Nothing is read or drawn. Every problem shows where it is in the editor and in the list under it |
So most edits draw without reaching a PDS or an AppView. Read again makes the call afresh whenever you want newer data.
Signed in on that HUD, the call is made as your account, so a timeline or your notifications read as they would in a tile. Signed out, it's made as no one, and a call that needs an account shows the tool's own error.
What the preview does
The preview draws the tree exactly as the workspace's tiles do. You can pick its width (a column, wide, a phone or the full pane) and draw it in light, dark or any of HUD's themes.
Clicking something a view opens doesn't open it. The preview says what it would open, and a call to list_records, get_record or query can be loaded into the call. Actions and forms don't write from the playground. Try those in the workspace.
The Tree tab shows _meta.ui, the tree the server resolved, and Data shows the answer it was drawn from.
Sharing
Copy link puts the call and the view in the address's #, compressed. Nothing is stored on the server, and opening the link anywhere brings back that view and call. The page also keeps your work in the browser, so a reload doesn't lose it.
What isn't built
The playground doesn't save a view as a record or publish it. A view written here reaches a model or the workspace only when you give it inline, as view in list_records, get_record or query.