FIX: Keep current filter while navigating posts in a topic (PR #12620)

Reported in: User Posts in a Topic - bug - Discourse Meta

This fixes a regression introduced in DEV: Clear filters when navigating to a post by pmusaraj · Pull Request #12557 · discourse/discourse · GitHub. In some cases, we want to clear the filters when navigating to a specific route (for example, when clicking on a notification). In other cases, though, we want to keep the filters as they are.

This PR adds a keepFilter option and uses it when:

  • navigating using the topic timeline (jumping to top, jumping to bottom or jumping to a specific post)
  • clicking on the header title to jump to the OP


This pull request has been mentioned on Discourse Meta. There might be relevant details there: