PhoenixKit 1.7.109: Draw on images, and name integrations freely
PhoenixKit 1.7.109 lets admins draw on images in the media viewer and start a discussion on each shape. Integration connections can now have any name.
Annotations on images
The media viewer gets rectangle, circle, polygon and freehand tools. After drawing a shape, a small composer asks for the first comment, with files or a GIF; Post keeps the shape, Cancel removes it. Those comments appear in the file’s own comment thread, and hovering a shape shows its comment. Annotations are deleted with their image, and stay, without an author, when their creator’s account is deleted.
Integration names
A connection name can now hold spaces and punctuation, and two connections of one provider may share a name. Renaming no longer changes the stored key, so modules that point at a connection keep working. The connection picker shows a masked part of the key, how old the connection is and a status: Connected, Auth failed, Not tested or Not connected. Save and test buttons no longer send twice on a double click.
Upgrading
Run mix phoenix_kit.update for V114 (new connection keys), V115 (annotations) and V116 (parent records for entity data).
Full release notes: PhoenixKit 1.7.109
1.7.109 · 12 May 2026
Added
- V114 migration: Integrations storage switched to uuid-only
keycolumn onphoenix_kit_settings(PR #536)- Collapses the per-row
keyfrom the compositeintegration:<provider>:<name>shape to just the row’s UUIDv7. Lifts both name restrictions baked into the old shape: the regex[a-zA-Z0-9][a-zA-Z0-9\-_]*and per-provider uniqueness are gone. Any non-empty string (after trim) is now a valid connection name; duplicates within a provider coexist (uuids disambiguate). Names with spaces, punctuation, “My Company Drive (US)” — all allowed add_connection/3: generates UUIDv7 up-front, embeds it in both theuuidandkeycolumns; provider + name live purely invalue_json.rename_connection/3rewrites only the JSONBnamefield — storage key is the row uuid, untouched across renames, so consumer modules pinning to uuid keep working- Read sites (
get_integration_by_uuid/1,list_connections/1,load_all_connections/1) source provider + name from JSONB; the list helpers expose:date_addedso UI callers render “Created N ago” without a second lookup provider:namestring lookups now first-match by case-insensitive name sort (names aren’t unique anymore). Read-shim contract preserved for legacymigrate_legacy/0callsiteslog_activitytakes explicit(provider, name)so audit rows carry human-readable names — parsing the key would have stamped a uuid string intometadata.connection- Migration walks every
integration:%-keyed row in a single UPDATE, backfills missingvalue_json -> 'name'/'provider', ensuresmodule = 'integrations', and rewriteskey = uuid::text. Legacy V0-shape keys without:namefold toname = "default".down/1rewrites back to composite shape with-<8-char>suffix from UUIDv7’s random tail on duplicate(provider, name)pairs
- Collapses the per-row
- V115 migration:
phoenix_kit_annotationstable for drawn-on-image shapes via the Etcher overlay (PR #537)- Stores rectangle / circle / polygon / freehand shapes tied to a
phoenix_kit_filesrow in image-pixel coordinates. Geometry is JSONB; shape kinds enforced via DB-level CHECK constraint matching Etcher 0.1’s four-tool set file_uuidFKON DELETE :delete_all— annotations vanish with their host image.creator_uuidnullable +ON DELETE :nilify_allso user deletion preserves their annotations as anonymous- Discussion threads attach via the existing comments convention: comments anchored to the file (
resource_type = "file",resource_uuid = file_uuid) withmetadata.annotation_uuidcarrying the back-reference. Annotation-rooted comments appear in the file’s main thread alongside non-annotated discussion - Indexes:
(file_uuid)for per-file listing, partial(creator_uuid) WHERE creator_uuid IS NOT NULLfor author lookups
- Stores rectangle / circle / polygon / freehand shapes tied to a
- V116 migration: nullable self-FK
parent_uuidonphoenix_kit_entity_data(PR #538)- Each entity-data row can point at another row of the same entity as its parent. System field — always present, optional, never user-removable (does not appear in
entities.fields_definition). Existing rows stayparent_uuid = NULLand become roots; no backfill - No
ON DELETEcascade — parent/child linkage and same-entity scope are managed by thePhoenixKitEntities.EntityDatacontext inside a transaction. A DB-level cascade would bypass the soft-delete machinery and the activity log - Same-entity enforcement is a context-layer responsibility. B-tree index on
(parent_uuid)covers the “list children” query for the WordPress-style indented tree
- Each entity-data row can point at another row of the same entity as its parent. System field — always present, optional, never user-removable (does not appear in
PhoenixKit.Annotationscontext +PhoenixKit.Modules.Storage.EtcherAdapter(PR #537)- Context handles CRUD against
phoenix_kit_annotationspluslist_for_file_with_previews/1that pulls every file comment in a single bulk query and groups bymetadata.annotation_uuidfor the tooltip preview Annotations.delete/1runs comment cascade + annotation row delete in aRepo.transaction/1so a failure between the two doesn’t leave the annotation alive with its discussion thread destroyedAnnotation.adapter_writable_fields/0exposes the schema’s@cast_fields(minusfile_uuid, which the adapter sets server-side fromtarget_uuid) as the source of truth for the adapter whitelist — the adapter’s@schema_keysderives from it so a future schema field can’t drift silentlyEtcherAdapterimplements theEtcher.Storagebehaviour, dispatching to the context. Adapter explicitly whitelists payload keys before reachingString.to_existing_atom— guards against forward-compat with Etcher’s payload shape growing new client-side keys
- Context handles CRUD against
PhoenixKitWeb.Components.AnnotationComposerLiveComponent (PR #537)- Focused composer for attaching the first comment to a newly-drawn annotation. Explicit Post / Cancel control flow owns the annotation lifecycle: Post commits comment + solidifies annotation, Cancel rolls the annotation back. Communicates with the parent MediaBrowser via LC-to-LC
send_update/2, no host-LV plumbing required - Scope: text + file uploads (image / video / audio / pdf / archive) + Giphy picker. Audio recording (which the full
CommentsComponentsupports) intentionally skipped for v1
- Focused composer for attaching the first comment to a newly-drawn annotation. Explicit Post / Cancel control flow owns the annotation lifecycle: Post commits comment + solidifies annotation, Cancel rolls the annotation back. Communicates with the parent MediaBrowser via LC-to-LC
- MediaBrowser integration with the Etcher overlay (PR #537)
Etcher.layermounted alongsideFresco.viewerin the modal. Newetcher:created/:updated/:deleted/:selectedhandlers wire the JS overlay into the storage backend- Lifecycle:
open_viewer/2preloads annotations + rolls back any pending compose;finalize_annotation_compose/2reloads annotations and pokes the file’sCommentsComponentto refresh;refresh_file_comments/1flips the component’sloaded?to false to trigger a sidebar reload creator_uuidis set server-side from the scope — client-suppliedcreator_uuidin the payload is overridden, preventing author spoofing
IntegrationPickerrewrite (PR #536)- Card subtitle: priority
external_account_id→ masked credential tail (first 8 +…+ last 4 for any ofapi_key/bot_token/access_key;•••for keys under 14 chars) - Age line under subtitle using shared
<.time_ago> - Status badge: distinct label + colour for each of the four canonical statuses (
connected→ green “Connected”,error→ red “Auth failed” withvalidation_statustooltip,configured→ yellow “Not tested”,disconnected→ grey “Not connected”) - Provider icon + display name auto-resolve via
Integrations.Providers.get/1— callers no longer pre-attach a:providerstruct - Provider-name badge hidden when picker is filtered to a single provider (both real callsites do this)
- Click feedback:
phx-click-loadingdims the clicked card + blocks rapid re-clicks during the LV round-trip; daisyUIloading-spinnerswaps in for the status badge during the same window provider_defmemoized in aMap.new(connections, ...)shared betweenfilter_by_search/3and the render path — dropsProviders.get/1calls from 2N to N per render- 33 new component spec tests covering subtitle priority + masked credential + age + provider auto-resolve + status branches + filter-by-provider + search threshold + empty state + deleted-card warning + click-action dispatch
- Card subtitle: priority
<.draggable_list>:sortable_handleattribute (PR #538)- Optional CSS selector (e.g.
".pk-drag-handle") that restricts drag initiation to elements matching the selector inside each item. When set, the item wrapper dropscursor-grabstyling — the caller renders their own handle. Backward-compatible: defaultnilpreserves whole-item drag. Mirrors<.table_default>’s:on_reorder+.pk-drag-handleconvention. JS hook (SortableGrid) already supporteddata-sortable-handle; this PR wires the Elixir-side knob through
- Optional CSS selector (e.g.
- Etcher tooltip JS slot overrides (PR #537)
window.Etcher.tooltipSlots.header/.footer/.bodytranslatemetadata.comment_*keys into the rich tooltip (author header, date · count subheader, thumbnail + quoted text body).window.Etcher = window.Etcher || {}guards against load order
AnnotationComposerPositionJS hook keeping the MediaBrowser’s floating annotation-composer popover inside the viewer bounds via re-clamping on mount + updates + window resize- Dep adds:
:fresco ~> 0.1(OpenSeadragon viewer wrapper, now a direct dep since Tessera 0.2 split it out),:etcher ~> 0.1(annotation overlay) - Three post-merge review docs in
dev_docs/pull_requests/2026/:536-integrations-v114-uuid-keys-picker-ux/,537-annotations-v115-etcher-overlay/,538-v116-parent-uuid-draggable-handle/— each with finding disposition tables tracking which items were addressed in follow-up commits and which were deferred to the original PR author
Changed
Integrations.validate_connection/2rescue narrowed to[DBConnection.OwnershipError, Postgrex.Error, Req.TransportError]so genuine logic bugs (KeyError,ArgumentError,MatchError) bubble up to the supervisor instead of being swallowed under a generic “validation failed”.validate_credentials/2mirrored the narrowing post-merge for parity (PR #536)Integrations.authenticated_request/4docstring spells out the URL-trust contract: the integration’s Bearer token is attached to every request, so callers must pin URLs to a domain allowlist before invoking. Internal callers (OpenRouterClient, OAuth refresh, userinfo) build URLs from the Providers registry which is hardcoded and safe; new callsites taking URLs from elsewhere need their own guard (PR #536)phx-disable-withon Save / Test Connection / Disconnect / Delete buttons onintegration_form.html.heexplus the OAuth Connect Account button. Pre-fix, a double-click + slow network could submit two save requests or spawn parallel HTTP probes (PR #536)- IntegrationForm
create_connection+save_form_with_renameerror branches preserve:new_name+:form_valueson error so a failed:empty_namesubmit doesn’t wipe the api_key the operator just typed. Dropped the dead:already_exists/:invalid_nameerror branches (those tuples no longer fire post-V114). Template: removed the now-incorrect “Letters, digits, hyphens, and underscores. Must be unique per provider.” name-rules hint (PR #536) PhoenixKit.Users.Permissions.module_label("db")/module_icon/module_descriptionpindbin@core_*maps so the display is correct even when the externalphoenix_kit_dbmodule isn’t loaded (PR #536)MediaBrowser.format_date/1strftime format string wrapped ingettext(...)so locales can reorder date components (%d %b %Yfor en-GB / fr / de) without code changesAnnotationComposer.first_error/1routes throughPhoenixKitWeb.Components.Core.Input.translate_error/1— gettext-aware helper that interpolates%{count}and other opts properlyAGENTS.mdCHANGELOG-ownership instruction corrected — entries are written by agents against the bumped@versionheading, matching the project’s actual workflow
Fixed
- Post-merge fixes folded from review of PR #536:
- V114 docstring drift after rebase rename: moduledoc references “V113” but the module is V114; “Stamp the table comment with ‘113’” while code stamps ‘114’; “post-V113 regression / invariant” in tests and picker comment. All swept to V114
Permissions.module_label("db")was falling through toString.capitalize("db")="Db"when the externalphoenix_kit_dbmodule isn’t loaded; test asserts"DB". Folded in to keep the post-rebase baseline green- Test fixture rows in
storage/scope_test.exs,media_browser_scope_test.exs,media_browser_test.exsviolated V113’sphoenix_kit_files_user_or_parent_checkCHECK constraint; eachcreate_file!/1now stampsuser_uuidvia a memoisedensure_user!/0helper IntegrationPicker.filter_by_search/3had a shadowingnamevariable in the inner case pattern match; renamed toprovider_nameString.slicenegative-bound range pinned with explicit step (-4..-1//1) to silence Elixir 1.16+ range-step warning- Credo cleanup:
get_integration/12-branchcondwithtruearm →if/else; inlinePhoenixKit.Settings.Queries.get_setting_by_uuid/1calls aliased asSettingsQueriesinintegrations_test.exs; three test files (storage/scope_test.exs,media_browser_scope_test.exs,media_browser_test.exs) aliasPhoenixKit.Users.Authfor theirensure_user!helpers
- Post-merge fixes folded from review of PR #537:
Annotations.delete/1deleted linked comments outside a transaction — if the comment cascade succeeded and the annotation row delete then failed (FK violation, DB transient), comments were gone but the annotation remained with its discussion permanently destroyed. Wrapped inRepo.transaction/1via an extracteddelete_in_transaction/1helperresource_type = "annotation"claim in three moduledocs (annotation.ex,v115.ex,etcher_adapter.ex) contradicted the actual implementation, which anchors comments to the file (resource_type = "file") withmetadata.annotation_uuid. All docs swept to match realityAnnotations.delete_linked_comments/1barerescue _ -> :okswallowed every exception class including logic bugs. Narrowed to[DBConnection.OwnershipError, Postgrex.Error, ArgumentError]so logic bugs surfaceAnnotationComposer.normalize/1reinvented whatEcto.Changeset.cast/3already does (accepts both atom- and string-keyed maps) AND silently passed the original map through whenString.to_existing_atomfailed, hiding typo’d field names from the user as “geometry: can’t be blank” rather than “unknown field” — function deleted- In-repo
Code.ensure_loaded?(PhoenixKit.Annotations)guard inMediaBrowser.load_annotations_for/1was needless defensive code —Annotationsis in the same compilation unit @compile {:no_warn_undefined, [PhoenixKit.Modules.Storage, ...]}would have shadowed legitimate compile errors on a core module rename —Storageremoved from the suppression listAnnotationComposerPosition.destroyedcleanup conditional was a never-falls-through guard — simplified- Etcher slot-preservation JS comment misstated the mechanism — corrected to “PhoenixKit owns the tooltip layout; downstream consumers must load AFTER phoenix_kit.js”
- Credo cleanup:
Annotations.first_attachment_thumbnail/1single-clausewith→case; aliasedAnnotations,Storage,EtcherAdapter,Storage.Fileso six “nested modules could be aliased” findings clear - PhoenixKitComments dialyzer ignores added for
annotations.ex+annotation_composer.ex(optional sibling package, guarded at runtime)
- V114 down SQL collision-suffix source:
substring(uuid::text from 1 for 8)extracted UUIDv7’s timestamp prefix — same-millisecond rows produced identical suffixes ⇒ duplicate “uniquified” keys when two+ rows collided on(provider, name). Switched tosubstring(uuid::text from 25 for 8)(random tail, 32 bits of entropy). Mirrored inrun_down!in the V114 test (PR #538 follow-up) - 3-row collision test added to V114 test suite covering N ≥ 3 case (exactly one plain key, N-1 distinct suffixed keys, all keys unique)
- IntegrationPicker click feedback was missing: clicking a card showed no visual response during the 100-500ms LV round-trip — operators would click again and submit a second request. Added
phx-click-loading:opacity-60 phx-click-loading:pointer-events-none+ status-badge → spinner swap during the in-flight window (PR #536)
i18n
- AnnotationComposer user-facing strings wrapped in gettext (flash messages + heex literals + ARIA labels — ~17 strings)
- MediaBrowser
format_datestrftime pattern wrapped in gettext so locales reorder date components - IntegrationPicker status labels (
Connected/Auth failed/Not tested/Not connected) and search placeholder + empty-state strings wrapped in gettext - IntegrationForm flash messages, button labels, name placeholder, danger-zone copy, OAuth step labels, redirect-uri instructions wrapped in gettext
PhoenixKit 1.7.109. Install or update: {:phoenix_kit, "~> 1.7"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.