Skip to content

feat: mobile auto-reflow becomes opt-in per artifact ([Q2]) - #435

Draft
an1va wants to merge 1 commit into
mainfrom
feat/reflow-opt-in
Draft

feat: mobile auto-reflow becomes opt-in per artifact ([Q2])#435
an1va wants to merge 1 commit into
mainfrom
feat/reflow-opt-in

Conversation

@an1va

@an1va an1va commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Split out of #430 (3 of 3). DRAFT on purpose: this one is a product call and can be closed freely without affecting the other two.

Today every viewport-less HTML page is auto-reflowed at serve time (viewport injection + overflow reset). This flips it to opt-in:

  • reflow column on artifact (0/1, default 0), set at publish (reflow:true in MCP/REST publish).
  • Byte-faithful serving becomes the default for viewport-less pages; reflow:true restores today's mobile-friendly transform per artifact.
  • Plus an extension-mismatch advisory at publish (bytes look like a full HTML document but the filename says otherwise).

The trade, stated plainly: this is RETROACTIVE for existing content. Already-published viewport-less pages render zoomed-out on phones after deploy (no backfill), and owners must republish with reflow:true to restore the old behavior. More faithful to the stored bytes, but a silent visible change for existing artifacts. If we ship it, it needs a release note; grandfathering (a one-time backfill setting reflow=1 on pre-deploy artifacts) is the alternative if we want zero surprise.

Migration is safe on all three dialects (constant-default ADD COLUMN, schema-before-code on D1). 942 tests green including the rewritten reflow-serve suite.

🤖 Generated with Claude Code

…advisory

Byte-faith wins: a viewport-less HTML page now serves EXACTLY as authored
by default — no injected viewport tag, no CSS caps. Publishers who want
Derive's conservative mobile fixes opt in with reflow=true at publish
(stored as artifact.reflow, set-on-create like the access triple; the
detection gate still applies, so an opted-in page that later declares its
own viewport is left alone). All three serve surfaces honor the flag: the
/raw sandbox, proposal previews, and domain-mode hosts.

The publish advisory now nudges instead of narrating a mutation: "phones
will render this zoomed-out — add a viewport meta (best), or republish
with reflow:true." And the second half of the retype-incident class gets
its advisory: content that IS a full HTML document but was explicitly
filenamed .md (so it will render as escaped source) now says so at
publish time, completing what #416's content sniffer did for the
filename-less path.

Schema: artifact.reflow integer 0/1 default 0, shared drizzle defs →
auto-generated DDL in all three dialects, d1-schema regenerated, OpenAPI
snapshot + web api-types regenerated.

Tests: the reflow-serve e2e suite rewritten around the flip (default =
byte-faithful, opt-in = injection, detection still gates, markdown
untouched); advisory tests updated + two new mismatch cases (a full HTML
doc typed markdown flags; markdown with inline html fragments does not).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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