Repository navigation
Choose the message folding mode in Settings → General (#3114) - #3180
Merged
Merged
Conversation
…preferences (#3114) 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 the picker was missing. `set-prefs` now takes `folding: { mode }`, refuses a mode no bubble can draw, and clears it on `null`; Settings → General draws Compact / Standard / No folding through `Segmented` and writes one `set-prefs` per change, while the read-only window keeps the mode in use as text. The Chinese dictionary carries the new sentences, and the host and client pages say so.
Collaborator
Author
|
Verdict: PASS at d8ed1f3 Ran at this tip: Red first — the same tree with only The three reds are the new expectations plus the 7→8 count that cannot hold without the picker: What I checked
Queued next from here; nothing was merged or labelled by this review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Written-by: Dev
Fixes #3179
Part of #3114
Owner: Dev
Reviewer: Reviewer
Tier: T3
What changed
The reader half shipped in the previous slice:
foldingOfalready folds a bubble byprefs.folding.modeandnonealready folds nothing, but nothing could write the mode, so everywindow folded at the default and Settings had no picker. This closes the writing half only —
core/src/client/message-fold.jsandcore/test/message-fold.test.jsare untouched (A12).Host (
core/src/host/channel.js, +12):set-prefstakesfolding: { mode }, checks it againsta
FOLD_MODESset next toNOTIFY_KINDS, storesstate.prefs.folding, deletes the record onnull, and refuses anything else withMessage folding must be compact, standard or none. Thecheck 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 readsfoldingOf(prefs)and draws aMessage foldingsection — aSegmentedpicker (Compact / Standard / No folding) in a writablewindow, 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 therefusal.
core/client.jsis rebuilt, not hand-edited.Tests:
core/test/install.test.jspins the host half (store, refusal,nullclear,none), andcore/test/settings-readonly-pages.test.jspins the picker and its one write. The#2474count ofGeneral's controls moves from 7 to 8 because the page really draws one more control; the
Send shortcutassertion 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, patches0001,0005,0008,0014, and thefiles/mirror of the test).ds-bot/,patches/ds-bot/topics.json,.github/**,policy/**,scripts/**,core/scripts/**, everypackage.json/package-lock.json,core/src/shared/**andplugins/**are unchanged.
Checkpoint
{ "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." }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 --checkfrom the repo root → exit 0, andgit diff --exit-code -- core/client.js→ exit 0 on the tree withclient.jscommitted.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 verifyat 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.jsread# tests 5 / # pass 4 / # fail 1(red atactual: undefined) andsettings-readonly-pages.test.jsread# tests 14 / # pass 13 / # fail 1(red atGeneral draws the folding picker,0 !== 1). Withchannel.jsandsettings.jsrestored tomainon this tree the two files read5/4/1and14/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). Nonpm ci/npm run harnessin this checkout —node_moduleswas carried over at this samecore/package-lock.json(byte-identical to the previous slice's). No smoke test: the change touches noindex.jsand no host turn path.