{ deleteHandler(); }} >
{$i18n.t(`Are you sure you want to delete "{{NAME}}"?`, { NAME: folders[folderId].name })}
{$i18n.t('Delete all contents inside this folder')}
{#if dragged && x && y}
{folders[folderId].name}
{/if}
{#if draggedOver}
{/if} { dispatch('open', state); }} >
{ if (!isWritable) return; if (clickTimer) { clearTimeout(clickTimer); // cancel the single-click action clickTimer = null; } renameHandler(); }} role="button" tabindex="0" on:click={async (e) => { if (shouldIgnoreRowClick(e.target)) return; if (clickTimer) { clearTimeout(clickTimer); clickTimer = null; } clickTimer = setTimeout(async () => { await openFolderHandler(); clickTimer = null; }, 100); // 100ms delay (typical double-click threshold) }} on:keydown={(e) => { if (e.currentTarget !== e.target) return; if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); openFolderHandler(); } }} on:pointerup={(e) => { e.stopPropagation(); }} >
{#if edit} { console.log('Blur'); updateHandler({ name }); edit = false; }} on:click={(e) => { // Prevent accidental collapse toggling when clicking inside input e.stopPropagation(); }} on:mousedown={(e) => { // Prevent accidental collapse toggling when clicking inside input e.stopPropagation(); }} on:keydown={(e) => { if (e.key === 'Enter') { updateHandler({ name }); edit = false; } }} class="w-full h-full bg-transparent outline-hidden" /> {:else}
{folders[folderId].name}
{#if !folders[folderId]?.shared && (folders[folderId]?.unread_count ?? 0) > 0}
{formatUnreadCount(folders[folderId].unread_count)}
{/if} {/if}
{#if isWritable} {/if}
{#if (folders[folderId]?.childrenIds ?? []).length > 0 || (chats ?? []).length > 0 || hasMoreChats}
{#if folders[folderId]?.childrenIds} {@const children = folders[folderId]?.childrenIds .map((id) => folders[id]) .sort((a, b) => a.name.localeCompare(b.name, undefined, { numeric: true, sensitivity: 'base' }) )} {#each children as childFolder (`${folderId}-${childFolder.id}`)} { dispatch('import', e.detail); }} on:update={(e) => { dispatch('update', e.detail); }} on:change={(e) => { dispatch('change', e.detail); }} /> {/each} {/if} {#each chats ?? [] as chat (chat.id)} { dispatch('change', e.detail); }} /> {/each} {#if hasMoreChats} {/if}
{/if} {#if chats === null && chatsLoading}
{/if}