feat: add action-based sub-route routing for dialogs and card actions#529
Open
heyitsaamir wants to merge 5 commits intomainfrom
Open
feat: add action-based sub-route routing for dialogs and card actions#529heyitsaamir wants to merge 5 commits intomainfrom
heyitsaamir wants to merge 5 commits intomainfrom
Conversation
Enable targeted routing for dialog open/submit and card action events using dot-separated identifiers (e.g., `dialog.open.simple_form`), matching the established sub-route pattern used by file.consent and message.submit routes. Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds action-based sub-route routing for specific invoke activities so handlers can be registered as dialog.open.{dialogId}, dialog.submit.{action}, and card.action.{action}, consistent with existing sub-route patterns like file.consent.accept and message.submit.feedback.
Changes:
- Extends invoke route typings to include
dialog.open.*,dialog.submit.*, andcard.action.*route keys. - Updates
Routerinvoke matching to select sub-routes based on reserved payload fields (value.data.dialog_id,value.data.action,value.action.data.action). - Adds router tests validating sub-route selection and continued catch-all behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/apps/src/routes/invoke/index.ts | Wires new sub-route type maps into the invoke route surface and exports them. |
| packages/apps/src/routes/invoke/dialog-open.ts | Introduces dialog.open.${string} route typing for task/fetch invokes. |
| packages/apps/src/routes/invoke/dialog-submit.ts | Introduces dialog.submit.${string} route typing for task/submit invokes. |
| packages/apps/src/routes/invoke/card-action.ts | Introduces card.action.${string} route typing for adaptiveCard/action invokes. |
| packages/apps/src/router/router.ts | Adds runtime selection logic for the new sub-routes. |
| packages/apps/src/router/router.spec.ts | Adds unit tests for the new invoke sub-route selection behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Replace manual dispatch (switch/if on dialog_id/action) with targeted sub-route handlers and remove `as any` casts from router tests. Co-Authored-By: Claude <noreply@anthropic.com>
Use === comparison against template literals instead of startsWith/slice, eliminating the need for string casts and staying consistent with the file.consent and message.submit selector patterns. Co-Authored-By: Claude <noreply@anthropic.com>
lilyydu
reviewed
Apr 17, 2026
corinagum
reviewed
Apr 17, 2026
The router matches dialog.submit sub-routes on value.data.action, but the HTML form was sending submissiondialogtype instead of action. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
dialog.open.{dialogId},dialog.submit.{action}, andcard.action.{action}, matching the pattern used byfile.consent.acceptandmessage.submit.feedbackvalue.data.dialog_id(dialog open),value.data.action(dialog submit), andvalue.action.data.action(card action)OpenDialogDataandSubmitDatacard utilities that set these reserved fieldsUsage
Test plan
dialog.open,dialog.submit,card.action) continue to work🤖 Generated with Claude Code