Skip to content

[1.x] feat: add setting to disable sticky pinning on All Discussions page#4607

Open
gianniguida wants to merge 2 commits intoflarum:1.xfrom
glowingblue:gg/feat-toggle-sticky-pinning-on-all
Open

[1.x] feat: add setting to disable sticky pinning on All Discussions page#4607
gianniguida wants to merge 2 commits intoflarum:1.xfrom
glowingblue:gg/feat-toggle-sticky-pinning-on-all

Conversation

@gianniguida
Copy link
Copy Markdown
Contributor

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 /all feel 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 /all is purely "latest activity," while still relying on sticky pinning inside individual tag pages where it remains useful.

Behavior matrix

Page Setting true (default) Setting false
/all Unread sticky pinned to top (existing behavior) Sticky at natural last_posted_at position
Tag page All sticky pinned to top All sticky pinned to top (unchanged)
Other filters No pinning No pinning

Changes

  • extend.php — register the setting with a default of true.
  • src/PinStickiedDiscussionsToTop.php — inject SettingsRepositoryInterface; before the UNION block, return early when the setting is false.
  • locale/en.yml — add admin.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

  • Admin toggle appears in the extension settings tab and persists across reloads.
  • With setting true: /all shows unread sticky at the top, read sticky at natural position (existing behavior).
  • With setting false: /all shows all sticky at their natural position; no sticky-induced reordering.
  • Tag pages pin sticky to the top in both states.
  • Sticky badge, row highlight, and first-post excerpt remain visible regardless of the setting.

Related

This setting is also honored by fof/discussion-language's replacement of PinStickiedDiscussionsToTop, so the toggle takes effect on language-filtered /all views as well.

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.
@gianniguida gianniguida requested a review from a team as a code owner April 29, 2026 13:02
@gianniguida gianniguida changed the title feat: add setting to control sticky pinning on All Discussions page [1.x] feat: add setting to control sticky pinning on All Discussions page Apr 29, 2026
@gianniguida gianniguida changed the title [1.x] feat: add setting to control sticky pinning on All Discussions page [1.x] feat: add setting to disable sticky pinning on All Discussions page Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant