# Changelog

All notable changes to DirectCompare will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

---

## [1.08] - 2026-06-01

### Fixed
- CollabSession: thread-safe named pipe handling — Stop() now uses CancelIoEx before joining receive thread, ReceiveLoop holds pipe_mutex during I/O (prevents use-after-free)
- SharedState: GetRawResults() and GetRawSources() now return by value for thread-safe snapshots (prevents dangling-reference races in CLI automation)
- ResultDatabase: all DB access now guarded by m_resultDbMutex — background save thread and GUI event handlers no longer race on SQLite
- Merge engine (legacy 2-way): fixed asymmetric hunk overlap using maxBaseCount = max(left, right) oldCount — prevents corrupted output when left/right modify overlapping regions of different lengths
- Deduplicated CLI command dispatch maps into shared kSharedCmdMap[] with LookupCmdId() helper
- Removed ~220 lines of dead code from SetCollabSession callback (unreachable after DispatchCliCommand early return)
- Consolidated duplicate TypeFromString implementations into single SourceLocation::TypeFromString()

---

## [1.07] - 2026-05-07

### Added
- Built-in PDF text extractor — view and diff PDF files without any external dependencies
- PDF encoding mode selector in diff viewer toolbar (Auto / WinAnsi / MacRoman / Raw Bytes) — cycle through encoding options when text appears garbled

### Changed
- PDF support now works fully offline with zero DLL requirements (replaces prior poppler dependency)

---

## [1.06] - 2026-04-06

### Added
- Git mergetool integration: invoke DCP as `dircomparepro -m BASE LOCAL REMOTE MERGED` for use with `git mergetool`
- Home screen shown at startup for quick access to recent sessions and common actions
- Colorblind-friendly theme (blue/orange palette) — toggle now cycles Light -> Dark -> Colorblind
- License status shown in title bar: [FREE], [TRIAL - N days], [TRIAL EXPIRED]
- Notification banner with contextual upgrade and trial CTAs

### Changed
- Trial extended to 30 days, zero-friction activation (no sign-up required)
- Web comparison correctly gated to Premium tier with upgrade prompt
- All file diffs in Browse mode now use the N-way diff viewer (legacy 2-way path removed)

### Fixed
- Eliminated git2.dll runtime dependency — exe is now fully static with zero DLL requirements
- Trial period corrected to 30 days on Windows (was incorrectly 7 days in all code paths)
- License info dialog now shows correct days remaining after trial registration (was showing -1)
- Thread-safe time functions used internally (eliminates potential race condition)

---

## [1.05] - 2026-04-02

### Fixed
- N-way diff viewer: synchronized scrolling now drives all panels simultaneously via direct RICHEDIT messages, eliminating the lag and jumpiness when dragging the scrollbar thumb

---

## [1.04] - 2026-03-26

### Added
- Filter toolbar: All / Diffs / Same / Minor toggle buttons in comparison toolbar
- Per-row copy arrows in N-way results tree (Actions column — click to copy file between sources)
- Diff count breakdown in main status bar (N different / N minor / N identical / N missing)
- Disk free space per local source in status bar
- Load time display in diff viewer line-detail bar

---

## [1.0.3] - 2026-03-18

### Added
- 3-way merge (base/mine/yours ancestor view) is now free in the Basic tier - no paid license required
- Web comparison diff viewer now uses the full N-way viewer (sync scroll, prev/next diff, gutter arrows)
- License Information dialog now shows active machine ID and license key (first 40 chars)

### Changed
- N-way merge (4+ sources) remains Standard tier and above
- Web comparison no longer uses the legacy 2-way diff viewer

---

## [1.0.0] - 2025-12-25

### Initial Release

This is the first public release of DirectCompare, a professional cross-platform directory comparison tool.

#### Added

**Core Comparison Engine**
- N-way directory comparison supporting 2, 3, 4+ simultaneous sources
- Legacy 2-way comparison mode for simple directory comparisons
- Deep content comparison using SHA-256 hashing
- Timestamp and file size comparison options
- Recursive directory scanning
- Smart folder alignment for renamed directory detection

**Source Providers**
- Local filesystem comparison
- Git repository comparison via libgit2 (compare branches without checkout)
- GitHub repository comparison via REST API (no cloning required)
- Archive comparison supporting ZIP, TAR, 7Z, RAR, ISO, CAB, AR, CPIO, GZ, BZ2, XZ
- Web resource comparison (compare local files with live websites)

**Similarity Search Engine**
- Configurable similarity threshold (0-100%)
- Text similarity matching (Jaccard coefficient, line-based)
- Image similarity matching (perceptual hashing with dHash and aHash)
- Content-based duplicate detection using SHA-256
- Support for custom similarity matchers via plugin interface

**Merge & Conflict Resolution**
- 3-way merge with Myers diff algorithm
- Interactive conflict resolution dialog
- Visual diff viewer with syntax highlighting
- Export merge results to files

**Advanced Features**
- Bookmark manager for saving important comparisons
- Comparison history tracking
- Export results to JSON, CSV, HTML formats
- Wildcard and regex pattern filtering
- Include/exclude rules for fine-grained control
- Recent directory history

**User Interface**
- Native cross-platform GUI using wxWidgets 3.2.8
- Dual-mode interface (2-way and N-way comparison views)
- Tree view with folder statistics and file counts
- Syntax highlighting for 50+ programming languages
- Image preview and comparison viewer
- Theme support (light/dark modes)
- Keyboard shortcuts for common operations
- Progress dialogs with cancellation support
- Context menus for file operations

**Licensing System**
- RSA-2048 cryptographic license validation
- Hardware-bound license keys (machine-specific)
- Offline license validation (no internet required)
- Multiple license tiers: Basic, Trial, Standard, Premium, Enterprise, Lifetime
- 30-day trial period with full feature access
- Anti-tamper protection and integrity checks
- Trial backup and restoration mechanisms

**Platform Support**
- Windows 10/11 (64-bit) - Fully static build (14.0 MB)
- Linux (Ubuntu 22.04+, Debian 12+) - Dynamically linked build (~3.0 MB)
- 100% feature parity between Windows and Linux

**Developer Tools**
- Comprehensive logging system with multiple severity levels
- Debug builds with additional validation
- Command-line interface for scripting
- Configuration file support (JSON format)

#### Security

**Security Enhancements**
- Fixed command injection vulnerability in file operations
- Fixed path traversal vulnerability in archive extraction ("Zip Slip")
- Enforced HTTPS certificate validation for all network requests
- Enhanced trial reset protection with FNV-1a integrity checksums
- Machine-bound trial keys to prevent sharing
- Backup storage for license data with tamper detection

**Compliance**
- OWASP Top 10 (2021) compliance
- CWE Top 25 vulnerability remediation
- RSA-2048 cryptographic signatures for license keys
- Secure coding practices (RAII, smart pointers, bounds checking)

#### Performance

- File enumeration: ~10,000 files/second on SSD
- SHA-256 hashing: ~500 MB/second
- Git repository scanning: ~5,000 files/second via libgit2
- GitHub API with local caching for improved performance
- Image similarity: ~20-30 images/second
- Text similarity: ~50-100 files/second

#### Documentation

- Comprehensive user documentation in `docs/` directory
- Architecture guide in `CLAUDE.md`
- Build instructions for Windows (`docs/BUILD_GUIDE_V2.md`)
- Build instructions for Linux (`linux/BUILD_LINUX.md`)
- Cross-platform status report (`docs/CROSS_PLATFORM_STATUS.md`)
- Security documentation (`docs/SECURITY_FIXES_2025.md`)
- Licensing system guide (`docs/LICENSING_SYSTEM.md`)
- QA testing procedures (`QA_TESTING_PROCEDURES.md`)

#### Dependencies

- wxWidgets 3.2.8 (Cross-platform GUI framework)
- libgit2 1.8.5 (Git integration)
- libarchive 3.8.3 (Archive support)
- OpenSSL 3.6.0 (Cryptography and hashing)
- libcurl (HTTP client - Linux only)
- WinHTTP (HTTP client - Windows only)

#### Known Issues

- GitHub API rate limits: 60 requests/hour unauthenticated, 5000/hour with token
- Very large files (>2GB) may cause memory pressure
- Some rare archive formats may require additional system libraries

---

## [1.03] - 2026-03-16

### Added

**Licensing & Activation**
- License expiry warning shown at startup: 30-day advance notice, and a clear explanation when a key has expired and the app has downgraded to Basic tier
- Feature gate enforcement throughout the UI — paid features now show an upgrade prompt when accessed without the required tier
- Git source provider gated to Standard tier and above
- Plugin file viewers (STL, OBJ, WAV, ACF) gated to Standard tier and above

**Results View**
- Filter toggle buttons (All / Diffs / Same / Minor) in the comparison toolbar with active-state highlighting
- Per-row copy arrows in the results tree — Actions column lets you copy individual files left, right, or both ways
- Diff count breakdown in the status bar (N different, N minor, N identical, N missing)
- Disk free space per local source displayed in the status bar

**Diff Viewer**
- Load time displayed in the diff viewer line-detail bar
- HTML view mode in the N-way diff viewer (renders `.html`/`.htm` files in a browser engine on platforms where wxWebView is available)

**Help System**
- Updated in-app Help with new sections: Per-Row Copy Arrows, Status Bar enhancements, Plugin Viewers, Sync Preview
- New Licensing tab in Help explaining Basic/Standard/Premium tiers, activation, and the upgrade path

**Build & Release**
- Single `scripts/release.bat` (and `release.ps1`) script that builds and packages both Windows (.zip) and Linux (.tar.gz) releases in one run
- `-LinuxOnly` flag to skip the Windows build
- `scripts/release_linux.sh` for standalone Linux packaging via WSL or native Linux
- SHA-256 checksums generated for both packages automatically

### Changed

- Pricing updated to annual subscription model: Standard $39/year, Premium $79/year (Lifetime remains a one-time purchase)
- Website pricing cards updated to reflect yearly pricing

### Fixed

- Linux build: `uint8_t`/`uint16_t`/`uint32_t`/`uintmax_t` not declared — added `#include <cstdint>` to `hex_compare_dialog.h`, `wav_viewer_dialog.h`, and `properties_panel.h`
- Linux build: `std::unique_ptr` not declared in `xlsx_reader.cpp` — added `#include <memory>`
- Linux build: Windows-only `SendMessage`/`HWND`/`EM_GETFIRSTVISIBLELINE` scroll sync in `dialogs_nway.cpp` wrapped in `#ifdef _WIN32`
- Linux build: wxWebView guarded with `DCP_USE_WEBVIEW` — defined automatically on Windows, and on Linux only when the webview library is actually present on the system
- Linux build: Makefile updated to link `-lGL -lGLU` for OpenGL viewers, and to optionally link wxWebView when available via `ldconfig`

---

## [Unreleased]

### Planned for v1.1

- Archive-to-archive direct comparison
- Multi-threaded file hashing for improved performance
- Enhanced image similarity algorithms
- Cloud storage integration (S3, Azure Blob Storage)
- Improved progress reporting with ETA calculations

### Planned for v1.2

- FTP/SFTP source providers
- Database comparison support (MySQL, PostgreSQL)
- Custom plugin system for extensibility
- Enhanced reporting templates with charts
- Batch comparison scripting

---

## Version History

- **v1.03** (2026-03-16) - Feature gates, BC parity features, Linux packaging
- **v1.0.0** (2025-12-25) - Initial public release

---

## Versioning Scheme

DirectCompare follows Semantic Versioning (MAJOR.MINOR.PATCH):

- **MAJOR** - Incompatible API changes or major feature overhauls
- **MINOR** - New features in a backward-compatible manner
- **PATCH** - Backward-compatible bug fixes

---

## Support

For questions, bug reports, or feature requests:

- **GitHub Issues:** https://github.com/yourorg/dircompare/issues
- **Email Support:** dircomparepro@gmail.com
- **Security Issues:** dircomparepro@gmail.com

---

*Last Updated: March 16, 2026*
