Skip to content

Surface multiple solutions for katas that have them#3275

Open
amcasey wants to merge 3 commits into
mainfrom
amcasey/AltSoln
Open

Surface multiple solutions for katas that have them#3275
amcasey wants to merge 3 commits into
mainfrom
amcasey/AltSoln

Conversation

@amcasey
Copy link
Copy Markdown
Member

@amcasey amcasey commented May 29, 2026

I remember finding the alternative solutions useful in the web version of the katas and I thought they might be useful in VS Code too. I decided not to try to figure out if the user's solution matched one of the available solutions since I wasn't sure Haiku could handle that reliably and it's easy enough to read past the one that matches yours.
AlternativeApproaches

amcasey added 2 commits May 26, 2026 13:01
When an exercise has multiple reference solutions (14 exercises today),
show a "See alternative approaches" link in the panel after a passing
check. Clicking opens Copilot Chat where the agent presents all
reference solutions with their explanations.

Changes:
- Preserve all @[solution] blocks from katas content (catalog.ts was
  discarding all but the first via .find())
- Add hasAlternatives flag to ExerciseContent, driven by solutionCodes.length > 1
- Extend the solution tool to return alternatives alongside the primary
- Thread hasAlternatives through webview to conditionally render the link
- Update agent instructions with new chat entry point and handling
- **"Explain this concept in more detail"** — Provide a deeper pedagogical explanation. Offer analogies, relate to prior units. Don't repeat the panel content.
- **"Help me understand why my solution failed"** — Analyze common mistakes for that exercise. Give targeted debugging hints, not the full solution.
- **"Explain this solution step by step"** — Walk through the reference solution line by line, explaining the quantum concepts and Q# patterns.
- **"Explain this solution step by step"** — Walk through the reference solution line by line, explaining the quantum concepts and Q# patterns. If there are multiple reference solutions, walk through only the first one.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Shall we instruct Copilot to also call the readUserCode (?) tool to read the user's solution, and compare to the reference solution?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This comment was meant for the line below it. Looks like this line is just out of date (and the corresponding row in the table). Could you clean it up maybe?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

After editing

Image

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Removed the entry for "Explain this solution"

Comment thread source/vscode/src/learning/types.d.ts
@amcasey amcasey marked this pull request as ready for review May 29, 2026 23:22
@amcasey amcasey requested review from billti and idavis as code owners May 29, 2026 23: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.

2 participants