fix: render whole sections for factory-compiled sites (0.4.2)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alex Dunmow 2026-11-20 02:51:47 +08:00
parent f23ab152d2
commit f65233007f
4 changed files with 26 additions and 7 deletions

View File

@ -0,0 +1,19 @@
# Compiled sites render whole sections on coffee
Decided 2026-11-20 for coffee 0.4.2, from the website factory's visual review (orchestrator WO-094, ADR 0078).
## Context
The website factory compiles a customer's site onto this theme and renders every page at 1280 and 390 pixels wide. The review found template defects that show on a real site as an empty region, an unreadable hero or a page wider than a phone.
## Decision
- rich-section renders one column with the text at a readable width when the section has no image. It used to keep a two-column grid with an empty media cell, so a compiled site whose about or contact section was waiting for a photo showed half the section blank.
- The navbar background is opaque and has no backdrop blur. A backdrop filter makes the navbar the containing block of its fixed mobile drawer, so the hidden drawer widened every page at phone width and could be scrolled into view.
## Consequences
- coffee 0.4.2 is published to the dev registry; the orchestrator's `internal/factory/themes.yaml` pins it.
- No schema field changes. A site that sets the old values renders as before wherever it has an image.
Keywords: coffee, rich-section, media, mediaPosition, empty column, hero, overlayColor, scrim, contrast, navbar, backdrop-blur, bn-navbar-drawer, team columns, WO-094, website factory, render review

View File

@ -2,7 +2,7 @@
name = "coffee"
display_name = "Coffee"
scope = "@themes"
version = "0.4.1"
version = "0.4.2"
description = "Warm, hand-crafted theme for cafes, bakeries, and slow-craft makers — kraft paper, doodle illustrations, and roasted browns."
kind = "theme"
categories = ["templates"]

View File

@ -9,7 +9,7 @@
{% macro dropdown(item) %}<div class="relative group"><button type="button" class="coffee-body inline-flex items-center gap-1 px-3 py-2 text-sm font-medium text-foreground/80 transition-colors hover:text-accent">{{ item.label }}<svg width="16" height="16" class="h-4 w-4 transition-transform group-hover:rotate-180" aria-hidden="true"><use href="/icons/lucide.svg#chevron-down"></use></svg></button><div class="absolute left-0 z-50 mt-1 w-56 invisible opacity-0 transition-all duration-200 group-hover:visible group-hover:opacity-100"><div class="coffee-card py-2 shadow-lg">{% for child in item.children %}{% if child.item_type == "header" %}<div class="coffee-hand px-4 py-2 text-base text-accent">{{ child.label }}</div>{% else %}<a href="{{ child.url|default:'#' }}"{% if child.open_in_new_tab %} target="_blank" rel="noopener"{% endif %} class="coffee-body block px-4 py-2 text-sm text-foreground transition-colors hover:bg-muted {{ child.css_class }}">{{ child.label }}</a>{% endif %}{% endfor %}</div></div></div>{% endmacro %}
{% macro brand(size) %}<a href="/" class="flex flex-shrink-0 items-center gap-2">{% if logoType == "text" and logoText.text %}<span class="coffee-display text-2xl text-primary {{ logoText.color }}">{{ logoText.text }}</span>{% elif logo %}<img src="{{ logo }}" alt="{{ alt|default:companyName }}" class="{{ size }} w-auto"{% if logoMaxWidth or logoMaxHeight %} style="{% if logoMaxWidth %}max-width:{{ logoMaxWidth }};{% endif %}{% if logoMaxHeight %}max-height:{{ logoMaxHeight }};{% endif %}"{% endif %}/>{% elif companyName %}<span class="coffee-display text-2xl text-primary">{{ companyName }}</span>{% endif %}</a>{% endmacro %}
{% macro ctabtn(extra) %}{% if cta_text %}<a href="{{ cta_url|default:'#' }}" class="kraft-tag text-sm {{ extra }}">{{ cta_text }}</a>{% endif %}{% endmacro %}
<nav data-bn-navbar data-bn-sticky="{{ sb }}" class="bn-navbar w-full {% if sb == "sticky" or sb == "shrink-on-scroll" %}sticky top-0 z-40 {% endif %}bg-background/95 backdrop-blur border-b border-dashed border-border {{ class }}">
<nav data-bn-navbar data-bn-sticky="{{ sb }}" class="bn-navbar w-full {% if sb == "sticky" or sb == "shrink-on-scroll" %}sticky top-0 z-40 {% endif %}bg-background border-b border-dashed border-border {{ class }}">
{% if showUtilityBar %}<div class="w-full border-b border-border/60 bg-muted/60 text-xs text-muted-foreground {% if not showOnMobile %}hidden sm:block{% endif %}"><div class="mx-auto flex h-8 max-w-7xl items-center justify-between px-4 sm:px-6 lg:px-8"><div class="coffee-body">{{ utilityBarText|safe }}</div><div class="flex items-center gap-4">{% if utilityBarPhone %}<a href="tel:{{ utilityBarPhone }}" class="hover:text-foreground">{{ utilityBarPhone }}</a>{% endif %}{% if utilityBarEmail %}<a href="mailto:{{ utilityBarEmail }}" class="hover:text-foreground">{{ utilityBarEmail }}</a>{% endif %}</div></div></div>{% endif %}
<div class="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
<div class="bn-navbar-row flex h-16 items-center justify-between">

