Repository navigation
feat(templates): add Code Comment quote template - #236
Merged
Merged
Conversation
A quote shown as a block comment in an editor-style panel: /** on the first line, each wrapped line of the quote after ' * ', the author as ' * @author Name' and ' */' to close, in JetBrains Mono. A file name tab sits above the panel. An empty author hides the @author line and an empty file name hides the tab. Lines are wrapped by hand because every wrapped line needs its own ' * '. The font is fixed width, so the line length comes from the text size. Closes codercops#222
anurag629
approved these changes
Oct 23, 2026
This was referenced Oct 26, 2026
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.
What and why
Adds the Code Comment quote template (
quote-code-comment), for developer quotes shared like a snippet. The quote is a block comment in an editor-style panel:All in JetBrains Mono. The comment markers use a muted colour, the quote the text colour and
@authorthe accent colour. A small file name tab ("quote.ts") sits above the panel.*. The lines are wrapped in the template itself (Satori's own wrapping can't add the*). JetBrains Mono is fixed width (0.6 em per character), so the line length comes straight from the text size. A single word longer than a line is split.…, and if a quote has so many short lines that it still can't fit, the last line that fits ends in….@authorline; an empty or blankfileNamehides the tab (and the panel's top-left corner becomes round).*.Fields:
quote(textarea),author,fileName(defaultquote.ts),bgColor,accentColor,textColor. Re-exported insrc/templates/quote/index.tsand registered at the end of the Quote block insrc/templates/registry.ts.Closes #222
How I tested this
tests/templates/quote-code-comment.test.ts(54 tests): the default comment, the tab, wrapping (every line starts with*, lines read back as the same quote, line length fits the panel, a long word is split, line breaks and blank lines, CRLF and lone CR, tabs and runs of spaces), long quotes and the row cap, hiding the author and the tab, odd input (empty, blank, numbers,null, text that looks like a comment), layout (1200x630, JetBrains Mono, display flex on every div, no grid, deterministic), and contrast for the quote, the@authorline, the markers and the file name on five colour setups (dark, white, white with a pale accent, cream with a dark accent, dark with a dark accent).*prefix, author always shown, tab always shown, wrong character width, no truncation, no word split, dropped blank lines, no row cap, no accent adjustment, faint markers, panel the same colour as the page, noprewhite-space, square corner always, no space collapsing, no CR handling, author not shortened). All were caught. One (the\rhandling) survived at first, because Windows line breaks are cleaned up by the trim anyway, so I added a lone-CR test./create/quote?template=quote-code-comment) with Chrome: the template shows in the gallery with its thumbnail, the live preview updates as I edit the quote, author and file name, and Download PNG gives a 1200x630 PNG that matches the preview. No console errors or warnings. The screenshots below are from the server image API (/api/og).npm run check(0 errors, 0 warnings, same hints asdev), and the full suite: 1095/1095.AI assistance
An AI coding assistant helped write the template and the tests. I read through it, ran the checks above myself and looked at every rendered image.
Screenshots
Default colours
White background
White background, pale accent
Long quote, wrapped
No author, no file name
Line breaks, other file name
Checklist
width: '1200px', height: '630px'divhasdisplay: 'flex', inline styles only, flexbox onlyMath.random()or dates inrenderdescriptionand 5 tagscommonFields(author, bgColor, accentColor, textColor)dev, includes screenshots, saysCloses #222