Allow resource command results to customize dialog actions
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 991
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 196
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Is your feature request related to a problem? Please describe the problem.
Resource commands can return a value, format, and `DisplayImmediately` setting through `CommandResults`. The dashboard opens that value in `TextVisualizerDialog`, whose primary action is always **Copy to clipboard**.
Integrations cannot hide or replace that button, provide a separate clipboard value, or choose a more appropriate action such as **Close**. For Markdown results, Copy also writes the raw Markdown source rather than the rendered text, which can make the action misleading or unhelpful.
This came up while implementing the Dev Tunnel URL command in #16842.
### Describe the solution you'd like
Allow a resource command result to declaratively customize its result-dialog actions while preserving the current Copy behavior by default. For example, a result could:
- Use **Close** instead of **Copy to clipboard**.
- Hide the copy action.
- Supply a clipboard value separate from the displayed value, such as rendered/plain text for a Markdown result.
A constrained set of dashboard-owned actions would avoid passing arbitrary client callbacks across the hosting/dashboard boundary.
### Additional context
Today `DashboardCommandExecutor` maps the command result to `OpenTextVisualizerDialogOptions`, and `TextVisualizerDialog` hardcodes its copy button using `TextVisualizerViewModel.FormattedText`. The command-result model does not carry action or clipboard metadata.
Contributor guide
Research direction
Start by tracing how DashboardCommandExecutor maps command results into OpenTextVisualizerDialogOptions, then inspect TextVisualizerDialog and TextVisualizerViewModel, including the command-result model mentioned in the issue. Define the dashboard-owned action and clipboard metadata needed for default Copy behavior, replacement or hiding, and separate Markdown clipboard text; done means each supported option works without arbitrary callbacks and existing behavior remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100