a7f3a9978521
fix Roman numeral permanence during search — use unfiltered index not filtered position
- time
- 2026-05-13 14:17 UTC · 5 months ago
- machine
- koh2
- parent
- e8965044190f
↓ peach-browser-a7f3a997.tar.gzatlas at this save
files changed1 file
src/popup/views/NotesTOC.tsx+6 −3src/popup/views/NotesTOC.tsx+6 −3
@@ -96,20 +96,23 @@9696 }9797 >9898 <For each={filteredNotes()}>99- {(note, i) => {99+ {(note) => {100+ // Permanent index from the unfiltered list — never changes during search101+ const permanentIndex = () => props.notes.findIndex((n) => n.id === note.id);102+ const expandingIdx = () => props.notes.findIndex((n) => n.id === props.expandingNoteId);100103 const expanding = () => props.expandingNoteId && props.expandingNoteId !== note.id;101104 const expandingNote = () => props.expandingNoteId === note.id;102105 return (103106 <NoteRow104107 note={note}105- index={i()}108+ index={permanentIndex()}106109 searchQuery={searchQuery()}107110 onTap={(n, el) => props.onOpenNote(n, el)}108111 onDelete={handleDelete}109112 onArchive={handleArchive}110113 fadingClass={111114 expanding()112- ? (i() < (filteredNotes().findIndex(n => n.id === props.expandingNoteId))115+ ? (permanentIndex() < expandingIdx()113116 ? "is-expanding-away is-expanding-away-up"114117 : "is-expanding-away is-expanding-away-down")115118 : expandingNote()