Unified diff view computed server-side via Python difflib. Added lines have a green left border and fade-in background; removed lines have red. Unchanged context lines are neutral. Optional line numbers, language badge, and title. No JavaScript required — diff is computed at render time, not in the browser.
| Surface | Note |
|---|---|
| googlechat | Renders as plain monospace text block; no colour highlighting. |
| Renders as a static diff without colour; additions and removals shown with +/- prefix only. |
| Field | Type | |
|---|---|---|
| old_code | string. The original text (before state). | required |
| new_code | string. The updated text (after state). | required |
| label | string. Title shown in the header bar. | optional |
| language | string. Language badge shown in header, e.g. "python", "typescript". | optional |
| show_line_numbers | bool. Show line numbers. Default true. | optional |
| context_lines | integer. Unchanged lines shown around each change. Default 3. | optional |
{
"type": "code_diff",
"old_code": "Old code",
"new_code": "New code"
}
{
"identifier": "urn:air:a2uicatalog.ai:atom:code_diff",
"displayName": "Code Diff",
"type": "application/vnd.a2ui.atom+json",
"url": "https://a2uicatalog.ai/atoms/code_diff",
"capabilities": [
"web",
"meet-stage",
"gas-sidebar",
"apps-script-web"
],
"description": "Unified diff view computed server-side via Python difflib. Added lines have a green left border and fade-in background; removed lines have red. Unchanged context lines are neutral. Optional line numbers, language badge, and title. No JavaScript required \u2014 diff is computed at render time, not in the browser.",
"representativeQueries": [
"show a server-side unified diff view with green additions and red removals",
"unified diff view computed server-side via python difflib. added lines have a green left border and",
"render a code diff"
]
}
The renderer is open source. Deploy your own instance in 4 commands — you own the URL, no dependency on the demo endpoint.
git clone https://github.com/a2uicatalog/a2ui
cd apps-script-surface/gas-schema-renderer
clasp push && clasp deploy
Full deploy guide →