Skip to content

feat: json column type, structured example cells, syntax highlighting - #33

Merged
damusix merged 1 commit into
mainfrom
worktree-json-column-type
Aug 22, 2026
Merged

feat: json column type, structured example cells, syntax highlighting#33
damusix merged 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, structured example values finally render, and code gets highlighted.

Two 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 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 {.

Two shiki entry points, not one. Grammars are static imports no bundler can tree-shake, so a shared six-language module would put ~620KB in the browser bundle. Body markdown reaches the client as already-rendered bodyHtml, so the six languages live on the parse side and the browser needs json alone: 4.22MB → 4.36MB. Both use the JavaScript raw engine — the default Oniguruma engine loads a WASM blob that would break the single-file export and its zero-network guarantee.

Modal now keeps a stack and answers ESC only in its top-most instance; without it, a dialog opened from inside another closed both.

Body code fences had never been highlighted — markdown-it was constructed with no highlight option. The skill also warns off json as a normalization escape hatch: a fixed set of known fields is columns, a repeating group is a child entity.

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 licenses parsing a *string* as a document; nested values are
recognised unconditionally, so an author who omits `json` still gets a
readable cell. Entity and process tables share one ExampleCell.

Modal keeps a stack and answers ESC only in its top-most instance — without
that, a dialog opened from inside another closed both.

Code fences were rendering as plain preformatted text; markdown-it was
constructed with no highlight option. Two shiki entry points rather than one
shared module: grammars are static imports that no bundler can tree-shake, so
a single module carrying all six languages would put ~620KB in the browser
bundle. Body markdown reaches the client as already-rendered bodyHtml, so the
six-language set lives on the parse side and the browser needs json alone —
4.22MB -> 4.36MB.

Both run the JavaScript raw engine over precompiled grammars. The default
Oniguruma engine loads a WebAssembly blob, which would break the single-file
export and its zero-network guarantee. defaultColor:false leaves both theme
values on every token so styles.css resolves them off the existing .theme-*
class, keeping code blocks on the in-app toggle rather than the OS scheme.
@damusix
damusix force-pushed the worktree-json-column-type branch from 1e93d92 to 312ddc5 Compare August 21, 2026 23:11
@damusix damusix changed the title feat: accept json as a column type, render structured example values feat: json column type, structured example cells, syntax highlighting Aug 21, 2026
@damusix
damusix merged commit 8dd5503 into main Aug 22, 2026
2 checks passed
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