Conversation
… theme support (#171) * feat(player): show inline dictionary popover * enhance(player): improve word lookup popup UI and functionality - Enhanced dictionary popover with better visual design - Added pronunciation button with speech synthesis - Improved loading and error states display - Limited definitions display to 6 items with more indicator - Added translation section with tags layout - Implemented responsive design and custom scrollbar - Enhanced fade-in animation for better UX - Fixed ResizeObserver compatibility in test environment - Updated tests to cover new features and error states Fixes: Improve word lookup popup appearance and functionality * refactor(player): optimize part-of-speech tags layout in dictionary popup - Changed definition layout from column to row for better space usage - Made part-of-speech tags more compact with inline layout - Reduced vertical space occupied by multiple definitions - Improved visual balance with fixed-width centered tags - Enhanced readability with better alignment and spacing Resolves space efficiency issues with multiple part-of-speech tags * refactor(player): extract DictionaryPopover as independent component - Created standalone DictionaryPopover component with complete UI - Moved all dictionary-related logic and styles to separate component - Simplified SubtitleOverlay by removing 200+ lines of dictionary code - Maintained all existing functionality (pronunciation, loading states, error handling) - Improved code organization and maintainability - Enhanced component reusability and testability Benefits: - Better separation of concerns - Easier to maintain and test dictionary functionality - Reduced SubtitleOverlay complexity - Improved code organization * fix(player): prevent DictionaryPopover overflow on screen edges - Added intelligent position calculation algorithm - Implemented 6 placement modes: top/bottom with left/right/center alignment - Automatic position adjustment based on viewport boundaries - Prevents horizontal overflow with 10px safety margin - Dynamic transform calculations for different placements - Maintains optimal positioning while avoiding screen edges - Enhanced user experience for edge-case word selections Benefits: - No more cutoff popover on right/left screen edges - Smart positioning adapts to available space - Consistent visual appearance across all positions - Improved accessibility and usability * feat(player): add comprehensive dictionary popover with theme support and pronunciation - Implement new DictionaryPopover component using Ant Design Popover for intelligent positioning - Add comprehensive pronunciation parsing with UK/US audio support and voice parameters - Enhance dictionary service parsing to handle complex HTML structures and <i> tag formats - Add theme compatibility using Ant Design CSS variables for light/dark mode adaptation - Implement internationalization support with loading/error state translations - Add robust test coverage for various dictionary HTML parsing scenarios Features: - Pronunciation: Extract audio URLs, phonetic symbols, and support both UK/US variants - Parsing: Handle mixed part-of-speech formats (tagged vs plain text) with comprehensive coverage - UI: Smart positioning, theme-aware styling, and accessibility improvements - Testing: Edge cases for "need", mixed formats, and complex part-of-speech structures This feature provides users with comprehensive word lookup functionality including native pronunciation support and seamless theme integration for enhanced subtitle reading experience. * test(DictionaryPopover): update tests to match current data structure and remove deprecated features - Remove phonetic field support in favor of pronunciations array structure - Update test mocks to use pronunciations with type and phonetic properties - Fix translation mocks to return actual Chinese translations instead of keys - Add data-testid to error content for proper test coverage - Remove definitions limitation logic and update test expectations accordingly - Change test from "limits to 6 definitions" to "displays all definitions" Changes: - DictionaryPopover: Remove phonetic field fallback, use only pronunciations array - Tests: Replace phonetic field with pronunciations array in mock data - Tests: Add proper Chinese translations for dictionary keys - Tests: Update definition display expectations to match unlimited display This ensures tests align with the current component implementation that uses the pronunciations array structure and displays all definitions without limitation
…nction (#172) * fix(dictionary): support pronunciation extraction without UK/US distinction - Update PronunciationInfo type to allow null type for unknown pronunciation - Enhance pronunciation parsing to handle cases without explicit UK/US labels - Add support for extracting pronunciation from `<span class="Phonitic">` without phontype - Update DictionaryPopover to display "通用" for unknown pronunciation types - Add comprehensive test cases for crystal-like pronunciation scenarios - Ensure backward compatibility with existing UK/US pronunciation formats Fixes pronunciation extraction for words like "crystal" where the HTML structure doesn't explicitly distinguish between UK and US pronunciation types. * refactor(dictionary): improve audio URL building and UI presentation - Simplify audio URL parameter building logic in buildAudioUrl - Remove voicename requirement check (only langid and txt are essential) - Simplify pronunciation type display in DictionaryPopover - Only show type label when type is explicitly known (uk/us) - Default to 'uk' when calling handlePronunciation for unknown types
) * fix(player): resolve focus loss after dictionary popup interaction 修复点击查词后焦点丢失导致快捷键失效的问题 - 阻止 DictionaryPopover 中发音按钮获得焦点 - 添加弹窗关闭时的焦点恢复机制 - 确保快捷键(如空格播放/暂停)在查词后仍能正常工作 Changes: - 在发音按钮的 onClick 事件中调用 blur() 移除焦点 - 在发音按钮的 onMouseDown 事件中调用 preventDefault() 阻止默认焦点行为 - 在词典弹窗关闭时自动将焦点恢复到视频表面或字幕覆盖层 - 保持查词和发音功能的完整性 影响范围: - 修复播放器快捷键在查词后失效的问题 - 提升用户交互体验 - 保持现有功能不受影响 * fix: fix type error
…on (#174) * fix(player): resolve shortcut pause failure caused by state oscillation Remove problematic automatic retry mechanisms in PlayerOrchestrator that were causing infinite state oscillation loops between play and pause operations. **Problem**: - Shortcut pause commands (spacebar) would fail and immediately resume playback - Logs showed repeating "Video element still playing after pause() call" warnings - Root cause: setTimeout-based verification logic in requestPlay() and requestPause() created mutual triggering loops **Solution**: - Remove 150ms retry logic from requestPlay() (lines 283-297) - Remove 50ms retry logic from requestPause() (lines 320-333) - Remove verification timeouts from requestTogglePlay() (lines 345-360) - Trust browser's native play()/pause() API reliability **Impact**: - ✅ Shortcut pause now works immediately without interference - ✅ Eliminates state oscillation loop warnings from logs - ✅ Mouse click controls remain unaffected - ✅ All other player functionality preserved Fixes #170 * test: update PlayerOrchestrator tests to reflect removed retry mechanisms Update reliability tests that previously validated automatic retry behavior: - 'should detect play failure in delayed verification' → 'should only call play once without retry' - 'should detect pause failure in delayed verification' → 'should only call pause once without retry' These tests now correctly validate the simplified behavior where play() and pause() are called exactly once without automatic retry mechanisms, aligning with the fix that removes state oscillation loops. All 578 tests now pass ✅
…nderer processes (#175) - Add @sentry/electron dependency for comprehensive error tracking and performance monitoring - Create shared TypeScript definitions for main and renderer Sentry configurations - Implement SentryService for main process with native crash reporting and breadcrumb collection - Implement SentryService for renderer process with web-specific error handling - Initialize Sentry in both main index and renderer init files for full coverage - Configure error boundaries, performance monitoring, and user context tracking - Add support for release tracking, environment detection, and custom integrations - Enable automatic breadcrumb collection and unhandled rejection capture This implementation provides: - Centralized error monitoring and crash reporting - Performance tracking and bottleneck identification - User session tracking with privacy-conscious defaults - Development/production environment separation - Comprehensive error context for debugging production issues
…xperience (#177) - Set PRODUCTION URL to China mirror (http://release.echoplayer.z2blog.com/api/releases) - Add CN_ALPHA and CN_BETA URLs for Chinese users' pre-release channels - Simplify AppUpdater logic to use PRODUCTION URL for all stable releases - Maintain GitHub URLs for non-CN users in test mode - Improve logging to distinguish China mirror usage
…gger without description (#179) - Add logic to automatically fetch release description from GitHub API when manual workflow trigger doesn't provide release_body - Fallback to informative default message if release not found or has no description - Maintain existing behavior when release_body is explicitly provided - Improve user experience by eliminating need to manually copy descriptions
…pause (#182) * fix(player): resolve spacebar shortcut not working after clicking to pause - Remove duplicate onKeyDown handler from VideoSurface component that was intercepting space key events and preventing global shortcuts from working - Add enhanced debug logging to track shortcut trigger events and focus state - Ensure consistent play/pause behavior regardless of focus location Fixes issue where clicking VideoSurface to pause would prevent spacebar from resuming playback * test: fix Windows timing race conditions in VideoLibraryDAO tests - Replace multiple Date.now() calls with fixed timestamps to prevent 1ms differences - Use consistent FIXED_NOW and FIXED_FIRST_PLAYED_AT constants across all mock data - Fix failing tests on Windows where Date.now() calls had microsecond variations Resolves test failures where expected timestamps differed by 1ms from actual values
|
Caution Review failedThe pull request is closed. WalkthroughAdds Sentry error tracking (main and renderer), implements dictionary popover with pronunciation parsing and UI, updates feed selection with CN routing, adjusts workflows to include prereleases and body fetching, modifies player orchestrator by removing retry checks, updates types/i18n/tests accordingly, and tweaks docs and test utilities. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant Subtitle as SubtitleContent
participant API as window.api.dictionary
participant Popover as DictionaryPopover
User->>Subtitle: Click word token
Subtitle->>Popover: Open with loading
Subtitle->>API: queryEudic(word)
API-->>Subtitle: DictionaryResult (pronunciations, definitions, translations)
Subtitle->>Popover: Update with data or error
User->>Popover: Click pronunciation play
Popover->>PopAudio: Try audioUrl
alt audio fails
Popover->>SpeechSynthesis: Fallback speak (uk/en-GB else en-US)
end
User->>Popover: Close
Popover-->>Subtitle: onClose
Subtitle->>UI: Restore focus
sequenceDiagram
autonumber
participant App as Electron Main
participant Svc as SentryService (main)
participant Rend as Renderer Init
participant RSvc as SentryService (renderer)
App->>Svc: init()
Svc->>SentryMain: dynamic import + init(config)
Note over Svc: Set tags/contexts, filters
Rend->>RSvc: init()
RSvc->>SentryRenderer: dynamic import + init(config)
Note over RSvc: Hook logger, window error handlers
sequenceDiagram
autonumber
participant Updater as AppUpdater
participant Geo as IP Country Lookup
participant Feeds as FeedUrl
Updater->>Geo: get ipCountry
Geo-->>Updater: 'cn' or other
alt Production or Latest
alt ipCountry == 'cn'
Updater->>Feeds: Use PRODUCTION (latest) / CN_* (prerelease)
else non-CN
Updater->>Feeds: Use GITHUB_LATEST or GitHub prerelease tag
end
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Possibly related PRs
Poem
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (24)
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary by CodeRabbit
New Features
Bug Fixes
Chores
Tests