Merge pull request #7011 from vldF/vldf/6955-edit-prompt-exception

feat: disable edit prompt action for the init prompt
This commit is contained in:
Dallin Romney 2025-08-07 10:09:43 -07:00 • committed by GitHub
commit 02324bbaa1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -60,6 +60,9 @@ function PromptRow({
}
};
const canEdit =
prompt.promptFile && !prompt.promptFile.startsWith("builtin:");
return (
<div
className="hover:bg-list-active hover:text-list-active-foreground flex items-center justify-between gap-3 rounded-md px-2 py-1 hover:cursor-pointer"
@ -78,8 +81,9 @@ function PromptRow({
</div>
<div className="flex items-center gap-2">
<PencilIcon
className="h-3 w-3 cursor-pointer text-gray-400 hover:brightness-125"
onClick={handleEditClick}
className={`h-3 w-3 cursor-pointer text-gray-400 hover:brightness-125 ${!canEdit ? "pointer-events-none cursor-not-allowed opacity-50" : ""}`}
onClick={canEdit ? handleEditClick : undefined}
aria-disabled={!canEdit}
/>
<div
onClick={handleBookmarkClick}