iSapozhnik

macOS Swift package for token-level text diffs with a display-only SwiftUI/AppKit renderer.

38
2
100% credibility
Found Feb 18, 2026 at 25 stars -- GitGems finds repos before they trend. Get early access to the next one.
Sign Up Free
AI Analysis
Swift
AI Summary

TextDiff is a macOS Swift package that computes differences between two text versions at word or character level and renders them as highlighted, merged views usable in SwiftUI or AppKit.

How It Works

1
💡 Spot the need

You're building a Mac app and want an easy way to show what changed between old and new text versions.

2
🔍 Find TextDiff

You discover TextDiff, a handy tool that highlights text differences beautifully.

3
🔗 Link it in

Simply connect it to your app project so it's ready to use.

4
📝 Feed in texts

Give it the original text and the updated text to compare.

5
See changes glow

It instantly shows additions in green, removals in red, and keeps unchanged parts clear.

6
🎨 Tweak the style

Adjust colors, fonts, and spacing to perfectly fit your app's look.

Users love it

Now everyone in your app quickly understands edits, making collaboration smooth and fun!

Sign up to see the full architecture

5 more

Sign Up Free

Star Growth

See how this repo grew from 25 to 38 stars Sign Up Free
Repurpose This Repo

Repurpose is a Pro feature

Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.

Unlock Repurpose
AI-Generated Review

What is TextDiff?

TextDiff is a macOS Swift package that computes token-level diffs between two text strings and renders a merged, display-only view highlighting insertions, deletions, and changes. Drop in two strings via SwiftUI's TextDiffView or AppKit's NSTextDiffView, pick token or character mode for precision (like refining "Add" to "Added" by shared prefix), and get automatic layout with wrapping and intrinsic height. Perfect for macOS SwiftUI apps, tutorials, or tools needing a compact text diff checker without selectable text.

Why is it gaining traction?

It delivers pixel-perfect rendering with customizable styles—tweak colors, fonts, chip spacing, strikethroughs, and insets—while handling whitespace, punctuation, and multiline text neutrally. Updates trigger efficient recomputes only when needed, and both SwiftUI and AppKit share the same renderer for consistent chips around changed words. Developers grab it for the dead-simple API that slots into macOS SwiftUI sidebars, toolbars, sheets, or menus faster than rolling custom diffs.

Who should use this?

macOS app builders integrating diffs into GitHub clients (desktop, CLI, runners, or SSH key setup tools), changelog viewers, or editors. Suited for SwiftUI tutorial projects, SwiftBar menu apps, or any dev needing inline text diffs in macOS GitHub actions workflows or download managers.

Verdict

Solid early pick (15 stars, 1.0% credibility score) with crisp docs, previews, and snapshot tests covering edge cases—mature enough for production niches despite low traction. Use it now if macOS-native text diffs fit; watch for broader adoption.

(198 words)

Sign up to read the full AI review Sign Up Free

Similar repos coming soon.