{ if (!carriesFiles(event) || workspace.tree.query) return event.preventDefault() dropping = true }} ondragleave={(event) => { if (!(event.currentTarget as HTMLElement).contains(event.relatedTarget as Node | null)) dropping = false }} ondrop={drop} >
{workspace.tree.space?.slug ?? 'diary'}
{items} {items === 1 ? 'item' : 'items'}{#if workspace.tree.foundCards.length > 0} · {workspace.tree.foundCards.length} {workspace.tree.foundCards.length === 1 ? 'card' : 'cards'}{/if}{#if workspace.tree.foundNotes.length > 0} · {workspace.tree.foundNotes.length} {workspace.tree.foundNotes.length === 1 ? 'note' : 'notes'}{/if}
{#if workspace.tree.query}
/
{workspace.tree.query}
{#if workspace.tree.globalSearch}
all spaces
{/if}
workspace.guard(() => workspace.tree.search(''))}>esc
{/if}
{#if nested}
workspace.guard(() => workspace.tree.up())}>
..
/
up
{/if} {#each workspace.tree.nodes as node, index (node.id)} {@const previous = above(index)} {@const nested = workspace.tree.isNested(node)} {#if !workspace.tree.query && !nested && node.kind === 'document' && (!previous || previous.kind !== 'document' || formatDay(previous.created_at) !== formatDay(node.created_at))}
{formatDay(node.created_at)}
{formatWeekday(node.created_at)}
{/if}
carry(event, node)} ondragend={release} {@attach into(isContainer(node) ? node.id : null, `into ${label(node)}`)} >
{ event.preventDefault() actions(index) }} class:active={index === workspace.tree.cursor} class:open={workspace.tiles.every.some((tile) => tile.open?.id === node.id)} class:marked={workspace.tree.isMarked(node.id)} class:nested data-index={index} onclick={(event) => click(event, index, node)} >
{label(node)}{#if isContainer(node)}
/
{/if} {#if workspace.tree.query && node.location}
{node.location}
{/if} {#if workspace.tree.query && node.in_text}
{#each hitParts(node.excerpt) as part, at (at)}{#if part.lit}
{part.text}
{:else}{part.text}{/if}{/each}
{/if}
{#if workspace.tree.isMarked(node.id)}
m
{/if} {#if node.shared}
{/if} {#if node.file?.encrypted}
{/if} {#if node.sealed}
{/if}
{aside(node)}
{#if isTouchDevice}
actions(index)}>
{/if}
{/each} {#if workspace.tree.foundCards.length > 0}
cards
{/if} {#each workspace.tree.foundCards as card, at (card.id)} {@const index = workspace.tree.nodes.length + at}
pick(index)}>
{card.title}
{card.space_slug}/{card.list_name}
{card.done_at !== null ? 'done' : card.due_at !== null ? formatDay(card.due_at) : 'card'}
{/each} {#if workspace.tree.foundNotes.length > 0}
notes
{/if} {#each workspace.tree.foundNotes as note, at (note.id)} {@const index = workspace.tree.nodes.length + workspace.tree.foundCards.length + at}
pick(index)}>
{headline(note.body) || '—'}
scratch
{relative(note.updated_at)}
{/each} {#if workspace.tree.rows === 0}
{#if workspace.tree.query} no matches {:else} nothing here yet —
o
writes,
⇧ O
makes a folder, files dropped here land here {/if}
{/if}