-
Notifications
You must be signed in to change notification settings - Fork 53
Lowercase JPG as Next.js Image is case sensitive #693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR forces file extensions to lowercase to ensure compatibility with Next.js Image component, which is case-sensitive. The changes address the issue where cameras and smartphones produce images with uppercase extensions (e.g., .JPG), which would result in broken images in the UI.
- Extension lowercasing logic added to
renamePathsfunction to normalize file extensions - Extension lowercasing logic added to
moveRawsfunction for raw photo and video file handling - Video extension handling migrated from hardcoded array to configuration-based approach
- Comprehensive test suite migration from Jest to Vitest with expanded coverage
- Unrelated UI improvements: search clear button and autocomplete handling fixes
Reviewed changes
Copilot reviewed 8 out of 25 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/lib/rename.ts | Core changes: lowercase extensions in renamePaths and moveRaws, add collision detection warning, use config for video extensions |
| src/lib/tests/rename.vitest.ts | New comprehensive Vitest test suite covering renamePaths, moveRaws, and errorSchema with edge cases |
| src/lib/tests/rename.test.ts | Removed old Jest tests, migrated to Vitest format |
| src/lib/tests/rename-rename.vitest.ts | Removed and consolidated into main test file |
| src/lib/tests/rename-moveRaw.vitest.ts | Removed mocked tests, replaced with integration tests in main file |
| src/hooks/useSearch.tsx | Added Clear button functionality and improved URL sync behavior |
| src/components/ComboBox.tsx | Fixed null value handling and disabled clearable for better UX consistency |
| src/components/SplitViewer/tests/SplitViewer.color.vitest.tsx | Added eslint disable comment for Next.js img element in test mock |
| public/test/fixtures/* | Added test fixture files for uppercase extensions, mixed case, collisions, and multi-extension scenarios |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 10 out of 28 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 11 out of 38 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Camera and smart phone produce images like DSC06077.JPG. The display expects lowercase and Next.js image is strict so there will be broken images. Then admin rename forced to lowercase
Improved clear keyword filter. URL may set the keyword then the search results label, and the input text match. Input may be set and URL, and search result label match. New clear button to replace MUI clear x.
Test plan
Added new test cases in Vitest format, and migrated related Jest tests to Vitest