Hi, Org maintainers. For a long while, I've been redoing C-u C-c C-q from time to time for realigning tags, not understanding why or when they stop to be aligned.
I just got a clue. I'm not sure it covers everything, but at least, it is a start and seems reproducible here. If I do C-u C-c C-q, all visible tags are getting aligned as expected. However, tags on collapsed entries lose the correct alignment they already have, not always, but for those sub-headers containing a link, and only those. If I expand all again, I see the misalignment, which C-u C-c C-q corrects. If I close once more, repeat C-u C-c C-q, the alignment is lost again within the headers (having links) now invisible. Another small detail, which might be another problem in the same area. I noticed that C-d between the end of header and a tag does not remove a space as I expected. This is nice actually, it protects the tag alignment. However, if the header is not top-level, C-d /adds/ one or more spaces and consequently shifts the tag to the right. One space is added per header-level. That is, for top level headers, things are OK. For headers just under top level, one space is added. For headers one level deeper, two spaces are added. Etc. The fact that the header contains a link or not seems irrelevant for this second problem. François