[WebImport] Refactor icon provider selection and update descriptions#967
Conversation
WalkthroughThe web import icon provider selection screen was refactored from hardcoded 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 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. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/WebImportSelectorScreen.kt (1)
59-68: Consider co-locating navigation destination inIconProviders.
IconProvidersalready owns icon/title/description metadata; adding destination there would remove the separatewhenmapping and reduce future update friction.Also applies to: 108-153
🤖 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/webimport/WebImportSelectorScreen.kt` around lines 59 - 68, The current when-mapping in WebImportSelectorScreen.kt (the val screen = when(it) { ... }) should be removed by co-locating the navigation destination on the IconProviders type: add a unique destination property (e.g., val destination or navDestination) to the IconProviders enum/class alongside its existing icon/title/description metadata, implement each provider's destination to return the corresponding screen object (MaterialSymbolsImportScreen, LucideImportScreen, etc.), and then change the usage in WebImportSelectorScreen (and the other occurrences around lines 108-153) to read provider.destination instead of the explicit when block so future providers only need to update IconProviders.
🤖 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/src/main/resources/messages/Valkyrie.properties`:
- Around line 120-122: Add an "Unreleased" changelog entry in
tools/idea-plugin/CHANGELOG.md documenting the user-facing UI copy change for
the IntelliJ plugin: note that the properties web.import.selector.title and
web.import.selector.google.title (and optionally
web.import.selector.google.description) were updated to change the icon provider
language; include a one-line concise entry under an Unreleased heading (date
optional) that clearly describes the visible text update for users.
---
Nitpick comments:
In
`@tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/WebImportSelectorScreen.kt`:
- Around line 59-68: The current when-mapping in WebImportSelectorScreen.kt (the
val screen = when(it) { ... }) should be removed by co-locating the navigation
destination on the IconProviders type: add a unique destination property (e.g.,
val destination or navDestination) to the IconProviders enum/class alongside its
existing icon/title/description metadata, implement each provider's destination
to return the corresponding screen object (MaterialSymbolsImportScreen,
LucideImportScreen, etc.), and then change the usage in WebImportSelectorScreen
(and the other occurrences around lines 108-153) to read provider.destination
instead of the explicit when block so future providers only need to update
IconProviders.
🪄 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: e5960fd2-0d5b-4b65-8b7a-5227f4dee0b1
📒 Files selected for processing (2)
tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/WebImportSelectorScreen.kttools/idea-plugin/src/main/resources/messages/Valkyrie.properties
📝 Changelog
If this PR introduces user-facing changes, please update the relevant Unreleased section in changelogs: