Skip to content

feat: Add prompt management (create/edit/delete) to prompts popup#265

Merged
PureWeen merged 7 commits intomainfrom
fix/the-screen-bottom-has-a-1-prompts-listin-20260303-1629
Mar 3, 2026
Merged

feat: Add prompt management (create/edit/delete) to prompts popup#265
PureWeen merged 7 commits intomainfrom
fix/the-screen-bottom-has-a-1-prompts-listin-20260303-1629

Conversation

@StephaneDelcroix
Copy link
Copy Markdown
Collaborator

Problem

The prompts popup at the bottom of ExpandedSessionView only listed available prompts for click-to-use. There was no way to create, edit, or delete prompts from the UI. Additionally:

  • The trigger was hidden when there were 0 prompts (undiscoverable)
  • "1 prompts" had a pluralization bug

Changes

  • Always show prompts trigger even with 0 prompts so the feature is discoverable
  • Fix pluralization: "1 prompts" → "1 prompt"
  • Add + New button in popup header to create prompts via inline form
  • Add edit/delete icons on user-owned prompt rows (project prompts are read-only)
  • Inline form for creating/editing prompts with name, description, and content fields
  • JSInvokable callbacks (SavePromptFromPopup, DeletePromptFromPopup) via DotNetObjectReference for JS→C# interop
  • Fix pre-existing CS0126 build error in CopilotService.CreateSessionAsync (bare return; in method returning Task<AgentSessionInfo>)

Tests

  • Added PromptManagementPopupTests.cs (12 tests) — validates trigger visibility, pluralization, popup buttons, form fields, and callbacks
  • Added 3 tests to PromptLibraryTests.cs — edit/overwrite, delete-then-recreate, delete non-existent
  • All 1714 passing tests continue to pass (1 pre-existing failure unrelated)

StephaneDelcroix and others added 7 commits March 3, 2026 17:38
- Always show prompts trigger even with 0 prompts (feature discoverability)
- Fix pluralization: '1 prompts' → '1 prompt'
- Add '+ New' button in popup header to create prompts
- Add edit/delete buttons on user-owned prompt rows
- Inline form for creating/editing prompts with name, description, content
- JSInvokable callbacks (SavePromptFromPopup, DeletePromptFromPopup) via DotNetObjectReference
- Fix pre-existing CS0126 build error in CopilotService.CreateSessionAsync
- Add tests for edit/overwrite, delete-then-recreate, and popup UI assertions

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…andedSessionView

- Add @implements IAsyncDisposable directive
- Add DisposeAsync() to dispose _promptDotNetRef when component is removed
- Resolve merge conflict with origin/main (keep PR management UI)
- SavePromptFromPopup and DeletePromptFromPopup already have try/catch error logging

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Replace StateHasChanged() with await InvokeAsync(StateHasChanged) in
  SavePromptFromPopup and DeletePromptFromPopup so continuations
  after Task.Run always marshal back to the Blazor dispatcher
- In DisposeAsync, null out window.__ppRef via JS before disposing
  _promptDotNetRef to prevent stuck popup overlay on component teardown

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@PureWeen PureWeen merged commit d98fb99 into main Mar 3, 2026
@PureWeen PureWeen deleted the fix/the-screen-bottom-has-a-1-prompts-listin-20260303-1629 branch March 3, 2026 23:49
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