Skip to content

docs: update dialog guides to current SDK patterns#2795

Merged
heyitsaamir merged 2 commits intomainfrom
docs/update-dialog-patterns
Apr 28, 2026
Merged

docs: update dialog guides to current SDK patterns#2795
heyitsaamir merged 2 commits intomainfrom
docs/update-dialog-patterns

Conversation

@heyitsaamir
Copy link
Copy Markdown
Collaborator

@heyitsaamir heyitsaamir commented Apr 27, 2026

Summary

  • replaced deprecated TaskFetchAction/TaskFetchData with OpenDialogData in TS and Python dialog docs
  • switched from single catch-all handlers with if-else routing to per-dialog sub-routes (dialog.open.simple_form / @app.on_dialog_open("simple_form"))
  • updated submit handling to use SubmitData for action-based routing instead of manual submissiondialogtype fields
  • simplified Python examples by dropping unnecessary InvokeResponse(body=...) wrapping

Test plan

  • npm run generate:docs in teams.md/ generates cleanly
  • review TS dialog pages: creating-dialogs, handling-dialog-submissions, handling-multi-step-forms
  • review Python dialog pages: same three
  • code examples match actual SDK exports (OpenDialogData, SubmitData from @microsoft/teams.cards / microsoft_teams.cards)

The TS and Python dialog docs were using deprecated TaskFetchAction/TaskFetchData
and manual if-else routing. Updated to use the current SDK patterns: OpenDialogData
for triggering, SubmitData for submit routing, and per-dialog handler registration
instead of catch-all handlers.

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 27, 2026 23:35
Copy link
Copy Markdown
Contributor

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

Updates the Teams SDK dialog documentation to reflect current handler-routing patterns and newer OpenDialogData / SubmitData shapes, reducing boilerplate in examples.

Changes:

  • Replace deprecated TaskFetchAction/TaskFetchData patterns with OpenDialogData (TS/Python).
  • Switch from catch-all handlers to per-dialog/per-action routes (dialog.open.<id>, dialog.submit.<action>, @app.on_dialog_open("<id>"), @app.on_dialog_submit("<action>")).
  • Simplify dialog submit responses in Python by returning TaskModuleResponse directly (no InvokeResponse(body=...) wrapping).

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
teams.md/src/pages/templates/in-depth-guides/dialogs/creating-dialogs.mdx Adds guidance encouraging per-dialog handlers over if/else routing.
teams.md/src/components/include/in-depth-guides/dialogs/creating-dialogs/typescript.incl.md Updates TS dialog open + submit examples to OpenDialogData/SubmitData and scoped routes.
teams.md/src/components/include/in-depth-guides/dialogs/creating-dialogs/python.incl.md Updates Python dialog open examples to OpenDialogData and @app.on_dialog_open("<id>") routing.
teams.md/src/components/include/in-depth-guides/dialogs/handling-dialog-submissions/typescript.incl.md Updates TS submission handling to dialog.submit.<action> routing guidance and examples.
teams.md/src/components/include/in-depth-guides/dialogs/handling-dialog-submissions/python.incl.md Updates Python submission handling to action-scoped @app.on_dialog_submit("<action>").
teams.md/src/components/include/in-depth-guides/dialogs/handling-multi-step-forms/typescript.incl.md Refactors TS multi-step dialog example to step-specific submit routes + SubmitData state passing.
teams.md/src/components/include/in-depth-guides/dialogs/handling-multi-step-forms/python.incl.md Refactors Python multi-step dialog example to step-specific submit routes + SubmitData state passing.

The tip was in the shared template, which would show it for C# too
(where the old catch-all pattern is still used). Moved it into the
language-specific includes with language-appropriate syntax.

Co-Authored-By: Claude <noreply@anthropic.com>
@heyitsaamir heyitsaamir requested a review from corinagum April 28, 2026 00:32
Copy link
Copy Markdown
Collaborator

@singhk97 singhk97 left a comment

Choose a reason for hiding this comment

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

lgtm

@heyitsaamir heyitsaamir merged commit 03fb8e2 into main Apr 28, 2026
2 checks passed
@heyitsaamir heyitsaamir deleted the docs/update-dialog-patterns branch April 28, 2026 18:20
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