View File

@ -1,13 +1,13 @@
<section class="py-16 md:py-24 {% if background == "muted" %}bg-muted text-foreground{% elif background == "card" %}bg-card text-card-foreground{% else %}bg-background text-foreground{% endif %}{% if class %} {{ class }}{% endif %}">
<div class="mx-auto grid max-w-6xl items-center gap-10 px-4 md:grid-cols-2 md:gap-16">
<div class="{% if mediaPosition == "left" %}md:order-2{% else %}md:order-1{% endif %}">
<div class="mx-auto grid max-w-6xl items-center gap-10 px-4 {% if media %}md:grid-cols-2{% endif %} md:gap-16">
<div class="{% if mediaPosition == "left" %}md:order-2{% else %}md:order-1{% endif %} {% if not media %}max-w-3xl{% endif %}">
{% if eyebrow %}<p class="coffee-hand text-2xl text-accent">{{ eyebrow }}</p>{% endif %}
{% if heading %}<h2 class="coffee-display mt-1 text-3xl text-primary md:text-4xl"><span class="coffee-doodle-underline">{{ heading }}</span></h2>{% endif %}
{% if body %}<div class="coffee-body mt-4 space-y-4 text-lg text-muted-foreground [&_a]:text-accent [&_a]:underline [&_a]:decoration-dashed [&_strong]:text-primary">{{ body|safe }}</div>{% endif %}
{% if ctaUrl and ctaLabel %}<a href="{{ ctaUrl }}" class="kraft-tag mt-6 text-base px-5 py-3">{{ ctaLabel }}<svg width="16" height="16" class="h-4 w-4" aria-hidden="true"><use href="/icons/lucide.svg#arrow-right"></use></svg></a>{% endif %}
</div>
<div class="{% if mediaPosition == "left" %}md:order-1{% else %}md:order-2{% endif %}">
{% if media %}<div class="coffee-frame coffee-torn-bottom overflow-hidden rounded-sm p-2">{% img media alt=mediaAlt class="h-auto w-full rounded-sm object-cover" %}</div>{% endif %}
</div>
{% if media %}<div class="{% if mediaPosition == "left" %}md:order-1{% else %}md:order-2{% endif %}">
<div class="coffee-frame coffee-torn-bottom overflow-hidden rounded-sm p-2">{% img media alt=mediaAlt class="h-auto w-full rounded-sm object-cover" %}</div>
</div>{% endif %}
</div>
</section>