Skip to content

[2.x] fix(deck): filter columns follow changes that move a discussion in or out of them - #5450

Merged
imorland merged 3 commits into
2.xfrom
im/deck-filter-membership
Nov 10, 2026
Merged

imorland merged 3 commits into
2.xfrom
im/deck-filter-membership

Conversation

@imorland

Copy link
Copy Markdown
Member

Fixes #5178

Changes proposed in this pull request:

A Deck filter column such as is:locked or tag:x kept discussions that stopped matching and never picked up ones that started to, because locking, stickying, re-tagging, hiding or restoring changes no activity, and a column only checks for activity since its newest item. Filtered discussion columns now ask the server about the discussion such an event concerns, using their own request narrowed by a new id filter for discussions in core, then add it where the server would list it or take it out. A burst of events costs one request per column, and extensions register their own events with new DeckColumns().membershipEvents('bestAnswerEvent').

Reviewers should focus on:

  • The cost: in a filtered column, a lock, sticky, retag, hide or restore now costs one throttled request per column even when the filter doesn't depend on it. Unfiltered columns behave as before (narrowing them by id would turn off the hidden-tag and ignored-discussion exclusions, which only apply without a filter).
  • Checks and rechecks for a column now run one at a time, activity first, so a late answer can't undo a newer one.

Screenshot

Before: locking "Old forum archive", unlocking "Rules and guidelines" and stickying "Moving to the new server" (as a moderator, in another session) changes nothing in the columns.

Before

After: each change shows in its column within a few seconds. Both recordings are at 2× speed.

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:

… out of them

Locking, stickying, re-tagging or restoring a discussion doesn't change its
activity, so a column's check for activity since the newest item it shows
never found it: a Filter column such as is:locked kept discussions that no
longer matched and never gained ones that started to.

Discussion columns now ask the server again about the discussions those
events concern, with their own request narrowed to the ids by a new `id`
filter for discussions, and add or remove them. Ids from a burst of events go
in one request per column. Extensions register their own events with
`new DeckColumns().membershipEvents(...)`.

Fixes #5178
@imorland imorland added this to the 2.1 milestone Nov 10, 2026
@imorland
imorland marked this pull request as ready for review November 10, 2026 19:15
@imorland
imorland requested a review from a team as a code owner November 10, 2026 19:15
@imorland
imorland merged commit d251fc4 into 2.x Nov 10, 2026
42 of 43 checks passed
@imorland
imorland deleted the im/deck-filter-membership branch November 10, 2026 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Deck] Filter columns don't follow changes that move a discussion in or out of their filters

1 participant