feat: link Caption to Title via {title} template variable (T426424)
Summary
- Caption (description) column's per-column default value now supports a
{title}template token that resolves per-row to each file's title at apply time. The trailing\s*#\s*$sequence placeholder (T425984) is stripped from the substitution — forward-compatible: the strip is a no-op until T425984 ships. - New chain icon between Title and Caption headers when they sit adjacent in the column order. Click opens Caption's HeaderMenuPopover with the default-value panel pre-expanded and seeded with
{title}(when empty). - New "Insert {title} variable" item in the Caption header dropdown — always-available fallback when the columns are not adjacent. Caption's default-value editor also gets a "Insert {title}" chip and a live preview of the expanded result against a sample row.
Phabricator
- T426424 — Caption column: support {title} variable in default (link Caption ← Title)
Test plan
-
Open the Caption header chevron menu → "Set default value" → type
Photo of {title}→ click "Apply to blank cells" → all blank captions fill withPhoto of <that-row's-title>. -
Pick a row whose title ends with the T425984 sequence placeholder (e.g. set Title to
Sunset over Lake #then re-apply) → caption resolves toPhoto of Sunset over Lake(no trailing#, no trailing whitespace). -
Picking a row whose title is empty → caption resolves to
Photo of(token expands to empty string; rest of the template renders). -
With Title and Caption visible side-by-side in the column order, hover the area between them → chain icon visible at the boundary → click → Caption header menu opens with the default-value editor expanded and
{title}seeded into an empty input. -
Reorder the columns so Title and Caption are NOT adjacent (use the columns modal drag handles) → the chain icon between them is gone → use Caption header chevron → "Insert {title} variable" → default-value panel expands and
{title}is appended to the current default. -
In the Caption default-value editor, type
Photo of {title}→ preview line showsPreview: Photo of <sample row's title>below the input. - No regressions: other columns' default-value editors still behave exactly as before; Caption per-row editing unaffected; "Apply to blanks / selected / overwrite" all four scopes still work for Caption.