Use LocalStorage for frequently used emoji
What does this MR do and why?
Previously, a cookie was used for this but (a) there is no need to use a cookie for communicating with the backend here, all the logic is in the frontend and (b) cookies expire. Prior to this MR, a user's frequently used emojis list would periodically get cleared out. This change will mean that a user's frequently used emoji list persists until such time as the user manually clears their local storage.
CAVEAT: prior to this MR and with the changes in this MR, a user's frequently used emoji list is specific to one browser. If the user logs in on another device or uses a different browser on their main device, then they will not be able to access the same frequently used emojis list. An ideal future improvement would include syncing this list to the server at regular intervals.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
there are no UI changes for this MR
How to set up and validate locally
- Open the GDK before checking out this branch.
- Apply some emoji reactions and take note of your frequently used emojis.
- Open the dev tools and check your cookies for the GDK
- You should see that the cookie
frequently_used_emojis
exists and it contains a comma separated list of emoji names. - In the Application section of dev tools, check local storage for a key named
frequently_used_emojis
. You should see that it does not exist.
- You should see that the cookie
- Check out this branch locally
- Visit an issue
- Click the "add reaction" emoji button on the issue
- You will see that you have a "frequently used" section in the emoji picker and it contains your frequently used emojis.
- Open the dev tools and check your cookies for the GDK
- You should see that the cookie
frequently_used_emojis
does not exist anymore - In the Application section of dev tools, check local storage for a key named
frequently_used_emojis
. You should see that it now exists, and contains a comma-separated list of emoji names.
- You should see that the cookie