Skip to content

fix(announcement-banner): persist dismiss state in localStorage#2445

Merged
RemiBonnet merged 5 commits intostagingfrom
fix/announcement-banner-dismiss-persistence
Mar 4, 2026
Merged

fix(announcement-banner): persist dismiss state in localStorage#2445
RemiBonnet merged 5 commits intostagingfrom
fix/announcement-banner-dismiss-persistence

Conversation

@jul-dan
Copy link
Contributor

@jul-dan jul-dan commented Mar 4, 2026

Summary

Issue: QOV-1643

Use a content-based hash key so the banner stays hidden after page refresh but reappears automatically when PostHog pushes a new announcement.

Testing

  • Changes tested locally in the relevant Console's pages and Storybooks
  • yarn test or yarn test -u (if you need to regenerate snapshots)
  • yarn format
  • yarn lint

PR Checklist

  • I followed naming, styling, and TypeScript rules (see .cursor/rules)
  • I performed a self-review (diff inspected, dead code removed)
  • I titled the PR using Conventional Commits with a scope when possible (e.g. feat(service): add new Terraform service) - required for semantic-release
  • I only kept necessary comments, written in English (watch for useless AI comments)
  • I involved a designer to validate UI changes if I am not a designer
  • I covered new business logic with tests (unit)
  • I confirmed CI is green (Codecov red can be accepted)
  • I reviewed and executed locally any AI-assisted code

Use a content-based hash key so the banner stays hidden after page
refresh but reappears automatically when PostHog pushes a new
announcement.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jul-dan
Copy link
Contributor Author

jul-dan commented Mar 4, 2026

Qovery Preview

Qovery can create a Preview Environment for this PR.
To trigger its creation, please post a comment with one of the following command.

Command Blueprint environment
/qovery preview 964984c5-fba6-4371-88d3-a5daf99642ab test-prod
/qovery preview 939e824e-ace5-46db-852e-4db251209aeb test-prod-clone
/qovery preview e68a6997-01bc-4a01-adcd-e763ade8d2ae test-prod-clone-pipeline-clone-test
/qovery preview 28c47145-c8e7-4b9d-8d9e-c65c95b48425 staging
/qovery preview cc1de7de-94e5-40f8-8e45-bc8986d9dfec storybook
/qovery preview {all|UUID1,UUID2,...} To preview multiple environments

This comment has been generated from Qovery AI 🤖.
Below, a word from its wisdom :

There is no better time than now, better future does not exist

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Mar 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 50.79%. Comparing base (ac5bc33) to head (87ecaef).
⚠️ Report is 10 commits behind head on staging.

Additional details and impacted files
@@             Coverage Diff             @@
##           staging    #2445      +/-   ##
===========================================
+ Coverage    47.15%   50.79%   +3.64%     
===========================================
  Files         1252      210    -1042     
  Lines        23142     4333   -18809     
  Branches      6832     1373    -5459     
===========================================
- Hits         10912     2201    -8711     
+ Misses       10151     1664    -8487     
+ Partials      2079      468    -1611     
Flag Coverage Δ
unittests 50.79% <100.00%> (+3.64%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.

…dismiss key

Replace manual localStorage calls and hash function with useLocalStorage
from @qovery/shared/util-hooks. Store the dismissed message directly as
the key value so the banner auto-reappears when PostHog changes the content.
@jul-dan jul-dan requested a review from RemiBonnet March 4, 2026 13:08
…nnouncement-banner/announcement-banner.spec.tsx

Co-authored-by: Rémi Bonnet <bonnet.rem@gmail.com>
@jul-dan jul-dan requested a review from RemiBonnet March 4, 2026 13:15
@RemiBonnet RemiBonnet merged commit 92d7603 into staging Mar 4, 2026
11 checks passed
@RemiBonnet RemiBonnet deleted the fix/announcement-banner-dismiss-persistence branch March 4, 2026 13:37
@RemiBonnet
Copy link
Member

🎉 This PR is included in version 1.294.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants