Elffuss BraidHub

kikocis/continue public

Feat: disable edit prompt action for the init prompt
Changeset41d4276ca5e3180bc09c6f226b0698da5fe80315f15cd5532c09b8cb02663e34
Authorvldf <vladislavf7@gmail.com> · 2025-08-06 12:19 +03:00
Committervldf <vladislavf7@gmail.com> · 2025-08-06 13:11 +03:00
Parents4940c71be2bf

Browse the files at this changeset

1 file changed

modified gui/src/components/mainInput/Lump/sections/PromptsSection.tsx +6 −2
@@ -60,6 +60,9 @@
6060 }
6161 };
6262
63+ const canEdit =
64+ prompt.promptFile && !prompt.promptFile.startsWith("builtin:");
65+
6366 return (
6467 <div
6568 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 @@
7881 </div>
7982 <div className="flex items-center gap-2">
8083 <PencilIcon
81- className="h-3 w-3 cursor-pointer text-gray-400 hover:brightness-125"
82- onClick={handleEditClick}
84+ className={`h-3 w-3 cursor-pointer text-gray-400 hover:brightness-125${!canEdit ? "pointer-events-none cursor-not-allowed opacity-50" : ""}`}
85+ onClick={canEdit ? handleEditClick : undefined}
86+ aria-disabled={!canEdit}
8387 />
8488 <div
8589 onClick={handleBookmarkClick}