Problem
The breadcrumb project picker on the project settings page shows only the current project's name. When the current project is a sandbox, the picker collapses to the sandbox's own name (e.g. feature-x) instead of the full ancestor path (e.g. dhis2-project/feature-x), even though the user has access to the parent.
Every other page (workflows, runs, channels, dataclips, sandboxes list) shows the full path correctly. Settings is the outlier.
Root cause
LightningWeb.LayoutComponents.breadcrumb_project_picker/1 accepts project, current_user, and access_root. When neither current_user nor access_root is passed, it falls back silently to treating the project itself as the access root, which produces the truncated label.
project_live/settings.html.heex:13 calls the picker with only project={@project}, hitting that fallback. The other call sites pass current_user={@current_user} access_root={@access_root}.
Suggested fix
Two parts, since the bug class is broader than the one missed call site:
- Precompute the picker label once per request. The
:project_scope hook already computes access_root; add a project_label assign there. Then every page can pass label={@project_label} to the picker without each one having to know about access_root.
- Remove the silent fallback. The picker should require a precomputed
label attr and raise (or fail the Phoenix attr check) if it isn't passed. The current code also does a DB query (access_root_for_user/2) inside a render component, which should move upstream.
Problem
The breadcrumb project picker on the project settings page shows only the current project's name. When the current project is a sandbox, the picker collapses to the sandbox's own name (e.g.
feature-x) instead of the full ancestor path (e.g.dhis2-project/feature-x), even though the user has access to the parent.Every other page (workflows, runs, channels, dataclips, sandboxes list) shows the full path correctly. Settings is the outlier.
Root cause
LightningWeb.LayoutComponents.breadcrumb_project_picker/1acceptsproject,current_user, andaccess_root. When neithercurrent_usernoraccess_rootis passed, it falls back silently to treating the project itself as the access root, which produces the truncated label.project_live/settings.html.heex:13calls the picker with onlyproject={@project}, hitting that fallback. The other call sites passcurrent_user={@current_user} access_root={@access_root}.Suggested fix
Two parts, since the bug class is broader than the one missed call site:
:project_scopehook already computesaccess_root; add aproject_labelassign there. Then every page can passlabel={@project_label}to the picker without each one having to know aboutaccess_root.labelattr and raise (or fail the Phoenix attr check) if it isn't passed. The current code also does a DB query (access_root_for_user/2) inside a render component, which should move upstream.