Repository navigation
fix: keep note order working after many drops into one place [20261121-renumber-note-positions-when-repeated] - #105
Merged
ttncode merged 2 commits intoNov 21, 2026
Conversation
Each drop takes the midpoint of its neighbours. Positions start as millisecond timestamps, so about 23 drops into a 1000 gap used up its precision and later drops landed in the wrong place; notes that already shared a position could not be dropped between at all. When the midpoint is not strictly between its neighbours, space the section out again from its top note, so positions stay on the timestamp scale that pinning, recovery and new notes rely on, and save the moved notes together without touching their edit time.
This was referenced Nov 21, 2026
Merged
ttncode
deleted the
fix/20261121-renumber-note-positions-when-repeated
branch
November 21, 2026 07:21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Topic:
20261121-renumber-note-positions-when-repeatedChange summary
position. Positions start as millisecond timestamps (~1.7e12), so about 23 drops into one 1000 gap used up float precision: drop 24 landed in the wrong place. Notes that already shared a position could not be dropped between at all.extension/model.js:placeNotechecks the midpoint is strictly between its neighbours; if not,spacedOutre-spaces the section in its new order, 1000 apart, hanging down from the section's top note (so it stays on the timestamp scale), and returnsrenumbered: [{ id, position }].extension/app.js:applyPlacementappliesrenumberedand saves those notes with the moved one in onepersistcall; theirupdatedAtis left alone.tests/model.test.js: 4 tests — 40 drops under the top note, a drop between tied notes, renumbering stays in the pinned section, and an unpinned renumbered note lands by age.Verify
node --test "tests/*.test.js"Verified: green, and the run describes the tree as it is now.
Note:
npm testonmainis still the old form until #103 merges.Ship decision: GO
No open Critical or Important finding. 8 readers; 1 fix-now finding fixed (renumbering to 1000·n put a section on another scale, so unpin/pin/recover misplaced notes).
Things I didn't touch
placement: "before"(code correct by reading).applyPlacementinapp.jsis untested;app.jscan't be imported in Node.Release
20261121-renumber-note-positions-when-repeated — note order keeps working after many drops
Change
Before release
kiln verifyran the full unit suite: exit 0, 218 of 218 pass on Node 22.17.1. (checked)Release steps
After release
Rollback
git revertthe merge commit, then open and merge that pull request, then release.