feat: rename Description column to Caption + enforce SDC caption rules
Summary
- Description column renamed to Caption everywhere in the UI (matches SDC terminology — the field is the file's Wikibase label, ≤ 250 chars plain text).
- Internal field key stays
description; one-shot migration rewrites legacy "Description" labels in saved fieldOrder prefs to "Caption" on load. - New
validateCaption(text)helper surfaces Commons' caption rules at edit time: 250-char limit, no line breaks/tabs, no HTML, no wikitext markup, no URLs, no leading/trailing whitespace. - Cell editor + detail-panel field both render a live
N / 250character counter and an inline bullet-list of violations; pasted multi-line text is auto-joined into a single line. - Header info icon on the Caption column shows the rules + a link to Commons:File captions.
- PublishModal blocks publish on invalid captions with a dedicated "Caption can't be saved as-is" block; BulkPublishModal counts caption-invalid items as blocked alongside missing-required-fields.
Phabricator
- T425878 — description should be caption
Research findings (250-char Wikibase label limit, plain-text-only, no markup, per-language storage) posted as a task comment before implementation.
Out of scope (per spec)
- The longer-form wikitext
description=field — captions and descriptions are different fields on Commons. - Multilingual caption editing — that's T425864.
Test plan
- Header reads Caption in the spreadsheet, the Columns modal, the detail panel, the paste-mode banner, the publish-modal issue list, and the status tooltip.
- Typing past 250 chars turns the counter red, surfaces "Captions must be ≤ 250 characters — you have 312.", and disables the Publish button (single + bulk).
-
Typing/pasting
<b>x</b>,[[link]],{{tmpl}}, orhttps://example.comshows the corresponding inline error and blocks publish. - Pasting a multi-line string into the cell editor flattens to a single line.
- Hover the info icon on the Caption header — popover shows the rules and the Commons:File captions link.
- Existing user with a saved fieldOrder still sees the field labelled "Caption" after reload (migration path).
-
Drafts persisted under the
descriptionkey are unchanged (no data loss).