Skip to content

Update the todo count in realtime

Olena Horal-Koretska requested to merge 403657-update-todos-in-real-time into master

What does this MR do and why?

It updates the todo counter in real time

🐛 There is and edge case bug that exists currently as well. When todos count is larger than 99, the counter is formatted as 99+. Because the update happens on FE side, the value is taken from the content of the todo counter, parsed and than 1 todo is either added or subtracted from this number. In case when value is 99+, adding todos is working fine. But when the todo is marked as done 99+ is parsed as 99 then 1 is subtracted from it and we get the number of todos as 98 which is not correct. I'm not sure whether we should do something about it

How to set up and validate locally

  1. Enable the feature flag:
echo "Feature.enable(:super_sidebar_nav)" | rails c
  1. Enable the user setting from the user dropdown:

Screenshot_2022-12-13_at_1.32.43_PM

  1. Go to the todo list - try completing todos and undoing todos or marking all as done. 2023-04-10_17.13.36

2023-04-10_17.13.12

  1. Observe the todo counter - it should be refreshed with adding/removing todos
  2. Go to some issue page and click Add todo/Mark as done on the top of the right sidebar 2023-04-10_21.24.53

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #403657 (closed)

Merge request reports