Repository navigation
Description
Context
Found while working #4154. A not-posted draft in the GitHub kit can show less than it asks the user to approve, and nothing guards the W1 issue approval against the same cut.
brain_github_issue_createaccepts a body of up to 65,536 characters (GITHUB_LIMITS.writeBodyChars,packages/ui-sdk/src/tool-contracts/github.ts:78; the create schema'sbodyatpackages/ui-sdk/src/tool-contracts/github.ts:134).- The kit's shared
Bodyhard-cuts atBODY_MAX_CHARS = 20_000(packages/ui-kit/src/github/object-parts.tsx:12, used atpackages/ui-kit/src/github/object-parts.tsx:84), its draft branch included.GitHubPullRequestinpreviewrenders its draft through that branch (packages/ui-kit/src/github/GitHubPullRequest.tsx:286-293), so a draft longer than 20,000 characters is cut, and the note under it says "Truncated · the rest is on GitHub", which is false for a draft that is not on GitHub yet. - The W1 issue approval (
GitHubIssuewithposting: { status: "preview" }, rendered byGithubCreatePreviewinpackages/ui-react/src/components/chat/tool-cards/github-cards.tsx) does not go throughBodyon main: its "As shown" pane is an unboundedUntrustedText(packages/ui-kit/src/github/GitHubIssue.tsx:94), so it already renders the whole body. Nothing proves that, so a refactor onto the sharedBodywould bring the 20,000-character cut back silently.
#4154 fixed the same gap for the W4 comment preview: GitHubComment in preview no longer applies its posted-comment bound.
Scope
Make the kit's draft body render the whole approved body, the same way the W4 preview does: the draft branch of Body (used by GitHubPullRequest preview) applies no bound and no "rest is on GitHub" note. Keep Body's 8-line clamp and its expand control, which names the total length. Guard the W1 GitHubIssue preview's whole-body rendering with a test and a story. Leave the bound on posted and read bodies unchanged.
Out of scope
Changing GITHUB_LIMITS, the tool schemas or the host's write path. Restyling W1 (it keeps its As shown / Exact text switch and gains no clamp). The read path's own body bounds.
Acceptance criteria
- A W1 preview (
GitHubIssue,posting: { status: "preview" }) and aGitHubPullRequestpreview whose body is longer than 20,000 characters render all of it, and show no "Truncated" note. A kit unit test proves this, and it fails when the cut is restored. - A read or posted issue/PR body keeps its 20,000-character bound and its "Truncated" note, proven by the same test.
- A W1 story with a long draft passes in both theme projects at 320px and desktop.
Verification
bun run test packages/ui-kit/tests and the kit storybook projects for stories/github/GitHubWrite.stories.tsx (and GitHubIssue.stories.tsx).
Contract impact
None: kit rendering only.
Corrected 2026-11-17 while claiming: the W1 issue preview does not render through Body on main and already shows the whole body; the 20,000-character draft cut lives in Body's draft branch, which GitHubPullRequest preview uses. Scope and criteria now name both, and keep the W1 guard as a test and a story.
Activity
schlessera commentedon Nov 17, 2026
Decision (maintainer, 2026-11-17): in 0.45.0 at
priority: p2.schlessera commentedon Nov 17, 2026
Claimed for implementation. Claim token:
claim-882f77d2. Branch:fix/4197-w1-preview-whole-body.path collision with #4198 on packages/ui-kit/stories/github/GitHubWrite.stories.tsx (same gap for W4); will merge origin/main if it lands first
schlessera commentedon Nov 17, 2026
Readiness correction (2026-11-17), folded into the body: on main the W1 issue preview (
GitHubIssue,posting: { status: "preview" }) does not render through the kit'sBody. Its "As shown" pane is an unboundedUntrustedText(packages/ui-kit/src/github/GitHubIssue.tsx:94), and rendering a 30,000-character draft shows all of it with no "Truncated" note. The 20,000-character draft cut lives inBody's draft branch, whichGitHubPullRequestinpreviewuses, and its note there says "the rest is on GitHub" for a draft that is not on GitHub yet.The fix keeps the issue's intent (a draft is never cut):
Body's draft branch renders the whole body like the W4 preview after #4154, and a unit test plus a long-draft W1 story guard the W1 preview against the cut coming back. No new scope beyond the citedBodydraft branch.fix(ui-kit): a not-posted GitHub draft shows its whole body (#4197) (#…
schlessera commentedon Nov 17, 2026
Merged in #4199 as
51d0f6de6through the integration lease (orchestrator merge queue for 0.45.0). Candidate confirmation passed on the exact head; the squash's own main run carries the post-merge heavy categories.