Skip to content

feat(react): support previous message role context and spacing - #1498

Merged
blove merged 2 commits into
mainfrom
blove/react-message-previous-role
Nov 9, 2026
Merged

blove merged 2 commits into
mainfrom
blove/react-message-previous-role

Conversation

@blove

@blove blove commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Custom message renderers can now forward the immediately preceding projected row's role to ChatMessage. This preserves assistant-to-user spacing through wrappers and updates the following row when its predecessor changes, while unrelated historical rows retain memoized rendering. Omitted context retains the existing sibling fallback; explicit context takes precedence.

The native example dogfoods primitive prevRole forwarding. The readonly optional prop and row-context field preserve one-argument renderers, enriched row inference, rich content ownership, scrolling, and current/streaming indicators. Guides and generated API snapshots describe the bounded spacing behavior; automatic control reveal and full T23 parity remain open.

Validation:

  • React: 884 tests across 46 files, type contracts, lint, ten package builds, and source/built boundaries passed.
  • Native: 313 component tests and all 45 E2E cases passed with no failures, flaky cases, or skips. The retained production case verified real view unmounting, owner lifetime, and physical cancellation. The owned walkthrough closed at exactly 7/7 requests.
  • Installed consumers: 16 ESM/type exports, strict declarations with skipLibCheck:false, and 28 browser scenarios passed, including wrapped/default rows, explicit precedence, and LTR/RTL computed spacing. All previous corruption guards remain; package tooling passed 100 tests.
  • Four retained cross-framework profiles and their complete package/source/build/output maps were independently checked against frozen source. All four profiles and the packed consumer were renewed after correcting the candidate verifier to require the original 27 cases for both frameworks, plus exactly one React spacing case. The actual candidate replay passed React 28 and Angular 27 cases with unchanged request guards.
  • Inventory/boundary tooling passed 580 tests; all 12 documentation examples compiled; API checks covered 30 entrypoints and 749 symbols with zero missing summaries. Independent spec, quality, and artifact reviews approved the change.

@vercel

vercel Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
threadplane Ready Ready Preview Nov 9, 2026 10:43am UTC

Request Review

@blove
blove merged commit 67e4116 into main Nov 9, 2026
90 checks passed
@blove
blove deleted the blove/react-message-previous-role branch November 9, 2026 11:26

This branch was successfully deployed

1 active deployment
Preview – threadplane — 4b6ac1a1 Deployed Nov 9, 2026 by vercel[bot]
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.

1 participant