Skip to content

fix: language filter doesn't cause flicker#8694

Open
VincentHan12 wants to merge 5 commits intomainfrom
vincenthan/nes-1054-templates-page-when-the-language-dropdown-is-selected-the
Open

fix: language filter doesn't cause flicker#8694
VincentHan12 wants to merge 5 commits intomainfrom
vincenthan/nes-1054-templates-page-when-the-language-dropdown-is-selected-the

Conversation

@VincentHan12
Copy link
Contributor

@VincentHan12 VincentHan12 commented Feb 5, 2026

Summary by CodeRabbit

  • Bug Fixes

    • Improved language filter behavior: header toggling now triggers an analytics beacon and open/close state without performing a navigation or submitting the filter form.
  • Tests

    • Updated test expectations to reflect the new non-navigational header behavior and adjusted language-filter query assertions.

@VincentHan12 VincentHan12 requested a review from jianwei1 February 5, 2026 01:09
@VincentHan12 VincentHan12 self-assigned this Feb 5, 2026
@linear
Copy link

linear bot commented Feb 5, 2026

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 5, 2026

Walkthrough

Removed router navigation and Formik submission from the template language dropdown; clicking now toggles the popper and directly calls the beacon tracker ('template-language'). Tests updated to assert beacon invocation and adjusted expected push query for language filtering.

Changes

Cohort / File(s) Summary
Header & Beacon
libs/journeys/ui/src/components/TemplateGallery/HeaderAndLanguageFilter/HeaderAndLanguageFilter.tsx
Removed router push and route-change listener from header button onClick; now calls setBeaconPageViewed('template-language') and toggles open state.
Language Popper Interaction
libs/journeys/ui/src/components/TemplateGallery/HeaderAndLanguageFilter/LanguagesFilterPopper/LanguagesFilterPopper.tsx
Removed handleSubmit invocation from PresentationLayer click handler so clicks only toggle open without submitting the Formik form.
Tests — Header & Gallery
libs/journeys/ui/src/components/TemplateGallery/HeaderAndLanguageFilter/HeaderAndLanguageFilter.spec.tsx, libs/journeys/ui/src/components/TemplateGallery/TemplateGallery.spec.tsx
Added import and mock for setBeaconPageViewed; updated assertions to expect beacon call instead of router push/navigation and adjusted expected query payload for language filter (languageIds: ['496']).

Sequence Diagram(s)

mermaid
sequenceDiagram
participant User as User
participant UI as Header Button
participant Popper as Languages Popper
participant Beacon as Beacon Hook
participant Router as Router (removed)

User->>UI: click language header
UI->>Beacon: setBeaconPageViewed('template-language')
UI->>Popper: toggle open state
Note over Router: no navigation / no shallow push

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • Kneesal
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: removing navigation logic that was causing page flicker when the language filter dropdown is selected.
Linked Issues check ✅ Passed The PR addresses NES-1054 by removing router navigation from the language filter handler and replacing it with a beacon call, preventing the page change that caused flicker.
Out of Scope Changes check ✅ Passed All changes directly address the flicker issue: removing navigation logic from HeaderAndLanguageFilter, removing form submission from LanguagesFilterPopper, and updating test assertions.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch vincenthan/nes-1054-templates-page-when-the-language-dropdown-is-selected-the

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot temporarily deployed to Preview - videos-admin February 5, 2026 01:11 Inactive
@github-actions github-actions bot temporarily deployed to Preview - resources February 5, 2026 01:11 Inactive
@github-actions github-actions bot temporarily deployed to Preview - journeys-admin February 5, 2026 01:11 Inactive
@nx-cloud
Copy link

nx-cloud bot commented Feb 5, 2026

View your CI Pipeline Execution ↗ for commit 38b2583

Command Status Duration Result
nx run resources-e2e:e2e ✅ Succeeded 13s View ↗

☁️ Nx Cloud last updated this comment at 2026-02-05 02:58:17 UTC

@github-actions github-actions bot temporarily deployed to Preview - journeys February 5, 2026 01:11 Inactive
@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
journeys ✅ Ready journeys preview Thu Feb 5 15:17:24 NZDT 2026

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
videos-admin ✅ Ready videos-admin preview Thu Feb 5 15:17:20 NZDT 2026

@blacksmith-sh

This comment has been minimized.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
resources ✅ Ready resources preview Thu Feb 5 15:17:33 NZDT 2026

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
watch ✅ Ready watch preview Thu Feb 5 15:17:38 NZDT 2026

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
journeys-admin ✅ Ready journeys-admin preview Thu Feb 5 15:19:38 NZDT 2026

@github-actions github-actions bot temporarily deployed to Preview - journeys-admin February 5, 2026 01:32 Inactive
@github-actions github-actions bot temporarily deployed to Preview - videos-admin February 5, 2026 01:32 Inactive
@github-actions github-actions bot temporarily deployed to Preview - resources February 5, 2026 01:32 Inactive
@github-actions github-actions bot temporarily deployed to Preview - journeys February 5, 2026 01:32 Inactive
…opdown-is-selected-the' of https://github.com/JesusFilm/core into vincenthan/nes-1054-templates-page-when-the-language-dropdown-is-selected-the
@github-actions github-actions bot temporarily deployed to Preview - journeys February 5, 2026 02:15 Inactive
@github-actions github-actions bot temporarily deployed to Preview - resources February 5, 2026 02:15 Inactive
@github-actions github-actions bot temporarily deployed to Preview - videos-admin February 5, 2026 02:15 Inactive
@github-actions github-actions bot temporarily deployed to Preview - journeys-admin February 5, 2026 02:15 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant