{ if (e.key === 'Escape' && selectedPaths.size > 0) { clearSelection(); } if ((e.ctrlKey || e.metaKey) && e.key === 'a' && $sortedNotes.length > 0) { // Only select all if focus is not in an input/editor const tag = (e.target as HTMLElement)?.tagName; if (tag !== 'INPUT' && tag !== 'TEXTAREA' && !(e.target as HTMLElement)?.closest('.ProseMirror')) { e.preventDefault(); selectedPaths = new Set($sortedNotes.map(n => n.path)); } } }} />
{viewTitle}
{#if $viewMode !== 'tasks'} {#if isAndroid} {/if} {#if $viewMode !== 'trash'} {/if} {/if}
{#if selectedPaths.size > 0}
{selectedPaths.size} selected
{#if $viewMode === 'trash'} {:else} {/if}
{/if} {#if batchMovePicker}
batchMovePicker = false}>
e.stopPropagation()}>
Move {selectedPaths.size} notes to...
{#if flatNotebookList.length === 0}
No notebooks available
{:else}
{#each flatNotebookList as nb} {/each}
{/if}
{/if} {#if batchTagEdit && !contextMenu}
batchTagEdit = false}>
e.stopPropagation()}>
Tags for {selectedPaths.size} notes
addTagToBatch(t)} oncancel={() => batchTagEdit = false} />
{#if tagEditTags.length > 0}
{#each tagEditTags as tag}
#{tag}
{/each}
{:else}
No common tags
{/if}
{/if}
{#if $viewMode === 'tasks'} {/if} {#if $viewMode === 'daily'}
{#each calDayNames as name}
{name}
{/each} {#each calDays() as cell} {#if cell.day === 0}
{:else} {/if} {/each}
{/if} {#if $sortedNotes.length === 0 && $viewMode !== 'daily' && $viewMode !== 'tasks' && (!($viewMode === 'trash') || trashNotebooks.length === 0)}
{#if $viewMode === 'trash'}

Trash is empty

{:else}

No notes yet

{/if}
{/if} {#if $viewMode === 'trash' && trashNotebooks.length > 0} {#each trashNotebooks as nb (nb.path)}
{nb.name}
{#if trashBusy === nb.path}
Working...
{:else}
{nb.note_count} {nb.note_count === 1 ? 'note' : 'notes'}
{/if}
{/each} {/if}
{#each visibleNotes as note, i (note.path)} {@const noteIndex = startIndex + i} {#if editingNote === note.path}
{ if (e.key === 'Enter') handleRename(note); if (e.key === 'Escape') editingNote = null; }} onblur={() => handleRename(note)} />
{:else} {/if} {/each}
{#if contextMenu}
e.stopPropagation()} role="menu"> {#if selectedPaths.size > 1 && selectedPaths.has(contextMenu.note.path)} {#if $viewMode === 'trash'} {:else if batchTagEdit}
addTagToBatch(t)} oncancel={() => batchTagEdit = false} />
{#if tagEditTags.length > 0}
{#each tagEditTags as tag}
#{tag}
{/each}
{:else}
No common tags
{/if}
{:else} {/if} {:else if $viewMode === 'trash'} {:else if tagEditNote}
addTagToNote(t)} oncancel={() => tagEditNote = null} />
{#if tagEditTags.length > 0}
{#each tagEditTags as tag}
#{tag}
{/each}
{:else}
No tags
{/if}
{:else if movePickerNote}
{#if flatNotebookList.length === 0}
No other notebooks
{:else}
{#each flatNotebookList as nb} {/each}
{/if} {:else} {#if $quickAccessPaths.includes(contextMenu.note.relative_path)} {:else} {/if} {#if !isMobile} {/if} {#if !isMobile} {/if} {/if}
{/if} {#if sortMenu}
e.stopPropagation()}>
Sort by
{/if}