feat(host): show GitHub avatars for participants #116
- IA
Closes #92. Part of #5.
Avatars now come from GitHub logins:
- **Host:** `github.login()` gets the owner's login with `gh api user` and saves it once found. If `gh` is missing or signed out, it tries again at most every five minutes, so signing in later works without a restart. - **Peers:** `hello` now returns the host owner's `github` login. Each host calls `hello` on its tailnet peers and maps the peer's Tailscale login to that GitHub login. - **Directory:** hosts include `github` next to `login` in their directory publication. The directory checks that `github` is a string when present. Deployed directories already store unknown fields as sent, so they need no redeploy. - **Clients:** the gateway sends local clients a `{ people }` frame (Tailscale login → GitHub login) when they connect and whenever the map changes. Sources are merged in this order: directory, then peers, then this host. `HOST_PROTOCOL` goes from 8 to 9. - **App:** the account menu passes `handle`, so it shows the owner's avatar. The timeline gets `avatars` keyed by Tailscale login (for message authors) and by GitHub login (for `@` mentions). It shows the GitHub login as the author's name and falls back to the part of the email before the `@`. Without a known login, the UI still shows initials. - **Docs:** `docs/architecture.md` describes where avatars come from.
### Validation
- `bun types` and `bun run ci` pass. - I ran a host from this lane on port 4199 with a throwaway `ACE_HOME`: - With `gh` signed in: `hello` returned `github: "iamnbutler"` and the `people` frame arrived. - With `gh` removed from `PATH`: `hello` had no `github` and `people` was `{}`, so the UI falls back to initials. - Against a local directory (`wrangler dev` in `services/directory`): - A teammate publication that included `github` was stored, and the host's `people` frame picked up that teammate. - A publication with a non-string `github` got a 400. - The host's own publication included `github` from its next heartbeat. - In the built app, the account menu showed the GitHub avatar. In a channel, a message showed the author's avatar (`github.com/iamnbutler.png?size=64` loaded), the name `iamnbutler`, and the avatar on the `@iamnbutler` mention. - Not tested: a live peer host. No other Ace host was on the tailnet.
### Built in Ace
Built in an Ace channel. To check the timeline avatar, I used a Playwright script with Chrome for Testing, run from Ace's shell. Ace's `desktop_inspect` could take a pixel screenshot of the Chrome window but failed in Accessibility mode ("inconsistent response evidence: window-context window title"), so I couldn't click into the channel. That gap is tracked in #113. I also used `wrangler dev` to run the directory locally.
iamnbutlerhead-ref-force-pushed ba7f98e6bb2flast month on GitHub
iamnbutlermerged 5151b269b6a8last month on GitHub
iamnbutlerreferenced this in chore(desktop): release canary 0.0.14 #130last month on GitHub