Skip to main content

max / makeover-layout

Drop Fill::fallback: substitution is renderer policy The second renderer found it within a day. Fill::Well falling back to Fill::Page is right for a renderer that can always paint an exact colour and wrong for a terminal, where the page is usually the surface a well is cut into and the two quantise onto one entry. The fallback would produce exactly the invisibility it was added to prevent. The description says what a region is and stops. makeover-immediate keeps the substitution it wants; makeover-tui answers the same intent with a drawn edge instead. This is what building the second renderer early is for. makeover-geometry recorded the API window shutting 48 hours after five adoptions landed; this closed before the first adoption of the vocabulary went anywhere.
Author: Max Johnson <me@maxj.phd> · 2026-07-28 21:31 UTC
Signed with PGP, not checked
Commit: 437eefded4217090c1f228dba45a85e16e4d6d83
Parent: 5bedb80
1 file changed, +10 insertions, -26 deletions
M src/lib.rs +10 -26
@@ -121,6 +121,16 @@
121 121 Well,
122 122 }
123 123
124 + // No `fallback` here, deliberately. An earlier cut had `Fill::Well` fall back
125 + // to `Fill::Page` so a consumer on makeover 2.2.0, which has no `surface-well`,
126 + // had something to paint. makeover-tui found that wrong within a day: page is
127 + // the surface a well is usually cut into, so on a terminal that substitution
128 + // produces exactly the invisibility it was meant to prevent, and the right
129 + // answer there is a drawn edge rather than a different colour.
130 + //
131 + // Substituting one intent for another is renderer policy. The description says
132 + // what the region is and stops.
133 +
124 134 impl Intent for Fill {
125 135 fn token(self) -> &'static str {
126 136 match self {
@@ -132,25 +142,6 @@
132 142 }
133 143 }
134 144
135 - impl Fill {
136 - /// What to use where [`Fill::token`] is not available yet.
137 - ///
138 - /// `surface-well` is derived by makeover 2.3.0, which is bumped in-tree
139 - /// and not published, so consumers on 2.2.0 have no such token. A well
140 - /// filled `surface-page` is what audiofiles ships today and is close
141 - /// enough to read as recessed; it is wrong only in that it does not track
142 - /// the raised surface it was cut from.
143 - ///
144 - /// Delete this once 2.3.0 is published and the three consumers adopt it.
145 - #[must_use]
146 - pub const fn fallback(self) -> Option<Self> {
147 - match self {
148 - Self::Well => Some(Self::Page),
149 - _ => None,
150 - }
151 - }
152 - }
153 -
154 145 /// How a region sits relative to the surface behind it.
155 146 ///
156 147 /// Fill and bevel are named together because naming them apart is what let
@@ -262,11 +253,4 @@
262 253 }
263 254 }
264 255
265 - #[test]
266 - fn only_the_well_needs_a_fallback() {
267 - assert_eq!(Fill::Well.fallback(), Some(Fill::Page));
268 - for f in [Fill::Page, Fill::Raised, Fill::Overlay] {
269 - assert_eq!(f.fallback(), None);
270 - }
271 - }
272 256 }