Skip to content

Copy the full generated prompt from the wizard dialog - #243

Merged
pelikhan merged 2 commits into
mainfrom
copilot/copy-prompt-button-fix
Sep 1, 2026
Merged

Copy the full generated prompt from the wizard dialog#243
pelikhan merged 2 commits into
mainfrom
copilot/copy-prompt-button-fix

Conversation

Copilot AI commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

The scenario assistant dialog copied only the user’s intent. It now copies the complete prompt generated from the current wizard configuration.

Changes

  • Pass a prompt generator into the scenario assistant context.
  • Generate the prompt after applying the selected archetype and defaults.
  • Store and copy the generated prompt from the result dialog.
  • Add regression coverage for clipboard contents.

Copilot AI and others added 2 commits September 1, 2026 12:44
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title Fix assistant dialog prompt copying Copy the full generated prompt from the wizard dialog Sep 1, 2026
Copilot AI requested a review from pelikhan September 1, 2026 12:47
@pelikhan
pelikhan marked this pull request as ready for review September 1, 2026 12:49
@pelikhan
pelikhan merged commit b07dd4c into main Sep 1, 2026
9 checks passed
@pelikhan
pelikhan deleted the copilot/copy-prompt-button-fix branch September 1, 2026 12:50

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewer: matt-pocock (auto-dispatched — TS/JS changes)

Reviewed the diff and test updates for wiring the fully generated prompt into the scenario assistant copy dialog.

No blocking issues found:

  • prompt fallback to request in slm-ui.js is safe if ctx.prompt is not a function.
  • ui.js correctly wires generateAgentPrompt(gatherAnswers(), patterns) into the assistant context.
  • Regression test in test/slm-ui.test.js verifies the clipboard now receives the full generated prompt via the copy button.
  • Ran the test suite locally (vitest run test/slm-ui.test.js test/ui.test.js) — all 16 tests pass.

Minor (non-blocking) observation: ctx.prompt() is invoked eagerly whenever a scenario match succeeds, calling gatherAnswers()/generateAgentPrompt() synchronously on the DOM at that moment — this is fine given the existing call pattern, just flagging for awareness if gatherAnswers() becomes expensive later.

Generated by Specialist PR Review for #243 · auto · 25.1 AIC · ⌖ 1.72 AIC · ⊞ 8K

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