Conversation
…the project tree without manual refresh
WalkthroughThe icon pack conversion flow was refactored to centralize file writing logic. A new 🚥 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. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/mode/iconpack/conversion/IconPackConversionViewModel.kt (1)
181-231:⚠️ Potential issue | 🟠 Major | ⚡ Quick winGuard
ImportingStatewithtry/finallyto avoid a stuck UI on write failures.If
ImageVectorWriter.saveVectors(...)throws,reset()is skipped and the screen can remain inImportingStateindefinitely.💡 Minimal fix
_state.updateState { BatchProcessing.ImportingState } val settings = inMemorySettings.current @@ - ImageVectorWriter.saveVectors( - project = project, - files = filesToWrite, - ) - - reset() + try { + ImageVectorWriter.saveVectors( + project = project, + files = filesToWrite, + ) + } finally { + reset() + }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/mode/iconpack/conversion/IconPackConversionViewModel.kt` around lines 181 - 231, Wrap the work that happens while the UI is in ImportingState (the generation of files and the call to ImageVectorWriter.saveVectors) in a try/finally: call _state.updateState { BatchProcessing.ImportingState } before the try, perform the mapping and ImageVectorWriter.saveVectors(project, filesToWrite) inside the try, and ensure reset() (and any state transition out of ImportingState) is invoked in the finally block so failures in ImageVectorWriter.saveVectors cannot leave the view stuck in ImportingState; refer to the existing _state.updateState, ImageVectorWriter.saveVectors, and reset() symbols when making this change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@tools/idea-plugin/CHANGELOG.md`:
- Line 16: Update the IconPack changelog bullet text to correct the grammar:
locate the line containing "[IconPack] Generated ImageVector files are now
appear immediately in the project tree without manual refresh" and change "are
now appear" to "now appear" (or equivalent phrasing like "now appear immediately
in the project tree without manual refresh") so the sentence reads correctly.
---
Outside diff comments:
In
`@tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/mode/iconpack/conversion/IconPackConversionViewModel.kt`:
- Around line 181-231: Wrap the work that happens while the UI is in
ImportingState (the generation of files and the call to
ImageVectorWriter.saveVectors) in a try/finally: call _state.updateState {
BatchProcessing.ImportingState } before the try, perform the mapping and
ImageVectorWriter.saveVectors(project, filesToWrite) inside the try, and ensure
reset() (and any state transition out of ImportingState) is invoked in the
finally block so failures in ImageVectorWriter.saveVectors cannot leave the view
stuck in ImportingState; refer to the existing _state.updateState,
ImageVectorWriter.saveVectors, and reset() symbols when making this change.
🪄 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: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 85f7c15f-4843-40f6-a59a-d7c2a7f4bdec
📒 Files selected for processing (4)
tools/idea-plugin/CHANGELOG.mdtools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/mode/iconpack/common/util/ImageVectorWriter.kttools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/mode/iconpack/conversion/IconPackConversionScreen.kttools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/mode/iconpack/conversion/IconPackConversionViewModel.kt
fa3f66da-3cd5-43db-afad-81ac9f91b36f.mov
📝 Changelog
If this PR introduces user-facing changes, please update the relevant Unreleased section in changelogs: