Fix: Resolve styled-components unknown prop warnings#227
Merged
Conversation
- Convert HStack layout props (gap, alignItems, justifyContent) to transient props with $ prefix - Convert ColorCircle isActive prop to transient prop $isActive - Update all usage across settings components to use transient props - Remove duplicate gap property in Box component - Build passes without styled-components warnings 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
|
Caution Review failedThe pull request is closed. 总体概述本次变更将Layout组件中的布局相关属性( 变更内容
估计代码审查工作量🎯 2 (简单) | ⏱️ ~12 分钟 变更具有高度一致性和重复性,属于系统化的属性命名规范迁移。涉及文件相对分散但每个文件的改动遵循相同模式,不涉及复杂的业务逻辑或控制流变更,主要为机械性的属性名称替换。 庆祝诗
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (4)
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 |
mkdir700
added a commit
that referenced
this pull request
Oct 22, 2025
…tle translation (#228) * ci(workflows): fix sync-release-to-gitcode.yml automatic triggering Replace release event trigger with workflow_run mechanism to ensure reliable automatic triggering after semantic-release creates GitHub releases. - Change trigger from release event to workflow_run listening to Release workflow - Add workflow_run event handling with GitHub API fetching - Maintain backward compatibility and manual dispatch functionality - Improve trigger type identification in summary display This resolves the issue where semantic-release created releases would not automatically trigger the GitCode sync workflow. * fix: Resolve styled-components unknown prop warnings (#227) * conductor-checkpoint-start * fix(styled-components): resolve unknown props warnings in settings page - Convert HStack layout props (gap, alignItems, justifyContent) to transient props with $ prefix - Convert ColorCircle isActive prop to transient prop $isActive - Update all usage across settings components to use transient props - Remove duplicate gap property in Box component - Build passes without styled-components warnings 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com> * feat(i18n): implement comprehensive subtitle translation service with Zhipu AI integration - Add SubtitleTranslationService with batch processing and intelligent context handling - Extend ConfigManager to support Zhipu API Key configuration with secure storage - Refactor ASR settings page to "Subtitle Generation" with translation configuration group - Add comprehensive TypeScript types for translation service interfaces - Implement database layer support for batch subtitle translation updates - Add IPC channel for API Key validation between frontend and backend - Update dependencies with AI SDK packages for translation functionality - Add OpenSpec specifications for config management, translation service, and UI integration - Enable automatic background translation after subtitle generation - Add comprehensive internationalization support for translation UI components Key Features: - Intelligent translation with video filename context and subtitle batching - Automatic background translation without blocking main workflow - Robust error handling with exponential backoff retry mechanism - Comprehensive UI for API Key configuration and validation - Full internationalization support in Chinese and English Technical Improvements: - Follow project conventions with styled-components and lucide-react icons - Implement proper Zustand state management patterns - Add comprehensive logging using loggerService - Maintain type safety throughout the translation pipeline * fix(db): resolve inaccurate error counting in updateSubtitleTranslations Track subtitle ID processing status to ensure each translation item is counted exactly once, replacing the previous record-based counting logic. Key improvements: - Use Set<string> to track processed and failed subtitle IDs - Count failures based on individual translation items rather than records - Prevent double counting by tracking each subtitleId's processing state - Provide detailed error messages with specific subtitle IDs - Ensure successCount + failureCount equals input translations.length This resolves the issue where successCount + failureCount could exceed the total number of input translations, making it difficult for callers to determine actual processing results. * refactor: improve translation result type and options - refine `TranslationOptions` to enforce `targetLanguage` as 'zh-CN' - improve `TranslationResult` type using discriminated union for success/failure - make `results` property in `TranslationBatchResult` readonly * refactor(asr): move background translation task after completion - move startBackgroundTranslation after ASR process completion - ensure translation starts only after successful ASR and DB save * refactor: enhance subtitle translation service - add sourceLanguage option to translation results - improve API key validation logic * fix(types): resolve TranslationOptions type mismatch in ASRSubtitleService Import TranslationOptions type and add explicit type annotation to fix TypeScript compilation error where targetLanguage string was incompatible with 'zh-CN' literal type. * test: fix missing mock methods in test files - Add getZhipuApiKey method to ConfigManager mocks in both test files - Add debug method to LoggerService mock in ipc.database.test.ts - Resolves TypeError: configManager.getZhipuApiKey is not a function - Resolves TypeError: logger.debug is not a function - All 665 tests now pass successfully --------- Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
Encountered styled-components warnings related to passing unknown props (
gap,alignItems,isActive,justifyContent,flexDirection) to DOM elements. This often happens when props intended for styling are mistakenly rendered as HTML attributes.Changes
src/renderer/src/components/Layout/index.ts:BoxPropsandStackPropsinterfaces to use the$prefix, marking them as transient props (gap->$gap,alignItems->$alignItems,justifyContent->$justifyContent,flexDirection->$flexDirection).gapproperty definition in theBoxstyled component.src/renderer/src/pages/settings/AppearanceSettings.tsx:isActiveprop inColorCircleto$isActive.HStackusage to use transient props forgapandalignItems.src/renderer/src/pages/settings/AboutSettings.tsx:HStackusage to use$alignItems.src/renderer/src/pages/settings/ShortcutSettings.tsx:HStackusage to use$justifyContent.Testing
Summary by CodeRabbit
发布说明
重构