Skip to content

Add V154 OG migration + admin list-UI, breadcrumb and sidebar enhancements - #650

Merged
ddon merged 6 commits into
BeamLabEU:mainfrom
mdon:og-migration-v152
Jul 20, 2026
Merged

Add V154 OG migration + admin list-UI, breadcrumb and sidebar enhancements#650
ddon merged 6 commits into
BeamLabEU:mainfrom
mdon:og-migration-v152

Conversation

@mdon

@mdonmdon commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

What

Adds core migration V154, creating the two tables the phoenix_kit_og plugin needs:

  • phoenix_kit_og_templates — reusable OG canvas designs (canvas JSONB, optional preview_image_uuid)
  • phoenix_kit_og_assignments — binds a template to a module_key × scope_type × scope_uuid scope via a JSONB slot_mapping

Uniqueness is a partial-unique-index pair, so a NULL scope_uuid (module-wide default tier) and per-scope assignments don't collide; template_uuid cascades on delete. Bumps @current_version → 154 and adds the ### V154 moduledoc block.

Renumbered on rebase (V152 → V154). This branch was authored against V152, but upstream/main has since claimed V152 (Newsletters/CRM send-profile restructuring) and V153 (folder header default). The OG migration was rebased onto current main and renumbered to V154 — the next free slot. The chain is contiguous 1..154 with no gaps. The migration file (postgres/v154.ex), @current_version, the moduledoc block, and the up/down version markers ('154' / '153') were all updated to match.

Notes

  • Idempotent (CREATE TABLE/INDEX IF NOT EXISTS, ADD COLUMN IF NOT EXISTS).
  • Prefix-safe: uuid_generate_v7() calls are schema-qualified, matching V148/V149.
  • CHANGELOG.md + mix.exs version bump intentionally left out for the maintainer to add at review.

Verification

  • mix format --check-formatted
  • mix compile --warnings-as-errors
  • mix credo --strict ✓ (no issues, whole tree)
  • prefix_migration_test.exs (the full-chain scratch-schema oracle) ✓ — applies V153→V154 cleanly, both OG tables created, marker → 154.
  • Full suite: 42 failures, identical to clean upstream/main (verified by running the same suite on 3813638f after a DB reset — the rebase introduces zero new failures; the 42 are pre-existing owner-role-protected / flash-not-fetched harness issues unrelated to this branch).

Also in this PR: admin list-UI & chrome enhancements (6 commits)

The components/JS work that backs the phoenix_kit_projects list-page overhaul, all reusable by any module. Rebased onto current main; two of the original commits (a search_toolbar form fix and a page_section forward) were dropped as redundant — upstream/main already carries equivalents.

Components (core/)

  • search_toolbar: added an in-flight loading spinner driven by phx-change-loading (sibling selector, pure CSS) with a loading_indicator opt-out for client-instant contexts.
  • bulk_actions_toolbar: new :trailing slot — far-right toolbar content (e.g. a view-mode switcher) rendered after the contextual Reorder/Delete/Clear buttons.

Admin layout / breadcrumb

  • page_action: pages can declare %{icon, label, navigate} and get a compact action button in the header breadcrumb next to the page title — lets list pages drop their in-content header row entirely. Forwarded through layouts/admin.html.heex alongside the existing page_section / page_section_path crumbs.
  • Active sidebar tabs now carry aria-current="page" (accessibility + a stable client-side marker).

JS (priv/static/assets/phoenix_kit.js)

  • TableLocalSearch hook: client-instant row narrowing for search_toolbar tables — hides rows by a lowercase data-search haystack during the debounce window while the server result stays authoritative; inert when the row set is incomplete (data-local-search-enabled).
  • AdminSidebarScroll: the admin menu keeps its scroll position across every navigation (live redirects rebuild the main container; cross-live_session navigation is a full reload). sessionStorage save with phx:page-loading-start/pagehide flushes; pre-paint restore via the hook on live redirects and DOMContentLoaded on full loads; falls back to centering the [aria-current="page"] link.

Verification

  • mix precommit ✓ (format, compile --warnings-as-errors, credo --strict)
  • Component tests: table_default_test.exs — includes pins for the spinner opt-out and aria-current.
  • Browser-verified in the parent app across the Projects/Tasks/Templates admin pages at desktop + phone widths.

@mdon
mdonforce-pushed the og-migration-v152 branch from d700c5b to 67f82e5CompareJuly 20, 2026 03:31
@mdonmdon changed the title Add V152 migration for phoenix_kit_og OpenGraph tablesAdd V152 OG migration + admin list-UI, breadcrumb and sidebar enhancementsJul 20, 2026
@ddon

ddon commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Bunch of conflicts @mdon

@mdon
mdonforce-pushed the og-migration-v152 branch from 67f82e5 to 7d596a6CompareJuly 20, 2026 15:28
@mdonmdon changed the title Add V152 OG migration + admin list-UI, breadcrumb and sidebar enhancementsAdd V154 OG migration + admin list-UI, breadcrumb and sidebar enhancementsJul 20, 2026
@mdon

mdon commented Jul 20, 2026

Copy link
Copy Markdown
ContributorAuthor

Conflicts resolved — rebased onto current main. The OG migration collided with your V152 (send-profiles) and V153 (folder header), so I renumbered it to V154 (next free slot; chain is contiguous 1..154). Two of my commits (a search_toolbar form fix and a page_section forward) dropped out as redundant since main already has equivalents.

Verified: prefix_migration_test applies V153→V154 clean on a fresh scratch schema, and the full suite shows 42 failures identical to clean main (3813638f) — zero new failures from the rebase. mergeStateStatus is now CLEAN.

@ddon
ddon merged commit 9ee74ce into BeamLabEU:mainJul 20, 2026
ddon pushed a commit that referenced this pull request Jul 20, 2026
Post-merge review of the V154 OG migration + admin list-UI bundle, the
cheap timezone-label accessor, and the etcher 0.8.2 patch bump. No bugs
found; two low-confidence nitpicks recorded on PR #650 (a likely no-op
@disable_ddl_transaction on V154, and a possible array/object mismatch
on the OG template's canvas JSONB default).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
ddon pushed a commit that referenced this pull request Jul 20, 2026
@disable_ddl_transaction true is on v154.ex:30, not :75; the canvas
JSONB default is on v154.ex:41, not :86. Both nitpicks previously
pointed at unrelated CREATE INDEX statements. Caught by /code-review.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
ddon pushed a commit that referenced this pull request Jul 20, 2026
Post-merge review of V155 (CRM contact id on newsletter deliveries +
per-broadcast dedup indexes). No bugs found: verified no version
collision with PR #650's V154 despite the misleading "V154"
branch/commit naming, confirmed up/down statement ordering respects
column/constraint dependencies, and cross-checked the widened-not-XOR
recipient-check deviation against V152's history.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
ddon pushed a commit that referenced this pull request Jul 20, 2026
Bumps version and adds the CHANGELOG entry for the merged-but-unpublished
PRs #650 (V154 OpenGraph tables + admin list-UI/breadcrumb/sidebar
enhancements), #653 (V155 delivery CRM contact id + per-broadcast dedup),
#654 (cheap timezone-label accessor), and #655 (etcher 0.8.2).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@mdon@ddon