feat: remember last export folder across sessions#516
feat: remember last export folder across sessions#516makaradam wants to merge 2 commits intosiddharthvaddem:mainfrom
Conversation
The save dialog now opens in the last folder the user exported to, instead of always defaulting to Downloads. The folder is persisted in userPreferences (localStorage) and passed through the IPC layer to the Electron save dialog as defaultPath. Closes siddharthvaddem#503
|
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 (3)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds a persistent "last export folder" flow: API, IPC handler, and preload now accept an optional exportFolder; the handler uses it as the save dialog defaultPath and returns the chosen dir; user preferences gain exportFolder; VideoEditor persists, loads, and passes exportFolder into save calls. ChangesExport folder persistence & save flow
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 84952f3091
ℹ️ 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".
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/components/video-editor/VideoEditor.tsx`:
- Around line 1319-1323: The current renderer code slices saveResult.path to
compute a folder which can produce empty strings for root saves; instead modify
the IPC/save handler to return a proper dirname (use path.normalize +
path.dirname) and update the renderer to call setExportFolder with that returned
dirname (replace the substring logic around saveResult.path and references in
setExportFolder at the blocks near lines handling saveResult.path and the other
occurrences around 1431-1435 and 1580-1584). Ensure the IPC payload contains a
field like exportFolder (computed in the main process) and change the renderer
to use saveResult.exportFolder directly rather than re-parsing paths.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 05baedd0-2e5d-4568-a2f3-4b853d04ee64
📒 Files selected for processing (5)
electron/electron-env.d.tselectron/ipc/handlers.tselectron/preload.tssrc/components/video-editor/VideoEditor.tsxsrc/lib/userPreferences.ts
Addresses code review feedback: the previous substring/lastIndexOf approach would store empty string as export folder if saved to root directory. path.dirname in the Electron handler handles edge cases correctly and is returned as a new dir field in the IPC response.
|
Superseded by [#519] (https://github.com/makaradam/openscreen/issues/519) |
|
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:
Spotted by Qodo code review - free for open-source projects. |
The save dialog now opens in the last folder the user exported to, instead of always defaulting to Downloads. The folder is persisted in userPreferences (localStorage) and passed through the IPC layer to the Electron save dialog as defaultPath.
Closes #503
What
The export save dialog now opens in the last folder the user chose,
instead of always defaulting to the Downloads directory.
How
exportFolder?: stringtoUserPreferences— persisted in localStoragesave-exported-videoIPC handler as
defaultPaththe chosen folder is extracted from the result path and saved back to preferences
Type of Change
Related Issue(s)
#503
Tested, and works
Summary by CodeRabbit