@floless/app 0.130.1 → 0.131.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,279 @@
1
+ /**
2
+ * reference-changes — what changed between two versions of a reference model. Refs #734, design §7.
3
+ *
4
+ * A reference model is borrowed geometry we never own: an IFC someone else authored, overlaid in the
5
+ * steel editor so you can see it, measure it and snap to it. The architect sends the NEXT version of
6
+ * that file; this panel is the answer to "what actually moved?".
7
+ *
8
+ * THIS MODULE RENDERS AN ANSWER IT DOES NOT COMPUTE. AWARE matches the objects (on IFC GlobalId and
9
+ * nothing else) and `server/reference-compare.ts` validates the response; everything here reads numbers
10
+ * out of that answer and draws them. floless never parses IFC and never compares geometry (CLAUDE.md).
11
+ *
12
+ * THE REFUSAL IS NOT AN ERROR STATE, AND DRAWING IT AS ONE WOULD BE A LIE OF TONE. When no ids pair,
13
+ * "everything added and everything removed" is the symptom of an exporter that regenerated every id, so
14
+ * AWARE returns no `changes` array at all and the server throws rather than handing us one. That is a
15
+ * correct, complete answer about two files that do not relate — not a failure of ours — so it is drawn
16
+ * in the neutral tokens, never `--err` red. THERE IS NO "COMPARE ANYWAY" AND THERE NEVER WILL BE: with
17
+ * no geometry fallback there is nothing left to compare with, so the button could only produce the
18
+ * fabricated list the refusal exists to prevent.
19
+ *
20
+ * TOKENS ARE THIS PAGE'S OWN. `web/steel-editor.html` DOES NOT LOAD `web/app.css` — it says so at :64
21
+ * and :995 — so `--surface-2`, `.guide-step`, `.canvas-empty` and friends do not exist here. Everything
22
+ * below uses the editor's vocabulary (`--panel`, `--sunken`, `--field`, `--mut`, `--line`, and the
23
+ * `--ok`/`--warn`/`--err` ink+bg+edge triads). A token that resolves to nothing fails SILENTLY and looks
24
+ * like an unstyled element rather than an error, so verify a name is in that page's `:root` before use.
25
+ *
26
+ * NO BESPOKE SCROLLBAR CSS IS NEEDED. The page's global `*{scrollbar-width:thin;scrollbar-color:…}` and
27
+ * `*::-webkit-scrollbar*` rules (`web/steel-editor.html:179`) already reach any container added here —
28
+ * the same reason the import modal's picker declares none (:1273). One outer scroll container owns the
29
+ * whole panel; nested scrollports are both where a native bar leaks in and a worse interaction.
30
+ */
31
+
32
+ /** Every count in design §7.3's header line. `uncomparable` is the one a clean-looking list hides. */
33
+ export const STAT_ORDER = ['added', 'removed', 'changed', 'uncomparable', 'unchanged'];
34
+
35
+ /**
36
+ * How a status reads — glyph, word, and class — because COLOUR ALONE IS NOT AN ENCODING.
37
+ *
38
+ * Each of the FOUR that assert something carries a glyph and a word in the DOM as well as a colour, so
39
+ * the list survives a colourblind reader, a grayscale print and a `data-tip` nobody hovers. (`unchanged`
40
+ * carries neither — see below, and the test asserts the glyphs for the four alone.) `uncomparable` is deliberately DASHED rather
41
+ * than filled even though it borrows the same amber as `changed`: shape is a distinction that survives
42
+ * losing colour entirely, and dashed says "we do not know" where filled asserts a fact.
43
+ *
44
+ * `unchanged` gets NO chip at all. Its whole job is to recede — a badge of equal weight to the other
45
+ * four fights the one thing it is there to communicate.
46
+ */
47
+ export const STATUS = {
48
+ added: { glyph: '+', word: 'added', cls: 'rc-chip rc-add' },
49
+ removed: { glyph: '−', word: 'removed', cls: 'rc-chip rc-rem' },
50
+ changed: { glyph: '~', word: 'changed', cls: 'rc-chip rc-chg' },
51
+ uncomparable: { glyph: '?', word: 'could not compare', cls: 'rc-chip rc-unk' },
52
+ unchanged: { glyph: '', word: 'unchanged', cls: 'rc-plain' },
53
+ };
54
+
55
+ /**
56
+ * The cap, and it is THIS PAGE'S CAP rather than a new one.
57
+ *
58
+ * The reference object tree solved this exact problem on this exact data and wrote down the
59
+ * measurement: filtering one real building for "mullion" matched ~8,000 objects across ten storeys, and
60
+ * force-expanding them built 2,795 rows — "a wall". So the list is capped and SAYS SO. A silent cap
61
+ * reads as "that is all there was", which on a change list is the same class of lie as folding
62
+ * `uncomparable` into `unchanged`.
63
+ *
64
+ * Kept in step with `REF_TREE_CAP` in `web/steel-editor.html` by intent, not by import: this file is an
65
+ * ES module surfaced on `window` by the same shim the page uses for `GridCore` (find it as
66
+ * `window.ReferenceChanges=RC`), while `REF_TREE_CAP` is a binding inside the editor's big inline
67
+ * classic script, which no module can see.
68
+ *
69
+ * AND NOW SOMETHING WATCHES. `server/reference-caps-parity.test.ts` reads both literals out of the two
70
+ * files and fails when they diverge — "kept in step by intent" is another way of saying unenforced.
71
+ * Cited by SYMBOL rather than line number, because every line citation this feature shipped had already
72
+ * drifted 20-150 lines inside the commit that wrote it.
73
+ */
74
+ export const RC_CAP = 300;
75
+
76
+ /** `12806` → `12,806`. The page's own convention: the editor formats every count this way. NO COUNT OF
77
+ * USES IS QUOTED — one was, and it went stale on the very commit that quoted it. */
78
+ const num = (n) => (Number.isFinite(n) ? n.toLocaleString() : '—');
79
+
80
+ /**
81
+ * A distance in words as well as numbers, because "moved 250 mm" is the sentence a person reads.
82
+ *
83
+ * Only ever rendered when `location` actually fired. A column reserved for every changed row would be
84
+ * dead space in the ~90% that did not move, and a "0 mm" printed against a reprofiled column would be
85
+ * an assertion nobody made.
86
+ */
87
+ export function movedPhrase(change) {
88
+ if (!change || !Array.isArray(change.changedBy) || !change.changedBy.includes('location')) return null;
89
+ const d = change.distance;
90
+ if (!Number.isFinite(d)) return null;
91
+ // Millimetres, one decimal under 10 so a sub-millimetre move is not rounded into "moved 0 mm" — which
92
+ // would read as "it did not move" for the exact case the tolerance was argued over.
93
+ const shown = d < 10 ? d.toFixed(1).replace(/\.0$/, '') : Math.round(d).toLocaleString();
94
+ return 'moved ' + shown + ' mm';
95
+ }
96
+
97
+ /**
98
+ * The five header counts, in the order urgency actually runs.
99
+ *
100
+ * NOT A SENTENCE. Rendered as prose, "12,806 unchanged" is the widest and loudest span on the line
101
+ * purely because it has five digits — the count that carries the least meaning dominating by accident of
102
+ * magnitude. As chips, the four that carry a decision or a fact sit at equal weight and `unchanged`
103
+ * comes last, toned down, reading as the odd one out rather than the anchor.
104
+ *
105
+ * EVERY COUNT APPEARS, including `uncomparable` and including zeroes. A zero that is drawn is a fact
106
+ * ("nothing was uncomparable"); a zero that is hidden is indistinguishable from a question nobody asked.
107
+ */
108
+ export function summaryStats(summary) {
109
+ if (!summary) return [];
110
+ return STAT_ORDER.map((key) => ({
111
+ key,
112
+ n: summary[key],
113
+ text: num(summary[key]),
114
+ word: STATUS[key].word,
115
+ glyph: STATUS[key].glyph,
116
+ }));
117
+ }
118
+
119
+ /**
120
+ * Which groups open themselves: the ones holding something to look at.
121
+ *
122
+ * The same instinct as the object tree's `wide` rule — never dump the whole building open, but never
123
+ * hide the thing that matters behind a chevron either. A storey that is 100% unchanged opens collapsed
124
+ * showing only its count, which is the honest summary of a storey nobody needs to read.
125
+ */
126
+ export function groupNeedsAttention(rows) {
127
+ return Array.isArray(rows) && rows.some((r) => r && r.status && r.status !== 'unchanged');
128
+ }
129
+
130
+ /**
131
+ * The default view is "needs attention" — added, removed, changed, uncomparable.
132
+ *
133
+ * BOTH A READ AND A BUDGET. The unchanged rows are the ones nobody asked about, and not building them is
134
+ * also the cheap half of the performance answer: a 12,806-row DOM built on open is the wall the cap
135
+ * exists to prevent, reached before the user has typed anything.
136
+ */
137
+ export function needsAttention(change) {
138
+ return !!change && change.status !== 'unchanged';
139
+ }
140
+
141
+ /**
142
+ * The window actually drawn, and the sentence that admits to it.
143
+ *
144
+ * Returns `{ shown, note }` — `note` is null only when nothing was withheld. Mirrors the object tree's
145
+ * centred-window recipe so a row the caller wants in view survives the cap rather than being sliced off
146
+ * the end of it.
147
+ */
148
+ export function capWindow(list, wantIdx) {
149
+ const all = Array.isArray(list) ? list : [];
150
+ if (all.length <= RC_CAP) return { shown: all, note: null };
151
+ let from = 0;
152
+ if (Number.isFinite(wantIdx) && wantIdx >= RC_CAP) from = Math.min(wantIdx - (RC_CAP >> 1), all.length - RC_CAP);
153
+ return {
154
+ shown: all.slice(from, from + RC_CAP),
155
+ note: 'Showing ' + RC_CAP + ' of ' + num(all.length) + ' — use the filter above to narrow this list.',
156
+ };
157
+ }
158
+
159
+ /**
160
+ * The refusal's copy, built from the numbers AWARE actually reported.
161
+ *
162
+ * PLAIN ENGLISH AND IT DOES NOT BLAME THE USER. The two causes it names are the two that are real — this
163
+ * is not a revision of that file, or the exporter regenerated every id — and neither is something the
164
+ * person reading did. The wording is design §7.3's, kept verbatim through review.
165
+ */
166
+ export function refusalCopy(refused, baseName) {
167
+ const revised = refused && refused.revisedName ? refused.revisedName : 'the new file';
168
+ const base = baseName || 'the version you have';
169
+ const n = refused && Number.isFinite(refused.revisedObjects) ? num(refused.revisedObjects) + ' objects' : 'its objects';
170
+ return {
171
+ lead: 'Nothing in these two files could be matched — none of ' + revised + "'s " + n +
172
+ ' share an IFC id with ' + base + '.',
173
+ why: 'Either this is not a revision of ' + base + ', or the tool that exported it gave every object a new id.',
174
+ };
175
+ }
176
+
177
+ /**
178
+ * The three ways out of a refusal, weighted rather than equal.
179
+ *
180
+ * Design §7.3 calls the middle one "the honest remedy" and then draws three identical buttons, which
181
+ * undersells its own framing. Both files loaded side by side is a workflow that already works today and
182
+ * is what a user actually wants when the automatic answer is unavailable — so it is the primary, and the
183
+ * order runs quietest to loudest.
184
+ *
185
+ * THERE IS NO FOURTH BUTTON. See the module header.
186
+ */
187
+ export const REFUSAL_ACTIONS = [
188
+ { id: 'cancel', label: 'Cancel', weight: 'ghost' },
189
+ { id: 'otherfile', label: 'Choose a different file', weight: 'secondary' },
190
+ { id: 'separate', label: 'Load it as a separate reference instead', weight: 'primary' },
191
+ ];
192
+
193
+ /**
194
+ * Is this comparison like-for-like?
195
+ *
196
+ * A new version read under a different scope than the old one, with nothing saying so, is design §10's
197
+ * "must never happen": rows would appear as added or removed because of the FILTER rather than because
198
+ * the building changed. `selected` carries a receipt per side precisely so this is answerable.
199
+ */
200
+ export function filterDiffers(selected) {
201
+ if (!selected) return false;
202
+ // WRITTEN AS ESCAPES, NOT AS RAW BYTES, and that is the whole change here — the behaviour is what it
203
+ // always was. These separators used to be literal U+0001/U+0002 characters in the source, which every
204
+ // reader renders as nothing: the line LOOKED like `join('')` with `+ '' +` between the axes. Two
205
+ // independent reviewers duly reported a collision bug that does not exist, and the next reader would
206
+ // eventually have 'fixed' the invisible separators away and created it for real.
207
+ //
208
+ // THEY ARE LOAD-BEARING. Without them `{storeys:['IfcWall']}` and `{ifcTypes:['IfcWall']}` normalise
209
+ // identically, as do `['L1','L2']` and `['L1L2']` — a silent FALSE NEGATIVE on the one check that
210
+ // stops rows being read as "the building changed" when the FILTER changed, which design §10 calls a
211
+ // thing that must never happen. Neither character can occur in an IFC storey or type name.
212
+ const ITEM = '\u0001', AXIS = '\u0002';
213
+ const norm = (s) => {
214
+ if (!s) return '';
215
+ const part = (v) => (Array.isArray(v) && v.length ? [...v].sort().join(ITEM) : '');
216
+ return part(s.storeys) + AXIS + part(s.ifcTypes) + AXIS + part(s.ids);
217
+ };
218
+ return norm(selected.base) !== norm(selected.revised);
219
+ }
220
+
221
+ /**
222
+ * The version chain as ROWS a history list can draw — newest first, numbered by position.
223
+ *
224
+ * NUMBERED BY POSITION IN THE CHAIN, NOT BY RENDER ORDER. The chain is oldest-first and everything else
225
+ * in this feature numbers it that way ("version 3" in the change panel's header is `versions.length`),
226
+ * so reversing for display must not renumber — a row that reads "version 1" at the bottom of one panel
227
+ * and "version 3" at the top of another is the same row described two ways.
228
+ *
229
+ * THREE DIFFERENT PASTS, THREE DIFFERENT WORDS, and collapsing any pair states something the chain does
230
+ * not say:
231
+ * • `adopted` — its date is when versioning was RECORDED, not when the file was loaded; nothing
232
+ * durable records the latter, which is the whole reason `sha256` had to join the
233
+ * schema. Saying "imported" would fabricate history in the one field a user reads to
234
+ * answer "which of these did I load first?".
235
+ * • restored — a rollback appends a COPY of an earlier row under a fresh id, so the same file
236
+ * appears twice. Rendered as an ordinary import it reads as "why did I load this
237
+ * twice?".
238
+ * • imported — an actual upload.
239
+ *
240
+ * A restored row is recognised by its FILE matching an earlier row's, which is exactly what `rollbackTo`
241
+ * produces and is the only handle available: nothing on the schema flags a restore, deliberately — the
242
+ * row IS a genuine load and carries no `adopted`.
243
+ */
244
+ export function versionRows(versions) {
245
+ // NUMBERED FROM THE RAW ARRAY, NOT THE FILTERED ONE. Dropping a null entry and then numbering by
246
+ // position would renumber every row after it, while the change panel's own "version N" counts
247
+ // `versions.length` unfiltered — so a malformed chain would make one row read as two different
248
+ // numbers in two panels, which is the exact thing this function's contract forbids.
249
+ const raw = Array.isArray(versions) ? versions : [];
250
+ const all = raw.map((v, rawIdx) => ({ v, rawIdx })).filter((x) => x.v);
251
+ const last = all.length - 1;
252
+ return all.map(({ v, rawIdx }, i) => {
253
+ const priorSame = all.findIndex((o) => o.v.file && o.v.file === v.file);
254
+ const restored = !v.adopted && priorSame >= 0 && priorSame < i;
255
+ return {
256
+ id: v.id || null,
257
+ // WHETHER ANYTHING CAN BE DONE TO THIS ROW. Both actions address a version by id, so a row without
258
+ // one can only produce a click that does nothing — and a control whose sole outcome is nothing is
259
+ // worse than no control, which is the rule the ⋯ menu already applies to itself.
260
+ actionable: !!v.id,
261
+ n: rawIdx + 1,
262
+ name: v.name || v.file || 'this version',
263
+ importedAt: v.importedAt || null,
264
+ current: i === last,
265
+ dateWord: v.adopted ? 'recorded' : restored ? 'restored' : 'imported',
266
+ // …AND THE NOTE'S NUMBER IS A RAW INDEX TOO. `priorSame` indexes the filtered list, so quoting it
267
+ // directly would name a different row than `n` counts once a null has been dropped.
268
+ note: v.adopted ? 'first seen before versioning'
269
+ : restored ? 'restored from version ' + (all[priorSame].rawIdx + 1)
270
+ : null,
271
+ };
272
+ }).reverse();
273
+ }
274
+
275
+ export default {
276
+ RC_CAP, STATUS, STAT_ORDER, REFUSAL_ACTIONS,
277
+ summaryStats, movedPhrase, groupNeedsAttention, needsAttention, capWindow, refusalCopy, filterDiffers,
278
+ versionRows,
279
+ };
@@ -0,0 +1,141 @@
1
+ /**
2
+ * reference-session — the live editor state a reference's re-read destroys. Refs #734, design §7.2.
3
+ *
4
+ * `Reload its geometry` and `Load a new version…` both replace a reference's objects wholesale. Three
5
+ * pieces of state the user built up are addressed by exactly what that replaces:
6
+ *
7
+ * the drilled-into object by ARRAY INDEX — migrated a layer down, in `revalidateSubSelection`,
8
+ * which keys on the file's own GlobalId
9
+ * the tree's open groups by POSITION — '2:1' is the second storey's second type; migrated
10
+ * HERE, on the storey/type labels the file supplies
11
+ * the measurement by RAW WORLD POINTS — not migrated, and cannot be; see below
12
+ *
13
+ * WHY THE MEASUREMENT IS NOT MIGRATED, stated here because it is a decision and not an omission.
14
+ * `refMeasureKept` records two world points and no object identity at all, so "keep it if both ends
15
+ * landed on something that did not move" cannot be evaluated from what is stored. Capturing that
16
+ * identity at measure time was costed and rejected on two grounds. First, `xrefSnapPoints` deduplicates
17
+ * its points ACROSS objects on a shared 0.5 mm key, so a corner touched by two objects is attributed to
18
+ * whichever reached it first — an endpoint's recorded owner can name a NEIGHBOUR, and the asymmetry runs
19
+ * the wrong way: dropping a measurement whose owner changed is merely wasteful, while KEEPING one whose
20
+ * recorded owner looks unchanged when the corner really belonged to a changed neighbour presents a wrong
21
+ * dimension as a measured one. Second, and decisively, a reload is not a comparison at all — nothing on
22
+ * that path classifies any object as unchanged, so the test is not hard to evaluate there, it is
23
+ * undefined. So the measurement is dropped on both paths and the drop is SAID. That is the honest half
24
+ * that was missing; what must never ship is the middle road of keeping the segment and hoping.
25
+ *
26
+ * NOTHING HERE TOUCHES THE DOM OR THE EDITOR'S GLOBALS. The impure halves — reading `refGeom`,
27
+ * `refTreeGroups`, the selection and the measurement — live in `web/steel-editor.html`, which calls in.
28
+ */
29
+
30
+ /**
31
+ * Re-key the tree's group state onto a new read, and report what could not be placed.
32
+ *
33
+ * `snapKeys` is the OLD state resolved into labels while the old objects still existed:
34
+ * `[{ storey, type, val }]`, where `type === undefined` marks a STOREY-level key and `val` is the
35
+ * `{ open, q }` the tree stores. `groups` is `groupReferenceObjects(newObjects)`.
36
+ *
37
+ * MATCHED ON THE RAW VALUES, NOT THE WORDS A HEADER SHOWS. Two types inside one storey can share a
38
+ * display word — that is exactly why the tree disambiguates them with the raw IFC token — so matching on
39
+ * words would silently merge two groups the file keeps apart. `null` is itself a real label here ("no
40
+ * storey recorded"), which is why absence is tagged rather than tested for falsiness.
41
+ *
42
+ * Returns `{ keys, lost }`. `lost` names only groups the user had OPEN: an explicit close is state worth
43
+ * migrating, but a vanished group they had collapsed cost them nothing, and naming it turns routine
44
+ * housekeeping into a wall. A missing STOREY is reported once, as the storey, rather than once per type
45
+ * inside it — otherwise dropping one level reports three losses for one event.
46
+ */
47
+ export function migrateGroupKeys(snapKeys, groups) {
48
+ const tag = (v) => (v === null || v === undefined ? '-' : 'v' + v); // present values are 'v'-prefixed, so '-' cannot collide
49
+ const at = new Map();
50
+ (groups || []).forEach((s, si) => at.set(tag(s.storey), si));
51
+ const keys = new Map();
52
+ const lost = [];
53
+ const seenStorey = new Set();
54
+ for (const k of snapKeys || []) {
55
+ const si = at.get(tag(k.storey));
56
+ if (si === undefined) {
57
+ // The whole storey is gone. Reported once however many of its types were open.
58
+ if (k.val && k.val.open && !seenStorey.has(tag(k.storey))) {
59
+ seenStorey.add(tag(k.storey));
60
+ lost.push({ storey: k.storey, type: undefined });
61
+ }
62
+ continue;
63
+ }
64
+ if (k.type === undefined) { keys.set(String(si), k.val); continue; }
65
+ const ti = (groups[si].types || []).findIndex((t) => tag(t.type) === tag(k.type));
66
+ if (ti < 0) { if (k.val && k.val.open) lost.push({ storey: k.storey, type: k.type }); continue; }
67
+ keys.set(si + ':' + ti, k.val);
68
+ }
69
+ return { keys, lost };
70
+ }
71
+
72
+ /**
73
+ * Did the drilled-into object survive into this read — asked of the DATA, not of the 3D layer.
74
+ *
75
+ * The 3D layer migrates the selection itself (`revalidateSubSelection`), and the obvious way to report
76
+ * the loss is to look at whether the editor's index survived that call. It is also wrong: the push that
77
+ * runs it is a no-op whenever the 3D view is not the active one, so a user who switches to 2D while a
78
+ * re-read is in flight leaves the old index standing — which reads as "it survived", and the object is
79
+ * then quietly dropped later when 3D next rebuilds. The report has to be derivable from the objects
80
+ * themselves, in both views, or it is not a report. (Codex review.)
81
+ *
82
+ * The RULE IS THE ONE `revalidateSubSelection` ALREADY APPLIES, restated here rather than reached for:
83
+ * an id that is absent says nothing, and an id that appears twice cannot say which object you were on,
84
+ * so only an id appearing EXACTLY once counts as the same object.
85
+ */
86
+ export function objectSurvives(globalId, objects) {
87
+ if (globalId === null || globalId === undefined || globalId === '') return false;
88
+ let seen = 0;
89
+ for (const o of objects || []) {
90
+ if (o && o.globalId === globalId && ++seen > 1) return false;
91
+ }
92
+ return seen === 1;
93
+ }
94
+
95
+ /** How many lost group names are listed before the rest become a count. */
96
+ export const CARRYOVER_NAME_CAP = 3;
97
+
98
+ /**
99
+ * The one phrase that stands for a set of lost groups — capped, and the cap admits to itself.
100
+ *
101
+ * Listing every name is the failure mode this shares with the change list's own row cap: a re-read that
102
+ * drops a whole storey can lose a dozen groups at once, and a sentence naming all twelve is not read.
103
+ */
104
+ export function groupsFact(labels) {
105
+ const n = (labels || []).length;
106
+ if (!n) return null;
107
+ const shown = labels.slice(0, CARRYOVER_NAME_CAP);
108
+ const rest = n - shown.length;
109
+ return n + ' group' + (n === 1 ? '' : 's') + ' you had open ('
110
+ + shown.join(', ') + (rest > 0 ? ', +' + rest + ' more' : '') + ')';
111
+ }
112
+
113
+ /**
114
+ * One sentence for up to three facts — never three separate boxes.
115
+ *
116
+ * Three stacked notes read as a checklist of problems. This is ordinary housekeeping after an act the
117
+ * user asked for, so it gets one plain sentence in the neutral voice, or — when everything migrated —
118
+ * nothing at all. `null` means SAY NOTHING, and every caller must honour it rather than rendering an
119
+ * empty container.
120
+ *
121
+ * `tail` differs per path on purpose and is not cosmetic: `Load a new version…` really does compare
122
+ * against "the version you had", while `Reload its geometry` re-reads the SAME file and has no earlier
123
+ * version to name. One shared string would make one of the two sentences false.
124
+ */
125
+ export function carryoverSentence(facts, tail) {
126
+ const list = (facts || []).filter(Boolean);
127
+ if (!list.length) return null;
128
+ const lead = list.length === 1 ? 'One thing didn’t carry over' : 'A few things didn’t carry over';
129
+ const words = list.length === 1
130
+ ? list[0]
131
+ : list.slice(0, -1).join(', ') + ' and ' + list[list.length - 1];
132
+ return lead + ' ' + tail + ': ' + words + '.';
133
+ }
134
+
135
+ /** The two tails, kept next to each other so the difference above stays visible. */
136
+ export const CARRYOVER_TAIL = {
137
+ reload: 'into the re-read file',
138
+ version: 'from the version you had',
139
+ };
140
+
141
+ export default { migrateGroupKeys, objectSurvives, groupsFact, carryoverSentence, CARRYOVER_NAME_CAP, CARRYOVER_TAIL };