Hello,
I just fixed this and submitted a pull request.
https://github.com/discourse/discourse/pull/4760
EDIT: To explain a little bit how I tracked the bug:
- I tried reproducing and found out that it actually reproduces by changing a topic’s title.
- I found out that there are two events that control the header and if the topic title is shown or not:
header:show-topicandheader:hide-topic. - Searched where
header:show-topicis triggered and found a match when a topic is reloaded (which happens when a topic is edited). - I changed the code to trigger
header:show-topiconly if the the topic title is not visible (not the one from the header, but the proper one,#topic-title).