Page MenuHomePhabricator

RCFilters: Search for namespaces by number
Open, LowestPublic

Description

E.g. :0 for main namespace and :2 for user namespace.

This is a super-power user feature. It's minor but might be appreciated.

Related Objects

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Hi! I'm Usama Walayat, a GSoC 2026 applicant for the Wikifile-Transfer project. I'd like to claim this task. Here's my deep analysis and proposed solution:
Problem:
The Recent Changes filter panel allows users to filter by namespace using the namespace name (e.g., "Talk", "User", "File"). However, it does NOT support searching by namespace number (e.g., typing "1" to find the Talk namespace, or "6" for File). This is painful for experienced MediaWiki developers and admins who know namespaces by their numeric IDs — especially on wikis with many custom namespaces (100+) where the name may be in another language.
Root Cause:
In resources/src/mediawiki.rcfilters/ui/FilterMenuOptionWidget.js, the matchesFilter() method only compares the search string against the namespace label (human-readable name). It never checks against mw.config.get('wgFormattedNamespaces') which stores the numeric ID → name mapping.
My Proposed Solution:

In FilterMenuOptionWidget.js, extend the matchesFilter() method to also check if the search query matches the namespace's numeric ID
Fetch the namespace number from mw.config.get('wgNamespaceIds') which maps namespace names to numbers
Add a reverse lookup so typing "1" matches Talk, "6" matches File, "10" matches Template
Ensure the match is exact for numbers (not a substring match) to avoid false positives
Add a QUnit test covering: search by name still works, search by number returns correct namespace, invalid numbers return no results

I have JavaScript and MediaWiki extension development experience. May I claim this task?

Hi @Mattflaschen-WMF,
I am also interested in working on this task.

I saw the proposed approach using wgNamespaceIds and extending matchesFilter(). That makes sense.

I would like to help with implementation or testing (e.g., adding QUnit tests or handling edge cases like invalid inputs). Please let me know if I can contribute.

Thank you!

Pinging task authors, especially when their account is disabled, won't help. :) Please do read the text in the Comment field. Thanks.