Skip to content

[WIP] Add replyToId for post back originated from Web Chat - #5871

Draft
William Wong (compulim) wants to merge 34 commits into
mainfrom
feat-postback-reply-to-id
Draft

William Wong (compulim) wants to merge 34 commits into
mainfrom
feat-postback-reply-to-id

Conversation

@compulim

@compulim William Wong (compulim) commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Related to #5862.

Changelog Entry

Added

  • Rich cards: added fill-in of replyToId for "post back" card actions, in PR #5871, by @compulim

Description

When clicking on a card action of type postBack, the outgoing activity will now contain replyToId to reference which activity it was replying to.

Design

Specific Changes

  • Added replyToId for all card action middleware
  • Added InferReactProps<T> for better representing Valibot prop types
  • I have added tests and executed them locally
  • I have updated CHANGELOG.md
  • I have updated documentation

Review Checklist

This section is for contributors to review your work.

  • Accessibility reviewed (tab order, content readability, alt text, color contrast)
  • Browser and platform compatibilities reviewed
  • CSS styles reviewed (minimal rules, no z-index)
  • Documents reviewed (docs, samples, live demo)
  • Internationalization reviewed (strings, unit formatting)
  • package.json and package-lock.json reviewed
  • Security reviewed (no data URIs, check for nonce leak)
  • Tests reviewed (coverage, legitimacy)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Optional audio content, stricter action validation, incorrect test coverage, and inaccurate API documentation need correction.

8 open findings
What changed in this PR

Adds originating activity IDs to rich-card postback activities and introduces readonly Valibot-derived React prop types.

Changes:

  • Propagates replyToId through 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.

Comment thread packages/bundle/src/adaptiveCards/Attachment/AudioCardAttachment.tsx Outdated
Comment thread __tests__/html2/replyToId/cardAction/audioCard.html Outdated
Comment thread docs/API.md Outdated
Comment thread docs/HOOKS.md
Comment thread packages/bundle/src/adaptiveCards/Attachment/HeroCardAttachment.tsx
Comment thread packages/bundle/src/adaptiveCards/Attachment/OAuthCardAttachment.tsx Outdated
Comment thread packages/bundle/src/adaptiveCards/createAdaptiveCardsAttachmentMiddleware.tsx Outdated
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

No deployments
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.

2 participants