Add Diff Checker tool - #14
Merged
Merged
Conversation
Compare two versions of any text and see exactly what changed. Additions and deletions are highlighted inline, either word by word (best for prose) or line by line (git-style), with live add/removed counts. - Single self-contained index.html, fully offline (pure-JS LCS diff, no libraries or network) - State persisted to localStorage under a namespaced key; seeds a worked example on first visit - Follows the Hillnote design system; supports light and dark via prefers-color-scheme, semantic green/red for add/remove, not colour-only (additions underlined, deletions struck through) - Registered in tools.json (version 1) and catalogVersion bumped to 24; screenshot added; npm run validate passes Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BzQFhrwK7osUrNi2uAhWER
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.
What is this tool?
Diff Checker compares two versions of any text and shows exactly what changed — additions and deletions highlighted inline. It offers two granularities: Words (best for prose — inline
swiftreplaces) and Lines (git-style, best for lists/code), with a live added / removed count. It's aimed at Hillnote's writing/research audience, who constantly compare drafts, edits, and revisions.quickThe diff is a pure-JavaScript LCS (longest-common-subsequence) edit script — no library, no network — and a guard falls back to line mode on very large inputs so typing stays snappy.
Checklist
diff-checker/index.htmlwith all CSS + JS inline.fetch, orimport.screenshots/diff-checker.webp(vianpm run screenshot diff-checker).tools.json(dirmatches the folder name).catalogVersion(23 → 24).version: 1.npm run validatepasses locally.Notes for reviewers
prefers-color-scheme).<ins>) and deletions struck through (<del>), so the diff is legible without relying on colour.""so the sample never reappears once you edit the panes. State is namespaced underdiff-checker:.MAX_TOKENScaps the word-level DP; beyond it the tool auto-switches to a line diff with a notice, and a hard ceiling shows a "too large" message rather than freezing.Generated by Claude Code