Repository navigation
fix(ui-kit): a not-posted GitHub draft shows its whole body (#4197) - #4199
Conversation
The shared Body cut a draft at the read bodies' 20,000-character bound and said the rest was on GitHub. A draft is what the host posts, up to 65,536 characters, so the draft branch now applies no bound, as the W4 comment preview does after #4154. Read bodies keep the bound and note. A unit test and long-draft stories (W1 issue approval, PR preview, both widths) prove a draft is never cut and a read body still is. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No uploads on this PR yet This PR changes UI files (
Tips for agentsLabel each shot so reviewers know what they're seeing. Labels apply to every file in a call, so run one uploads put after.png --pr 4199 --meta path=/settings --state after --caption "Saved settings toast"
uploads put chat.png --pr 4199 --app ios --screen "Chat" --state afterNo CLI? With the Uploads MCP, call This comment updates with each upload, so you don't need to post the images yourself. A shot or two in the PR description is still welcome. Check what's attached with Workspace admins can turn this comment off in Settings → GitHub · docs |
|
Collisions ( #4198 also adds stories at the end of |
Independent reviewReviewed head 5bbdff7 against base 0babede. Reviewer: agent. No findings. {
"version": 1,
"kind": "brain-review-receipt",
"pr": 4199,
"head": "5bbdff7bdfcc6bab7948b338e22ad541cce0e5fe",
"base": "0babedee2b94fb8ae06d3fac7c16917903e2f4e3",
"reviewer": "agent",
"outcome": "no-findings",
"findings": []
} |
|
Infrastructure retry (orchestrator): confirmation run 44177638029 on head Purpose: one new confirmation request on the same head, to get complete exact-head proof. The failed job was not rerun. If discovery fails again without new evidence, the PR goes to diagnosis under #4241 instead of another retry. |
Closes #4197. Part of #3791.
What changed
A not-posted GitHub draft in the kit now shows its whole body.
Body's draft branch (packages/ui-kit/src/github/object-parts.tsx) applies no bound. It used to cut a draft at the read bodies' 20,000-character bound and say "Truncated · the rest is on GitHub", which is false for a draft that is not on GitHub yet. The host posts up to 65,536 characters (GITHUB_LIMITS.writeBodyChars). The 8-line clamp stays, and its expand control names the whole length.GitHubPullRequestinpreviewuses this branch.BODY_MAX_CHARS = 20_000and their "Truncated" note.GitHubIssue,posting: { status: "preview" }) did not go throughBodyon main. Its "As shown" pane already rendered the whole body, but nothing proved it. A unit test and a long-draft story now do.This mirrors #4198 (#4154), where
GitHubCommentinpreviewdrops the posted-comment bound.Issue correction. The issue said W1 renders through
Body. It does not on main. I folded the correction into the issue body and posted a dated comment. The scope is still the citedBodydraft branch. No styling changes: W1 keeps its As shown / Exact text switch and gains no clamp.Proof
Unit (
packages/ui-kit/tests/github-draft-body.test.tsx, new): a draft of more than 25,000 characters renders whole with no "Truncated" in the W1 issue preview and the PR preview. An issue and a PR as read stay cut at the bound and show the note.bun run test packages/ui-kit/tests: 1102 pass, 0 fail.Failing-first and mutation receipts. Each mutation was applied, the named assertion failed, and the source was restored.
Bodydraft branch getsmaxChars={BODY_MAX_CHARS}back (= main).PR_PREVIEW_WHOLE_BODYfails. The received text ends at the cut with "Truncated · the rest is on GitHub". 4 pass, 1 fail.ISSUE_READ_BOUNDandPR_READ_BOUNDfail. 3 pass, 2 fail.UntrustedTextis cut at 20,000.W1_PREVIEW_WHOLE_BODYfails. 4 pass, 1 fail.GitHub/WriteW1LongDraftandW1LongDraftNarrow,GitHub/GitHubPullRequestPreviewLongDraftandPreviewLongDraftNarrow, instorybookandstorybook-light) fail on 'a draft is never shown cut'. 8 failed, 66 passed.Real browser. Host Chromium 1243, outside the command sandbox, on a built tree. The kit storybook projects
storybook(dark) andstorybook-lightranGitHubWrite,GitHubPullRequestandGitHubIssuewith the a11y gate aterror: 106/106 passed. That covers the new long-draft stories at 320px and at desktop width in both themes. The PR preview story opens the clamp through "Show full description · N characters" and checks the last line. The W1 story checks the last line in As shown and in Exact text.No new pixel baselines. The
subjects.visual.tsxlist is explicit and does not include the new stories.Typecheck: root
bun run typecheckpasses. No exports changed:object-parts.tsxis internal, andBODY_MAX_CHARSis now exported from that module only, for the test.Collisions (
bun scripts/collisions.ts --json --pr 4199, head5bbdff7bd): nopathortextualcollisions. Closure-only collisions with #3054, #3056, #3059, #3069, #3581, #3622, #4151, #4173, #4177, #4179, #4194, #4196 and #4198. If #4198 lands first, I'll mergeorigin/mainand keep its W4 stories inGitHubWrite.stories.tsx.Contract impact: none. This is kit rendering only.
Changeset:
.changeset/github-draft-body-whole.md(@schlessera/brain-ui-kitpatch).{"version":1,"kind":"brain-check-pr-receipt","head":"5bbdff7bdfcc6bab7948b338e22ad541cce0e5fe","base":"origin/main","mode":"focused","startedAt":"2026-11-17T17:57:47.088Z","finishedAt":"2026-11-17T17:58:33.137Z","checks":[{"name":"all lint and leakage gates","categories":["changeset"],"outcome":"passed","elapsedMs":13895.289138},{"name":"environment documentation","categories":["changeset"],"outcome":"passed","elapsedMs":104.48015399999713},{"name":"pending changeset package names","categories":["changeset"],"outcome":"passed","elapsedMs":99.20082600000023},{"name":"contribution changeset","categories":["changeset"],"outcome":"passed","elapsedMs":18.388457000000926},{"name":"affected fast invariants","categories":["verify","unit"],"outcome":"passed","elapsedMs":31915.869445000004}]}🤖 Generated with Claude Code