Commit Graph

4857 Commits

Author SHA1 Message Date
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
icarus
36df06db75 refactor(video): update import path for useAddOpenAIVideo hook 2025-10-12 04:53:59 +08:00
icarus
a901943675 refactor(video): rename useOpenAIVideos to useAddOpenAIVideo 2025-10-12 04:53:45 +08:00
icarus
953f0f4a2f fix(video-viewer): handle undefined video status in radio group 2025-10-12 04:33:23 +08:00
icarus
8b875935d0 feat(video): add onPress handler to video send button
Handle video creation when the send button is pressed
2025-10-12 04:32:31 +08:00
icarus
2f9b174095 feat(video): add image reference button and send tooltip
Add button for image reference with tooltip in video panel
Include send button tooltip using i18n translation
2025-10-12 04:31:20 +08:00
icarus
d80eac2fbe feat(video): add error handling and loading state for video creation
handle video creation errors by showing toast notifications and prevent multiple submissions by adding a loading state
2025-10-12 04:21:54 +08:00
icarus
5776512bf6 fix(ToastPortal): prevent text overflow by adjusting toast width styles 2025-10-12 04:13:32 +08:00
icarus
fd1a3faa69 feat(video): add video list component to display videos
Implement VideoList component to show videos from a provider. Replace placeholder div with the new component in VideoPage.
2025-10-12 03:49:25 +08:00
icarus
82ad9e15e2 feat(video): enhance video error handling with retry options
Add retry and redownload buttons for failed video loading states
Improve error message display with detailed failure reason
2025-10-12 03:44:16 +08:00
icarus
46221985bd feat(video): add video loading error handling and status display
- Add new error message for video loading failure in i18n
- Implement video loading state and error handling in VideoViewer
- Display appropriate UI for loading errors when video fails to load
2025-10-12 03:34:22 +08:00
icarus
d982c659d3 refactor(video): rename VideoPlayer to VideoViewer and improve layout
Move status radio group to absolute position and update background colors
2025-10-12 03:22:19 +08:00
icarus
dad9425b44 feat(video): pass provider prop to VideoPanel component
Add useProvider hook to fetch provider data and pass it to VideoPanel to enable provider-specific functionality
2025-10-12 03:15:22 +08:00
icarus
dc19c17526 feat(video): add status handling and error messages to video player
- Add new i18n strings for video status and error messages
- Implement status-based UI rendering with progress indicators
- Include test radio group for status simulation
2025-10-12 03:13:23 +08:00
icarus
85c8d5fca2 refactor(video): rename Video component to VideoPlayer and pass video prop
Update VideoPanel to use VideoPlayer component instead of Video and accept video as a prop
2025-10-12 02:49:15 +08:00
icarus
4cf4c1e946 feat(video): add OpenAI video creation support in VideoPanel
- Integrate OpenAI video creation API with proper provider handling
- Add keyboard event to trigger video creation on Enter key
2025-10-12 02:44:20 +08:00
icarus
00221471b8 feat(video): add hook for handling OpenAI video status updates 2025-10-12 02:40:12 +08:00
icarus
6d22a635f2 feat(video): add downloading status and metadata to video types
Add new video status types for downloading state and include metadata in OpenAIVideoBase. This allows better tracking of video processing stages and provides access to video metadata.
2025-10-12 02:40:04 +08:00
icarus
014247f983 refactor(videos): move useVideos to videos folder 2025-10-12 02:39:41 +08:00
icarus
7fe4524415 feat(hooks): add useVideos hook for video management
Implement custom hook to handle video operations including add, update, remove and set videos
2025-10-12 02:10:00 +08:00
icarus
0ada5656ad fix(video): make videoMap entries optional and handle undefined cases
Fix potential runtime errors by properly handling undefined videoMap entries. Update type definition and add null checks for videoMap operations.
2025-10-12 02:01:54 +08:00
icarus
c7c6561b77 Merge branch 'main' of github.com:CherryHQ/cherry-studio into feat/sora2 2025-10-12 01:51:51 +08:00
icarus
590d69cfba feat(video): add video store module and migration
- Initialize video store module with state management for video operations
- Add video state to root reducer
- Extend video types with id field and specific OpenAIVideo types
- Include video store in migration to initialize videoMap
2025-10-12 01:50:33 +08:00