feat(web): public custom page API - #66
Merged
Merged
Conversation
Promote Observer.Web.Page from an internal contract to a documented public behaviour, following LiveDashboard's PageBuilder playbook: - `use Observer.Web.Page` pulls in Phoenix.LiveComponent and provides overridable defaults for every callback, so a minimal page only needs render/1. - New `pages:` router option registers custom pages by route name, e.g. observer_dashboard "/observer", pages: [queue: MyPage]. Names clashing with built-in pillars are rejected at compile time. - Custom pages are threaded through the session into page resolution and appended to the navigation bar with a generic icon fallback. Risk assessment: - Impact: additive API; dashboards without the :pages option behave exactly as before (option defaults to []). - Blast radius: router option plumbing, IndexLive page resolution, nav component; built-in page resolution clauses are untouched and take precedence over custom names. - Regression risk: low - session shape gains one key with a nil-safe read; suite green (401 tests, 96.0% coverage). - Rollback plan: revert the commit; hosts using :pages would need to drop the option (compile error otherwise), no data involved.
thiagoesteves
force-pushed
the
thiagoesteves/public-page-api
branch
from
July 17, 2026 14:19
f277a70 to
9e9206c
Compare
…illar The custom-pages validation predates the Logs pillar, so after rebasing onto main a host could register pages: [logs: MyPage] and have it pass validation while being silently shadowed by the built-in Logs page. Add logs to @reserved_page_names with a matching validation test. Risk assessment: - Impact: registering a custom page named :logs now raises at compile time instead of being silently unreachable. - Blast radius: one module attribute plus a test. - Regression risk: low - suite green (420 tests, 95.9% coverage). - Rollback plan: revert the commit.
Owner
Author
|
Post-rebase integration check: everything from the Logs pillar carried through (page resolution, nav, icons, tests), with one gap - |
Add WebDev.DemoPage to dev.exs and register it through the new :pages router option, so the public page API can be exercised locally end to end: DEMO nav entry, the standard dashboard assigns (node, access, theme) and a counter button proving the handle_parent_event flow. It also doubles as a copy-pasteable example of a minimal page. Risk assessment: - Impact: dev.exs only; the published library is untouched. - Blast radius: standalone dev server. - Regression risk: low - verified by booting the dev server and fetching /observer/demo (nav entry, content and counter render). - Rollback plan: revert the commit.
Owner
Author
|
Added |
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 free
to 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.
What
Turns ObserverWeb into a platform: host applications can now add their own pages to the dashboard, following the same playbook that grew LiveDashboard's custom-page ecosystem.
Observer.Web.Pageis now a documented public behaviour.use Observer.Web.Pagepulls inPhoenix.LiveComponentplus overridable no-op defaults for every callback, so a minimal page is justrender/1.pages:option onobserver_dashboard/2:observer_dashboard "/observer", pages: [queue: MyApp.ObserverQueuePage]serves the page at/observer/queueand addsQUEUEto the nav (generic icon fallback for custom pages).ArgumentError; invalid shapes too.@access,@user,@params,@theme), so they can honor read-only access like the built-ins.Why
Part of the roadmap derived from comparing ObserverWeb against OTP observer, observer_cli and Phoenix LiveDashboard: a public page API lets the community fill niches (Ecto stats, Broadway, queues) without growing the core.
Risk assessment
:pageseverything behaves exactly as before (defaults to[], nil-safe session read for live upgrades).IndexLivepage resolution, nav component. Built-in resolution clauses are untouched and take precedence over custom names.:pagesdrop the option.Checklist
mix testgreen (401 tests)mix coveralls96.0% (threshold 95%)mix credo --strict,mix sobelow,mix dialyzer,mix format --check-formattedclean🤖 Generated with Claude Code