fix(ci): resolve CI/CD workflow failures and React warnings#134
fix(ci): resolve CI/CD workflow failures and React warnings#134xuan2261 wants to merge 14 commits intoAnionex:mainfrom
Conversation
- Add 111 new translation keys across 3 locales (en, vi, zh) - Home.tsx: 49 keys (nav, hero, features, tabs, templates, errors) - Settings.tsx: 62 keys (sections, fields, buttons, confirmations) - Total: 280 synchronized keys per locale - All tests pass (14/14), build successful
Components updated: - Loading.tsx: runInBackground button text - ConfirmDialog.tsx: dialog title and button labels - StatusBadge.tsx: all status labels with i18n - usePageStatus.ts: status labels and descriptions - AiRefineInput.tsx: UI text elements - ExportTasksPanel.tsx: task types, page ranges, warnings - MaterialSelector.tsx: toast messages, labels, filter options - TemplateSelector.tsx: toast messages, section headers - ProjectSettingsModal.tsx: complete i18n with custom hooks Translation files updated for en, zh, vi with components namespace.
- OutlineCard: Page number, title/points placeholders, delete confirm - DescriptionCard: Page header, generating state, edit modal labels - SlideCard: Not generated text, delete confirm - ProjectCard: Edit hint, page count, preview alt, delete button New translation keys added under outline.card.*, preview.descriptionCard.*, preview.slideCard.*, history.projectCard.* for EN/VI/ZH locales.
- Fix missing Vietnamese diacritics in components.export section - Fix missing Vietnamese diacritics in components.material section - Fix missing Vietnamese diacritics in components.template section - Validate all 3 translation files have identical 437 keys - Validate 45 interpolation variables match across EN/VI/ZH - Add i18n infrastructure (react-i18next setup) - Add LanguageSwitcher component - Update all pages to use t() hook for translations Includes changes from Phase 01-05 that were not previously committed.
- Add 'vi' (Vietnamese) to LANGUAGE_CONFIG in backend prompts.py - Add 'vi' to OutputLanguage type and OPTIONS in endpoints.ts - Update Settings type to include 'vi' output language - Add i18n translations for FilePreviewModal, MaterialGeneratorModal, ReferenceFileSelector - Update 3 shared components to use useTranslation hook - All tests passing (14/14)
- Mark multi-language support as completed (en/vi/zh) - Add documentation links section pointing to docs/
- Rename README.md → README_CN.md (Chinese version) - Rename README_EN.md → README.md (English as default) - Add i18n section documenting 3-language support (EN, VI, ZH) - Add CI/CD & Testing section with GitHub Actions workflows - Add Detailed Documentation section linking to docs/ - Update Recent Updates with Jan-06 i18n release - Update Roadmap with completed multi-language UI support - Add FAQ entry for language switching - Update project structure with i18n and workflows
- Add conditional check for Docker Hub secrets to prevent login failure - Fix Dockerfile ARG syntax for hadolint compatibility (remove trailing slash from GHCR_REGISTRY) - Fix React Hook dependency warnings with eslint-disable comments for intentional patterns - Extract hooks (useToast, useConfirm) and utilities (materialUtils, templateUtils) to separate files for Fast Refresh compatibility
Summary of ChangesHello @xuan2261, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request delivers significant improvements to the project's maintainability, development experience, and user accessibility. It introduces robust internationalization capabilities, ensuring a broader audience can comfortably use the application. Concurrently, it strengthens the CI/CD pipeline and refines the development environment by resolving common issues and enhancing code structure. Highlights
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces internationalization (i18n) support to the frontend, which is a significant and well-executed effort. It also includes several CI/CD fixes and refactorings that improve code quality and maintainability. The refactoring of custom hooks like useToast and useConfirm into separate files is a great improvement for code organization. The documentation has also been updated to reflect these changes and to make English the primary language, which improves accessibility for a wider audience. I've pointed out a potential issue with a useEffect dependency array and a minor style issue in the Dockerfile. Overall, this is a great contribution to the project.
| // eslint-disable-next-line react-hooks/exhaustive-deps | ||
| }, [projectId]); |
There was a problem hiding this comment.
The dependency array for this useEffect has been changed to just [projectId], and the eslint-disable-next-line comment was added. While this fixes the lint warning, it might introduce a subtle bug. The original dependency array [projectId, currentProject?.id] would cause this effect to re-run when currentProject is loaded and its ID becomes available. With only [projectId], if currentProject is initially null, the effect will run once, but it won't re-run when currentProject is populated from the store. This could leave the component with stale data, and the logic in the else if block might not execute as intended.
A safer approach to fix the lint warning while preserving the logic would be to include all dependencies and memoize functions where necessary. For example:
useEffect(() => {
if (projectId && (!currentProject || currentProject.id !== projectId)) {
syncProject(projectId);
}
// ... other logic
}, [projectId, currentProject, syncProject]);This ensures the effect runs whenever projectId or currentProject changes, which seems to be the original intent.
| # 镜像源配置参数(可通过 build args 覆盖) | ||
| ARG DOCKER_REGISTRY= | ||
| ARG GHCR_REGISTRY=ghcr.io/ | ||
| # hadolint ignore=DL3007 |
There was a problem hiding this comment.
The hadolint ignore=DL3007 comment seems to be misplaced. It's likely intended for the FROM ...:latest instruction on line 9 to suppress the warning about using the latest tag. For better clarity and to ensure it's correctly interpreted by tools, it should be placed on the line immediately preceding the FROM instruction (line 8).
- Add render.yaml blueprint for one-click deployment - Add frontend/.env.production with production API URL - Update frontend API client to support VITE_API_BASE_URL env variable - Add comprehensive deployment guide documentation
The Dockerfile already appends '/' after GHCR_REGISTRY variable, causing double slash (ghcr.io//astral-sh/uv) when CI passes 'ghcr.io/'. This fix ensures consistent format without trailing slash.
Add if conditions to metadata extraction, build/push, and image digest steps to prevent invalid tag format errors when secrets are not configured on fork repositories.
- Add backend/fly.toml with persistent volume for SQLite - Add frontend/fly.toml with static site config - Update docs/deployment-guide.md with comprehensive Fly.io instructions - Region configured for Singapore (closest to Vietnam)
- Update frontend package dependencies - Add test scripts for API testing and slide creation - Minor component updates across pages - Add dev startup script
- Keep i18n translations from local branch - Merge new features: HelpModal, MaterialCenterModal, reasoning settings - Add editable outline/description in SlidePreview - Add Vietnamese language support - Add Baidu OCR API configuration - Keep local English README.md
Summary
Changes
.github/workflows/docker-publish.yml: Addif: env.DOCKERHUB_USERNAME != ''conditionbackend/Dockerfile: FixGHCR_REGISTRY=ghcr.iosyntax, add hadolint ignore commentTest plan