Skip to content

Tell which lines an edit in the feed changed - #84

Open
markusressel wants to merge 1 commit into
masterfrom
feed-ranges
Open

markusressel wants to merge 1 commit into
masterfrom
feed-ranges

Conversation

@markusressel

Copy link
Copy Markdown
Member

Feed entries of kind edited now say exactly which lines changed, so the app and the web client can highlight those lines instead of the section from heading to heading. Requested by Markus via the Android client; the contract was agreed with it and is in docs/dashboard.md ("Changed lines").

  • summary.ranges: [{line, count, heading, headingOccurrence, offset}] in text order, on the text after the last edit of the editing session. count: 0 marks removed lines.
  • summary.textHash: the first 16 hex digits of SHA-256 over that text. When it matches, the client uses the absolute lines; otherwise it goes by heading + offset.
  • Changes up to 3 unchanged lines apart merge, and there are at most 20 ranges (the closest neighbours merge).
  • # comments in the front matter no longer count as headings, which also affects summary.headings.
  • Migration 4 in activity.db adds feed.ranges and feed.text_hash. Older entries have ranges: null and no textHash.
  • Conflicts with Open pages by QR code keys in the front matter #83, which also adds migration 4. Whichever merges second renumbers its migration to 5.
  • Feature feed-ranges. OpenAPI: FeedSummary and FeedRange updated.

Tests: go test ./... and golangci-lint are clean.

🤖 Generated with Claude Code

Edit summaries get `ranges` (line, count, nearest heading with its
occurrence and offset) and `textHash` of the text after the edit, so
clients highlight the changed lines instead of whole sections. Ranges
compare the session start with its end, merge changes up to 3 lines
apart and stop at 20. Headings in the front matter no longer count.
Feature `feed-ranges`, activity.db migration 4, see docs/dashboard.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant