fix: exclude non-markdown files from Inbox view
Added isMarkdown check to isInboxEntry so .yml, .json, and binary files no longer appear in the Inbox. All other views (All Notes, Archive, Trash, Sections, Views) already filter by markdown. FOLDERS still shows all file types. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -730,3 +730,16 @@ describe('filterEntries — fileKind filtering', () => {
|
||||
expect(result.map(e => e.title)).toEqual(['Old'])
|
||||
})
|
||||
})
|
||||
|
||||
describe('filterInboxEntries — excludes non-markdown files', () => {
|
||||
it('only shows markdown files in inbox', () => {
|
||||
const now = Math.floor(Date.now() / 1000)
|
||||
const entries = [
|
||||
makeEntry({ path: '/vault/note.md', title: 'Note', fileKind: 'markdown', createdAt: now }),
|
||||
makeEntry({ path: '/vault/config.yml', title: 'config.yml', fileKind: 'text', createdAt: now }),
|
||||
makeEntry({ path: '/vault/photo.png', title: 'photo.png', fileKind: 'binary', createdAt: now }),
|
||||
]
|
||||
const result = filterInboxEntries(entries, 'all')
|
||||
expect(result.map(e => e.title)).toEqual(['Note'])
|
||||
})
|
||||
})
|
||||
|
||||
@@ -381,8 +381,9 @@ export function countAllByFilter(entries: VaultEntry[]): Record<NoteListFilter,
|
||||
|
||||
// --- Inbox ---
|
||||
|
||||
/** Check if entry belongs in the Inbox (not organized, not trashed/archived, not a Type). */
|
||||
/** Check if entry belongs in the Inbox (markdown only, not organized, not trashed/archived, not a Type). */
|
||||
export function isInboxEntry(entry: VaultEntry): boolean {
|
||||
if (!isMarkdown(entry)) return false
|
||||
if (entry.trashed || entry.archived) return false
|
||||
if (entry.isA === 'Type') return false
|
||||
return !entry.organized
|
||||
|
||||
Reference in New Issue
Block a user