feat: Add exportFolder to user preferences#512
feat: Add exportFolder to user preferences#512AbhinRustagi wants to merge 3 commits intosiddharthvaddem:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThreads an optional Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/lib/userPreferences.ts (1)
89-98: 💤 Low valuelooks good overall, one tiny edge case
the dual-separator handling is solid for cross-platform. one minor nit: for a Windows root-level save like
C:\file.mp4, this returns"C:"rather than"C:\". technicallyC:means "current directory on drive C" whileC:\means root, but this is such a rare edge case (who saves exports to root?) and the handler's fs.stat check would validate it anyway.lowkey fine to ship as-is, just wanted to call it out.
🔧 optional: handle Windows drive root edge case
export function parentDirectoryOf(filePath: string): string | null { const lastSep = Math.max(filePath.lastIndexOf("/"), filePath.lastIndexOf("\\")); if (lastSep <= 0) return null; - return filePath.slice(0, lastSep); + const parent = filePath.slice(0, lastSep); + // Windows drive letter without trailing slash (e.g. "C:") - add the backslash + if (/^[a-zA-Z]:$/.test(parent)) { + return parent + "\\"; + } + return parent; }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/lib/userPreferences.ts` around lines 89 - 98, The parentDirectoryOf function returns "C:" for Windows root saves like "C:\file.mp4" because it slices up to the separator index (2) instead of including the backslash; update parentDirectoryOf to detect a Windows drive-root pattern (e.g., /^[A-Za-z]:\\/ or check filePath[1]==':' and filePath[2]=='\\') when lastSep === 2 and return the three-character root ("C:\\"), otherwise keep the existing behavior (use lastSep to slice). Ensure you reference the parentDirectoryOf function and handle both "/" and "\\" separators as before.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/lib/userPreferences.ts`:
- Around line 89-98: The parentDirectoryOf function returns "C:" for Windows
root saves like "C:\file.mp4" because it slices up to the separator index (2)
instead of including the backslash; update parentDirectoryOf to detect a Windows
drive-root pattern (e.g., /^[A-Za-z]:\\/ or check filePath[1]==':' and
filePath[2]=='\\') when lastSep === 2 and return the three-character root
("C:\\"), otherwise keep the existing behavior (use lastSep to slice). Ensure
you reference the parentDirectoryOf function and handle both "/" and "\\"
separators as before.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 2734a685-11c3-429b-96aa-986b5784f5c9
📒 Files selected for processing (5)
electron/electron-env.d.tselectron/ipc/handlers.tselectron/preload.tssrc/components/video-editor/VideoEditor.tsxsrc/lib/userPreferences.ts
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c40727672f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
Hi, Severity: remediation recommended | Category: correctness How to fix: Add error to return type Agent prompt to fix - you can give this to your LLM of choice:
Found by Qodo code review |
Description
Adds
exportFolderas a key to user preferences, and stores the location of the last saved video, and prefills it in the next export action.Type of Change
Related Issue(s)
Closes #503
Screenshots / Video
Screenshot (if applicable):
Video (if applicable):
Testing
~/Downloadsand save.localStorage).~/Downloadswithout erroring.parentDirectoryOfhandles\separators.Checklist
Thank you for contributing!
Summary by CodeRabbit