# `MishkaDocument.Resources.Helpers.SiteNames`
[🔗](https://github.com/mishka-group/mishka_document/blob/v0.0.1/lib/mishka_document/resources/__helpers/site_names.ex#L5)

Ash preparation that resolves, for the whole page in ONE query, the site name the master's
site badge (`event_site` column) shows on each event-log row.

A row's `site_id` lives in its JSONB `metadata`/`data`, not a column or relationship, so it cannot
be preloaded and a naive column would read one `MishkaCmsCore.Runtime.Site` per row. This
after_action instead gathers every distinct id on the page, reads all their names at once
(`:read_any`, tenancy bypassed — it only names the master's own badge and never widens which rows a
viewer sees), and stamps the resolved display name onto each record's metadata (`:site_name`); the
column then just reads it.

Only a master (a user whose `site_id` is nil) sees the badge, so every other read, a tenant's or
one with no actor, skips the lookup entirely. A page with no site_ids does no read at all, and a
site that no longer exists falls back to a truncated id.

See `MishkaDocument.EventLog` and `MishkaCmsCoreWeb.Templates.ActivityTimeline`.

# `init`

# `supports`

# `temporal_safe?`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
