Commit Graph

4879 Commits

Author SHA1 Message Date
icarus
15b7eb78c1 feat(video): add thumbnail retrieval hook and update video interfaces
Implement useRetrieveThumbnail hook to handle thumbnail fetching and caching
Update video interfaces to clarify thumbnail field types and add missing documentation
Refactor useVideos to use new thumbnail hook instead of direct API calls
2025-10-13 17:46:24 +08:00
icarus
efd5e9dcf2 fix(video): reload video element when video id changes
Ensure the video element is properly reloaded when switching between different videos to prevent playback issues
2025-10-13 17:01:22 +08:00
icarus
3b69b2bc49 fix(video): filter openai videos by queued or in_progress status 2025-10-13 16:54:10 +08:00
icarus
c8dfae1d70 refactor(video): extract VideoListItem component from VideoList
Move VideoListItem implementation to a separate file to improve code organization and maintainability
2025-10-13 16:40:58 +08:00
icarus
2ab3ddd804 fix(video): ensure thumbnail is not null before showing it 2025-10-13 16:39:44 +08:00
icarus
7a62418f41 chore: bump version to 1.7.0-sora.2 2025-10-13 16:32:52 +08:00
icarus
58c5df9284 feat(video): implement video download functionality and improve viewer
- Add video download logic with progress tracking in VideoPanel
- Reset load state when video changes in VideoViewer
- Improve video player styling and loading state handling
- Add file upload and metadata handling for downloaded videos
2025-10-13 16:32:42 +08:00
icarus
c20394f460 feat(video): add VideoPlayer component with file loading
Implement VideoPlayer component that fetches video file path using FileManager and displays it with loading skeleton. This improves video loading reliability by handling file existence checks and error states.
2025-10-13 15:23:48 +08:00
icarus
8518734e48 feat(files): add video file type support
Add video file type metadata and UI components to support video files in the files page
2025-10-13 15:11:12 +08:00
icarus
29a01ef49a fix(video): pass onDownload callback to LoadFailedVideo component
Make onRedownload prop required in LoadFailedVideo and directly pass the onDownload callback instead of using optional chaining. This ensures the redownload functionality works consistently when video loading fails.
2025-10-13 15:04:25 +08:00
icarus
5e4b516402 feat(video): add expired state and regenerate button to video viewer
Implement expired video state handling with a regenerate button. The viewer now checks if the video has expired and shows appropriate UI with a regeneration option (currently unimplemented).
2025-10-13 14:58:45 +08:00
icarus
1c89262929 feat(video): add video download functionality
implement video download feature with progress tracking and error handling
update video status and thumbnail types to support null values
add download error message to i18n
2025-10-13 14:44:16 +08:00
icarus
b68a0ffaba feat(video): add name and providerId fields to video types
Add required name and providerId fields to video interfaces and update all related implementations including mock data and hook usage. This ensures consistent video object structure across the application.
2025-10-13 14:24:45 +08:00
icarus
41041fa296 feat(video): add download button for completed videos
Implement download button UI for completed videos. Currently shows a toast notification as the functionality is not yet implemented.
2025-10-13 14:20:07 +08:00
icarus
66b88aec74 refactor(video): add commented mock video code and fix dependency array 2025-10-13 14:05:02 +08:00
icarus
f54e583f34 refactor(video): extract video status components and fix type names
Extract inline video status rendering logic into separate components for better maintainability. Also fix inconsistent type naming (Videodownloaded -> VideoDownloaded, VideoFailed -> VideoFailedBase) and properly type VideoFailed as OpenAIVideoFailed.
2025-10-13 14:03:54 +08:00
icarus
1e1bfafb88 refactor(video): rename VideoProps to VideoViewerProps for clarity 2025-10-13 13:44:56 +08:00
icarus
63459e3ec4 feat(video): add error details modal for failed videos
Implement a modal dialog to display detailed error information when a video processing fails. This provides better visibility into failure reasons compared to just showing a generic error state.
2025-10-13 13:43:40 +08:00
icarus
de10a7fd6c refactor(video): improve video status update handling with ref
- Use useRef to track videos state to avoid stale closures
- Add error handling for video status updates
- Remove hardcoded openai provider check in favor of dynamic provider
2025-10-13 13:33:12 +08:00
icarus
dced99ce57 refactor(video): clean up unused imports and hooks in video components
Remove unused imports and hooks from VideoPage and useOpenAIVideo
Simplify useOpenAIVideo by removing unnecessary effect and dependencies
2025-10-13 13:33:00 +08:00
icarus
0cafdeb540 refactor(video): remove mock data and use real videos from provider 2025-10-13 13:24:43 +08:00
icarus
258666e382 refactor(video): remove unused useVideos hook import 2025-10-13 13:23:06 +08:00
icarus
8a45fe70d0 refactor(video): update video handling and type definitions
- Rename RetrieveVideoParams to RetrieveVideoContentParams for consistency
- Move video list management to parent component
- Add setVideo action and improve video state updates
- Implement video status polling and thumbnail fetching
2025-10-13 13:22:49 +08:00
icarus
d8363b5591 docs(video): add jsdoc comments for VideoStatus enum values
Explain the meaning of each VideoStatus value in the interface documentation
2025-10-12 21:33:53 +08:00
icarus
397a24b833 Merge branch 'main' of github.com:CherryHQ/cherry-studio into feat/sora2 2025-10-12 21:18:49 +08:00
beyondkmp
7b90dfb46c
fix: intercept webview keyboard shortcuts for search functionality (#10641)
* feat: intercept webview keyboard shortcuts for search functionality

Implemented keyboard shortcut interception in webview to enable search functionality (Ctrl/Cmd+F) and navigation (Enter/Escape) within mini app pages. Previously, these shortcuts were consumed by the webview content and not propagated to the host application.

Changes:
- Added Webview_SearchHotkey IPC channel for forwarding keyboard events
- Implemented before-input-event handler in WebviewService to intercept Ctrl/Cmd+F, Escape, and Enter
- Extended preload API with onFindShortcut callback for webview shortcut events
- Updated WebviewSearch component to handle shortcuts from both window and webview
- Added comprehensive test coverage for webview shortcut handling

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix lint

* refactor: improve webview hotkey initialization and error handling

Refactored webview keyboard shortcut handler for better code organization and reliability.

Changes:
- Extracted keyboard handler logic into reusable attachKeyboardHandler function
- Added initWebviewHotkeys() to initialize handlers for existing webviews on startup
- Integrated initialization in main app entry point
- Added explanatory comment for event.preventDefault() behavior
- Added warning log when webContentsId is unavailable in WebviewSearch

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* feat: add WebviewKeyEvent type and update related components

- Introduced WebviewKeyEvent type to standardize keyboard event handling for webviews.
- Updated preload index to utilize the new WebviewKeyEvent type in the onFindShortcut callback.
- Refactored WebviewSearch component and its tests to accommodate the new type, enhancing type safety and clarity.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

* fix lint

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-10-12 18:45:37 +08:00
Pleasure1234
26a9dba01a
fix: claude-translator.yml (#10588)
* Update claude-translator.yml

* Update claude-translator.yml
2025-10-12 18:20:34 +08:00
icarus
ca53e5f0c7 build(deps): update openai dependency to forked version
Replace openai npm package with forked version @cherrystudio/openai@6.3.0-fork.1
Update package version to 1.7.0-sora.1
2025-10-12 18:13:48 +08:00
icarus
c50a574982 fix(video): handle queued status in video progress updates
Add 'queued' status to the SWR refresh conditions and restructure progress update logic to prevent potential race conditions when video status changes from queued to in_progress
2025-10-12 17:52:48 +08:00
icarus
c3c125f3a3 feat(video): add video status tracking and thumbnail handling
- Implement useVideo hook for single video retrieval
- Make thumbnail optional in VideoCompleted interface
- Add prompt parameter to addOpenAIVideo and handle progress updates
- Add auto-refresh for in-progress videos and update progress
2025-10-12 17:37:56 +08:00
icarus
eba370210f feat(video): add useOpenAIVideo hook for fetching video data
Implement a custom hook using SWR to fetch and manage OpenAI video data with revalidation capabilities
2025-10-12 17:17:35 +08:00
icarus
697ef22ab6 refactor(video): replace mock videos with real data from useVideos hook 2025-10-12 17:16:00 +08:00
SuYao
a176814ad1
fix: update ESLint configuration and dependencies, replace zod import… (#10645)
fix: update ESLint configuration and dependencies, replace zod import style
2025-10-12 17:15:52 +08:00
George·Dong
ea51439aac
feat(reasoning): add special handling for Grok 4 fast models & qwen3-omni/qwen3-vl (#10367)
* feat(reasoning): add special handling for Grok 4 fast models

* feat(models): add grok4_fast model and refine grok reasoning

* feat(reasoning): unify Grok reasoning handling and XAI params

* feat(models): Grok/qwen handling and XAI

* feat(models): recognize qwen3-vl thinking models and add sizes

* fix(reasoning): reasoning enabled for QwenAlwaysThink models

* feat(reasoning): enable reasoning for Grok 4 Fast models

* fix(reasoning): rename and correct Grok 4 Fast model checks

* fix: adjust Grok-4 Fast reasoning detection for OpenRouter

* fix(reasoning): exclude non-reasoning models from reasoning detection
2025-10-12 11:34:16 +08:00
icarus
33582a460b fix(video): set empty string as default prompt instead of undefined 2025-10-12 08:14:10 +08:00
icarus
d5078baa20 refactor(VideoViewer): remove unused imports and radio group component
Clean up code by removing unused imports and commented out radio group component
2025-10-12 08:11:23 +08:00
icarus
ae54d5d9b9 fix(video): handle undefined video case in VideoPanel
Add conditional check to handle undefined video case and show toast for unimplemented remix video feature.
2025-10-12 08:09:19 +08:00
icarus
7bde37680e fix(video): handle undefined video case and add new video button
Add fallback for undefined video case in VideoPanel to clear prompt params
Add PlusIcon button in VideoList to allow creating new videos by setting activeVideoId to undefined
2025-10-12 08:05:02 +08:00
icarus
942c239d14 feat(video): add mock data and improve video panel handling
- Add mock video data for testing purposes
- Improve video panel state management with useEffect
- Export video types from index file
2025-10-12 07:56:45 +08:00
icarus
83114ee0c1 feat(video): add active video selection to VideoList
- Introduce activeVideoId state to track selected video
- Update VideoList to highlight active video with border
- Pass click handler to set active video
2025-10-12 07:44:43 +08:00
icarus
0dd894c911 feat(i18n): update video status messages and add thumbnail placeholder
- Simplify "failed" status message across languages
- Add thumbnail placeholder text for all locales
- Add error messages for image reference uploads in zh-cn
2025-10-12 07:35:26 +08:00
icarus
e0cb39d00d feat(video): implement video list UI with status indicators and thumbnails
- Add mock data for testing video list display
- Implement status icons, progress bars, and thumbnail display
- Add hover effects and styling for video items
- Update video types to include thumbnail and prompt fields
2025-10-12 07:35:06 +08:00
icarus
12323375a5 feat(video): add image reference upload with validation
implement image reference upload functionality in video panel
add validation for file format and size (max 5MB)
replace lodash merge with custom deepUpdate utility
add error messages for invalid uploads
2025-10-12 07:00:23 +08:00
icarus
788b170f98 feat(video): pass params to VideoPanel for state management
Move prompt state management to parent component to maintain consistency across video creation flow
2025-10-12 06:00:42 +08:00
icarus
42015b51e3 feat(i18n): add new translations for video features and common actions
- Add complete Chinese translations for video-related terms and statuses
- Add new common action translations (redownload, retry, send) in multiple languages
- Mark video-related terms for translation in other languages
2025-10-12 05:52:53 +08:00
icarus
9997188f5e refactor(video): extract size update logic into separate callback
Improve code maintainability by separating size update logic into its own useCallback hook
2025-10-12 05:48:53 +08:00
icarus
1fd7b0b667 feat(video): add settings component for OpenAI video params
Add OpenAIParamSettings component to handle video duration and size selection
Include new i18n translations for seconds and size labels
2025-10-12 05:45:58 +08:00
icarus
1467493e1d refactor(video-settings): improve settings layout and remove unused components
- Remove SettingTitle component and move label to Select component
- Update SettingsGroup styling for better spacing and borders
- Clean up unused imports in shared components
2025-10-12 05:32:41 +08:00
icarus
f61cadd5b5 feat(video): add video model validation and settings improvements
- Introduce new utility and config files for video model validation
- Refactor ModelSetting component to use centralized video models config
- Update VideoPage to handle video params with proper model validation
2025-10-12 05:32:26 +08:00
icarus
377b2b796f feat(video-settings): add SettingsGroup component and update SettingItem divider default
Update SettingItem to have divider=false by default and introduce new SettingsGroup component for better organization
2025-10-12 04:54:17 +08:00