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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
//! GUI icon glyphs, drawn from the Phosphor icon font (registered in
//! [`super::app::GuiApp::new`] via `egui_phosphor::add_to_fonts`).
//!
//! egui's bundled fonts (Ubuntu-Light / NotoEmoji / emoji-icon-font) do **not**
//! actually contain the emoji and symbols the tree and buttons want โ `๐`,
//! `๐`, `๐`, `๐`, the `โพ`/`โธ` chevrons and the `โ`/`โ`/`โ`/`๏ผ` marks all
//! report `has_glyph == false` and render as empty "tofu" boxes on the target
//! systems. Phosphor's glyphs live in the Private Use Area and render reliably
//! in the proportional family every label uses, so every GUI icon is sourced
//! from here rather than from a bare Unicode literal.
//!
//! These are thin, readable aliases over the Phosphor constants so call sites
//! read `icons::FOLDER` instead of a bare escape, and a future weight/variant
//! swap is a one-file change.
//!
//! The weight is chosen in [`super::app::GuiApp::new`], not here: every Phosphor
//! variant maps the *same* codepoints (`FOLDER` is `U+E24A` in all of them), so
//! these constants are identical whichever weight is registered, and only one
//! variant can be registered at a time โ `add_to_fonts` always inserts under
//! the font key `"phosphor"`, so a second call would replace the first rather
//! than sit beside it. Mixing two icon weights in one build would therefore
//! mean registering a second family by hand and paying for a second copy of the
//! font; it isn't worth it for a weight change.
use light as p;
use HashMap;
/// Collapsed tree row (folder/collection closed) โ leading disclosure caret.
pub const CARET_RIGHT: &str = CARET_RIGHT;
/// Expanded tree row (folder/collection open) โ leading disclosure caret.
pub const CARET_DOWN: &str = CARET_DOWN;
/// The Source view's find bar.
pub const SEARCH: &str = MAGNIFYING_GLASS;
/// The Environments panel's "go to the active environment" button.
pub const GOTO_ACTIVE: &str = CROSSHAIR_SIMPLE;
/// A folder in the workspace/collection tree.
pub const FOLDER: &str = FOLDER;
/// A collection file (`.hurl` / `.json`) in the tree.
pub const FILE: &str = FILE_TEXT;
/// A PaperTrail report file (`.trail`) in the tree. A chart, deliberately
/// unlike the collection's document glyph โ a report *produces* a table, it
/// isn't another list of requests.
pub const REPORT: &str = CHART_BAR;
/// An environment file (`.vars`) in the tree, and the git-loaded env marker.
pub const ENV: &str = KEY;
/// The requests list is in the collection file's own order (the default).
pub const SORT_FILE: &str = LIST;
/// The requests list is sorted A-Z.
pub const SORT_ASC: &str = SORT_ASCENDING;
/// The requests list is sorted Z-A.
pub const SORT_DESC: &str = SORT_DESCENDING;
/// Run / send action (formerly `โถ`).
pub const PLAY: &str = PLAY;
/// Add action (formerly `๏ผ`).
pub const PLUS: &str = PLUS;
/// Close / remove action (formerly `โ`).
pub const CLOSE: &str = X;
/// A passing run or assertion (formerly `โ`).
pub const PASS: &str = CHECK;
/// A failing run or assertion (formerly `โ`).
pub const FAIL: &str = X;
/// A request or run in progress (formerly `โฆ`).
pub const RUNNING: &str = CIRCLE_NOTCH;
/// Warning / error banner marker (formerly `โ `).
pub const WARNING: &str = WARNING;
/// A git-remote-linked collection or environment (formerly `โ`).
pub const GIT: &str = GIT_BRANCH;
/// Save action (report editor Save button).
pub const SAVE: &str = FLOPPY_DISK;
/// Move a selected report block up in its list.
pub const CARET_UP: &str = CARET_UP;
/// Delete a selected report block.
pub const TRASH: &str = TRASH;
/// Stop an in-flight report run.
pub const STOP: &str = STOP;
/// Export a report's results to a file.
pub const EXPORT: &str = EXPORT;
/// Hand an exported file to the desktop's default application (it leaves the
/// app, hence the arrow out of a box rather than a second export glyph).
pub const OPEN_EXTERNAL: &str = ARROW_SQUARE_OUT;
/// A row queued in the streaming results grid (formerly `ยท`).
pub const ROW_SCHEDULED: &str = DOT_OUTLINE;
/// Preview a report's projected rows without sending anything (the dry run).
/// An eye rather than a second play glyph, so it can't be mistaken for Run.
pub const PREVIEW: &str = EYE;
/// A request / collection edited since it was last read from (or written to)
/// disk. A pencil rather than the conventional `*` or `โ`, because the marker
/// shares the row's right-hand gutter with the pass/fail run marks and a dot
/// there reads as "queued" (see [`ROW_SCHEDULED`]).
pub const EDITED: &str = PENCIL_SIMPLE;
/// Stands in for a newline that was collapsed to fit a value onto one row of
/// the report results grid. The obvious `โ` (U+23CE) is a tofu box here โ no
/// font egui bundles carries it, and unlike the dots in [`super::widgets`]
/// this one sits *inside* a run of text, so it can't be painted around. The
/// terminal UI keeps `โ`, which a terminal font does have.
pub const CELL_NEWLINE: &str = ARROW_ELBOW_DOWN_LEFT;
/// Directional arrows, for the shared strings that spell a menu path or a key
/// hint with one (see [`SUBSTITUTIONS`]).
pub const ARROW_LEFT: &str = ARROW_LEFT;
/// See [`ARROW_LEFT`].
pub const ARROW_RIGHT: &str = ARROW_RIGHT;
/// See [`ARROW_LEFT`].
pub const ARROW_UP: &str = ARROW_UP;
/// See [`ARROW_LEFT`].
pub const ARROW_DOWN: &str = ARROW_DOWN;
/// Characters that a shared [`crate::i18n`] string may legitimately contain,
/// but that the GUI's font stack cannot draw, paired with something that says
/// the same thing and that it can.
///
/// The string table serves both front-ends, and a terminal's font is far
/// better stocked than the three fonts egui bundles: `โ `, `โถ`, `๏ผ` and the
/// arrows are perfectly ordinary in the terminal UI and tofu boxes here.
/// Rather than flatten the table to the poorer of the two alphabets โ which
/// would make every warning and every key hint worse in the front-end that
/// renders them properly โ the GUI swaps in an icon as it reads them.
///
/// This maps by **meaning, not by shape**: `โถ Run` becomes the same play icon
/// the GUI's own Run button uses, and `โณ Runningโฆ` the same spinner its
/// report toolbar uses, so a shared string arrives in the icon vocabulary the
/// surrounding GUI is already speaking. The one exception is `โ`, which has no
/// counterpart โ Phosphor has no solid disc at text size, which is why
/// [`super::widgets::status_dot`] paints one rather than typing it, and a dot
/// inside a run of text cannot be painted around. It falls back to the smaller
/// `โข`, which the bundled fonts do carry.
///
/// Rows are listed here whether or not the GUI has a use for them today. A row
/// that only the terminal UI shows costs nothing to cover, and covering it
/// means the string is already safe on the day someone shows it in the GUI โ
/// which is the day nobody would think to check.
const SUBSTITUTIONS: & = &;
/// `text` with every character the GUI cannot draw replaced by an icon that
/// can be (see [`SUBSTITUTIONS`]).
///
/// Borrowed rather than owned on the overwhelmingly common path: all but a
/// handful of rows come back untouched, and the ones that don't are rewritten
/// at most once each per process, so this allocates a few dozen bytes in total
/// and then never again. That is what buys the `&'static str` the string table
/// is built from, and with it the guarantee that *every* GUI string has been
/// through here โ a substitution applied at call sites instead would only ever
/// cover the call sites somebody remembered.