Problem
Frontmatter fields in the editor are all free-text. For controlled fields — tags, type, context — that means typos and quiet drift, and there's no way to see the allowed values while editing. Re-typing a known vocabulary by hand defeats the point of having one.
Proposal
Let a folder declare allowed values per field, and have the editor render a dropdown instead of a text input.
Declaration in the existing .ok/frontmatter.yml (new, optional _schema block):
_schema:
type:
enum: [note, person, project, concept]
tags:
type: list
enum: [docs, internal, wip]
folder-config-get returns this as frontmatter_schema.
FrontmatterRow routes a field that has an enum to a new SelectWidget (reusing the existing Radix <Select>): single-select for scalars, multi-select for list/tags.
- No declaration → unchanged free-text. Fully backward-compatible.
Why this shape
- Reuses what's already there — the Radix
Select, and the {type:'enum', values} pattern you already use for MDX component attributes.
- Folder-scoped, so each area defines its own vocabulary.
- Additive: no change to the existing frontmatter types.
Happy to implement it if the design works for you — including where you'd prefer the declaration to live (.ok/frontmatter.yml vs a separate .ok/schema.yml).
Problem
Frontmatter fields in the editor are all free-text. For controlled fields —
tags,type,context— that means typos and quiet drift, and there's no way to see the allowed values while editing. Re-typing a known vocabulary by hand defeats the point of having one.Proposal
Let a folder declare allowed values per field, and have the editor render a dropdown instead of a text input.
Declaration in the existing
.ok/frontmatter.yml(new, optional_schemablock):folder-config-getreturns this asfrontmatter_schema.FrontmatterRowroutes a field that has an enum to a newSelectWidget(reusing the existing Radix<Select>): single-select for scalars, multi-select forlist/tags.Why this shape
Select, and the{type:'enum', values}pattern you already use for MDX component attributes.Happy to implement it if the design works for you — including where you'd prefer the declaration to live (
.ok/frontmatter.ymlvs a separate.ok/schema.yml).