feat: mobile auto-reflow becomes opt-in per artifact ([Q2]) - #435
Draft
an1va wants to merge 1 commit into
Draft
Conversation
…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>
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.
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:
reflowcolumn on artifact (0/1, default 0), set at publish (reflow:truein MCP/REST publish).reflow:truerestores today's mobile-friendly transform per artifact.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:trueto 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 settingreflow=1on 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