gtg icon indicating copy to clipboard operation
gtg copied to clipboard

Properly maintain the task count in Tag.set_parent (fix #404)

Open gycsaba96 opened this issue 1 year ago • 2 comments

Hi!

I am a newcomer. This PR fixes issue #404 .

Parent tag's task count was not updated when adding/removing children tags to them. The problem is solved by overriding the set_parent method in the Tag class and introducing a _get_ancestors helper method.

gycsaba96 avatar Jul 15 '23 13:07 gycsaba96

Hi @gycsaba96, the big refactoring has finally landed (see the pinned 0.7 tracking issue for details)!

Could you check whether this is still needed with the current git master version? It might have been fixed as part of the mega branch. Otherwise, you will need to git rebase this PR.

nekohayo avatar Feb 26 '24 18:02 nekohayo

Hi Jeff,

The problem is still present in the new version. However, I might need some time to find a proper solution using the new codebase. (My old solution relied on the base class of Tag, which had changed.)

gycsaba96 avatar Feb 28 '24 18:02 gycsaba96

Hi Jeff,

I have fixed the bug:

  • Now, the ancestors of a tag are also considered when updating the task counts.
  • After a drag-and-drop, these counts are recalculated.

gycsaba96 avatar Mar 06 '24 10:03 gycsaba96

Sorry for all the rebasing, this LGTM Merging, thanks!

diegogangl avatar Mar 15 '24 23:03 diegogangl