Skip to content

Add Diff Checker tool - #14

Merged
02karthik merged 1 commit into
mainfrom
claude/wizardly-mayer-315o43
Aug 4, 2026
Merged

Add Diff Checker tool#14
02karthik merged 1 commit into
mainfrom
claude/wizardly-mayer-315o43

Conversation

@02karthik

Copy link
Copy Markdown
Collaborator

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 swift replaces quick) 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.

The 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

  • It's a single file: diff-checker/index.html with all CSS + JS inline.
  • It is fully self-contained / offline — no remote fonts, scripts, styles, images, fetch, or import.
  • No analytics, trackers, or phone-home behavior.
  • Added a screenshot at screenshots/diff-checker.webp (via npm run screenshot diff-checker).
  • Registered the tool in tools.json (dir matches the folder name).
  • Bumped the top-level catalogVersion (23 → 24).
  • For an update to an existing tool: N/A — new tool at version: 1.
  • npm run validate passes locally.

Notes for reviewers

  • Design system: single azure accent for chrome; the green/red on the diff is the documented semantic palette (positive/negative families), used only for illustrative diff content. Every colour goes through a token — verified in both light and dark (prefers-color-scheme).
  • Not colour-only: additions are underlined (<ins>) and deletions struck through (<del>), so the diff is legible without relying on colour.
  • First-run example: seeds a short worked example so the tool (and gallery card) shows what it does; cleared state is stored as "" so the sample never reappears once you edit the panes. State is namespaced under diff-checker:.
  • Performance guard: MAX_TOKENS caps 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.
  • Distinct from existing/closed work: no existing tool does text comparison, and this is unrelated to the previously closed Markdown Preview / Markdown Table PRs.

Generated by Claude Code

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
@02karthik
02karthik merged commit e797934 into main Aug 4, 2026
1 check passed
@02karthik
02karthik deleted the claude/wizardly-mayer-315o43 branch August 4, 2026 00:47
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.

2 participants