Skip to content

Commit 73253cf

Browse files
committed
fix: prevent mode name from disappearing when editing other fields
- Fix mode name input field to check currentEditingField === "modeName" instead of just currentEditingModeSlug - Add currentEditingField: "modeName" to onFocus handler to properly track field editing state - This prevents the mode name from showing empty local state when other fields are being edited Fixes the issue where mode name would disappear when editing description, role definition, or other fields in custom modes.
1 parent 211d18a commit 73253cf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

webview-ui/src/components/modes/ModesView.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ const ModesView = ({ onDone }: ModesViewProps) => {
780780
<Input
781781
type="text"
782782
value={
783-
editingState.currentEditingModeSlug === visualMode
783+
editingState.currentEditingField === 'modeName' && editingState.currentEditingModeSlug === visualMode
784784
? editingState.modeName
785785
: (getModeProperty(findModeBySlug(visualMode, customModes), "name") ??
786786
"")
@@ -791,6 +791,7 @@ const ModesView = ({ onDone }: ModesViewProps) => {
791791
setEditingState(prev => ({
792792
...prev,
793793
currentEditingModeSlug: visualMode,
794+
currentEditingField: 'modeName',
794795
modeName: customMode.name
795796
}))
796797
}

0 commit comments

Comments
 (0)