Staff 0.8.5: Person media folders under a parent folder you choose
Staff 0.8.5 lets your app decide where the PhoenixKit staff directory creates each person’s media folder. Until now every person’s folder went to the root of storage.
A parent folder for person media
Name a function in config and new person folders are created under the folder it returns:
config :phoenix_kit_staff, :attachments_parent_folder, {MyApp.Media, :parent_for}
It is called as parent_for(:person, actor_uuid, person_uuid), or with two arguments, and returns {:ok, folder_uuid} or nil for the root. A function that fails falls back to the root.
The setting only decides where a new folder goes. Existing folders at the root are still found and reused, and the Files and Images tabs find a person’s folder by its name wherever it sits. A permanent delete removes every folder of that person, wherever it is. Without the setting nothing changes.
Full release notes: Staff 0.8.5
0.8.5 · 15 September 2026
Added
- Attachment folders can be created under a host-configured parent folder (
config :phoenix_kit_staff, :attachments_parent_folder, {Mod, :fun}, called asfun(:person, actor_uuid, person_uuid)orfun(:person, actor_uuid)). Folders created at the root before the setting are still found and reused.
Fixed
- Folder lookups no longer depend on the hook’s answer. The Files/Images tabs resolved the folder without the actor while uploads created it with one, so a hook that varies by actor left uploaded media invisible after a reload, and a second admin got a twin folder. The person’s root folder is now resolved by its person-unique name (configured parent, then root, then any parent).
- Permanent person delete purges every
staff-person-<uuid>folder wherever it sits, instead of only the one under the parent the hook returned for anilactor. - The parent-folder hook now receives the person uuid as its subject (it was always
nil) and a hook that exits falls back to the root like one that raises.
Staff 0.8.5. Install or update: {:phoenix_kit_staff, "~> 0.8"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.