Repository navigation
[WIP] Add replyToId for post back originated from Web Chat - #5871
Draft
William Wong (compulim) wants to merge 34 commits into
Draft
William Wong (compulim) wants to merge 34 commits into
William Wong (compulim) wants to merge 34 commits into
Conversation
William Wong (compulim)
force-pushed
the
feat-postback-reply-to-id
branch
from
October 9, 2026 21:57
2feec1a to
bf34055
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Optional audio content, stricter action validation, incorrect test coverage, and inaccurate API documentation need correction.
8 open findings
Allow titleless tap actions in rich-card validation · New Handle optional audio content before child validation · New Test AudioCardAttachment with the correct audio content type · New Forward the complete middleware request to next · New Use DirectLineCardAction for card action values · New Remove stale readonly-content TODO · New Format expression consistently with repository standards · New Preserve attachment prop checking in animation branch · New
What changed in this PR
Adds originating activity IDs to rich-card postback activities and introduces readonly Valibot-derived React prop types.
Changes:
- Propagates
replyToIdthrough card rendering and postback handling. - Migrates card wrappers from JavaScript/PropTypes to validated TypeScript.
- Adds API documentation, changelog entries, and HTML integration tests.
| File | Description |
|---|---|
packages/react-valibot/src/InferReactProps.ts |
Adds readonly prop inference. |
packages/react-valibot/src/index.ts |
Exports the new type. |
packages/bundle/src/adaptiveCards/createAdaptiveCardsAttachmentMiddleware.tsx |
Supplies originating activity IDs. |
packages/bundle/src/adaptiveCards/Attachment/VideoCardContent.tsx |
Forwards replyToId. |
packages/bundle/src/adaptiveCards/Attachment/VideoCardAttachment.tsx |
Adds validated TSX wrapper. |
packages/bundle/src/adaptiveCards/Attachment/VideoCardAttachment.js |
Removes legacy wrapper. |
packages/bundle/src/adaptiveCards/Attachment/ThumbnailCardContent.tsx |
Forwards replyToId. |
packages/bundle/src/adaptiveCards/Attachment/ThumbnailCardAttachment.tsx |
Adds validated TSX wrapper. |
packages/bundle/src/adaptiveCards/Attachment/ThumbnailCardAttachment.js |
Removes legacy wrapper. |
packages/bundle/src/adaptiveCards/Attachment/SignInCardContent.tsx |
Forwards replyToId. |
packages/bundle/src/adaptiveCards/Attachment/SignInCardAttachment.tsx |
Adds validated TSX wrapper. |
packages/bundle/src/adaptiveCards/Attachment/SignInCardAttachment.js |
Removes legacy wrapper. |
packages/bundle/src/adaptiveCards/Attachment/ReceiptCardContent.tsx |
Forwards replyToId. |
packages/bundle/src/adaptiveCards/Attachment/ReceiptCardAttachment.tsx |
Adds validated TSX wrapper. |
packages/bundle/src/adaptiveCards/Attachment/ReceiptCardAttachment.js |
Removes legacy wrapper. |
packages/bundle/src/adaptiveCards/Attachment/private/directLineSchema.ts |
Uses the extracted action schema. |
packages/bundle/src/adaptiveCards/Attachment/private/directLineCardActionSchema.ts |
Adds action validation. |
packages/bundle/src/adaptiveCards/Attachment/OAuthCardContent.tsx |
Forwards replyToId. |
packages/bundle/src/adaptiveCards/Attachment/OAuthCardAttachment.tsx |
Adds validated TSX wrapper. |
packages/bundle/src/adaptiveCards/Attachment/OAuthCardAttachment.js |
Removes legacy wrapper. |
packages/bundle/src/adaptiveCards/Attachment/HeroCardContent.tsx |
Forwards replyToId. |
packages/bundle/src/adaptiveCards/Attachment/HeroCardAttachment.tsx |
Adds validated TSX wrapper. |
packages/bundle/src/adaptiveCards/Attachment/HeroCardAttachment.js |
Removes legacy wrapper. |
packages/bundle/src/adaptiveCards/Attachment/CommonCard.tsx |
Adds typed common-card rendering. |
packages/bundle/src/adaptiveCards/Attachment/CommonCard.js |
Removes legacy implementation. |
packages/bundle/src/adaptiveCards/Attachment/AudioCardContent.tsx |
Forwards replyToId. |
packages/bundle/src/adaptiveCards/Attachment/AudioCardAttachment.tsx |
Adds validated TSX wrapper. |
packages/bundle/src/adaptiveCards/Attachment/AudioCardAttachment.js |
Removes legacy wrapper. |
packages/bundle/src/adaptiveCards/Attachment/AnimationCardContent.tsx |
Forwards IDs and autoplay state. |
packages/bundle/src/adaptiveCards/Attachment/AnimationCardAttachment.tsx |
Adds validated TSX wrapper. |
packages/bundle/src/adaptiveCards/Attachment/AnimationCardAttachment.js |
Removes legacy wrapper. |
packages/bundle/src/adaptiveCards/Attachment/AdaptiveCardRenderer.tsx |
Uses the extracted action schema. |
packages/api/src/hooks/middleware/createDefaultCardActionMiddleware.ts |
Notes remaining reply handling. |
docs/HOOKS.md |
Documents hook arguments. |
docs/API.md |
Documents middleware context. |
CHANGELOG.md |
Records the feature. |
__tests__/html2/replyToId/cardAction/videoCard.html |
Tests video-card postbacks. |
__tests__/html2/replyToId/cardAction/thumbnailCard.html |
Tests thumbnail-card postbacks. |
__tests__/html2/replyToId/cardAction/signInCard.html |
Tests sign-in-card postbacks. |
__tests__/html2/replyToId/cardAction/receiptCard.html |
Tests receipt-card postbacks. |
__tests__/html2/replyToId/cardAction/oauthCard.html |
Tests OAuth-card postbacks. |
__tests__/html2/replyToId/cardAction/heroCard.html |
Tests hero-card postbacks. |
__tests__/html2/replyToId/cardAction/audioCard.html |
Intended to test audio cards. |
__tests__/html2/replyToId/cardAction/animationCard.html |
Tests animation-card postbacks. |
__tests__/html2/replyToId/cardAction/adaptiveCard.html |
Tests Adaptive Card submissions. |
__tests__/html2/hooks/useSendPostBack.text.html |
Tests textual postbacks. |
__tests__/html2/hooks/useSendPostBack.replyToId.html |
Tests hook-level reply IDs. |
__tests__/html2/hooks/usePerformCardAction.replyToId.html |
Tests middleware propagation. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Updated the cardActionMiddleware documentation to clarify the middleware signature and request structure. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Removed TODO comments regarding content prop validation. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This branch has not been deployed
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.



Changelog Entry
Added
replyToIdfor "post back" card actions, in PR #5871, by @compulimDescription
When clicking on a card action of type
postBack, the outgoing activity will now containreplyToIdto reference which activity it was replying to.Design
Specific Changes
replyToIdfor all card action middlewareInferReactProps<T>for better representing Valibot prop typesCHANGELOG.mdReview Checklist
Accessibility reviewed (tab order, content readability, alt text, color contrast)Browser and platform compatibilities reviewedCSS styles reviewed (minimal rules, noz-index)Internationalization reviewed (strings, unit formatting)package.jsonandpackage-lock.jsonreviewedSecurity reviewed (no data URIs, check for nonce leak)