Allow saving prompts from the Prompt Manager (#12359)

Adds the following features to the prompt manager:

- New prompt – Create a new prompt from the UI. It will only persist if
it is saved.
- Save prompt – Save a prompt by clicking the save button in the UI. A
keybinding will be added for this in the future.
- Reveal prompt - Show the selected prompt on the file system. Only
available for saved prompts.

New prompts that are saved will use the
`{slugified_title}_{ver}_{id}.md` format which all imported prompts will
move to in the near future.

Also orders prompts in alphabetical order by default.

Release Notes:

- N/A
This commit is contained in:
Nate Butler 2024-05-27 13:48:21 -04:00 committed by GitHub
parent 345361cd38
commit a6dd2ca694
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 476 additions and 89 deletions

View file

@ -1,5 +1,5 @@
use super::{SlashCommand, SlashCommandCleanup, SlashCommandInvocation};
use crate::prompts::prompt_library::PromptLibrary;
use crate::prompts::PromptLibrary;
use anyhow::{anyhow, Context, Result};
use futures::channel::oneshot;
use fuzzy::StringMatchCandidate;