- Implemented CustomCryptoSymbol model to handle user-defined symbols.
- Enhanced PriceManager to manage custom symbols, including fetching and caching prices.
- Updated PriceService to support fetching prices for custom symbols.
- Modified CryptoSymbol to include methods for symbol validation and retrieval.
- Redesigned PreferencesWindowView to allow users to add and delete custom symbols with validation.
- Added caching logic for custom symbol prices to improve performance.
- Updated error handling in PriceError to account for custom symbol scenarios.
- Replace GitHub button with update detection button
- Integrate GitHub API to fetch latest release version
- Implement version comparison logic
- Add loading animation during update check
- Display appropriate alerts for up-to-date/new version/error states
- Auto-open GitHub releases page when update is available
- Auto-close about window after opening release page
- Optimize progress view size for better UI alignment
Technical changes:
- Add GitHubRelease and GitHubCommit models for API parsing
- Add UpdateError enum for error handling
- Implement fetchLatestVersion() with URLSession and semaphores
- Add compareVersions() function for semantic version comparison
- Use DispatchQueue for async network operations and UI updates
Major feature enhancement for the BTC price monitoring application:
### New Features
- **Configurable Refresh Intervals**: Users can now select from 5s, 10s, 30s, 60s options
- **Persistent Settings**: User preferences saved via UserDefaults
- **GitHub Integration**: Direct link to project repository via menu
- **Version Display**: Shows current app version in about dialog
- **Debug Logging**: Comprehensive debug output for development (Debug builds only)
### Implementation Details
- **AppSettings.swift**: New configuration management class
- **RefreshInterval.swift**: Enum defining refresh options with display text
- **Enhanced PriceManager**: Dynamic timer management with configurable intervals
- **Updated BTCMenuBarApp**: Added refresh settings submenu, GitHub link, and version info
- **Debug Infrastructure**: Conditional compilation logging throughout price update flow
### UI/UX Improvements
- **Refresh Settings Submenu**: Visual indicators (✓) for current selection
- **Enhanced About Dialog**: Shows current refresh interval and app version
- **Clean Menu Structure**: Organized with proper separators and SF Symbols
- **GitHub Button**: Quick access to project repository
### Code Quality
- **Removed Redundancy**: Deleted unused ContentView.swift template file
- **Comprehensive Comments**: Added detailed Chinese comments throughout
- **Error Handling**: Robust error handling with user-friendly messages
- **Architecture Clean**: Follows MVVM pattern with clear separation of concerns
### Files Changed
- Modified: BTCMenuBarApp.swift, PriceManager.swift, project.pbxproj
- Added: AppSettings.swift, RefreshInterval.swift
- Deleted: ContentView.swift (unused template)
- Updated: Entitlements, app entry point, and service files
BREAKING CHANGE: None - all changes are additive and backward compatible