Skip to content

Fix breadcrumbs teleport error on singleton edit views#617

Open
Bhavatu wants to merge 1 commit into
mainfrom
fix/edit_partials_breadcrumbs_teleport
Open

Fix breadcrumbs teleport error on singleton edit views#617
Bhavatu wants to merge 1 commit into
mainfrom
fix/edit_partials_breadcrumbs_teleport

Conversation

@Bhavatu

@Bhavatu Bhavatu commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Description

Singleton settings views (PlanFeatures, NotificationSettings, etc.) mix in SuccessUrlEditPageMixin, which returns [] from get_breadcrumbs_items() to hide the snippet breadcrumb trail. With empty breadcrumbs, Wagtail renders shared/header.html instead of slim_header.html, so the live DOM contains no header [data-w-breadcrumbs] element. The upstream edit_partials.html still unconditionally emits a w-teleport into that selector, which made every AJAX save raise a Stimulus "No valid target container found" error in the browser.

Override edit_partials.html via WatchEditView.partials_template_name and guard only the breadcrumbs block behind {% if breadcrumbs_items %}, falling back to {{ block.super }} for the rest so upstream teleports for title, side panels and history continue to work.

Fixes WATCH-BACKEND-3N8

Screenshots/Videos (if applicable)

Add screenshots or videos demonstrating the changes if applicable.

Related issue

E.g. Link to asana, sentry, slack thread etc.

Requirements, dependencies and related PRs

Describe or link possible requirements, dependencies and related PRs here

Additional Notes

Any additional information that reviewers should know about this PR.


✅ Pre-Merge Checklist

Type of Change

  • Set the PR's label to match the nature of this change

Testing

  • Built Unit tests (unit tests added/updated)
  • Built E2E tests (if applicable. E2E tests added/updated)
  • [-] Authorization is tested (permissions and access controls verified)
  • Manually tested locally (functionality verified)
    Manual testing instructions
    • Go to Plan Features, open console. Change any value, wait 500ms (don't save). Error: No valid target container found at 'header [data-w-breadcrumbs]'. should not pop up anymore.

Internationalization & Accessibility

  • [-] New strings are translatable (all user-facing text uses i18n)
  • [-] Accessibility standards met (WCAG compliance, screen reader support)

Integrations (if applicable)

If there are model changes to models which use any of the features below, verify the new models work together with the features.
For example, when adding a new model, verify the new model instances are copied when copying a plan.

  • [-] Moderation integration implemented
  • [-] Reporting integration implemented
  • [-] Copy plan feature integration implemented
  • [-] Umbrella plan structure integration implemented

Dependencies

  • [-] Dependencies are merged (if applicable. If the change depends on other PRs e.g. kausal_common)

Singleton settings views (PlanFeatures, NotificationSettings, etc.) mix in
SuccessUrlEditPageMixin, which returns [] from get_breadcrumbs_items() to
hide the snippet breadcrumb trail. With empty breadcrumbs, Wagtail renders
shared/header.html instead of slim_header.html, so the live DOM contains no
`header [data-w-breadcrumbs]` element. The upstream edit_partials.html still
unconditionally emits a w-teleport into that selector, which made every AJAX
save raise a Stimulus "No valid target container found" error in the browser.

Override edit_partials.html via WatchEditView.partials_template_name and
guard only the breadcrumbs block behind {% if breadcrumbs_items %}, falling
back to {{ block.super }} for the rest so upstream teleports for title,
side panels and history continue to work.

Fixes WATCH-BACKEND-3N8
@Bhavatu Bhavatu added the Bug fix Bug fix (non-breaking change which fixes an issue) label Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug fix Bug fix (non-breaking change which fixes an issue)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant