Elffuss BraidHub

kikocis/continue public

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

feat: disable edit prompt action for the init prompt
Changeseta765bb1061c8a6cf8e41617fa79c1021045087dca756005854271ddbc9d9caad
AuthorDallin Romney <dallinromney@gmail.com> · 2025-08-07 10:09 -07:00
CommitterGitHub <noreply@github.com> · 2025-08-07 10:09 -07:00
Parentsf69193afceac, 80d4c66b3ffb

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}