Skip to content

feat: accept json as a column type, render structured example values - #33

Open
damusix wants to merge 1 commit into
mainfrom
worktree-json-column-type
Open

feat: accept json as a column type, render structured example values#33
damusix wants to merge 1 commit into
mainfrom
worktree-json-column-type

Conversation

@damusix

@damusix damusix commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

json joins the column-type vocabulary, and structured example values finally render.

Two independent triggers, deliberately. A nested YAML value is recognised on any column, so an author who never declares json still gets a readable cell instead of [object Object]. Declaring json/jsonb additionally licenses parsing a value written as a quoted JSON string — the declared type is the only thing that can distinguish a document from text that happens to start with {.

The expander's dialog is always stacked, which covers both callers without either knowing where it sits: from the dictionary it is the only dialog on screen, from an entity or process dialog it layers over the opener. That required giving Modal a stack — every instance listens for ESC on document, so previously a nested dialog would have dismissed its opener along with itself.

The skill now warns off json as a normalization escape hatch: a fixed set of known fields is columns, a repeating group is a child entity.

models/key-inherited gains a live example — PaymentMethod.details, whose shape genuinely differs per method type, with one null row.

Example cells went through String(value), so any nested value rendered as
"[object Object]" — the frontmatter format accepted structured data that no
surface could display. A structured cell now shows a truncated monospace
preview with an expander that opens the pretty-printed document.

The declared type is what licenses parsing a *string* as a document; nested
values are recognised unconditionally, so an author who omits `json` still
gets a readable cell.

Modal keeps a stack and answers ESC only in its top-most instance — without
that, a dialog opened from inside another closed both.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant