Skip to content

Draw a long document as a card you can read beside the conversation (#3114) - #3183

Merged
Birfy merged 1 commit into
mainfrom
dev/3114-document-card
Nov 18, 2026
Merged

Birfy merged 1 commit into
mainfrom
dev/3114-document-card

Conversation

@Birfy

@Birfy Birfy commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Written-by: Dev

Fixes #3182
Part of #3114

Owner: Dev
Reviewer: Reviewer
Tier: T1

A reply that reads as a document — over the standard cap (12 lines / 800 characters) and either headed in two places or broken into three --- sections — is no longer drawn as a long bubble. The bubble carries one card instead: the first heading as its title, a {n} sections count and Open beside the conversation. The card opens the whole text in the right-hand panel as its own document view, closable with × and closed again when the conversation moves on; Show message text under the card reads the whole text in place. none folding draws no card and the whole text, and a reply still streaming is never a card. The recognition reads headings and section breaks outside code blocks only — a heading inside one is content.

foldBody gains two optional properties, actions and sessionId, and only its two existing call sites pass them (cells.js, user-message.js). The thresholds, the preview, FoldedContent and foldingOf are untouched, and documentCards is not a stored preference in this slice — the card follows the folding mode (none turns it off), as #3112's default does.

{
  "pr": 3183,
  "claim": "Dev",
  "issue": 3182,
  "summary": "A long message that reads as a document is drawn as one card in the bubble instead of a long folded reply: title, section count and Open beside the conversation. The card opens the whole text in the right-hand panel as a document view, closable with × and closed when the conversation changes; Show message text reads it in place. none folding and a streaming reply draw no card. The recognition counts headings and --- sections outside code blocks, and foldBody gained only two optional properties.",
  "files": [
    "core/src/client/message-fold.js",
    "core/src/client/index.js",
    "core/src/client/browser-pane.js",
    "core/src/client/overlays.js",
    "core/src/client/cells.js",
    "core/src/client/user-message.js",
    "core/src/client/styles.js",
    "core/src/client/i18n.js",
    "core/test/message-fold.test.js",
    "docs/subsystems/core-client.md",
    "changelog.d/3114-document-cards.added.md"
  ],
  "checks": { "ran": "cd core && TZ=UTC node --import ./test/harness-resolve.mjs --test test/message-fold.test.js", "result": "green", "at": "c498c5aac80b27c7a51d1036046114e2863547a7" },
  "next": "none — ready for review"
}

Verification at the tip c498c5a

Ran:

  • cd core && TZ=UTC node --import ./test/harness-resolve.mjs --test test/message-fold.test.js → # tests 9 / # pass 9 / # fail 0; with the document branch and the two call sites reverted the same command reads # tests 9 / # pass 6 / # fail 3, the three sentences this slice names (the bubble carries a document card 0 !== 1, there is a card to open 0 !== 1, + 'Show more' / - 'Show message text').
  • cd core && TZ=UTC node --import ./test/harness-resolve.mjs --test test/tool-cells.test.js test/empty-message-cell.test.js test/palette-preview.test.js test/client-bundle.test.js test/settings-readonly-pages.test.js test/bot-browsers.test.js test/earlier-message-actions.test.js → # tests 73 / # pass 73 / # fail 0 (19, 3, 15, 2, 14, 14, 6).
  • node core/scripts/build-client.mjs --check from the repository root → exit 0, and git diff --exit-code -- core/client.js → exit 0, on the tree with core/client.js committed.
  • node scripts/ds-bot-patches.mjs check → ok 10 patches apply cleanly in order and ok core/ equals ds-bot/ + patches/ds-bot/; node scripts/ds-bot-patches.mjs canonical → generate is a no-op.
  • npm --prefix core run arch-docs → arch-docs: OK (17 changed file(s)); cd core && npm run lint → 0 errors.
  • TZ=UTC TMPDIR=/data/flybot-tmp npm run verify → exit 0 (lint, arch-docs, build check, patches check/canonical, the core suite and both plugin suites, every block # fail 0).
  • 17 changed files: the 11 hand-written ones (261 + 28 = 289 lines; the slice planned 218 + 25 = 243, and the 46 over are the card/pane component code and the comments that name the document view, still under T1's 400-line cap) and the 6 generated ones (core/client.js, three patches/ds-bot/*.patch, two patches/ds-bot/files/ mirrors). No gate file, no ds-bot/, no topics.json, no ds-bot.pin.json, no core/src/host/, no core/src/shared/, no plugins/.

Not run:

  • No browser click-through: the card, the in-place expansion and the pane are pressed through the cell harness (a stateful React mock that runs the cell's real onClick), not a real page. What a reader sees in a wide window — one card, the first heading as the title, 2 sections, the panel with the same title and the last line of the text, × closing it, Show message text returning the whole text to the bubble — is checked by those draws and by reading index.js/overlays.js/browser-pane.js by hand.
  • No npm ci / npm run harness: node_modules were carried over at the same dependency tree (version-only difference in core/package.json and its lockfile from the previous slice).
  • No smoke test: no core/index.js and no host path changed.
  • git fetch is unavailable (only api.github.com is reachable), so origin/main is a local ref to the base commit's tree and the branch is pushed through the Git data API.

…3114)

A reply over the standard cap that carries two headings or three --- sections
is drawn as a card in the bubble: title, section count, Open beside the
conversation. It opens the whole text in the panel as the document view, and
Show message text reads it in place. none folding draws no card.
@Birfy Birfy added the agent-pr Pull request opened by an agent label Nov 18, 2026
@Birfy Birfy self-assigned this Nov 18, 2026
@Birfy
Birfy added this pull request to the merge queue Nov 18, 2026
Merged via the queue into main with commit 25d54e4 Nov 18, 2026
18 of 20 checks passed
@Birfy
Birfy deleted the dev/3114-document-card branch November 18, 2026 19:20
@github-actions github-actions Bot removed the agent-pr Pull request opened by an agent label Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[#3114] 长文档卡片:气泡出卡,对话旁读全文,或就地展开

1 participant