feat: Title column validation + sensible default
Summary
- Title column now defaults to the original filename (sans extension) instead of being blank.
- "Original filename" column (renamed from "Filename") is hidden by default; available via the columns modal.
- Live local validation in the Title cell editor: forbidden characters, length (240-byte UTF-8 cap), structural rules, plus soft warnings for camera-default names (DSC, IMG, PXL, Screenshot, WhatsApp Image…).
- Debounced (~400 ms) Commons uniqueness check via
action=query&prop=info&titles=File:<title>.<ext>, cached through the sharedapiCache(5-min TTL). - New blocking issue codes (
invalid-title,title-taken) flow throughBLOCKING_ISSUE_CODESso single + bulk publish are blocked while a Title cell carries a validation error. - Help-icon link in the Title column header opens Commons:File naming in a new tab.
Validation rules sourced from Commons:File naming, MediaWiki page title manual, and Commons:MediaWiki:Titleblacklist (soft warnings for camera-style auto-names that the server-side blacklist would reject anyway). Full ruleset is documented in the Phab task comment.
Phabricator
- T425880 — title validation
Test plan
- New uploads land with original filename (sans extension) pre-filled in Title.
- Existing stash items have the same default after a fresh load.
- "Original filename" column hidden by default; toggle visible via columns modal works.
-
Click into a Title cell and type forbidden characters (
/,:,[) — inline error appears, cell goes red. - Type a title >240 UTF-8 bytes — "Too long" error appears.
- Type leading/trailing spaces or doubled spaces — error appears.
- Type "DSC0001" — soft warning shows but doesn't block publish.
- Type a known existing Commons title (e.g. "Tour Eiffel Wikimedia Commons") — after debounce, "Already exists" error appears.
- Try to publish a row with an invalid title — Publish modal lists "Title — invalid (Commons filename rules)" or "Title — already exists on Commons" in blocking issues; Publish button stays disabled.
- Header help icon on the Title column opens https://commons.wikimedia.org/wiki/Commons:File_naming in a new tab.