Skip to content

v0.1.4 - one degradation function, not three copies

Choose a tag to compare

@DDDMUC DDDMUC released this 09 Oct 14:11
· 1 commit to main since this release

The degradation paths are one function now, not three copies.

"Composition failed", "the host projection threw" and "the last resort" each carried their own copy of
the fallback logic - one called the host projection, one inlined plain text - so three places had to be
kept in sync by hand. There is only degradedBody() now: it tries the host's own projection first
(which keeps reference chips and the rest of the host rendering), and falls back to plain text only if
the projection throws too. Content-first is part of the function's contract: plain text is the last
step, reached only when the host itself refuses to project.

New regression: projectUserText is called exactly once in the whole repo, the plain-text span is
constructed in exactly one place, and every degradation caller goes through the same function -
writing a second degradation copy turns the test red.