// What the gallery shows, in order: every drawing HUD makes, as a tile. // Each trusted view, bundled in views/ or the operator's HUD is served with // here (Grain's, harness/apps.mjs) (a collection's view twice: its list and one // record; a record a method view draws as its query, opened by get_record), // the drawings with no view (an account's profile, an app's page, records // of a collection no view draws), then // header variants that reuse another entry's result. record.mjs records // each entry's answer into answers.json (the public ones from a HUD server // as no one; `made` ones from made.mjs, as the signed-in `me`), and // data.mjs makes target/gallery/gallery.json of them // (local://gallery-contract.md has the shape). // // `$picked.` in arguments is what record.mjs picked from another // entry's answer, by `picks`. `header` overrides what data.mjs works out // of the call (account, domain, icon, symbol). const repo = 'at://chadtmiller.com/dev.knotless.repo/knotless'; const pull = 'at://did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.pull/3n2hkefgu7ieu'; const gallery = 'at://did:plc:kqd2csf4wvgvqioz374r5r2y/social.grain.gallery/3mzzwhvdshf7d'; /** The person the gallery is signed in as, whose made-up answers are theirs. */ export const me = 'chadtmiller.com'; /** The people whose faces the tiles show, and the made-up chats are with, as getProfiles answers for them. */ export const people = ['chadtmiller.com', 'danabra.mov', 'pfrazee.com', 'bnewbold.net', 'jay.bsky.team', 'tx3.grapevyne.social', 'zzstoatzz.io']; const q = (method, params) => ({ name: 'query', args: { method, params } }); const records = (actor, collection, limit = 4) => ({ name: 'list_records', args: { actor, collection, limit } }); const record = (pick) => ({ name: 'get_record', args: { uri: `$picked.${pick}` } }); /** A collection's view, as its list and one record of it: two entries. */ const collection = (view, group, actor, nsid, [list, one], pick = 0) => [ { id: `${view}-list`, group, view, title: list, call: records(actor, nsid), note: `list_records ${nsid} (views/${view}.json, list)` }, { id: `${view}-record`, group, view, title: one, call: record(`${view}-record`), note: `get_record ${nsid} (views/${view}.json, record)`, pick: { from: `${view}-list`, record: pick } } ]; /** The entries, in the gallery's order: grouped by app, then the header variants. */ export const entries = [ // Bluesky { id: 'bsky-timeline', group: 'Bluesky', view: 'bsky-timeline', made: true, title: 'Following', call: q('app.bsky.feed.getTimeline', { limit: 6 }), note: 'query app.bsky.feed.getTimeline (views/bsky-timeline.json); made up, signed in only' }, { id: 'bsky-feed', group: 'Bluesky', view: 'bsky-feed', title: 'Discover', call: q('app.bsky.feed.getFeed', { feed: 'at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.generator/whats-hot', limit: 6 }), note: 'query app.bsky.feed.getFeed (views/bsky-feed.json)' }, { id: 'bsky-author-feed', group: 'Bluesky', view: 'bsky-author-feed', title: 'Posts', call: q('app.bsky.feed.getAuthorFeed', { actor: 'danabra.mov', filter: 'posts_no_replies', limit: 6 }), note: 'query app.bsky.feed.getAuthorFeed (views/bsky-author-feed.json)' }, { id: 'bsky-thread', group: 'Bluesky', view: 'bsky-thread', title: 'Thread', call: q('app.bsky.feed.getPostThread', { uri: '$picked.bsky-thread', depth: 2 }), note: 'query app.bsky.feed.getPostThread (views/bsky-thread.json)', pick: { from: 'bsky-author-feed', post: 'replies' } }, { id: 'bsky-post', group: 'Bluesky', view: 'bsky-thread', title: 'Post', call: record('bsky-post'), note: 'get_record app.bsky.feed.post: a post opens as its thread (views/bsky-thread.json, records)', pick: { from: 'bsky-author-feed', post: 'replies' } }, { id: 'bsky-profile', group: 'Bluesky', view: 'bsky-profile', title: 'Profile', call: q('app.bsky.actor.getProfile', { actor: 'danabra.mov' }), note: 'query app.bsky.actor.getProfile (views/bsky-profile.json)' }, { id: 'bsky-notifications', group: 'Bluesky', view: 'bsky-notifications', made: true, title: 'Notifications', call: q('app.bsky.notification.listNotifications', { limit: 25 }), note: 'query app.bsky.notification.listNotifications (views/bsky-notifications.json): each with the post it is about; made up, signed in only' }, { id: 'bsky-app', group: 'Bluesky', view: 'bsky-app', title: 'Bluesky', call: { name: 'describe_app', args: { domain: 'bsky.app', actor: 'danabra.mov' } }, note: 'describe_app bsky.app for an account (views/bsky-app.json, its page)' }, { id: 'bsky-feed-generators', group: 'Bluesky', view: 'bsky-feed-generators', title: 'Feeds', call: q('app.bsky.feed.getFeedGenerators', { feeds: [ 'at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.generator/whats-hot', 'at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.generator/with-friends', 'at://did:plc:wqowuobffl66jv3kpsvo7ak4/app.bsky.feed.generator/the-science-feed' ] }), note: 'query app.bsky.feed.getFeedGenerators (views/bsky-feed-generators.json)' }, // Bluesky Chat: signed in only, every answer made up. { id: 'bsky-chats', group: 'Bluesky Chat', view: 'bsky-chats', made: true, title: 'Chats', call: q('chat.bsky.convo.listConvos', {}), note: 'query chat.bsky.convo.listConvos (views/bsky-chats.json); made up, signed in only' }, { id: 'bsky-chat', group: 'Bluesky Chat', view: 'bsky-chat', made: true, title: 'Reading group', call: q('chat.bsky.convo.getMessages', { convoId: '3n2group0chat' }), note: 'query chat.bsky.convo.getMessages (views/bsky-chat.json): a group chat, its box to send; made up, signed in only' }, { id: 'bsky-chat-with', group: 'Bluesky Chat', view: 'bsky-chat-with', made: true, title: 'Chat with Dan', call: q('chat.bsky.convo.getConvoForMembers', { members: ['$picked.dan'] }), note: 'query chat.bsky.convo.getConvoForMembers (views/bsky-chat-with.json): one person, its box to send; made up, signed in only' }, { id: 'bsky-chat-availability', group: 'Bluesky Chat', view: 'bsky-chat-availability', made: true, title: 'Message Dan', call: q('chat.bsky.convo.getConvoAvailability', { members: ['$picked.dan'] }), note: 'query chat.bsky.convo.getConvoAvailability (views/bsky-chat-availability.json): the Message button; made up, signed in only' }, // Grain: an operator's views (HUD_APPS, harness/apps.mjs), as Grain serves them to HUD { id: 'grain-feed', group: 'Grain', view: 'grain-feed', title: 'Recent galleries', call: q('social.grain.feed.getFeed', { feed: 'at://did:web:grain.social/social.grain.feed.generator/recent', limit: 4 }), note: 'query social.grain.feed.getFeed (Grain’s grain-feed, an operator’s view)' }, { id: 'grain-gallery-view', group: 'Grain', view: 'grain-gallery-view', title: 'nyc', call: q('social.grain.gallery.getGallery', { gallery }), note: 'query social.grain.gallery.getGallery (Grain’s grain-gallery-view, an operator’s view)' }, { id: 'grain-app', group: 'Grain', view: 'grain-app', title: 'Grain', call: { name: 'describe_app', args: { domain: 'grain.social', actor: 'tx3.grapevyne.social' } }, note: 'describe_app grain.social for an account (Grain’s grain-app, an operator’s view, its page)' }, { id: 'grain-notifications', group: 'Grain', view: 'grain-notifications', made: true, title: 'Notifications', call: q('social.grain.notification.listNotifications', {}), note: 'query social.grain.notification.listNotifications (Grain’s grain-notifications, an operator’s view); made up, signed in only' }, // knotless { id: 'knotless-app', group: 'knotless', view: 'knotless-app', title: 'knotless', call: { name: 'describe_app', args: { domain: 'knotless.dev', actor: 'chadtmiller.com' } }, note: 'describe_app knotless.dev for an account (views/knotless-app.json, its page)' }, { id: 'knotless-feed', group: 'knotless', view: 'knotless-feed', title: 'Activity', call: q('dev.knotless.getFeed', { actor: '$picked.me', limit: 8 }), note: 'query dev.knotless.getFeed (views/knotless-feed.json)' }, { id: 'knotless-notifications', group: 'knotless', view: 'knotless-notifications', made: true, title: 'Notifications', call: q('dev.knotless.listNotifications', {}), note: 'query dev.knotless.listNotifications (views/knotless-notifications.json); made up, signed in only' }, { id: 'knotless-profile', group: 'knotless', view: 'knotless-profile', title: 'Profile', call: q('dev.knotless.getProfile', { actor: 'chadtmiller.com' }), note: 'query dev.knotless.getProfile (views/knotless-profile.json)' }, { id: 'knotless-actor-repos', group: 'knotless', view: 'knotless-actor-repos', title: 'Repositories', call: q('dev.knotless.getActorRepos', { actor: 'chadtmiller.com' }), note: 'query dev.knotless.getActorRepos (views/knotless-actor-repos.json)' }, { id: 'knotless-actor-stars', group: 'knotless', view: 'knotless-actor-stars', title: 'Starred', call: q('dev.knotless.getActorStars', { actor: 'chadtmiller.com' }), note: 'query dev.knotless.getActorStars (views/knotless-actor-stars.json)' }, { id: 'knotless-actor-items', group: 'knotless', view: 'knotless-actor-items', title: 'Pulls opened', call: q('dev.knotless.listActorItems', { actor: 'chadtmiller.com', kind: 'pull', relation: 'created', state: 'closed', limit: 6 }), note: 'query dev.knotless.listActorItems (views/knotless-actor-items.json)' }, { id: 'knotless-repo', group: 'knotless', view: 'knotless-repo', title: 'knotless', call: q('dev.knotless.getRepo', { repo }), note: 'query dev.knotless.getRepo (views/knotless-repo.json)' }, { id: 'knotless-items', group: 'knotless', view: 'knotless-items', title: 'Open issues', call: q('dev.knotless.listItems', { repo, kind: 'issue', state: 'open', limit: 6 }), note: 'query dev.knotless.listItems (views/knotless-items.json)' }, { id: 'knotless-thread', group: 'knotless', view: 'knotless-thread', title: 'Pull', call: q('dev.knotless.getThread', { repo, uri: pull }), note: 'query dev.knotless.getThread (views/knotless-thread.json)' }, { id: 'knotless-diff', group: 'knotless', view: 'knotless-diff', title: 'Dockerfile changes', call: q('dev.knotless.getPullDiff', { repo, uri: pull, paths: ['Dockerfile'] }), note: 'query dev.knotless.getPullDiff (views/knotless-diff.json)' }, { id: 'knotless-commits', group: 'knotless', view: 'knotless-commits', title: 'Commits', call: q('dev.knotless.listCommits', { repo, limit: 6 }), note: 'query dev.knotless.listCommits (views/knotless-commits.json)' }, { id: 'knotless-checks', group: 'knotless', view: 'knotless-checks', title: 'Checks', call: q('dev.knotless.listChecks', { repo, key: '3myg5zr2qubsd', limit: 6 }), note: 'query dev.knotless.listChecks (views/knotless-checks.json)' }, { id: 'knotless-file', group: 'knotless', view: 'knotless-file', title: 'README', call: q('dev.knotless.getFile', { repo, path: 'README.md' }), note: 'query dev.knotless.getFile (views/knotless-file.json)' }, // plyr.fm ...collection('plyr-likes', 'plyr.fm', 'chadtmiller.com', 'fm.plyr.like', ['Liked tracks', 'Liked track']), ...collection('plyr-list', 'plyr.fm', 'zzstoatzz.io', 'fm.plyr.list', ['Playlists', 'Playlist']), // standard.site and Leaflet ...collection('standard-document', 'standard.site', 'danabra.mov', 'site.standard.document', ['Blog posts', 'Blog post']), ...collection('standard-publication', 'standard.site', 'danabra.mov', 'site.standard.publication', ['Blogs', 'Blog'], 1), // No view: what HUD draws of its own. { id: 'repo-profile', group: 'Generic', title: 'Profile', call: { name: 'describe_repo', args: { actor: 'danabra.mov' } }, note: 'describe_repo: an account’s profile, no view (as recorded, its sections and recent activity are left out)' }, { id: 'app-generic', group: 'Generic', title: 'Bluesky', call: { name: 'describe_app', args: { domain: 'bsky.app' } }, note: 'describe_app bsky.app: an app’s page with no page view (its entry points), no account' }, { id: 'records-generic-list', group: 'Generic', title: 'Likes', call: records('pfrazee.com', 'app.bsky.feed.like'), note: 'list_records app.bsky.feed.like: records of a collection no view draws, their fields by its lexicon' }, { id: 'records-generic-record', group: 'Generic', title: 'Profile record', call: { name: 'get_record', args: { uri: 'at://did:plc:fpruhuo22xkm5o7ttr2ktxdo/app.bsky.actor.profile/self' } }, note: 'get_record app.bsky.actor.profile: one record no view draws, its fields by its lexicon' } ]; /** Header variants: another entry's result under a header that differs. */ export const variants = [ { id: 'header-long-title', of: 'bsky-author-feed', title: 'Everything Dan posted this autumn about React, atproto, physics as a game loop and Japanese verbs, kept for the reading group', note: 'header variant: a very long title (result of bsky-author-feed)' }, { id: 'header-no-handle', of: 'knotless-actor-stars', title: 'Starred', call: q('dev.knotless.getActorStars', { actor: 'did:plc:qa3nvyq2lmqd7gbrcxpkbfh4' }), header: { account: null }, note: 'header variant: an account by a DID with no known handle (result of knotless-actor-stars)' }, { id: 'header-from', of: 'bsky-thread', title: 'Thread', from: 'bsky-author-feed', note: 'header variant: opened from another tile, bsky-author-feed (result of bsky-thread)' }, { id: 'header-agent', of: 'bsky-profile', title: 'Profile', agent: true, note: 'header variant: added by an agent (result of bsky-profile)' }, { id: 'header-no-favicon', of: 'plyr-likes-list', title: 'Liked tracks', header: { icon: null }, note: 'header variant: an app with no favicon, its kind’s symbol in its place (result of plyr-likes-list)' } ];