Canapin
(Coin-coin le Canapin)
July 6, 2023, 8:29am
6
Well, a few team members have liked your post…
There are so many things to do in Discourse, priorities are set. No answer doesn’t mean no interest, but rather that it’s not a priority.
I wasn’t aware of such a feature, and after trying it, I agree with your suggestion.
Removing the filter could also set the scroll to the current displayed post. Currently, it scrolls up to the first post.
I believe the related code is here for info:
showTopReplies() {
this.cancelFilter();
this.set("filter", "summary");
return this.refreshAndJumpToSecondVisible();
},
// Filter the stream to a particular user.
filterParticipant(username) {
this.cancelFilter();
this.userFilters.addObject(username);
return this.refreshAndJumpToSecondVisible();
},
filterReplies(postNumber, postId) {
this.cancelFilter();
this.set("filterRepliesToPostNumber", postNumber);
this.appEvents.trigger("post-stream:filter-replies", {
topic_id: this.get("topic.id"),
post_number: postNumber,
post_id: postId,
The refreshAndJumpToSecondVisible method is declared several lines above: discourse/app/assets/javascripts/discourse/app/models/post-stream.js at f69748e32558c2cd1e69b947c201b5a9c8862043 · discourse/discourse · GitHub
And the cancel filter method is here:
DiscourseURL.jumpToPost(postNumber, {
originalTopOffset,
});
schedule("afterRender", () => {
highlightPost(postNumber);
});
});
},
filterUpwards(postID) {
this.cancelFilter();
this.set("filterUpwardsPostID", postID);
this.appEvents.trigger("post-stream:filter-upwards", {
topic_id: this.get("topic.id"),
post_id: postID,
});
return this.refresh({ refreshInPlace: true }).then(() => {
this.appEvents.trigger("post-stream:refresh");
if (this.posts && this.posts.length > 1) {
2 Likes