To-Do List Counter Does Not Respect Filter

Summary

When you filter your To-Do List for e.g. a certain project, the count badges still have the unfiltered count.

Steps to reproduce

  1. Click on To-Do List in the navbar.
  2. Select a group you have To-Do entries for.

Alternatively to point 2, you can set any other filter and it won’t update the count badges either.

Example Project

No example project but you need at least 1 To-Do which is not matched by the filters you set to see this.

What is the current bug behavior?

The badges next to “To-Do” and “Done” still show the unfiltered count, even though a filter is present.

What is the expected correct behavior?

The badges will show the actual amount of displayed (done) todos like when filtering issues.

Relevant logs and/or screenshots

image

image

image

Output of checks

This bug happens on GitLab.com

Results of GitLab environment info

See “Output of checks”.

Results of GitLab application Check

See “Output of checks”.

Possible fixes

The To-Do List appears to only display the total todos_pending_count and todos_done_count in the .nav-tabs section, while issues have a issuables_state_counter_text that dynamically determines the filtered count through issuables_count_for_state.

Link to To-Do view that only shows total counts: https://gitlab.com/gitlab-org/gitlab/-/blob/2d88503d/app/views/dashboard/todos/index.html.haml#L18

Edited by Kev