Skip to content

[2.x] feat(core): filter discussions by the groups of their authors - #5458

Open
imorland wants to merge 3 commits into
2.xfrom
im/discussion-group-filter
Open

imorland wants to merge 3 commits into
2.xfrom
im/discussion-group-filter

Conversation

@imorland

@imorland imorland commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Requested on Discuss: https://discuss.flarum.org/d/40038-introducing-deck-follow-every-conversation-you-care-about-live/4 (no issue)

Changes proposed in this pull request:
Adds a group: filter for discussions: group:mods lists the discussions started by a member of Mods. Groups can be named by ID, singular or plural name in any case, a comma list matches any of them, and -group: excludes them. The existing GroupGambit is now registered for discussions too, so the forum search and Deck's custom filter columns accept it, e.g. group:mods is:unread -author:me.

Until now group: only existed for users; in a discussion search it fell through to a text search for the words "group" and the group's name.

Reviewers should focus on:

  • Groups the actor can't see match nothing, so a hidden group's members aren't revealed. group:members matches every registered author, as Deck's posts authorGroup filter does; -group: includes discussions whose author was deleted.
  • Names are compared in PHP rather than with SQL lower(), which only folds ASCII on SQLite.
  • GlobalSearchState no longer writes a filter twice now that discussions and users share a gambit (filter[group]=mods became group:mods group:mods).

Screenshot

The search window's suggestions now offer group: for discussions.

Before After
before after

Necessity

  • Has the problem that is being solved here been clearly explained?
  • If applicable, have various options for solving this problem been considered?
  • For core PRs, does this need to be in core, or could it be in an extension?
  • Are we willing to maintain this for years / potentially forever?

Confirmed

  • Frontend changes: tested on a local Flarum installation.
  • Frontend changes: tests are green (run yarn test in js/).
  • Frontend changes: tests have been added, or are not appropriate here.
  • Backend changes: tests are green (run composer test).
  • Backend changes: tests have been added, or are not appropriate here.
  • Where applicable, changes are suitable for all supported database drivers (MySQL, MariaDB, PostgreSQL, SQLite).
  • Core developer confirmed locally this works as intended.
  • The description above is written by me and describes what this pull request actually does.

Required changes:

@imorland imorland added this to the 2.1 milestone Nov 10, 2026
@imorland
imorland marked this pull request as ready for review November 11, 2026 00:13
@imorland
imorland requested a review from a team as a code owner November 11, 2026 00:13
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