The functions findFirstNoteSegmentAbove and findFirstNoteSegmentBelow don't do what their names say they do. Better names would be something like findPreviousNoteSegment and findNextNoteSegment.
Or if they should actually be finding the first note above/below, then they need to do focus.find(isNote, 'up') and focus.find(isNote, 'down').
The functions
findFirstNoteSegmentAbove
andfindFirstNoteSegmentBelow
don't do what their names say they do. Better names would be something likefindPreviousNoteSegment
andfindNextNoteSegment
.Or if they should actually be finding the first note above/below, then they need to do
focus.find(isNote, 'up')
andfocus.find(isNote, 'down')
.See: https://github.com/guardian/scribe-plugin-noting/blob/jp-refactor-note-toggle-2/src/utils/noting/find-next-note-segment.js#L10
And: https://github.com/guardian/scribe-plugin-noting/blob/jp-refactor-note-toggle-2/src/utils/noting/find-previous-note-segment.js#L10