WT-1364 What's New and What's Next nav links - #1598
Conversation
When the page is accessed from the navigation link, keep the navigation menu and hide the "You Firefox has been updated" notification.
There was a problem hiding this comment.
Pull request overview
This PR updates the Flare navigation to derive “What’s New” / “What’s Next” links from localized Wagtail pages via new Jinja global functions, and adjusts the 2026 What’s New page behavior when users arrive from the main navigation. It also extends the Notification block with an optional anchor ID and includes small front-end updates to support the new behavior and a Kick page layering fix.
Changes:
- Added
get_whats_new_url/get_whats_next_urlJinja global functions and replaced hard-coded nav URLs with CMS-derived links. - Added an
anchor_idfield to Notification settings and wired it through to the notification component/template. - Updated What’s New 2026 page/menu behavior for
?fromMainNav=true, added a small JS bundle, and fixed Kick page menu panel z-index.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| springfield/cms/tests/test_templatetags.py | Adds tests for new template tags and nav rendering behavior. |
| springfield/cms/tests/factories.py | Adds RoadmapPageFactory for new tests. |
| springfield/cms/templatetags/cms_tags.py | Introduces get_whats_new_url / get_whats_next_url Jinja global functions. |
| springfield/cms/templates/components/notification.html | Adds optional anchor_id prop that becomes an HTML id. |
| springfield/cms/templates/cms/whats_new_page2026.html | Shows header menu only when fromMainNav is present; adds new JS bundle. |
| springfield/cms/templates/cms/includes/flare-menus/browser.html | Swaps hard-coded links for CMS-derived URLs and adds ?fromMainNav=true for What’s New. |
| springfield/cms/templates/cms/blocks/notification.html | Passes anchor_id from block settings into the notification component. |
| springfield/cms/models/pages.py | Preserves fromMainNav during What’s New index redirect to latest child. |
| springfield/cms/fixtures/notification_fixtures.py | Extends notification fixtures to include the new anchor_id setting. |
| springfield/cms/blocks.py | Adds anchor_id to NotificationSettings block. |
| media/static-bundles.json | Registers the new flare-whats-new JS bundle. |
| media/js/cms/pages/flare-whats-new.es6.js | Adds client-side logic to hide a specific anchored notification when coming from main nav. |
| media/css/cms/pages/flare-kick-page.css | Adjusts z-index to prevent the menu panel being overlapped. |
5f0d319 to
b95b689
Compare
|
confirming from a slack conversation: we should continue to exclude languages that only have the General WNP |
|
r+ after fixing failing unit tests and rebase. One non-blocking: the .flare26-kick-page .fl-menu-panel { z-index: 3 } rule in flare-kick-page.css (lines 71-74) is now redundant with the global .fl-menu-panel { z-index: 3 }. Could drop those lines. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Suppressed comments (3)
springfield/cms/templates/cms/blocks/notification.html:19
- issue (blocking): The CMS block never passes
value.settings.anchor_idinto this component, so the new field cannot render anidand notifications are not linkable as documented. Pass the value as the component'sanchor_idprop.
closable="{{ value.settings.closable }}"
>
springfield/cms/blocks.py:2206
- issue (blocking): Adding this setting changes the serialized notification-block shape, but the PR has no data migration for existing page data or Wagtail revisions. Add a CMS migration that recursively initializes
settings.anchor_idfor existing notification blocks and revisions so stored content conforms to the new format.
anchor_id = blocks.CharBlock(
required=False,
help_text="Add an ID to make this section linkable from navigation. "
"Use 'firefox-has-been-updated' on a What's New page to hide the notification "
"when the user comes from a context where they shouldn't see this message.",
springfield/cms/templates/cms/blocks/notification.html:9
- test (blocking): This new content-hiding branch has no automated coverage, although notification rendering is covered in
springfield/cms/tests/test_blocks.py:3479. Add cases for matching and nonmatching anchor IDs withfromMainNavpresent and absent; this would also catch wiring errors between the block and component.
{% set hide_firefox_updated_notification = request.GET.get("fromMainNav") and value.settings.anchor_id == "firefox-has-been-updated" %}
stevejalim
left a comment
There was a problem hiding this comment.
r+wc - tested locally
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1598 +/- ##
==========================================
+ Coverage 88.18% 88.21% +0.02%
==========================================
Files 179 180 +1
Lines 12596 12690 +94
==========================================
+ Hits 11108 11194 +86
- Misses 1488 1496 +8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
One-line summary
Replace hard-coded nav links with template tags that query existing localized pages. Change the What's New page behavior when coming from the navigation. Create blocks for What's New and What's Next links for the Navigation snippet.
Significant changes and points to review
get_whats_new_urltemplate tag that gets the existing What's New Index page for the current localeget_whats_next_urltemplate tag that gets the existing What's Next (Roadmap) page for the current localefirefox-has-been-updatedanchor ID when users land on the page from the navigation<ul>tags and don't render a separator next to anotherIssue / Bugzilla link
https://mozilla-hub.atlassian.net/browse/WT-1364
Testing
en-,fr,andde) and check that the links don't show?from_main_nav=trueis included in the URL)?from_main_nav=truefrom the URL and check that the navigation isn't therefirefox-has-been-updatedas the Anchor ID to the "Your Firefox has been updated." Notification?from_main_nav=trueis included in the URL)?from_main_nav=trueis not included in the URLen-,fr,andde) and check that the menu doesn't display the links