Skip to content

WT-1364 What's New and What's Next nav links - #1598

Open
maribedran wants to merge 23 commits into
mainfrom
WT-1364-whats-new-nav
Open

WT-1364 What's New and What's Next nav links#1598
maribedran wants to merge 23 commits into
mainfrom
WT-1364-whats-new-nav

Conversation

@maribedran

@maribedran maribedran commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

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

  • Create the get_whats_new_url template tag that gets the existing What's New Index page for the current locale
    • Only return the URL if the page has published children, excluding the "General" WNP
  • Create the get_whats_next_url template tag that gets the existing What's Next (Roadmap) page for the current locale
  • Replace hard-coded nav links with the template tags
  • Add a new Anchor ID field to the Notification block
  • Hide Notification on the What's New Page when it has the firefox-has-been-updated anchor ID when users land on the page from the navigation
  • Fix the navigation CSS that kept the nav menu hidden behind the page content on WNPs
  • When no WNP is available, redirect the user to the homepage in the same locale
  • Create new blocks for the Navigation snippet with the What's New and What's Next links
    • Update the Nav Column template to render correctly in case those links are missing: open and close the <ul> tags and don't render a separator next to another

Issue / Bugzilla link

https://mozilla-hub.atlassian.net/browse/WT-1364

Testing

  • Access any page and check that the Browser menu on the navigation includes the What's New and What's Next links
  • Change to a locale where those pages don't exist (anything other than en-, fr, and de) and check that the links don't show
  • Click the What's New link and check that the page renders with the navigation (?from_main_nav=true is included in the URL)
    • Remove the ?from_main_nav=true from the URL and check that the navigation isn't there
  • Edit the latest What's New page and set firefox-has-been-updated as the Anchor ID to the "Your Firefox has been updated." Notification
    • Check that the notification isn't displayed when you access the page from the navigation link (?from_main_nav=true is included in the URL)
    • Check that the notification is displayed when ?from_main_nav=true is not included in the URL
  • Create a new Navigation snippet with a column similar to the existing "Browser" column on the static navigation; use the "What's New Link" and "What's Next Link" blocks
    • Make it the default navigation or add it to a page to see it live
    • Access the page in a locale that doesn't have those pages (anything other than en-, fr, and de) and check that the menu doesn't display the links
image image image

@maribedran
maribedran requested a review from Copilot July 10, 2026 22:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_url Jinja global functions and replaced hard-coded nav URLs with CMS-derived links.
  • Added an anchor_id field 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.

Comment thread springfield/cms/templatetags/cms_tags.py Outdated
Comment thread springfield/cms/templatetags/cms_tags.py Outdated
Comment thread springfield/cms/templates/cms/blocks/notification.html Outdated
Comment thread media/js/cms/pages/flare-whats-new.es6.js Outdated
Comment thread springfield/cms/tests/test_templatetags.py
Comment thread springfield/cms/models/pages.py
@maribedran maribedran added the Needs Review Awaiting code review label Jul 16, 2026
@maribedran
maribedran force-pushed the WT-1364-whats-new-nav branch from 5f0d319 to b95b689 Compare July 28, 2026 22:54
@slightlyoffbeat

Copy link
Copy Markdown
Contributor

confirming from a slack conversation: we should continue to exclude languages that only have the General WNP

@slightlyoffbeat

Copy link
Copy Markdown
Contributor

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_id into this component, so the new field cannot render an id and notifications are not linkable as documented. Pass the value as the component's anchor_id prop.
      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_id for 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 with fromMainNav present 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" %}

Comment thread springfield/cms/models/pages.py Outdated

@stevejalim stevejalim left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+wc - tested locally

Comment thread springfield/cms/templates/cms/whats_new_page2026.html Outdated
@codecov

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 88.21%. Comparing base (87c4abe) to head (f15367f).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
springfield/cms/models/pages.py 87.50% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review Awaiting code review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants