1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
//! **The enrollment pane**: a name, a grade, and the symbol that comes back
//! (yog's `docs/REMOTE.md` §8.4).
//!
//! # It stands where the conversation would, and that is the design
//!
//! The shell's rule is *a bar rather than a modal*, because a refusal about one
//! pane must not stop the operator reading the other three. This is the
//! exception and it earns it: what the pane holds is a **private key on a
//! screen**, the whole act is "look at this now and then close it", and leaving
//! a conversation legible behind it would invite exactly the thing the material
//! must not have — a long life on a display. So it replaces the central panel
//! while it is open, and the control that closes it is the one that forgets.
//!
//! # It is a modal, so it behaves like one (bl-7574)
//!
//! The argument above is about the WINDOW and the pane only ever covered a
//! PANEL, which left it a modal in name. Two things close that, and neither
//! widens what it covers.
//!
//! **Escape closes it** ([`crate::ui::Model::escape`]), doing exactly what
//! [`CLOSE`] does — the material included, because the control that closes this
//! pane is the control that forgets. Reachable by Tab is not the same as
//! operable, and this is the one pane whose stated purpose is *close it
//! quickly*. Its name box wears [`crate::ui::keys::NAME_ID`] so the gate that
//! makes Escape mean *leave the box* while typing covers it too.
//!
//! **Nothing live paints under it**: the composer is a bottom panel and so
//! outside what a central panel covers, which put a live `start` control —
//! firing a conversation on the very wall being enrolled into — beneath the
//! symbol. `crate::ui::shell` stands it down while an enrollment is open. The
//! roster and the conversation list stay, and that is deliberate: they are
//! where the operator looks, not what they act with, and the doc's reason above
//! is about a *conversation* legible behind the material.
//!
//! # The symbol is geometry, so the assertions are geometry
//!
//! A QR symbol has no glyphs. `crate::paint_probe` is the one walk over painted
//! *text* and it has nothing to say about one, so the tests assert the **module
//! matrix** — which is the thing that is right or wrong — and the paint probe
//! asserts the words around it. Pixels are the wrong altitude to be right at:
//! a symbol drawn at the wrong scale still carries the same bytes, and a symbol
//! with a wrong module does not.
use crateSymbol;
use crate;
/// The word that opens an enrollment, on the wall the window is aimed at.
pub const OPEN: &str = "enroll a box…";
/// The word that spends it.
pub const SEND: &str = "mint";
/// The word that closes it and forgets the material.
pub const CLOSE: &str = "done — forget it";
/// The pane's own heading.
pub const HEADING: &str = "enroll a box";
/// What the name box says before anything is typed.
pub const NAME_HINT: &str = "the new box's name";
/// The line under the symbol. It says the one thing an operator cannot see by
/// looking.
pub const KEPT: &str = "not written down anywhere — scan it now, or enroll again";
/// What stands where the symbol will be, while the engine is minting.
pub const MINTING: &str = "minting…";
/// How many screen points one module gets. Small enough that a version-40
/// symbol still fits a pane, large enough that a camera resolves one.
const MODULE: f32 = 4.0;
/// The quiet zone, in modules — the standard's four, which a decoder uses to
/// find the symbol's edge.
const QUIET: usize = 4;
/// Paint the enrollment, and take the clicks on it. Answers whether there was
/// one to paint, so the shell knows whether the conversation still stands.
/// The half before the answer: what to call the box, what grade to mint it at,
/// and the button that spends the act.
/// **Every row here WRAPS, because this pane is not as wide as the window**
/// (bl-dc07). The enrollment stands in the central panel, which is what the two
/// side panels leave: at a 400-point window that is about 120 points, and an
/// unwrapped row lays its controls on one line however long the line has to be.
/// The name box, the `foot` grade and the control that CLOSES the pane all went
/// off the right edge of the window — and the one that closes it is the one
/// that forgets the material, so the pane holding a private key was the pane
/// with no visible way out of it.
/// **The symbol, as rectangles.** One filled rectangle per dark module on a
/// light ground, with the quiet zone painted rather than assumed: a decoder
/// uses it to find the symbol's edge, and a pane's own background is not it.
/// Where one module sits inside the symbol's rectangle, quiet zone included.
/// `n` modules, in screen points. Through `u16` rather than by a cast: the
/// house lint set denies a lossy numeric cast and its only home would be a
/// manifest-wide relaxation, and the widest symbol there is measures 185
/// modules with its quiet zone — so the conversion is exact and the saturation
/// is unreachable by arithmetic rather than by hope.