Skip to content

Kartikpatkar/diff-board

Repository files navigation

🔀 DiffBoard – Code Comparison Tool

License: MIT Version Chrome Extension

Tagline: Compare code, text, and JSON like a developer — fast, visual, and distraction-free.


✨ Overview

DiffBoard is a modern, developer-friendly Chrome Extension that opens from the extension toolbar and helps you compare code, text, JSON, logs, and config files with a clean UI and powerful diff visualization.

Built for developers who frequently compare:

  • API responses
  • Code changes
  • Config files
  • JSON payloads
  • Logs and text outputs

DiffBoard focuses on clarity, speed, and usability, without overwhelming you with unnecessary complexity.


🚀 Key Features

🔍 Side-by-Side Code Comparison

  • Paste or drop files into the Original and Modified editors

  • Visual, GitHub-style diff output

  • Clear highlights for:

    • ➕ Added lines
    • ➖ Removed lines
    • ✏️ Modified lines

📊 Diff Summary Panel

  • Instant statistics:

    • Lines added
    • Lines removed
    • Lines modified
  • Always visible above the diff results

📋 Copy & Export Utilities

  • Copy left input or right input from editor panels
  • Consolidated 📋 Copy... dropdown selection list:
    • Copy Full Diff (View)
    • Copy Unified Diff Patch (standard .patch output)
    • Copy Added (+) Lines or Removed (-) Lines only
  • Download comparison results as diff.txt or diff.html
  • Instant toast alerts confirming copy success or errors

🧩 Format Tools

  • Reusable format actions for Format, Minify, Validate, and Sort Keys (JSON)
  • Works with common text and code inputs, not just JSON payloads
  • Ideal for API payloads, config files, and source snippets

📁 File Import

  • Drag and drop files directly onto either editor
  • Supports common text, code, markup, config, and log file types
  • Helpful for quick comparisons without manual copy and paste

🔎 Diff Workflow Tools

  • Find text inside the rendered diff with live match highlighting and counts
  • Chevron navigation arrows (Next / Prev match) that scroll matches centered into view
  • Toggle diff rendering views between Side-by-side and Unified (Line-by-line)
  • Context toggles to show all lines or restrict viewport to changed sections
  • Export comparison results as plain text or HTML for ticketing and sharing
  • Ignore whitespace, case, and line-ending differences when comparing

💾 Session Recovery

  • Restores left editor content after refresh
  • Restores right editor content after refresh
  • Restores the active Editors/Diff tab
  • Keeps theme preference between sessions

🗂️ Supported Formats

DiffBoard supports syntax highlighting and formatting for a wide variety of development, configuration, and markup formats, including JavaScript, TypeScript, HTML, CSS, JSON, YAML, XML, Markdown, Python, Java, C/C++, C#, Shell scripts, and plain text.

⌨️ Keyboard Shortcuts

  • Ctrl/Cmd + Enter → Compare
  • Ctrl/Cmd + L → Clear
  • Ctrl/Cmd + Shift + C → Copy diff
  • Ctrl/Cmd + D → Toggle theme
  • Ctrl/Cmd + J → Apply selected format tool
  • Ctrl/Cmd + 1 / 2 → Switch between Editors and Diff tabs
  • Built-in shortcuts help modal available from the toolbar

🪄 Better Large-File UX

  • Comparing... loading state during heavy diff rendering
  • Debounced compare flow to avoid repeated renders from rapid clicks
  • Wrap toggles in both Editors and Diff views for long-line handling

🌓 Dark / Light Theme

  • Clean light theme for readability
  • Developer-friendly dark mode
  • Theme preference persisted locally across sessions

🧭 Tab-Based Workflow

  • Input View – paste and edit content
  • Diff View – focus on comparison results

🧼 Clear & Reset

  • Clear inputs and diff results instantly
  • Reset stats and UI state with one click

🖥️ UI Philosophy

DiffBoard is designed with:

  • Minimal distractions
  • Clear visual hierarchy
  • Keyboard-friendly layout
  • Scrollable, non-clipping diff output
  • No forced fullscreen — users stay in control
  • Long-line resilience with optional wrapping and loading feedback

📸 Screenshots

🔷 Light Mode

Main Page - Light Theme Keyboard Shortcuts Screen - Light Theme Diff View - Light Theme

🌑 Dark Mode

Main Page - Dark Theme Diff View - Dark Theme


🛠 Built With

  • HTML, CSS, JavaScript (Vanilla)
  • jsdiff – diff engine
  • Diff2Html – GitHub-style diff rendering
  • Chrome Extensions API (Manifest V3)
  • Modular utility-based architecture

📦 Installation

🔧 Load DiffBoard Manually (Developer Mode)

  1. Clone or Download this Repository

    git clone https://github.com/Kartikpatkar/diff-board.git
  2. Open Chrome Extensions Page

    chrome://extensions/
    
  3. Enable Developer Mode

    • Toggle Developer mode (top-right)
  4. Click “Load unpacked”

    • Select the project root folder (contains manifest.json)
  5. Done 🎉

    • Click the extension icon in Chrome to launch DiffBoard

✅ Works completely offline ✅ No login or external services required


🧪 Current Capabilities

✔ Side-by-side or Unified line-by-line diff toggling ✔ Drag-and-drop direct file import ✔ High-fidelity syntax highlighting using offline static libraries (Light/Dark themes) ✔ Non-destructive formatting, comment-stripping, and minifying using tokenizer state machines ✔ Dynamic stats panel (+ additions, - removals, ~ changes) ✔ Consolidated Copy selector (Full View, Patch, +, - lines) ✔ Downloadable diff exports in TXT and HTML formats ✔ Search inside rendered diffs with up/down chevron navigation and centered viewport scrolling ✔ Ignore whitespace, case, and line-ending comparison options ✔ Accidental reset protection (confirmation guard popups for clear events) ✔ Keyboard shortcuts and in-app shortcut modal panel ✔ Persistent configuration and last-session state recovery on refresh ✔ Optional wrap line toggles for text views and comparison cards


🛣️ Roadmap (Planned Enhancements)

  • 🧠 VS Code–style Compare View
  • 🔗 Shareable diff export
  • 📌 Save comparison history
  • 💾 Remember recent comparisons

🤝 Contributing

Contributions, bug reports, and feature suggestions are welcome!

  • Fork the repository
  • Create a feature branch
  • Submit a pull request

Please keep changes modular and follow existing code structure.


🧠 Author

Built by Kartik Patkar 🔗 GitHub • LinkedIn • Developer & Salesforce Consultant


📜 License

This project is licensed under the MIT License — free to use, modify, and distribute.


DiffBoard — because comparing code should be simple, fast, and visual.

About

DiffBoard is a privacy-first Chrome extension that lets developers compare code, JSON, and text side-by-side with clear visual diffs, offline support, and a modern dark/light UI — all directly in the browser.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Contributors