Uh oh!
There was an error while loading. Please reload this page.
Extract DB module to phoenix_kit_db package; remove dead PagesHTML - #518
Merged
Conversation
The DB explorer module is now a standalone PhoenixKit plugin
(github.com/BeamLabEU/phoenix_kit_db). Hosts that want it pull it in
via:
{:phoenix_kit_db, "~> 0.1"}
Auto-discovery + admin_tabs/0 wires up the routes; no hand-registration
in core needed.
Changes:
- Drop PhoenixKit.Modules.DB from internal_modules/0 in
module_registry.ex.
- Drop hand-registered /admin/db, /admin/db/activity, and
/admin/db/:schema/:table live declarations from integration.ex.
- Drop the hardcoded DB module card from modules.html.heex; the
external module renders its own card via the auto-discovered
"External" section.
- Delete lib/modules/db/ entirely (db.ex + listener.ex + 6 web files).The previous commit removed PhoenixKit.Modules.DB from
internal_modules/0 in module_registry.ex and deleted the lib/modules/db
tree, but two test files still hardcoded the module:
- test/phoenix_kit/module_test.exs — @all_internal_modules list
- test/phoenix_kit/module_registry_test.exs — `expected` list +
three "registered count >= 8" assertions
Drop PhoenixKit.Modules.DB from both lists and lower the count
floors from 8 to 7 to match the new internal-module count.
ast-grep --lang elixir --pattern 'PhoenixKit.Modules.DB' returns zero
hits across lib/ + test/ after this change. The single
{"db", "/admin/db"} entry in lib/phoenix_kit_web/users/auth.ex:997's
best-available-admin-path map stays as-is — same shape as the also-
external phoenix_kit_ai's {"ai", "/admin/ai"} entry, gated at runtime
by enabled_module_keys/0.
Verification
- mix compile --warnings-as-errors clean
- mix format --check-formatted clean
- mix credo --strict: 0 issues
- 1055 tests, 4 failures — all in V107Test (AI endpoint
integration_uuid backfill); pre-existing on dev, unrelated to
this extraction.The "Reference Files" table at the end of dev_docs/guides/ 2026-02-24-module-system-guide.md cited lib/modules/db/db.ex as the canonical "Supervisor child and admin tab" example. Now that the module is external (phoenix_kit_db package), move the reference into the External examples section between hello_world (minimal) and document_creator (full-featured) — phoenix_kit_db sits naturally between them as a small-footprint plugin with a Postgrex.Notifications GenServer child + multi-page admin tabs. Other dev_docs hits for "lib/modules/db" are point-in-time PR reviews, audits, and plans — historical artifacts, left untouched per the workspace reviewer-artifact convention. Verification - mix compile clean - mix format --check-formatted clean - mix credo --strict: 0 issues - ast-grep --lang elixir --pattern 'PhoenixKit.Modules.DB' returns zero hits across lib/ + test/.
PhoenixKitWeb.PagesHTML had no callers anywhere — no controller, no route, no test. The module embedded a single show.html.heex template that read @html_content / @page_title assigns nothing was setting, and integration.ex's docstring described /pages/* and root catch-all routes that don't exist. Verification before deletion: - ast-grep --lang elixir --pattern 'PhoenixKitWeb.PagesHTML' returns only the module's own definition. - ripgrep for /pages/* routes finds only doc-example strings inside modules/sitemap/route_resolver.ex (illustrative, not real refs) and the now-removed integration.ex docstring. - priv/static/pages/ doesn't exist; the markdown source dir the template was meant to render from was never created. - Two guides (custom-admin-pages.md, making-pages-live.md) are about custom admin LiveViews and PubSub-driven real-time, both unrelated to this dead markdown-renderer. - The publishing module (phoenix_kit_publishing) covers actual CMS-page rendering, which is presumably why this never got wired up. Removed: - lib/phoenix_kit_web/controllers/pages_html.ex - lib/phoenix_kit_web/controllers/pages_html/show.html.heex - The "Public pages routes (if Pages module enabled)" docstring block in integration.ex. Verification after - mix compile --warnings-as-errors clean (61 files recompiled). - mix format --check-formatted clean. - mix credo --strict: 0 issues; 7203 -> 7202 mods/funs (exactly the one removed module). - 1055 tests, 4 failures — same V107Test (AI endpoint backfill) pre-existing on dev. Test count unchanged → no test was tied to the dead module.
7 tasks
ddon added a commit
that referenced
this pull request
May 8, 2026
Eight post-merge reviews covering V111 PDF tables, the DB-module extraction, MediaBrowser modal + LV login return_to, external-plugin admin permissions, dashboard sidebar gettext, live Hex.pm known-packages fetch, the publishing routing-strategy shim, and the LanguageSwitcher per_translation_urls attr (plus the bundled DnD work). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ddon added a commit
that referenced
this pull request
May 8, 2026
…525 Code/doc fixes addressing one finding per PR (or several where trivial). Each closes a NITPICK or IMPROVEMENT-LOW from the matching CLAUDE_REVIEW.md; design-level / breaking / risky items deferred per the FOLLOW_UP.md "Skipped" sections. - #516: Drop dead `String.to_atom` fallback in OAuth interpolate_url - #518: Delete stray 0-byte pages_html.ex - #519: Fix stale `viewer={true}` template comment + login_path trailing-slash self-loop guard - #521: Resolution-order doc on permission_key_for_admin_view/1 - #522: Hot-reload safety pitfall in per-module-i18n.md - #523: KnownPackages — max-pages cap, ensure_table race comment, Logger-levels operational signals in moduledoc - #524: __mix_recompile__?/0 note next to apply/3 explanation - #525: LanguageSwitcher attr doc atom/string keys + DRY resolve_url per-language + JS sortable:flash defensive status check Plus FOLLOW_UP.md per PR enumerating closed vs deferred items. PR #525's FOLLOW_UP also captures the bundled DnD audit trail (table_default drag-handle scoping, sortable:flash, TR cell-width preservation) absent from the original PR body. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ddon added a commit
that referenced
this pull request
May 8, 2026
Three-day window of accumulated work since 1.7.105 (2026-05-05): PRs #516, #518, #519, #521, #522, #523, #524, #525, plus the review-doc suite and post-merge triage closing nitpicks across all eight. Headline changes — V111 PDF library tables, DB module extracted to phoenix_kit_db, MediaBrowser modal viewer, sidebar gettext API, live Hex.pm catalog, publishing routing-strategy shim closing the /:locale/<literal>/... host-route shadowing bug, LanguageSwitcher :per_translation_urls, and bundled DnD improvements (drag-handle scoping, sortable:flash, TR cell-width preservation). All changes are strictly additive / non-breaking; one transitional extraction (DB → phoenix_kit_db) requires the paired Hex package once it ships. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two cleanups in core, both part of the lib/modules/* extraction direction:
The companion DB module repo is in flight on the boss's side; this PR is the core-side cleanup and can ship independently — the DB explorer route registration is now done by the external module via `admin_tabs/0` once the package is installed.
Commits
Verification
Stale-ref grep — both removals
```
ast-grep --lang elixir --pattern 'PhoenixKit.Modules.DB' lib/ test/ # zero
ast-grep --lang elixir --pattern 'PhoenixKitWeb.PagesHTML' lib/ test/ # zero
rg -n 'db_explorer|/admin/db' lib/ # zero (besides the
# auth.ex:997 best-path
# map entry, kept by
# design — same shape
# as the also-external
# phoenix_kit_ai entry)
rg -n 'PagesHTML|PagesController|pages_html' lib/ test/ dev_docs/ guides/ # zero
```
The four hits in `dev_docs/{guides,plans,audits}/` for `lib/modules/db` are point-in-time PR reviews / plans / audits — historical artifacts, left untouched per the workspace reviewer-artifact convention. The single living guide reference (`module-system-guide.md`) was updated in commit `c42fb797`.
Test plan