Release 0.2.0 - #1
Conversation
Summary of ChangesHello @brennanmceachran, 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 significantly enhances the Highlights
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 significant new functionality by adding animated reference support, which is a great enhancement. The implementation is robust, including bundled ffmpeg/ffprobe binaries for a zero-config experience and fallback mechanisms. The TUI has also been polished to accommodate these new features. My review includes suggestions to improve code maintainability by reducing duplication, enhancing type safety, and fixing a minor keyboard navigation regression in the UI.
|
|
||
| - In the TUI, move to the new **Reference** row to toggle between `None`, `Upload file`, and `Auto from job`. Auto builds an animated WebP/APNG from the tail frames of the selected completed job so the next render starts exactly where the last one ended. | ||
| - For manual continuity, supply `--input-reference ./reference.webp` (or `.png`) when running the CLI. The file is uploaded with your render request and also copied into the job’s output folder for reuse. | ||
| - `sora-cli` bundles ffmpeg and ffprobe, so the auto-builder works out of the box on macOS and Linux without additional setup. Set `SORA_CLI_FFMPEG_PATH` / `SORA_CLI_FFPROBE_PATH` if you prefer your own binaries. |
There was a problem hiding this comment.
The documentation mentions that the auto-builder for animated references works out-of-the-box on macOS and Linux. Since the project also bundles Windows binaries for ffmpeg/ffprobe, it would be helpful to mention that Windows is also supported for a zero-config experience to give Windows users confidence that the feature will work for them.
| - `sora-cli` bundles ffmpeg and ffprobe, so the auto-builder works out of the box on macOS and Linux without additional setup. Set `SORA_CLI_FFMPEG_PATH` / `SORA_CLI_FFPROBE_PATH` if you prefer your own binaries. | |
| - `sora-cli` bundles ffmpeg and ffprobe, so the auto-builder works out of the box on macOS, Linux, and Windows without additional setup. Set `SORA_CLI_FFMPEG_PATH` / `SORA_CLI_FFPROBE_PATH` if you prefer your own binaries. |
| function inferMimeType(pathLike: string): string | undefined { | ||
| const ext = extname(pathLike).toLowerCase(); | ||
| if (ext === '.webp') return 'image/webp'; | ||
| if (ext === '.png') return 'image/png'; | ||
| if (ext === '.jpg' || ext === '.jpeg') return 'image/jpeg'; | ||
| if (ext === '.gif') return 'image/gif'; | ||
| if (ext === '.mp4') return 'video/mp4'; | ||
| return undefined; | ||
| } |
There was a problem hiding this comment.
The inferMimeType function can be made more concise and easier to maintain by using a map/object for the extension-to-MIME-type mapping instead of a series of if statements.
function inferMimeType(pathLike: string): string | undefined {
const ext = extname(pathLike).toLowerCase();
const mimeMap: Record<string, string> = {
'.webp': 'image/webp',
'.png': 'image/png',
'.jpg': 'image/jpeg',
'.jpeg': 'image/jpeg',
'.gif': 'image/gif',
'.mp4': 'video/mp4',
};
return mimeMap[ext];
}| `ffprobe ${basename(path)}`, | ||
| ); | ||
|
|
||
| let info: any; |
There was a problem hiding this comment.
Using any for the ffprobe output (info) weakens type safety. Defining a specific interface for the expected JSON structure would make the code more robust, prevent potential runtime errors, and improve developer experience when working with this data. You only need to type the fields you access.
| let info: any; | |
| interface FfprobeStreamInfo { | |
| nb_read_frames?: string; | |
| nb_frames?: string; | |
| avg_frame_rate?: string; | |
| r_frame_rate?: string; | |
| duration?: string; | |
| } | |
| interface FfprobeOutput { | |
| streams?: FfprobeStreamInfo[]; | |
| } | |
| let info: FfprobeOutput; |
| function inferReferenceFormat(pathLike: string): 'webp' | 'png' | undefined { | ||
| const ext = extname(pathLike).toLowerCase(); | ||
| if (ext === '.webp') return 'webp'; | ||
| if (ext === '.png') return 'png'; | ||
| return undefined; | ||
| } | ||
|
|
||
| function guessReferenceMime(pathLike: string, format?: 'webp' | 'png'): string { | ||
| if (format === 'webp') return 'image/webp'; | ||
| if (format === 'png') return 'image/png'; | ||
| const detected = inferReferenceFormat(pathLike); | ||
| if (detected === 'webp') return 'image/webp'; | ||
| if (detected === 'png') return 'image/png'; | ||
| return 'application/octet-stream'; | ||
| } |
There was a problem hiding this comment.
The helper functions inferReferenceFormat and guessReferenceMime duplicate logic that is also present in src/api/sora.ts (inferMimeType). To improve maintainability and ensure a single source of truth, this logic should be consolidated into a shared utility file (e.g., src/utils/mime.ts) and imported where needed.
| const result = moveVertical(originalValue, cursorOffset, -1); | ||
| if (result === null) { | ||
| nextCursorOffset = 0; | ||
| } else { | ||
| nextCursorOffset = result; | ||
| } |
There was a problem hiding this comment.
The previous implementation allowed the user to press the up-arrow on the first line of the prompt to loop focus to the last field in the form. This change removes that behavior, instead moving the cursor to the start of the input. This is a regression in keyboard navigation usability. Please consider restoring the onMoveOut(-1) call when moveVertical returns null to allow users to cycle through the form fields in both directions.
| const result = moveVertical(originalValue, cursorOffset, -1); | |
| if (result === null) { | |
| nextCursorOffset = 0; | |
| } else { | |
| nextCursorOffset = result; | |
| } | |
| const result = moveVertical(originalValue, cursorOffset, -1); | |
| if (result === null) { | |
| onMoveOut?.(-1); | |
| return; | |
| } | |
| nextCursorOffset = result; |
Summary
Testing