Repository navigation
feat(import): say which notes are about each dive row - #346
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Each row of the logbook import report's
divesnow carriesnotes: list[int]: indexes into the same report'snotes, ascending, naming the notes about that dive. It's on bothPOST /import/logbook/previewandPOST /import/logbook, which shareImportReport. This is the contract the web half renders against.report.notesstays whole and unchanged, so every note is still listed once andnotes_truncatedkeeps its meaning. A note the cap dropped is on no row. No note is on two rows. Notes about no dive (a tag list, a site, the portrait) are on no row, and a client shows those in the list as before. A client can't make this join itself, because a note'suuidis the document's identifier, and the row'suuidis the stored dive's. Those differ for a remapped dive and for a dive that a later file's recording joins. Across a batch, two files can also give one uuid to two dives. So the join runs server-side on the batch member plus the document uuid. A note's member is traced by object identity rather than by position, because at the cap a later note can take a derived note's place and shift every index after it. A document dive whose recordings partly joined dives you already have puts its notes on the dive it became.record_remapped_references_stayis on no row, since its uuid names the first of the two records, not the remapped one. The change is additive, so the web build deployed now keeps renderingreport.notesas it does today.Verified with five new batch tests against Postgres: a sighting note on its created dive in both preview and apply, a dive whose stored uuid isn't the document's, two files sharing a dive uuid, a cap that shifts indexes, and a note about no dive. The import suites pass, as do ruff and all three mypy runs.
🤖 Generated with Claude Code