From e305b8105a7f84ea7d813c6630c7878bb62aaecb Mon Sep 17 00:00:00 2001 From: Guilhem Date: Tue, 24 Feb 2026 17:35:22 +0000 Subject: [PATCH] refactor: use TextInput component for group summary inline editing Replace raw with TextInput component using transparent background. Add subtle hover background on the summary label. Co-Authored-By: Claude Opus 4.6 --- .../lib/components/graph/GroupNodeCard.svelte | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/frontend/src/lib/components/graph/GroupNodeCard.svelte b/frontend/src/lib/components/graph/GroupNodeCard.svelte index 35b3965e0c..ac1135ed10 100644 --- a/frontend/src/lib/components/graph/GroupNodeCard.svelte +++ b/frontend/src/lib/components/graph/GroupNodeCard.svelte @@ -5,6 +5,7 @@ import { twMerge } from 'tailwind-merge' import { preventDefault, stopPropagation } from 'svelte/legacy' import GroupNoteArea from './GroupNoteArea.svelte' + import TextInput from '$lib/components/text_input/TextInput.svelte' interface Props { summary?: string @@ -43,15 +44,15 @@ // Inline summary editing let editingSummary = $state(false) let summaryInput = $state('') - let summaryInputElement: HTMLInputElement | undefined = $state(undefined) + let textInputComponent: TextInput | undefined = $state(undefined) function startEditingSummary() { if (!editMode) return editingSummary = true summaryInput = summary ?? '' requestAnimationFrame(() => { - summaryInputElement?.focus() - summaryInputElement?.select() + textInputComponent?.focus() + textInputComponent?.select() }) } @@ -98,22 +99,18 @@
{#if editingSummary} - {}))} - onpointerdown={stopPropagation(() => {})} - spellcheck="false" + size="xs" + class="!bg-transparent !border-transparent !shadow-none !text-2xs !font-medium !p-0 !m-0 !min-w-0 flex-1 !min-h-0 !h-auto nodrag nowheel" + inputProps={{ placeholder: 'Group', onblur: saveSummary, onkeydown: handleSummaryKeydown, spellcheck: false }} /> {:else} {})) : undefined} >{summary || 'Group'}