Skip to content

Update quoted replies & new quotes features#482

Open
corinagum wants to merge 12 commits intomainfrom
cg/quoted-replies
Open

Update quoted replies & new quotes features#482
corinagum wants to merge 12 commits intomainfrom
cg/quoted-replies

Conversation

@corinagum
Copy link
Collaborator

@corinagum corinagum commented Mar 23, 2026

image
  • Remove withReplyToId(): replyToId body property has no effect on threading (APX only uses it for encryption)
  • Add QuotedReplyEntity type with nested quotedReply data object (messageId required, senderId/senderName/preview/time/isReplyDeleted/validatedMessageReference optional)
  • Add getQuotedMessages() on MessageActivity to read inbound quoted reply entities
  • Add addQuotedReply(messageId, response?) builder on MessageActivity for constructing outbound quotes (build order = reading order)
  • Update reply() to stamp quotedReply entity + <quoted messageId="..."/> placeholder instead of blockquote HTML; remove replyToId assignment
  • Add quoteReply(messageId, activity) on ActivityContext for quoting arbitrary messages
  • Mark all quoted reply types and methods as @experimental
  • Fix bug in ActivityContext constructor where Object.assign(this, rest) ran before MessageActivity.from().toInterface(), causing interface methods (getQuotedMessages, stripMentionsText, isRecipientMentioned, getAccountMention) to be missing on context.activity. Added regression test.
  • Add quoted-replies example exercising all APIs

@corinagum corinagum marked this pull request as ready for review March 24, 2026 18:19
@corinagum corinagum requested a review from Copilot March 24, 2026 21:43
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the SDK’s reply/quote behavior to use Teams “quoted replies” (entity + <quoted .../> placeholder) instead of replyToId/blockquote HTML, adds first-class quoted-reply types/APIs, fixes an ActivityContext constructor enrichment bug, and introduces an example app to exercise the new functionality.

Changes:

  • Add QuotedReplyEntity/QuotedReplyData, plumb into Entity union, and add MessageActivity.getQuotedMessages() + addQuotedReply().
  • Update ActivityContext.reply() to stamp quoted-reply metadata + placeholder, and add ActivityContext.quoteReply(messageId, ...).
  • Fix ActivityContext constructor ordering bug (enrichment before Object.assign) and add regression tests + a new quoted-replies example.

Reviewed changes

Copilot reviewed 16 out of 19 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
packages/apps/src/contexts/activity.ts Adds quoteReply() API, changes reply() quoting behavior, and fixes constructor activity enrichment ordering.
packages/apps/src/contexts/activity.test.ts Updates tests to assert quoted-reply entity + placeholder behavior for reply() and quoteReply().
packages/apps/src/app.process.spec.ts Regression test ensuring message activities are enriched with interface methods (e.g., getQuotedMessages).
packages/api/src/models/entity/quoted-reply-entity.ts Introduces QuotedReplyEntity and nested quoted reply data model.
packages/api/src/models/entity/index.ts Exposes QuotedReplyEntity via the Entity union and exports.
packages/api/src/activities/message/message.ts Adds getQuotedMessages() and addQuotedReply() builder API.
packages/api/src/activities/message/message.spec.ts Adds unit tests for quoted-reply parsing and builder behavior.
packages/api/src/activities/activity.ts Removes withReplyToId() builder method.
packages/api/src/activities/activity.spec.ts Updates tests to reflect removal of withReplyToId().
package-lock.json Adds the new @examples/quoted-replies workspace entry.
examples/quoted-replies/** New runnable example demonstrating reading/sending quoted replies.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@corinagum corinagum changed the title Update quoted replies Update quoted replies & new quotes features Mar 25, 2026
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
heyitsaamir
heyitsaamir previously approved these changes Mar 26, 2026
Copy link
Collaborator

@heyitsaamir heyitsaamir left a comment

Choose a reason for hiding this comment

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

lg2m. Lmk if we change between quoteReply and quote. Both sound ok to me!

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.

3 participants