- Add configurable visible/instructions prompt families for commit/PR generation, PR checks/comments flows, and git conflict resolution helpers. - Refactor prompt sending to explicit visible + synthetic parts instead of newline-based splitting, with legacy override migration for old keys. - Polish Magic Prompts settings UX with grouped sidebar entries, tooltip-based descriptions, AI icon, and validation that visible prompts cannot be empty across web and VS Code runtimes.
21 lines
486 B
TypeScript
21 lines
486 B
TypeScript
import { create } from 'zustand';
|
|
|
|
type MagicPromptsState = {
|
|
selectedPromptId: string;
|
|
setSelectedPromptId: (id: string) => void;
|
|
};
|
|
|
|
const DEFAULT_PROMPT_ID = 'git.commit.generate';
|
|
|
|
export const useMagicPromptsStore = create<MagicPromptsState>((set) => ({
|
|
selectedPromptId: DEFAULT_PROMPT_ID,
|
|
setSelectedPromptId: (id) => {
|
|
set((state) => {
|
|
if (state.selectedPromptId === id) {
|
|
return state;
|
|
}
|
|
return { selectedPromptId: id };
|
|
});
|
|
},
|
|
}));
|