Skip to content

feat(media): flow_diagram renders 16:9 by default, scales to fit#2900

Merged
chubes4 merged 1 commit into
mainfrom
feat/flow-diagram-preset-canvas
Jul 13, 2026
Merged

feat(media): flow_diagram renders 16:9 by default, scales to fit#2900
chubes4 merged 1 commit into
mainfrom
feat/flow-diagram-preset-canvas

Conversation

@chubes4

@chubes4 chubes4 commented Jul 13, 2026

Copy link
Copy Markdown
Member

Summary

  • Follow-up to feat(media): add brand-agnostic flow_diagram core template #2898. The flow_diagram template used to size its canvas to content, producing a thin banner that's awkward as a blog featured image or social share.
  • It now renders onto a fixed target canvas and centers the diagram within it. The default is a 16:9 card (twitter_card, 1200x675).
  • The diagram grid scales down uniformly to fit the canvas (nodes, gaps, margins, fonts, corner radii all scale together), so it stays proportional and readable.
  • Callers can override with preset (any PlatformPresets key) or explicit width/height. Very wide horizontal flows grow the canvas rather than clip.

Why

A generic diagram primitive should produce a correctly-proportioned image out of the box, not a strip you have to pad by hand. 16:9 is the sensible default for the most common use (featured images, social cards).

Test plan

  • Smoke test extended: asserts the default render is exactly 1200x675 (16:9) and that a preset=open_graph override yields 1200x630. 15/15 assertions pass locally on PHP 8.3.6.
  • Verified visually with the OAuth-flow diagram at the default canvas.

Notes

  • resolve_canvas() precedence: explicit width/height → preset → default preset.
  • Uses floor() on scaled metrics so scaled content never overflows the target by a rounding pixel (canvas dimensions stay exact).

The template previously sized the canvas to content, producing a thin
banner that's awkward as a featured image. It now renders onto a fixed
target canvas (default: 16:9 twitter_card 1200x675) and centers the
diagram within it, scaling the grid down uniformly to fit. Callers can
override with 'preset' or explicit width/height; very wide flows still
grow the canvas rather than clip.

Smoke test extended to assert the 16:9 default and preset override.
@chubes4 chubes4 force-pushed the feat/flow-diagram-preset-canvas branch from dca15be to c8a2750 Compare July 13, 2026 21:52
@homeboy-ci

homeboy-ci Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Homeboy Results — data-machine

Lint

review lint — passed

ℹ️ Full options: homeboy self docs commands/lint
Deep dive: homeboy review lint data-machine --changed-since dba3b9d

Artifacts and drill-down
  • CI results artifact: homeboy-ci-results-data-machine-review-lint-quality-Linux-node24 contains immediate command JSON for this action invocation.
  • Observation artifact: homeboy-observations-data-machine-review-lint-quality-Linux-node24 contains exported Homeboy run history for deeper queries.
  • Drill-down: download the observation artifact, then run homeboy runs import <dir>, homeboy runs list, and homeboy runs findings <run-id>.
  • Artifacts are attached to the workflow run: https://github.com/Extra-Chill/data-machine/actions/runs/29287922059

Test

review test — passed

ℹ️ Auto-fix lint issues: homeboy refactor data-machine --from lint --write
ℹ️ Collect coverage: homeboy test data-machine --coverage
ℹ️ Save test baseline: homeboy test data-machine --baseline
ℹ️ Pass args to test runner: homeboy test -- [args]
ℹ️ Full options: homeboy self docs commands/test
Deep dive: homeboy review test data-machine --changed-since dba3b9d

Artifacts and drill-down
  • CI results artifact: homeboy-ci-results-data-machine-review-test-quality-Linux-node24 contains immediate command JSON for this action invocation.
  • Observation artifact: homeboy-observations-data-machine-review-test-quality-Linux-node24 contains exported Homeboy run history for deeper queries.
  • Drill-down: download the observation artifact, then run homeboy runs import <dir>, homeboy runs list, and homeboy runs findings <run-id>.
  • Artifacts are attached to the workflow run: https://github.com/Extra-Chill/data-machine/actions/runs/29287922059

Audit

review audit — passed

  • audit — 45 finding(s)
  • Total: 45 finding(s)

Deep dive: homeboy review audit data-machine --changed-since dba3b9d

Artifacts and drill-down
  • CI results artifact: homeboy-ci-results-data-machine-review-audit-quality-Linux-node24 contains immediate command JSON for this action invocation.
  • Observation artifact: homeboy-observations-data-machine-review-audit-quality-Linux-node24 contains exported Homeboy run history for deeper queries.
  • Drill-down: download the observation artifact, then run homeboy runs import <dir>, homeboy runs list, and homeboy runs findings <run-id>.
  • Artifacts are attached to the workflow run: https://github.com/Extra-Chill/data-machine/actions/runs/29287922059
Tooling versions
  • Homeboy CLI: homeboy 0.283.1+10b6335515eb+c8a27502
  • Extension: wordpress from https://github.com/Extra-Chill/homeboy-extensions
  • Extension revision: 40f77e42
  • Action: unknown@unknown

@chubes4 chubes4 merged commit c3d3ae2 into main Jul 13, 2026
5 checks passed
@chubes4 chubes4 deleted the feat/flow-diagram-preset-canvas branch July 13, 2026 21:55
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