max / makeover-geometry
- Co-Authored-By
- Claude Opus 5 (1M context) <noreply@anthropic.com>
1 file changed,
+24 insertions,
-6 deletions
| @@ -1580,16 +1580,34 @@ | |||
| 1580 | 1580 | } | |
| 1581 | 1581 | ||
| 1582 | 1582 | #[test] | |
| 1583 | - | fn size_class_does_not_reach_the_gap_scale() { | |
| 1584 | - | // Deliberately absent, asserted so that wiring it in has to come here | |
| 1585 | - | // and say so. Whether a compact window tightens its shells is a look | |
| 1586 | - | // call; deriving it is what went wrong with Touch on 2026-07-29. | |
| 1583 | + | fn the_gap_scale_is_reachable_without_naming_a_size_class() { | |
| 1584 | + | // This was size_class_does_not_reach_the_gap_scale, a tripwire holding | |
| 1585 | + | // the axis unwired: "asserted so that wiring it in has to come here and | |
| 1586 | + | // say so". Saying so, 2026-08-09 — it is wired, Max ruled it, and the | |
| 1587 | + | // reasoning is in the docs on Gap::step_at_size. | |
| 1587 | 1588 | // | |
| 1588 | - | // This test does not check a value. It checks that the whole spacing | |
| 1589 | - | // layer is reachable without naming a size class at all. | |
| 1589 | + | // What survives is the half that was always the real assertion: the | |
| 1590 | + | // whole spacing layer stays reachable without naming a size class. A | |
| 1591 | + | // caller that has no idea how wide the window is still gets an answer, | |
| 1592 | + | // and it is the wide-window one. Only step_at_size asks. | |
| 1590 | 1593 | let _ = geometry_css_vars(Density::Pointer); | |
| 1591 | 1594 | let _ = Gap::Page.px_at(Density::Touch); | |
| 1592 | 1595 | assert_eq!(SizeClass::all().len(), 3); | |
| 1596 | + | ||
| 1597 | + | // The tripwire's other half, kept as a real check now that there is | |
| 1598 | + | // something to check: no size class may reach the four control gaps. | |
| 1599 | + | // That is the line whose crossing would be the 2026-07-29 bug again. | |
| 1600 | + | for gap in [Gap::Bound, Gap::Peer, Gap::Group, Gap::Section] { | |
| 1601 | + | for class in SizeClass::all() { | |
| 1602 | + | for density in [Density::Pointer, Density::Touch] { | |
| 1603 | + | assert_eq!( | |
| 1604 | + | gap.step_at_size(density, class), | |
| 1605 | + | gap.step_at(density), | |
| 1606 | + | "{gap:?} moved on {class:?}: screen budget reached a target gap" | |
| 1607 | + | ); | |
| 1608 | + | } | |
| 1609 | + | } | |
| 1610 | + | } | |
| 1593 | 1611 | } | |
| 1594 | 1612 | ||
| 1595 | 1613 | #[test] |