Skip to main content

max / makeover-touch

4.4 KB · 109 lines History Blame Raw
1 # makeover-touch
2
3 The adaptation layer of the make-family design system.
4
5 `makeover` answers *what colour*. `makeover-geometry` answers *how much space*,
6 and owns the two axes an adaptation is stated against: `Density` (pointer or
7 touch) and `SizeClass` (compact, medium, expanded). `makeover-layout` answers
8 *what the thing is*. This crate answers one question and no other:
9
10 > Does this affordance exist here?
11
12 Like `makeover-layout`, it emits nothing. It is a description, rendered to CSS by
13 `makeover-webview` and to whatever the other renderers can express.
14
15 ## Why it is a crate and not a density preset
16
17 Measured across the MNW server's `@media` blocks (137) and goingson's
18 `ui-mode-*` blocks (192), bucketed by what the declarations inside actually
19 change:
20
21 | bucket | MNW | GO | retired by |
22 |---|---|---|---|
23 | density | 32% | 27% | a `makeover-geometry` preset |
24 | type | 23% | 15% | the type scale |
25 | columns | 20% | 12% | `makeover_layout::Column` |
26 | reflow | 16% | 17% | `makeover_layout::Arrangement` |
27 | **show/hide** | **12%** | **12%** | **this crate** |
28 | **reposition** | **6%** | **20%** | **this crate** |
29 | **appearance** | **1%** | **17%** | **this crate** |
30
31 The bottom three are the roughly 43% no spacing scale can retire. `display:
32 none` on a keyboard hint says the affordance does not exist on touch. No amount
33 of gap retuning expresses that, and a scale that tried would be putting a
34 product claim on a measurement axis.
35
36 ## What is here
37
38 `Affordance`, six members, drawn from what the two measured apps already gate by
39 hand:
40
41 | member | reads | rule |
42 |---|---|---|
43 | `Hover` | density | pointer only |
44 | `Hint` | density | pointer only |
45 | `Ancillary` | size | expanded only |
46 | `Detail` | size | medium and up |
47 | `Anchored` | size | compact only |
48 | `Overflow` | size | compact only |
49
50 `Affordance::available(density, size)` is the whole crate in one call. A
51 renderer asks per affordance and never branches on a width.
52
53 `column_cutoff(size)` closes the one seam neither neighbour could: layout defines
54 the priority ladder and `Column::kept_at`, geometry defines the boundaries, and
55 nothing else says which cutoff a compact window uses. Answering it with
56 `nth-child` on an ordinal means inserting a column silently hides the wrong one.
57
58 ## The rules the tests hold
59
60 **Density gates only what the contact patch touches.** Hovering, and the
61 keyboard chrome documenting shortcuts a touch surface cannot send. Not how much
62 screen there is: a phone is small *and* touch, a tablet is big *and* touch.
63 Putting a screen-budget claim on the input device is the
64 failure this crate exists to prevent.
65
66 **Touch never gains an affordance pointer lacks.** Touch is derived from pointer
67 by subtracting what a fingertip cannot do, so it loses members and never gains
68 one.
69
70 **Collapsing is allowed, inverting is not.** Borrowed from `makeover-geometry`,
71 where two gap relationships both resolve to zero cells on a terminal and stay
72 two members. `Hover` and `Hint` have identical rules today and are still two
73 members, because the call site names what is gated rather than the rule.
74
75 **Compact compensates rather than only losing.** `Anchored` and `Overflow` are
76 available at the narrow end and not the wide one. An adaptation that only
77 removes things describes a degraded layout, not a different one.
78
79 ## What is not here, on purpose
80
81 **Boundaries.** `makeover-geometry` quotes Material 3's window size classes at
82 600 and 840. This crate adds no third axis, no fourth class and no breakpoint of
83 its own.
84
85 **A navigation shell fork.** goingson carries two, concentrated in
86 `.app-header`, `.tab`, `.tab-navigation`, `.pill-nav`, `.saved-views-sidebar`
87 and `.modal-container`. That is not one shell adapting, it is two shells, and
88 choosing to build two is a product decision the app owns.
89
90 **Which class applies.** The app decides, from a measured width and from what it
91 already knows about the input. This crate takes both as arguments and never
92 sniffs.
93
94 **What a renderer does when an affordance is unavailable.** Hiding it,
95 substituting it or showing it anyway is renderer policy, the same class of
96 decision `makeover-layout` deleted `Fill::fallback` for.
97
98 ## Status
99
100 Unpublished. The vocabulary is six members and the intent is to stop there:
101 guessing at an eighth is how a description becomes a framework.
102
103 Design lives in the wiki note `makeover-touch`; the backlog is in GoingsOn under
104 the project of the same name.
105
106 ## Licence
107
108 MIT.
109