{#each activeItems as item (item.id)}
handleDragPointerDown(e, item.id)} class="drag-handle cursor-grab max-md:opacity-100 md:opacity-0 md:group-hover:opacity-100 focus:opacity-100 transition-opacity duration-150 touch-none outline-none" data-testid="checklist-drag-handle">
toggleItem(item.id)} aria-label={item.text ? `Done: ${item.text}` : 'Done'} class="h-4 w-4 rounded border-[var(--border-subtle)] text-[var(--primary)] focus:ring-[var(--primary)]" data-testid="checklist-checkbox" />
updateText(item.id, (e.target as HTMLElement).innerHTML)} onkeydown={(e) => handleKeydown(e, item.id)} onclick={handleLinkClick} onpaste={handlePaste} onblur={(e) => { const el = e.currentTarget as HTMLElement; requestAnimationFrame(() => { if (el.isConnected && !el.contains(document.activeElement)) { el.innerHTML = linkifyText(item.text); } }); }} class="flex-1 min-w-0 bg-transparent text-sm outline-none break-words {item.checked ? 'text-[var(--text-muted)] line-through' : 'text-[var(--text)]'}" data-placeholder="List item" aria-placeholder="List item" aria-label="Checklist item" data-testid="checklist-input" data-item-id={item.id} role="textbox" tabindex="0" >
{/each}
{#if doneCount > 0}
{#if doneExpanded}
{#each doneSectionGroups as group} {#if group.parentLabel}
{@html linkifyText(group.parentLabel.text)}
{/if} {#each group.children as item (item.id)}
toggleItem(item.id)} aria-label={item.text ? `Done: ${item.text}` : 'Done'} class="h-4 w-4 rounded border-[var(--border-subtle)] text-[var(--primary)] focus:ring-[var(--primary)]" data-testid="checklist-done-checkbox" /> {@html linkifyText(item.text)}
{/each} {/each}
{/if}
{/if} {#if linkPopover} (linkPopover = null)} /> {/if}