Update the todo count in realtime
Proposal
In the current/old navigation, completing a todo would update the todo count in the header. We should add this functionality back in to the new navigation.
https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/assets/javascripts/pages/dashboard/todos/index/todos.js is the script that modifies the current todo count. Since the new navigation is vue-based there's likely a smarter way of getting these counts.
Implementation plan
- In #399114 (closed), we have capped the todos count to
99
. The limiting was done server-side. We'll want to move that logic to the frontend as the threshold might be met when adding todos client-side. - Listen to the
todo:toggle
event and use the payload to update the todos count in the sidebar.
Edited by Paul Gascou-Vaillancourt