Skip to content

Commit 23dcc34

Browse files
authored
Merge pull request #1 from lordvins226/feat/image-block
feat(quoteforge[image-block]): inline image block with positioning
2 parents 165a276 + f5f5e1d commit 23dcc34

31 files changed

Lines changed: 1218 additions & 8 deletions

content/image-demo.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"template": "quote",
3+
"theme": "dark-teal",
4+
"size": "twitter",
5+
"blocks": [
6+
{ "type": "headline", "parts": [{ "text": "Image block demo", "style": "bold" }] },
7+
{ "type": "image", "src": "./logo.svg", "width": "md", "align": "center", "alt": "Logo" },
8+
{ "type": "text", "content": "Local SVG resolved to a data-URI at render time." }
9+
]
10+
}

content/image-demos/align.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"template": "quote",
3+
"theme": "dark-teal",
4+
"size": "twitter-square",
5+
"blocks": [
6+
{ "type": "headline", "parts": [{ "text": "Alignment", "style": "bold" }] },
7+
{ "type": "image", "src": "./photo.svg", "width": "sm", "align": "left", "alt": "left" },
8+
{ "type": "image", "src": "./photo.svg", "width": "sm", "align": "center", "alt": "center" },
9+
{ "type": "image", "src": "./photo.svg", "width": "sm", "align": "right", "alt": "right" }
10+
]
11+
}

content/image-demos/card.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"template": "quote",
3+
"theme": "dark-teal",
4+
"size": "instagram-port",
5+
"blocks": [
6+
{ "type": "image", "src": "./photo.svg", "width": "full", "align": "center", "alt": "Sunset over the hills" },
7+
{ "type": "headline", "parts": [
8+
{ "text": "Ship ", "style": "normal" },
9+
{ "text": "small", "style": "accent" },
10+
{ "text": ", ship often.", "style": "normal" }
11+
] },
12+
{ "type": "text", "content": "An image block sits inline with the rest of the card flow." }
13+
]
14+
}

content/image-demos/photo.svg

Lines changed: 16 additions & 0 deletions
Loading

content/image-demos/widths.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"template": "quote",
3+
"theme": "dark-teal",
4+
"size": "twitter-square",
5+
"blocks": [
6+
{ "type": "headline", "parts": [{ "text": "Widths", "style": "bold" }] },
7+
{ "type": "image", "src": "./photo.svg", "width": "sm", "align": "center", "alt": "small" },
8+
{ "type": "image", "src": "./photo.svg", "width": "md", "align": "center", "alt": "medium" },
9+
{ "type": "image", "src": "./photo.svg", "width": "lg", "align": "center", "alt": "large" },
10+
{ "type": "image", "src": "./photo.svg", "width": "full", "align": "center", "alt": "full" }
11+
]
12+
}

content/logo.svg

Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# ADR 0001 — Inline image block: scope and deferred capabilities
2+
3+
- Status: Accepted
4+
- Date: 2026-06-22
5+
- Related spec: [docs/specs/2026-06-22-image-block-design.md](../specs/2026-06-22-image-block-design.md)
6+
7+
## Context
8+
9+
Users need to include images in cards and decks and control their placement. The
10+
rendering pipeline is a vertical flow of typed blocks (`headline`, `divider`,
11+
`spacer`, …) defined by a single Zod discriminated union and rendered through
12+
per-type Nunjucks partials. Several image models are possible — inline (flow),
13+
background, and free/absolute positioning — with increasing complexity.
14+
15+
## Decision
16+
17+
Ship V1 as an **inline image block** only: a new member of the block union that
18+
flows in block order, with `align` (left/center/right), `width` (sm/md/lg/full),
19+
and `alt`. Source may be a remote URL, a local file path (CLI), or a data-URI;
20+
resolution to a Puppeteer-loadable `src` happens server-side, never in React.
21+
22+
## Deferred (explicitly out of scope for V1)
23+
24+
Each is recorded so the boundary is intentional, not an oversight:
25+
26+
1. **Rounded corners / border** — needs theme-driven color custom properties
27+
(CLAUDE.md #3) and a border-radius scale; purely cosmetic, no blocker.
28+
2. **Caption text** — a themed sub-text under the image; adds a styling surface and
29+
another field; revisit once inline images are in real use.
30+
3. **Background image** — a different layout model (image behind the card with an
31+
overlay for legibility); separate schema shape and CSS path. Worth its own spec.
32+
4. **Absolute (x/y) positioning + drag-to-place** — the most flexible and most
33+
complex model; requires coordinate storage, overlap/z-index rules, and dnd-kit
34+
work in the studio. Deferred until there is demonstrated need.
35+
36+
## Consequences
37+
38+
- The schema, template, and studio changes stay small and follow existing patterns,
39+
keeping V1 low-risk and quick to review.
40+
- Each deferred capability is additive: rounded corners and caption extend the same
41+
block; background and absolute positioning are new models that should get their
42+
own ADR + spec rather than being bolted onto the inline block.
43+
- If a deferred item is later picked up, supersede or extend this ADR rather than
44+
silently widening the inline block's responsibilities.

0 commit comments

Comments
 (0)