[1.x] feat: add setting to disable sticky pinning on All Discussions page#4607
Open
gianniguida wants to merge 2 commits intoflarum:1.xfrom
Open
[1.x] feat: add setting to disable sticky pinning on All Discussions page#4607gianniguida wants to merge 2 commits intoflarum:1.xfrom
gianniguida wants to merge 2 commits intoflarum:1.xfrom
Conversation
Adds an admin toggle (default: enabled) that gates unread-only sticky pinning on /all. When disabled, stickied discussions appear at their natural last_posted_at position. Tag pages are unaffected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an admin setting
flarum-sticky.pin_sticky_on_all_discussions(default:true) that controls whether stickied discussions get pinned to the top of the All Discussions page. Tag pages are unaffected.Motivation
Today, on
/all, unread sticky discussions are floated to the top via a UNION query. For communities with long-lived sticky announcements (rules, FAQs, sticky welcome threads), this can push fresh activity down and make/allfeel stale — once a user has read the sticky, it returns to its natural position, but a forum with many users will always have some user with an unread sticky, so the pinning is effectively permanent for new visitors.This adds an opt-out so admins can decide that
/allis purely "latest activity," while still relying on sticky pinning inside individual tag pages where it remains useful.Behavior matrix
true(default)false/alllast_posted_atpositionChanges
extend.php— register the setting with a default oftrue.src/PinStickiedDiscussionsToTop.php— injectSettingsRepositoryInterface; before the UNION block, return early when the setting isfalse.locale/en.yml— addadmin.settings.pin_sticky_on_all_discussions_{label,help}.js/src/admin/index.js— add a boolean toggle in the extension's admin settings tab.Backwards compatibility
The default value matches existing behavior, so this is a no-op on upgrade. No migration is needed.
Testing
true:/allshows unread sticky at the top, read sticky at natural position (existing behavior).false:/allshows all sticky at their natural position; no sticky-induced reordering.Related
This setting is also honored by
fof/discussion-language's replacement ofPinStickiedDiscussionsToTop, so the toggle takes effect on language-filtered/allviews as well.