fix(news): resolve category filter state desynchronization (#8032) - #8035
fix(news): resolve category filter state desynchronization (#8032)#8035suryaff733 wants to merge 2 commits into
Conversation
…8032) Signed-off-by: CELTM Global <celtm.global@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughNewsGrid now uses React state and ChangesNewsGrid filter state
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The news category filters now keep displayed articles and active button styling synchronized through React state, including after remounting. No merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
Preview deployment for PR #8035 removed. This PR preview was automatically pruned because we keep only the 3 most recently updated previews on GitHub Pages to stay within deployment size limits. If needed, push a new commit to this PR to generate a fresh preview. |
Description
This PR fixes #8032
On
/company/news, the category filter buttons (CoverageandReleases) previously relied on module-level variables (coverageFiltered,pressReleaseFiltered) and direct DOM manipulation (classList.toggle("mystyle")). When navigating away from/company/newsand returning, the component remounted with fresh DOM elements while the module variables stayed set to their previous states, causing the filter list and button highlights to invert and desynchronize.Changes Introduced:
classList.toggle).selectedCategoryviauseState).newslist declaratively fromqueryResultsandselectedCategorywithuseMemo.mystyle) declaratively to JSXclassNameprops.data?.allMdx?.nodes.Video / Screen Recording
Screen.Recording.2026-09-09.at.13.50.28.1.mp4
Notes for Reviewers
/company/newsand other pages; filter selections and visual button highlights now remain cleanly in sync.Signed commits
Summary by CodeRabbit