Skip to content

fix(ci): resolve CI/CD workflow failures and React warnings#134

Open
xuan2261 wants to merge 14 commits intoAnionex:mainfrom
xuan2261:main
Open

fix(ci): resolve CI/CD workflow failures and React warnings#134
xuan2261 wants to merge 14 commits intoAnionex:mainfrom
xuan2261:main

Conversation

@xuan2261
Copy link

@xuan2261 xuan2261 commented Jan 6, 2026

Summary

  • Add conditional check for Docker Hub secrets to prevent login failure when secrets not configured
  • 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

Changes

  • .github/workflows/docker-publish.yml: Add if: env.DOCKERHUB_USERNAME != '' condition
  • backend/Dockerfile: Fix GHCR_REGISTRY=ghcr.io syntax, add hadolint ignore comment
  • Frontend components: Fix hook dependencies, separate utility exports for Fast Refresh

Test plan

  • Verify Docker build workflow skips login when secrets not configured
  • Verify hadolint passes on Dockerfile
  • Verify frontend build succeeds without warnings
  • Verify Fast Refresh works in development mode

- 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
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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

  • Internationalization (i18n) Support: Implemented comprehensive internationalization across the frontend using react-i18next, adding support for English, Vietnamese, and Chinese. All user-facing strings are now managed via translation files.
  • CI/CD & Dockerfile Fixes: Resolved CI/CD workflow failures by adding a conditional check for Docker Hub secrets and fixing Dockerfile ARG syntax for Hadolint compatibility, including correcting a trailing slash issue in GHCR_REGISTRY.
  • React Development Enhancements: Addressed React Hook dependency warnings with eslint-disable comments for intentional patterns and extracted common hooks (useToast, useConfirm) and utilities (materialUtils, templateUtils) into separate files to improve code organization and Fast Refresh compatibility.
  • Documentation Update: The main README.md has been fully translated to English and significantly expanded with detailed sections on project origin, features, roadmap, tech stack, and CI/CD. A new README_CN.md file was created for the Chinese version.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/docker-publish.yml
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +42 to +43
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [projectId]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant