Repository navigation
Commit 98d2390
authored
Written-by: Dev
Fixes #3179
Part of #3114
Owner: Dev
Reviewer: Reviewer
Tier: T3
## What changed
The reader half shipped in the previous slice: `foldingOf` already folds
a bubble by
`prefs.folding.mode` and `none` already folds nothing, but nothing could
write the mode, so every
window folded at the default and Settings had no picker. This closes the
writing half only —
`core/src/client/message-fold.js` and `core/test/message-fold.test.js`
are untouched (A12).
**Host** (`core/src/host/channel.js`, +12): `set-prefs` takes `folding:
{ mode }`, checks it against
a `FOLD_MODES` set next to `NOTIFY_KINDS`, stores `state.prefs.folding`,
deletes the record on
`null`, and refuses anything else with `Message folding must be compact,
standard or none`. The
check is inline, like motion's three-way choice beside it; no
`core/src/shared/` module was added.
**Client** (`core/src/client/settings.js`, +17): General reads
`foldingOf(prefs)` and draws a
`Message folding` section — a `Segmented` picker (Compact / Standard /
No folding) in a writable
window, and one plain-text row naming the mode in a read-only one, so
`#2474`'s rule still holds.
`core/src/client/i18n.js` (+6) carries the section title, the hint, the
three labels and the
refusal. `core/client.js` is rebuilt, not hand-edited.
Tests: `core/test/install.test.js` pins the host half (store, refusal,
`null` clear, `none`), and
`core/test/settings-readonly-pages.test.js` pins the picker and its one
write. The `#2474` count of
General's controls moves from 7 to 8 because the page really draws one
more control; the
`Send shortcut` assertion on the same line still holds.
Fourteen files: eight hand-written (+81/−4 lines, of which the tests are
40) and six generated
(`core/client.js`, patches `0001`, `0005`, `0008`, `0014`, and the
`files/` mirror of the test).
`ds-bot/`, `patches/ds-bot/topics.json`, `.github/**`, `policy/**`,
`scripts/**`,
`core/scripts/**`, every `package.json`/`package-lock.json`,
`core/src/shared/**` and `plugins/**`
are unchanged.
## Checkpoint
<!-- flybot:checkpoint -->
```json
{
"pr": 3180,
"claim": "Dev",
"issue": 3179,
"summary": "`set-prefs` now stores the message folding mode and refuses anything that is not compact, standard or none, while `null` clears it back to the default. Settings → General draws a Message folding picker whose three choices write that field, and a read-only window keeps the mode in use as text instead of drawing a control. The client already folded by `prefs.folding.mode`, so this slice only closes the writing half: no bubble, threshold or existing Chinese sentence about folding changed.",
"files": [
"core/src/host/channel.js",
"core/src/client/settings.js",
"core/src/client/i18n.js",
"core/test/install.test.js",
"core/test/settings-readonly-pages.test.js",
"docs/subsystems/core-host.md",
"docs/subsystems/core-client.md",
"changelog.d/3114-fold-prefs.added.md"
],
"checks": { "ran": "TZ=UTC TMPDIR=/data/flybot-tmp npm run verify", "result": "green", "at": "d8ed1f3ead793d77c961b7b360fa271e5e4a62b3" },
"next": "Reviewer: a PASS at this tip (T3), then the queue. No gate file changed; nothing was enqueued from here."
}
```
<!-- /flybot:checkpoint -->
## Verification at the tip
Ran: `cd core && TZ=UTC node --import ./test/harness-resolve.mjs --test
test/install.test.js` → 5/5.
Ran: `cd core && TZ=UTC node --import ./test/harness-resolve.mjs --test
test/settings-readonly-pages.test.js` → 14/14.
Ran: `cd core && TZ=UTC node --import ./test/harness-resolve.mjs --test
test/message-fold.test.js test/tool-cells.test.js
test/client-bundle.test.js test/empty-message-cell.test.js` → 29/29 (5 /
19 / 2 / 3).
Ran: `node core/scripts/build-client.mjs --check` from the repo root →
exit 0, and `git diff --exit-code -- core/client.js` → exit 0 on the
tree with `client.js` committed.
Ran: `node scripts/ds-bot-patches.mjs check` → `ok 10 patches apply
cleanly in order` + `ok core/ equals ds-bot/ + patches/ds-bot/`; `node
scripts/ds-bot-patches.mjs canonical` → `generate is a no-op`.
Ran: `npm --prefix core run arch-docs` → `arch-docs: OK (2 changed
file(s))`.
Ran: `TZ=UTC TMPDIR=/data/flybot-tmp npm run verify` at this tip → exit
0 (lint, build check, patches check/canonical, core suite,
social/tree/timeline/workflow/project suites).
Red first: on a branch carrying only the two tests, `install.test.js`
read `# tests 5 / # pass 4 / # fail 1` (red at `actual: undefined`) and
`settings-readonly-pages.test.js` read `# tests 14 / # pass 13 / # fail
1` (red at `General draws the folding picker`, `0 !== 1`). With
`channel.js` and `settings.js` restored to `main` on this tree the two
files read `5/4/1` and `14/12/2` — the second red there is the same new
test plus the 7→8 count, which necessarily fails while the picker is
gone.
Not run: no browser click-through (the picker is pressed through the
cell harness, a stateful React mock that runs the real `onClick`). No
`npm ci` / `npm run harness` in this checkout — `node_modules` was
carried over at this same `core/package-lock.json` (byte-identical to
the previous slice's). No smoke test: the change touches no `index.js`
and no host turn path.
1 parent 5ca430c commit 98d2390
14 files changed
Lines changed: 5901 additions & 6341 deletions
File tree
- changelog.d
- core
- src
- client
- host
- test
- docs/subsystems
- patches/ds-bot
- files/test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
486 | 486 | | |
487 | 487 | | |
488 | 488 | | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
489 | 495 | | |
490 | 496 | | |
491 | 497 | | |
| |||
20070 | 20076 | | |
20071 | 20077 | | |
20072 | 20078 | | |
| 20079 | + | |
| 20080 | + | |
20073 | 20081 | | |
20074 | 20082 | | |
20075 | 20083 | | |
| |||
20133 | 20141 | | |
20134 | 20142 | | |
20135 | 20143 | | |
| 20144 | + | |
20136 | 20145 | | |
20137 | 20146 | | |
20138 | 20147 | | |
| |||
20161 | 20170 | | |
20162 | 20171 | | |
20163 | 20172 | | |
| 20173 | + | |
| 20174 | + | |
| 20175 | + | |
| 20176 | + | |
| 20177 | + | |
20164 | 20178 | | |
20165 | 20179 | | |
20166 | 20180 | | |
| |||
20224 | 20238 | | |
20225 | 20239 | | |
20226 | 20240 | | |
| 20241 | + | |
| 20242 | + | |
| 20243 | + | |
| 20244 | + | |
| 20245 | + | |
| 20246 | + | |
| 20247 | + | |
| 20248 | + | |
| 20249 | + | |
| 20250 | + | |
| 20251 | + | |
| 20252 | + | |
| 20253 | + | |
| 20254 | + | |
| 20255 | + | |
| 20256 | + | |
| 20257 | + | |
| 20258 | + | |
| 20259 | + | |
20227 | 20260 | | |
20228 | 20261 | | |
20229 | 20262 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
456 | 456 | | |
457 | 457 | | |
458 | 458 | | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
459 | 465 | | |
460 | 466 | | |
461 | 467 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
57 | 62 | | |
58 | 63 | | |
59 | 64 | | |
| |||
112 | 117 | | |
113 | 118 | | |
114 | 119 | | |
| 120 | + | |
115 | 121 | | |
116 | 122 | | |
117 | 123 | | |
| |||
134 | 140 | | |
135 | 141 | | |
136 | 142 | | |
| 143 | + | |
| 144 | + | |
137 | 145 | | |
138 | 146 | | |
139 | 147 | | |
| |||
162 | 170 | | |
163 | 171 | | |
164 | 172 | | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
165 | 182 | | |
166 | 183 | | |
167 | 184 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
| |||
310 | 313 | | |
311 | 314 | | |
312 | 315 | | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
313 | 325 | | |
314 | 326 | | |
315 | 327 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
204 | 221 | | |
205 | 222 | | |
206 | 223 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
181 | | - | |
| 180 | + | |
| 181 | + | |
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
264 | | - | |
| 264 | + | |
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
| |||
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
278 | 298 | | |
279 | 299 | | |
280 | 300 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
0 commit comments