Skip to content

PhoenixKit 1.7.166: Referrals move to their own module, annotated thumbnails

PhoenixKit 1.7.166 moves referral codes out of core into the separate phoenix_kit_referrals package, and can draw a file’s annotations into its thumbnail in the media browser.

Referrals

The referral code pages, logic and admin tab now come from phoenix_kit_referrals. Core keeps the database tables, so no data moves. Without the package, referrals read as turned off and the referral field disappears from sign-up.

Annotated thumbnails

With Annotated Thumbnails turned on in the media settings, the rectangles, circles and strokes drawn on an image are baked into a separate thumbnail, which the media browser grid shows. It is rebuilt in the background after each edit. The setting is off by default and needs ImageMagick.

Upgrading

If your site uses referral codes, add phoenix_kit_referrals to your dependencies.

Full release notes: PhoenixKit 1.7.166

1.7.166 · 25 June 2026

Added

  • Annotated media thumbnails baked from Etcher shapes. A file’s Etcher annotation shapes (rectangles, circles, marker/freehand strokes) are baked into a single deterministic thumbnail_annotated PNG variant (ImageMagick, with the geometry→draw mapping delegated to Etcher.Raster), so the markup is visible in the MediaBrowser grid without rendering shapes live for every viewer. The AnnotationThumbnailJob Oban worker debounces regeneration in the background; its unique constraint is computed from the installed Oban.Job.states/0 minus the terminal states (robust across Oban 2.20/2.23) and excludes :completed, so a finished regen never throttles the next edit. The grid prefers the baked variant with a checksum-based cache-bust and falls back to the plain thumbnail. Gated behind a project-wide media setting (storage_annotated_thumbnails_enabled, off by default) — an “Annotated Thumbnails” toggle in Media Settings → Media Configuration. Bumps the :etcher dependency to ~> 0.7. (#607)
  • VariantGenerator.store_prepared_variant/5. Stores an already-rendered variant file (produced outside the resize pipeline, e.g. the baked annotated thumbnail) through the existing stats / bucket-storage / FileInstance / file-location tail. (#607)

Changed

  • Referrals extracted into the standalone phoenix_kit_referrals module. The referral-codes feature (schemas, business logic, admin UI) leaves core for the auto-discovered package, mirroring how posts and user_connections are structured; core keeps the database tables (migrations untouched). A new runtime-dispatch facade, PhoenixKit.Users.Referrals, resolves the installed module by its PhoenixKit.Module key and dispatches via apply/3, so core has no compile-time dependency on the package. With the module absent every call degrades safely: the system reads as disabled, lookups return nil, and use_code/2 is a no-op (the referral field disappears from signup). The module’s admin tab and routes now flow through generic module discovery (admin_tabs/0, settings_tabs/0, route_module/0) instead of the removed hardcoded subtab and route injection. (#607)

PhoenixKit 1.7.166. Install or update: {:phoenix_kit, "~> 1.7"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.