Merge pull request #5503 from uinstinct/implement-prompt-edit

open config when clicking on editing the prompt
This commit is contained in:
Dallin Romney 2025-05-12 09:59:21 -07:00 • committed by GitHub
commit c8c4ea5f6d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4,6 +4,8 @@ import {
} from "@heroicons/react/24/outline";
import { BookmarkIcon as BookmarkSolid } from "@heroicons/react/24/solid";
import { SlashCommandDescription } from "core";
import { useContext } from "react";
import { IdeMessengerContext } from "../../../../context/IdeMessenger";
import { useBookmarkedSlashCommands } from "../../../../hooks/useBookmarkedSlashCommands";
import { useAppSelector } from "../../../../redux/hooks";
import { fontSize } from "../../../../util";
@ -89,14 +91,16 @@ function PromptRow({
*/
export function PromptsSection() {
const { isCommandBookmarked, toggleBookmark } = useBookmarkedSlashCommands();
const ideMessenger = useContext(IdeMessengerContext);
const slashCommands = useAppSelector(
(state) => state.config.config.slashCommands ?? [],
);
const handleEdit = (prompt: any) => {
// Handle edit action here
console.log("Editing prompt:", prompt);
const handleEdit = (_prompt: SlashCommandDescription) => {
ideMessenger.post("config/openProfile", {
profileId: undefined,
});
};
const sortedCommands = [...slashCommands].sort((a, b) => {