Skip to content

[IconPack] Generated ImageVector files are now appear immediately in the project tree without manual refresh#972

Merged
egorikftp merged 1 commit intomainfrom
feature/idea/import
May 1, 2026
Merged

[IconPack] Generated ImageVector files are now appear immediately in the project tree without manual refresh#972
egorikftp merged 1 commit intomainfrom
feature/idea/import

Conversation

@egorikftp
Copy link
Copy Markdown
Member

@egorikftp egorikftp commented May 1, 2026

fa3f66da-3cd5-43db-afad-81ac9f91b36f.mov

📝 Changelog

If this PR introduces user-facing changes, please update the relevant Unreleased section in changelogs:

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 1, 2026

Walkthrough

The icon pack conversion flow was refactored to centralize file writing logic. A new ImageVectorWriter utility was created to handle persisting generated ImageVector files to disk and triggering IntelliJ's file system refresh. The import method in IconPackConversionViewModel now accepts a Project parameter and delegates file persistence to ImageVectorWriter.saveVectors instead of writing files inline. The screen was updated to pass the project context to the view model. The ConversionEvent.ImportCompleted event was removed from the contract, as refresh handling moved into the writer utility. The changelog was updated to document that generated files now appear immediately in the project tree.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: generated ImageVector files now appear immediately in the project tree without manual refresh, which is the core objective reflected in the code changes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The PR description includes an issue reference and a completed changelog update for the IntelliJ Plugin, meeting the core requirements.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/idea/import

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Guard ImportingState with try/finally to avoid a stuck UI on write failures.

If ImageVectorWriter.saveVectors(...) throws, reset() is skipped and the screen can remain in ImportingState indefinitely.

💡 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

📥 Commits

Reviewing files that changed from the base of the PR and between 817277d and c5a7abf.

📒 Files selected for processing (4)
  • tools/idea-plugin/CHANGELOG.md
  • tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/mode/iconpack/common/util/ImageVectorWriter.kt
  • tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/mode/iconpack/conversion/IconPackConversionScreen.kt
  • tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/mode/iconpack/conversion/IconPackConversionViewModel.kt

Comment thread tools/idea-plugin/CHANGELOG.md
@egorikftp egorikftp enabled auto-merge (rebase) May 1, 2026 12:04
@egorikftp egorikftp merged commit 1d04e82 into main May 1, 2026
6 checks passed
@egorikftp egorikftp deleted the feature/idea/import branch May 1, 2026 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[IDEA Plugin] [IconPack] IDE does not automatically show icons after import

2 participants