Update comic rendering pipeline#24
Open
elasticdotventures wants to merge 5 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR expands the scripted SVG comic pipeline to support richer per-panel metadata (scene/beat/visual focus/expression/cameos), improves prompt planning via scenario + improv menus, and surfaces more provenance (model selection) through the voting UX/API.
Changes:
- Add structured script metadata (scene/beat/visualFocus/expression/cameo) and use it in both prompting and SVG rendering (new backdrops, faces/expressions, and new characters).
- Update workflow planning to generate scenario setups + shared improv menus, and to select script models from an env-configurable lineup.
- Improve the web terminal integration and voting UX (model reveal after voting) with corresponding API contract updates.
Reviewed changes
Copilot reviewed 14 out of 16 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
wrangler.toml |
Replaces A/B script model vars with a configurable SCRIPT_MODEL_LINEUP list. |
src/types/vue-web-terminal.d.ts |
Adds proper Vue Plugin default export typing for vue-web-terminal. |
src/main.ts |
Switches to Terminal plugin default export and makes the terminal websocket URL configurable via env. |
src/components/TheXTerm.vue |
Adds focus-on-pointerdown, normalizes comic enable commands, and refactors activity listeners/connection bootstrapping. |
src/components/ComicViewer.vue |
Stores and displays the selected model after a vote. |
scripts/test-api-contracts.mjs |
Extends contract assertions for vote responses and workflow plan shape. |
functions/lib/svg-renderer.ts |
Major renderer upgrade: scene backdrops, expression-aware faces, cameos, and new characters (tux/python/kube_captain). |
functions/lib/svg-prompt-generator.ts |
Updates prompt phrasing/style guide toward xkcd-like B/W line art + props. |
functions/lib/local-bootstrap-comic.ts |
Updates bootstrap scripts to use new per-panel metadata and new characters. |
functions/lib/ledgrrr-wasm/ledger_workflow_wasm_bg.wasm.types.txt |
Adds wasm type dump artifact file. |
functions/lib/ledgrrr-wasm/index.ts |
Fixes import to reference the generated .js module. |
functions/lib/comic-generator.ts |
Adds new panel fields/types, improv menu support, sanitizers, and richer prompt rules. |
functions/lib/cast.ts |
Extends CastCharacter with optional behavior/idea/drawable metadata. |
functions/lib/agentic-comic-workflow.ts |
Adds scenario/improv planning, broader topic generation, and script-model lineup selection. |
functions/api/vote.ts |
Returns {selected: {variant, model}} in vote response by reading model_a/model_b from DB. |
cast/characters.ts |
Enriches existing cast metadata and adds new characters (tux/python/kube_captain). |
Comments suppressed due to low confidence (3)
functions/lib/comic-generator.ts:409
- These heuristic scene regexes are missing grouping around the alternation, so the
\bboundary only applies to the first alternative (e.g.,\bwhiteboardORdiagramOR ...). This can misclassify scenes based on partial/accidental matches. Wrap alternatives in a non-capturing group and add a trailing boundary where appropriate (e.g.,\b(?:whiteboard|diagram|arrow|...)\b).
const hint = `${action || ''} ${dialogue || ''} ${robotThought || ''}`.toLowerCase();
if (/\bwhiteboard|diagram|arrow|architecture|box|flow|schema|chart\b/.test(hint)) return 'whiteboard';
if (/\bincident|outage|pager|status|sev|war room|rollback|postmortem\b/.test(hint)) return 'incident_room';
if (/\bmeeting|standup|roadmap|kpi|slide|stakeholder|executive\b/.test(hint)) return 'meeting';
if (/\bdns|tcp|packet|cache|cdn|api|queue|service|network\b/.test(hint)) return 'network';
src/components/TheXTerm.vue:202
- Event bus handlers are registered on mount (
emitter.on(...)) but never unregistered on unmount. If this component is remounted (navigation/HMR), it will accumulate duplicate listeners and push duplicate terminal messages. Addemitter.off('webSocket.open', handleMessage)/emitter.off('webSocket.onMessage', handleMessage)inonUnmounted().
onMounted(() => {
// Don't start idle timer here - wait for terminal initialization
emitter.on("webSocket.open", handleMessage);
emitter.on("webSocket.onMessage", handleMessage);
functions/lib/svg-renderer.ts:1343
roughPolyline()is introduced here but never used in this module, which increases maintenance surface area and makes it harder to tell which helpers are part of the renderer pipeline. If it's not needed, remove it; if it is, wire it into the relevant drawing paths and add a brief usage comment.
function roughPolyline(points: Point[], rng: () => number, controls: SketchControls): Point[] {
const roughPoints: Point[] = [];
for (let index = 0; index < points.length - 1; index += 1) {
const segment = roughLinePoints(points[index], points[index + 1], rng, controls, 4, 0.06);
if (index > 0) segment.shift();
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
303
to
307
| assert.equal(response.status, 200); | ||
| let payload = await readJson(response); | ||
| assert.deepEqual(payload.votes, { a: 1, b: 0 }); | ||
| assert.deepEqual(payload.selected, { variant: 'a', model: '@cf/model-a' }); | ||
|
|
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Brian Horakh <35611074+elasticdotventures@users.noreply.github.com>
Deploying promptexecutionwebsite with
|
| Latest commit: |
c121a93
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://161c96ee.promptexecutionwebsite.pages.dev |
| Branch Preview URL: | https://feature-comic-rendering-pipe.promptexecutionwebsite.pages.dev |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Brian Horakh <35611074+elasticdotventures@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Brian Horakh <35611074+elasticdotventures@users.noreply.github.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.
No description provided.