Repository navigation
Fold a long reply to its preview with Show more (#3114) - #3178
Merged
Merged
Conversation
Five cases: the caps, the preview cut and code-block closing, the bubble's single control, opening and folding back, and no fold while streaming or under the cap. The module exists but no bubble draws it yet, so the two draw cases are the red half.
A reply over the standard cap (12 lines or 800 characters) now draws a whole-line preview with one Show more control in the bubble; the control opens the whole reply and becomes Show less. A streaming reply and one at or under the cap are never folded, and the preview closes a code block it opens. foldingOf(roster.prefs) reads the mode, standard by default. The bubble hands the renderer over as the draw property, not as children: a cell component is expanded from its props alone. The document card and the Settings preference are the next slice. core/client.js and patches/ds-bot/ are generated (npm run build, ds-bot-patches generate); docs/subsystems/core-client.md carries the rule.
Collaborator
Author
|
Written-by: Dev PR opened at tip |
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 #3177
Part of #3114
Owner: Dev
Reviewer: Reviewer
Tier: T1
What changed
A reply over the standard cap (12 lines or 800 characters, whichever comes first) now draws a whole-line preview inside its bubble with one Show more control; pressing it draws the whole reply and the control becomes Show less. A reply still streaming, and one at or under the cap, are never folded, and a preview never leaves a code block open.
foldingOf(roster.prefs)reads the mode —standardby default,nonefolding nothing — so the Settings slice has a read to write through. The document card and the Settings preference are the next slice, not this one.The bubble hands the renderer over as the
drawproperty, not as children: a cell component is expanded from its props alone (core/test/tool-cells.test.jsL55–60), and a children-based fold made five of those cases red.core/client.js,patches/ds-bot/0003,patches/ds-bot/0008and the twopatches/ds-bot/files/mirrors are generated bynpm run buildandnode scripts/ds-bot-patches.mjs generate;core/src/client/i18n.jsis untouched becauseShow more/Show lesswere already there.Twelve files, not the eleven the slice counted:
core/client.jsis carried by patch0008-client-bundle, andds-bot-patches checkfails unless that patch moves with it, so the generated set is five files. Hand-written is exactly 282 changed lines (+280/−2) across the seven source files.Checkpoint
{
"pr": 3178, "claim": "Dev", "issue": 3177,
"summary": "A long chat reply now folds to a whole-line preview with one Show more control in the bubble; the control opens the whole reply and becomes Show less. Streaming replies and replies at or under the standard cap are never folded, and a preview never leaves a code block open. foldingOf(roster.prefs) reads the mode so the Settings slice has a read to write through. The renderer reaches the bubble as the draw property, not as children, because a cell component is expanded from its props alone.",
"files": ["changelog.d/3114-message-folding.added.md", "core/client.js", "core/src/client/cells.js", "core/src/client/message-fold.js", "core/src/client/styles.js", "core/src/client/user-message.js", "core/test/message-fold.test.js", "docs/subsystems/core-client.md", "patches/ds-bot/0003-flybot-api-client.patch", "patches/ds-bot/0008-client-bundle.patch", "patches/ds-bot/files/src/client/message-fold.js", "patches/ds-bot/files/test/message-fold.test.js"],
"checks": { "ran": "TZ=UTC TMPDIR=/data/flybot-tmp npm run verify", "result": "green", "at": "e8025b4ea2d23b56ca3871928937f4c58880b0d0" },
"next": "none — ready for review"
}
Verification at the tip
Ran:
cd core && TZ=UTC node --import ./test/harness-resolve.mjs --test test/message-fold.test.js→# tests 5 / # pass 5 / # fail 0cd core && TZ=UTC node --import ./test/harness-resolve.mjs --test "test/{empty-message-cell,tool-cells,palette-preview}.test.js"→# tests 37 / # pass 37 / # fail 0(3 / 19 / 15)cd core && TZ=UTC node --import ./test/harness-resolve.mjs --test test/client-bundle.test.js→# tests 2 / # pass 2 / # fail 0node core/scripts/build-client.mjs --check→ exit 0, thengit diff --exit-code core/client.js→ exit 0 (on the tree withclient.jscommitted)node scripts/ds-bot-patches.mjs check→ pin, 10 patches,core/ equals ds-bot/ + patches/ds-bot/all ok;canonical→generate is a no-opnpm --prefix core run arch-docs→arch-docs: OKgit diff --name-only origin/main...HEAD | grep -E '^(\.github/|policy/|scripts/|core/scripts/|.*package\.json$|.*package-lock\.json$)'→ empty;-- core/src/client/i18n.js→ emptygit diff --numstat origin/main...HEADover the seven hand-written files →280+2 = 282message-fold.jsand its test on the tree (no call site) →# tests 5 / # pass 3 / # fail 2,the bubble carries a fold controlandCannot read properties of undefined (reading 'props')TZ=UTC TMPDIR=/data/flybot-tmp npm run verify→ exit 0Not run:
npm ci/npm run harnessin this checkout:node_moduleswas carried over from the previous slice at the samecore/package-lock.json;npm run buildand every suite above ran on it.git fetchis unavailable on this box (no git on PATH by default; a bundled git 2.53 was used for the repo's own git-dependent gates), soorigin/mainis a local ref to baseb303da8a2dd8, whose tree equalsmain's tree read through the API.