fix: stabilize note list hotspots

This commit is contained in:
lucaronin
2026-04-08 09:18:59 +02:00
parent 8141b8fc8c
commit f66c8cf8ca
6 changed files with 126 additions and 167 deletions

View File

@@ -9,144 +9,6 @@ type NoteListProps = ComponentProps<typeof NoteList>
export const allSelection: SidebarSelection = { kind: 'filter', filter: 'all' }
export const mockEntries: VaultEntry[] = [
{
path: '/Users/luca/Laputa/project/26q1-laputa-app.md',
filename: '26q1-laputa-app.md',
title: 'Build Laputa App',
isA: 'Project',
aliases: [],
belongsTo: [],
relatedTo: ['[[topic/software-development]]'],
status: 'Active',
owner: 'Luca',
cadence: null,
archived: false,
modifiedAt: 1700000000,
createdAt: null,
fileSize: 1024,
snippet: 'Build a personal knowledge management app.',
wordCount: 0,
relationships: {
'Related to': ['[[topic/software-development]]'],
},
icon: null,
color: null,
order: null,
template: null,
sort: null,
outgoingLinks: [],
properties: {},
},
{
path: '/Users/luca/Laputa/note/facebook-ads-strategy.md',
filename: 'facebook-ads-strategy.md',
title: 'Facebook Ads Strategy',
isA: 'Note',
aliases: [],
belongsTo: ['[[project/26q1-laputa-app]]'],
relatedTo: ['[[topic/growth]]'],
status: null,
owner: null,
cadence: null,
archived: false,
modifiedAt: 1700000000,
createdAt: null,
fileSize: 847,
snippet: 'Lookalike audiences convert 3x better.',
wordCount: 0,
relationships: {
'Belongs to': ['[[project/26q1-laputa-app]]'],
'Related to': ['[[topic/growth]]'],
},
icon: null,
color: null,
order: null,
template: null,
sort: null,
outgoingLinks: [],
properties: {},
},
{
path: '/Users/luca/Laputa/person/matteo-cellini.md',
filename: 'matteo-cellini.md',
title: 'Matteo Cellini',
isA: 'Person',
aliases: [],
belongsTo: [],
relatedTo: [],
status: null,
owner: null,
cadence: null,
archived: false,
modifiedAt: 1700000000,
createdAt: null,
fileSize: 320,
snippet: 'Sponsorship manager.',
wordCount: 0,
relationships: {},
icon: null,
color: null,
order: null,
template: null,
sort: null,
outgoingLinks: [],
properties: {},
},
{
path: '/Users/luca/Laputa/event/2026-02-14-kickoff.md',
filename: '2026-02-14-kickoff.md',
title: 'Kickoff Meeting',
isA: 'Event',
aliases: [],
belongsTo: [],
relatedTo: [],
status: null,
owner: null,
cadence: null,
archived: false,
modifiedAt: 1700000000,
createdAt: null,
fileSize: 512,
snippet: 'Project kickoff meeting notes.',
wordCount: 0,
relationships: {},
icon: null,
color: null,
order: null,
template: null,
sort: null,
outgoingLinks: [],
properties: {},
},
{
path: '/Users/luca/Laputa/topic/software-development.md',
filename: 'software-development.md',
title: 'Software Development',
isA: 'Topic',
aliases: [],
belongsTo: [],
relatedTo: [],
status: null,
owner: null,
cadence: null,
archived: false,
modifiedAt: 1700000000,
createdAt: null,
fileSize: 256,
snippet: 'Frontend, backend, and systems programming.',
wordCount: 0,
relationships: {},
icon: null,
color: null,
order: null,
template: null,
sort: null,
outgoingLinks: [],
properties: {},
},
]
export const makeEntry = (overrides: Partial<VaultEntry> = {}): VaultEntry => ({
path: '/test.md',
filename: 'test.md',
@@ -171,11 +33,80 @@ export const makeEntry = (overrides: Partial<VaultEntry> = {}): VaultEntry => ({
sort: null,
view: null,
visible: null,
organized: false,
favorite: false,
favoriteIndex: null,
listPropertiesDisplay: [],
outgoingLinks: [],
properties: {},
hasH1: false,
...overrides,
})
export const mockEntries: VaultEntry[] = [
makeEntry({
path: '/Users/luca/Laputa/project/26q1-laputa-app.md',
filename: '26q1-laputa-app.md',
title: 'Build Laputa App',
isA: 'Project',
relatedTo: ['[[topic/software-development]]'],
status: 'Active',
modifiedAt: 1700000000,
createdAt: null,
fileSize: 1024,
snippet: 'Build a personal knowledge management app.',
relationships: {
'Related to': ['[[topic/software-development]]'],
},
}),
makeEntry({
path: '/Users/luca/Laputa/note/facebook-ads-strategy.md',
filename: 'facebook-ads-strategy.md',
title: 'Facebook Ads Strategy',
isA: 'Note',
belongsTo: ['[[project/26q1-laputa-app]]'],
relatedTo: ['[[topic/growth]]'],
modifiedAt: 1700000000,
createdAt: null,
fileSize: 847,
snippet: 'Lookalike audiences convert 3x better.',
relationships: {
'Belongs to': ['[[project/26q1-laputa-app]]'],
'Related to': ['[[topic/growth]]'],
},
}),
makeEntry({
path: '/Users/luca/Laputa/person/matteo-cellini.md',
filename: 'matteo-cellini.md',
title: 'Matteo Cellini',
isA: 'Person',
modifiedAt: 1700000000,
createdAt: null,
fileSize: 320,
snippet: 'Sponsorship manager.',
}),
makeEntry({
path: '/Users/luca/Laputa/event/2026-02-14-kickoff.md',
filename: '2026-02-14-kickoff.md',
title: 'Kickoff Meeting',
isA: 'Event',
modifiedAt: 1700000000,
createdAt: null,
fileSize: 512,
snippet: 'Project kickoff meeting notes.',
}),
makeEntry({
path: '/Users/luca/Laputa/topic/software-development.md',
filename: 'software-development.md',
title: 'Software Development',
isA: 'Topic',
modifiedAt: 1700000000,
createdAt: null,
fileSize: 256,
snippet: 'Frontend, backend, and systems programming.',
}),
]
export const makeIndexedEntry = (index: number, overrides?: Partial<VaultEntry>): VaultEntry =>
makeEntry({
path: `/vault/note/note-${index}.md`,