Skip to content

Fix single input prompt labels in CLI publish commands #10579

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jul 21, 2025

Problem

Single-input prompts in CLI publish commands were not properly displaying field labels, making them ambiguous for users. The issue occurred in PublishCommandBase.HandlePromptActivityAsync where:

  • Multi-input prompts: Correctly showed input.Label for each field
  • Single-input prompts: Only showed activity.Data.StatusText (narrative context) and ignored input.Label (field name)

This meant users would see prompts like:

Configure deployment target

instead of the more descriptive:

Configure deployment target Environment Name: 

Solution

Added a BuildPromptText helper method that implements the logic specified in the issue:

  1. Multi-input prompts: Unchanged behavior - uses only the label: "Label: "
  2. Single-input prompts with different StatusText and Label: Shows both: "[bold]StatusText[/] Label: "
  3. Single-input prompts where StatusText equals Label: Shows only label once: "Label: "
  4. Markup escaping: Properly escapes Spectre.Console markup in both StatusText and Label using EscapeMarkup()

Testing

Added comprehensive unit tests in PublishCommandPromptTextTests.cs covering:

  • Single input with different StatusText and Label
  • Single input with same StatusText and Label (case insensitive)
  • Multi-input prompts (verifying unchanged behavior)
  • Markup escaping scenarios

All 135 existing CLI tests pass, confirming no regression in functionality.

Example

Before:

[bold]Configure deployment target[/]

After:

[bold]Configure deployment target[/] Environment Name: 

Fixes #10465.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: captainsafia <1857993+captainsafia@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Labels not properly show for PromptInputsAsync call with single InteractionInput in CLI Fix single input prompt labels in CLI publish commands Jul 22, 2025
@Copilot Copilot AI requested a review from captainsafia July 22, 2025 00:22
Copilot finished work on behalf of captainsafia July 22, 2025 00:22
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.

Labels not properly show for PromptInputsAsync call with single InteractionInput in CLI
2 participants