primitive · pds
<atproto-latest-commit>
Current head of a repo: rev (TID) + optional CID + decoded 'last activity' age. Tries getLatestCommit, falls back to getRepoStatus.rev.
Live
Default:
With CID:
Without age:
<atproto-latest-commit src="pfrazee.com"></atproto-latest-commit>
<atproto-latest-commit src="..." show-cid></atproto-latest-commit>
<atproto-latest-commit src="..." hide-age></atproto-latest-commit> Attributes
| Name | Type | Default | Description |
|---|---|---|---|
src * | string | — | Handle or DID. |
show-cid | boolean | — | Show the commit CID (truncated) in addition to the rev. |
hide-age | boolean | — | Suppress the decoded timestamp suffix. |
Parts
External CSS can target these via atproto-latest-commit::part(<name>) { ... }.
| Part | What it is |
|---|---|
commit / rev / cid / age | Outer span + rev + optional CID + decoded age. |
What the rev tells you
A TID (Timestamp Identifier) is a 13-char base32-sortable string whose top 53 bits encode microseconds since epoch. Every commit on a repo has one, and because TIDs are monotonic, the latest TID IS the "last activity" timestamp for the repo — no separate lookup needed.
This component decodes the TID client-side. No network call needed beyond the initial fetch.
Fallback behavior
Not all PDSes implement com.atproto.sync.getLatestCommit —
Matt's own PDS returns 501 for it. The component catches that and falls
back to com.atproto.sync.getRepoStatus, which also returns
the current rev (just without the CID). So you always get the rev + age;
CID display degrades gracefully.
Use cases
- "Last active" indicator next to a profile — is this account still posting? Was it active this week?
- Commit badge in a repo-browser UI — see which collection got the latest write.
- Freshness signal on content you embed — did this user update their bio or post anything new recently?
Related
<atproto-repo-status> — the active/deactivated badge,
complements this. <atproto-repo> — the full repo
inventory view.