Expose vertical writing through the API, MCP, and the agent skill - #19
Open
dani-polani wants to merge 1 commit into
Open
Expose vertical writing through the API, MCP, and the agent skill#19dani-polani wants to merge 1 commit into
dani-polani wants to merge 1 commit into
Conversation
Two fields, both following the existing `rtl` precedent: - `settings.axis` — "rows" (default) or "columns". - `lines[].orientation` — "upright" (default), "vertical", or "sideways". The API only encodes state into a URL, so none of the layout work is involved. `axis` is spelled `layoutAxis` internally, so it is pulled out of the settings spread and mapped by hand; leaving it in would have added a stray key that the compact encoder silently drops, and the feature would have looked wired up while doing nothing. Unknown values are rejected with a named error rather than normalized, which matches how `palette` and `lineStyle` behave. Docs get the naming trap `upper`/`lower` set up: they mean earlier and later in the stack, which is above/below in rows but left/right in columns. Same correction in the MCP tool description, which also said links must be "vertically adjacent". Both now mention that Japanese and Chinese are not segmented for you. OpenAPI, the /api page, and the agent skill get a worked tategaki example. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #18, which shipped column layout in the editor only. This makes it reachable programmatically and from an AI assistant.
What's added
Two fields, both following the existing
rtlprecedent:settings.axis—"rows"(default) or"columns"lines[].orientation—"upright"(default),"vertical", or"sideways"The API only encodes state into a URL, so none of the layout work from #18 is involved here.
One trap worth knowing about
axisis spelledlayoutAxisinternally, and settings were merged with a spread. Left in the spread it would have landed as a stray key that the compact encoder silently drops: the field would have validated, the request would have succeeded, and the diagram would have come back horizontal. It is pulled out and mapped by hand, with a test asserting the decoded state rather than just the accepted input.Unknown values are rejected with a named error instead of being normalized, matching
paletteandlineStyle.Docs
pairs[].upper/lowermean earlier and later in the stack. That is above/below in rows but left/right in columns, and the names now say so on the/apipage. The MCP tool description said links must be "vertically adjacent"; corrected, and both surfaces now state that Japanese and Chinese are not segmented for you. OpenAPI, the/apipage, and the agent skill get a worked tategaki example.Verification
196 tests green (7 added, covering both fields, the decoded state, defaults, and rejection of bad values). Driven end to end: POST to the running API, then the returned URL opened in Chromium — columns present, Japanese stacked, English upright beside it.
Found along the way, not fixed here
/api/ogrenders "NO GLYPH" boxes for any non-Latin script.og-fonts.tsbundles only Inter,loadSystemFontsis off, and the deploy image (node:22-bookworm-slim) has no fonts. This predates vertical writing: the horizontal Japanese example breaks the same way. It affects social cards for every non-Latin gallery page and the inline PNG the MCP tool returns. Left alone deliberately, since the fix is a build-weight tradeoff; tracked separately.🤖 Generated with Claude Code