Skip to content

[2.x] fix(deck): name the parts of a filter it can't use - #5459

Open
imorland wants to merge 3 commits into
2.xfrom
im/deck-filter-unknown-part
Open

imorland wants to merge 3 commits into
2.xfrom
im/deck-filter-unknown-part

Conversation

@imorland

@imorland imorland commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Reported 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:
When a custom filter column's query has a part that isn't a discussion filter, Deck said "Use filters only, such as tag:support is:unread. Plain words aren't supported.", which led a member to think combined filters weren't supported (they are; the part it refused was group:, then a users-only filter). It now names the parts it can't use, e.g. "group:mods isn't a filter for discussions. Use filters such as tag:support or is:unread.", in both the Add column form and the Filters window, and the message clears once the query is edited.

For extensions, a column field's invalidText can now be a function of what was typed.

Reviewers should focus on:

  • Unknown parts are worked out from the registered gambits (app.search.gambits.match), so extensions' filters count as known.
  • Runs of spaces or tabs in a pasted query aren't reported as parts.

Screenshot

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:

A custom filter column rejected a whole query with "Plain words aren't
supported" when one part of it was a filter for something else, such as
group:, which only exists for members. The message now names the parts no
discussion filter takes, so a member can see what to change.
@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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant