# Changelog

All notable changes to Watch Finished Turbo 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).

## [Unreleased]

### Added

- **API Proxy Architecture**: Next.js now proxies all API and WebSocket requests to backend service
  - Eliminates need to expose API port (3001) externally
  - Enables remote access to web UI without CORS issues
  - More secure deployment with single public port (3000)
- `.env.example` file documenting environment variables
- localStorage persistence for filter selections, search terms, and sort preferences across Files and Tasks pages
- Proper loading states to prevent "flash of empty content" on fresh page loads
- Real-time progress tracking with visual progress bar and color-coded states
- Comprehensive Recent Improvements section in architecture documentation
- Key Features section in main README highlighting system capabilities

### Changed

- **BREAKING**: Web client now uses API proxy by default instead of direct API connection
  - Remove `NEXT_PUBLIC_WATCH_FINISHED_API` from `.env.local` to use proxy (recommended)
  - Set `API_URL` for Next.js server to locate backend (default: http://localhost:3001)
  - Old behavior available by setting `NEXT_PUBLIC_WATCH_FINISHED_API` explicitly
- Docker configuration now only exposes port 3000 (web), port 3001 (API) is internal
- **BREAKING**: Simplified `files` table schema by removing `status` column
  - Files table now only tracks observations: `dataset`, `input`, `output`, `date`
  - Task processing states managed exclusively in `tasks` table
  - Automatic database migration preserves all existing file records
- Updated API endpoint from `/files/:dataset/status/:status` to `/files/:dataset`
- Improved React Query cache updates for progress events (no more full refetches)
- Enhanced HandBrake progress regex to handle space before `%` sign (e.g., "79.60 %")

### Fixed

- Dataset name extraction in WatcherService now correctly maps file paths to configured dataset keys
- HandBrake progress tracking regex now matches format "XX.XX %" with space before percent
- React key prop warning in TaskList component by using React.Fragment with proper keys
- Empty state flashing by checking for undefined data during initial page loads
- FileList loading state now accounts for multi-step query dependencies (datasets → files)

### Performance

- Reduced API calls through localStorage caching of user preferences
- Direct cache updates for progress events eliminate unnecessary network requests
- Optimistic UI updates provide immediate feedback with background synchronization
- Prevented unnecessary re-renders through proper loading state management

## [Previous Versions]

See git commit history for changes prior to this changelog.

### Notable Historical Changes

- Multi-stage Docker build with dev and prod modes
- Comprehensive dev container setup
- Task queue retry logic with configurable settings
- WebSocket real-time event system
- Priority-based task processing
- Dataset configuration management
