Accent Components

Location select

Where a thing lives, chosen from the tree — display titles, indent as nesting, never a typed path.


Where a thing lives, chosen from the structure: CmsLocationSelect (src/components/CmsLocationSelect.tsx) is the system location select. Any surface that asks "which folder is the parent?" renders it — the field editor's Location control today, every future parent picker the same way.

It codifies a standing rule: nesting is chosen, never typed. A folder gets a flat name; where it lives is a separate act, picked from the site's existing structure. No slashes, no free-text paths.

What it renders

A native select whose options are the container tree, not a flat list of slug paths:

  • Top level first(top level), value ''.
  • Parents before children, depth-first, siblings ordered by label.
  • Display titles, not slugs — the labelFor prop threads the lane's containerDisplayTitle, so a retitled folder reads as its title.
  • Nesting by indent — a child renders indented under its parent instead of spelling the path.
  • Ancestors a child implies are materialized even when only the child is registered, so the hierarchy never has holes.

Closed, the control shows only the chosen node's title — so beneath it the component prints the titled path ("Components / anchor"), and a leaf name shared by two branches still says which one it is.

Props

Prop Says
value / onChange The chosen location; '' is top level.
paths The lane's registered container paths. The current value rides along, so a location only its children registered still shows as itself.
labelFor Path → display title. Leaf segment without it.
topLevelLabel Replaces (top level) when the lane says it differently.

The tree ordering itself lives beside the folder-authoring lane (folderTreeOptions in src/lib/folderChoice.ts), so the select and the dialogs draw from one builder.

The holdout

The Move… dialog still lists flat full paths through the generic dialogs system. It shares the registry and the authoring rules, but not yet this rendering — converging it onto the tree grammar is the known next step.