Repository navigation
Let the team switch the long-document card off (#3114) - #3185
Merged
Merged
Conversation
Settings → General gains a Document cards switch beside the folding mode. Off stores state.prefs.documentCards = false at the top of prefs — beside the folding record, so rewriting a mode never clears it — and makes showsDocumentCard answer false, so a long document folds like any other reply with no card and no Show message text. On is the default, so a team that never touches the switch draws exactly what it drew before. Fixes #3184 Part of #3114
Collaborator
Author
|
Verdict: PASS at a503ee0 Ran at this tip:
What I checked
|
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 #3184
Part of #3114
Owner: Dev
Reviewer: Reviewer
Tier: T3
What changed
Settings → General keeps a Document cards switch in its Message folding section, beside the folding picker and drawn like In other chats. It is on by default and leaves every bubble exactly as it was drawn before the switch existed; switched off, a long document is no longer a card and Show message text goes with it — the reply folds by the chosen mode (compact / standard / none) like any other long message. The choice is written through
set-prefsand stored as the top-levelstate.prefs.documentCards: false, besideprefs.foldingand not inside it, so writing a folding mode never clears it. On is the default, so an explicittrueis read as "clear the record" and stores nothing;nulldoes the same, and any other value is refused withDocument cards must be on or offand stores nothing. A locked (read-only) window draws no switch and keeps the choice as text. The switch reaches the bubble at one point only:showsDocumentCardanswers false when the switch is off. The thresholds, the preview,FoldedContent,shouldFold,previewOfand the streaming-first order infoldBodyare untouched.Checkpoint
{ "pr": 3185, "claim": "Dev", "issue": 3184, "summary": "Settings → General gains a Document cards switch beside the folding picker, on by default. Off stores the top-level state.prefs.documentCards = false so a folding-mode write cannot clear it, and makes showsDocumentCard answer false: a long document folds like any other reply, with no card and no Show message text. On is the default, an explicit true clears the record, and any other value is refused without storing anything. A locked window draws no switch and keeps the choice as text.", "files": [ "core/src/host/channel.js", "core/src/client/message-fold.js", "core/src/client/settings.js", "core/src/client/i18n.js", "core/test/install.test.js", "core/test/message-fold.test.js", "core/test/settings-readonly-pages.test.js", "docs/subsystems/core-host.md", "docs/subsystems/core-client.md", "changelog.d/3114-document-cards-switch.added.md" ], "checks": { "ran": "TZ=UTC TMPDIR=/data/flybot-tmp npm run verify", "result": "green", "at": "a503ee01a6217d5418b138467cf7da9a91c4c61f" }, "next": "none — ready for review" }Verification at the tip a503ee0
Ran:
cd core && TZ=UTC node --import ./test/harness-resolve.mjs --test test/install.test.js→# tests 6 / # pass 6 / # fail 0.cd core && TZ=UTC node --import ./test/harness-resolve.mjs --test test/settings-readonly-pages.test.js→# tests 15 / # pass 15 / # fail 0.cd core && TZ=UTC node --import ./test/harness-resolve.mjs --test test/message-fold.test.js→# tests 10 / # pass 10 / # fail 0.6 / 5 / 1(expected: false / actual: undefined), settings15 / 13 / 2(9 !== 8,1 !== 0), message-fold10 / 8 / 2(undefined !== true,0 !== 1). With the host contract, the UI and thefoldingOfread side in place butshowsDocumentCardstill untouched: settings15/15, install6/6, message-fold9/10, the one red stillno card when the switch is off and compact(0 !== 1). TheshowsDocumentCardshort-circuit alone takes it to10/10.cd core && TZ=UTC node --import ./test/harness-resolve.mjs --test test/tool-cells.test.js test/empty-message-cell.test.js test/earlier-message-actions.test.js test/palette-preview.test.js test/bot-browsers.test.js test/client-bundle.test.js test/i18n.test.js test/i18n-missing-entries.test.js→# tests 79 / # pass 79 / # fail 0(19, 3, 6, 15, 14, 2, 3, 17).cd core && npm run build, then from the rootnode core/scripts/build-client.mjs --check→ exit 0 andgit diff --exit-code -- core/client.js→ exit 0.node scripts/ds-bot-patches.mjs generate→checkendsok 10 patches apply cleanly in order/ok core/ equals ds-bot/ + patches/ds-bot/;canonical→generate is a no-op;patches/ds-bot/topics.json,ds-bot.pin.jsonandds-bot/**unchanged.npm --prefix core run arch-docs→arch-docs: OK (18 changed file(s)).TZ=UTC TMPDIR=/data/flybot-tmp npm run verify→ exit 0.core/client.js,0001,0005,0008,0014and the threepatches/ds-bot/files/mirrors). No gate file, nocore/src/shared/, noplugins/, noauthz.js, no panel file, no package file.Not run:
onClick/onChange), not a real page. The manual gate — wide window with a two-heading document draws a card, General off turns the same message into Show more, a refresh keeps it off, switching back returns the card and Show message text — is what a reader should press once; the host side of it isset-prefsand the client side isfoldingOfreadingprefs.documentCards.npm ciin the plugin packages: their tests resolve DSH fromcore/dev/harness/, andnpm run verifyran them all.core/index.jsand no host runtime path changed.git fetchis unavailable (only api.github.com is reachable), soorigin/mainis a local ref at the base commit and the branch is pushed through the Git data API;is a no-opabove was run against that same base.On a deployment with more than one member,
set-prefsis refused asbot/blocked-shared— the existing behaviour of every team preference (theme, folding), not this switch.