Bug
When editing a note, sortAndMove() re-sorts the note list and moves the note to its new position (e.g., top for modification date sort, or alphabetically for title sort), but the list does not scroll to follow the moved note. The note appears to vanish from the visible area of the list.
Steps to reproduce
- Open a folder with many notes (enough to scroll)
- Sort by modification date (ascending) or by title
- Select and edit a note that is currently visible in the middle of the list
- The note moves to the top (modification date) or to its new alphabetical position
- The list stays scrolled to the same position — the note is no longer visible
Expected: The note list should scroll to keep the edited note visible after re-sorting.
Root cause (from source code)
sortAndMove() in ViewController.swift (lines 1608-1619) calls moveRow() but never calls scrollRowToVisible():
public func sortAndMove(note: Note, project: Project? = nil) {
guard let srcIndex = notesTableView.getIndex(for: note) else { return }
let notes = notesTableView.getNoteList()
let resorted = storage.sortNotes(noteList: notes)
guard let dstIndex = resorted.firstIndex(of: note) else { return }
if srcIndex != dstIndex {
notesTableView.moveRow(at: srcIndex, to: dstIndex)
notesTableView.setNoteList(notes: resorted)
// Missing: notesTableView.scrollRowToVisible(dstIndex)
}
}
Suggested fix
Add notesTableView.scrollRowToVisible(dstIndex) after the moveRow call. This API is already used elsewhere in the codebase (e.g., SidebarOutlineView.swift line 632, ViewController.swift line 1515).
Environment
- FSNotes 7.1.1
- macOS 15 Sequoia
Bug
When editing a note,
sortAndMove()re-sorts the note list and moves the note to its new position (e.g., top for modification date sort, or alphabetically for title sort), but the list does not scroll to follow the moved note. The note appears to vanish from the visible area of the list.Steps to reproduce
Expected: The note list should scroll to keep the edited note visible after re-sorting.
Root cause (from source code)
sortAndMove()inViewController.swift(lines 1608-1619) callsmoveRow()but never callsscrollRowToVisible():Suggested fix
Add
notesTableView.scrollRowToVisible(dstIndex)after themoveRowcall. This API is already used elsewhere in the codebase (e.g.,SidebarOutlineView.swiftline 632,ViewController.swiftline 1515).Environment