PhoenixKitHelloWorld.Web.ProjectHelloTabLive (PhoenixKitHelloWorld v0.2.2)

Copy Markdown View Source

The reference project-extension tab — the render side of the phoenix_kit_project_extensions/0 contract (see that function in PhoenixKitHelloWorld for the catalog side; copy the pair when adding a project tab to your module).

The projects hub renders contributed tabs via live_render with an embed-session contract, so a tab LV must be mountable off-router (:not_mounted_at_router): read everything from session, export no handle_params/3, and never assume router assigns. Session keys the hub supplies:

  • "project_uuid" — the host project. The ONLY required key.
  • "ext_key" / "instance_key" — which enablement row this render is.
  • "config" — the instance's config map (whitelisted, admin-edited in the project's Modules panel).
  • "current_user_uuid" — viewer identity for user-aware behavior (may be absent; degrade to read-only/anonymous, never crash).
  • "locale" — set the Gettext locale when present.
  • "wrapper_class", and the emit-mode keys ("mode", "pubsub_topic", "frame_ref") — same semantics as phoenix_kit_projects' own embedding contract.

This demo renders the received contract verbatim — the "contract debug" card for hub tabs, mirroring what HelloWidget's contract view does for dashboard widgets.