[Idea Plugin] Add contributors section to About screen#1012
Conversation
WalkthroughThis PR adds a contributors list feature to the About settings screen. It introduces domain models ( 🚥 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. 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/settings/tabs/about/ui/ContributorItem.kt (1)
36-42: ⚖️ Poor tradeoffAvatar decoding runs on the composition thread.
The
remember(...)calculation block executes synchronously during composition, soImageIO.read(...).toComposeImageBitmap()decodes the image on the UI thread each timeavatarByteschanges. For a handful of small avatars this is minor, but consider decoding off the main thread (e.g. in the ViewModel coroutine alongside the fetch, or viaLaunchedEffect+ a background dispatcher) so decode work never blocks composition.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/settings/tabs/about/ui/ContributorItem.kt` around lines 36 - 42, The avatar decoding is happening synchronously inside the composition in the remember block for val bitmap using contributor.avatarBytes and ImageIO.read(...).toComposeImageBitmap(), which blocks the UI thread; move the decode off the main thread by performing image decoding in a background coroutine (either in the ViewModel when fetching avatarBytes or inside the composable via LaunchedEffect + withContext(Dispatchers.IO)) and expose a decoded ImageBitmap state that the UI reads, keeping the composable lightweight and replacing the synchronous remember(...) decode with a state that is set from the background task.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/settings/tabs/about/AboutSettingsViewModel.kt`:
- Around line 32-35: The current use of runCatching around
AvatarByteArray(httpClient.get(contributor.avatarUrl).bodyAsBytes()) swallows
CancellationException from the suspending httpClient.get call and prevents
cooperative cancellation; change the error handling so CancellationException is
re-thrown instead of converted to null (e.g., after runCatching or in a
getOrElse/getOrNull replacement, detect if the caught throwable is a
CancellationException and throw it, otherwise return null) and keep the rest of
the logic that assigns contributor.copy(avatarBytes = bytes).
---
Nitpick comments:
In
`@tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/settings/tabs/about/ui/ContributorItem.kt`:
- Around line 36-42: The avatar decoding is happening synchronously inside the
composition in the remember block for val bitmap using contributor.avatarBytes
and ImageIO.read(...).toComposeImageBitmap(), which blocks the UI thread; move
the decode off the main thread by performing image decoding in a background
coroutine (either in the ViewModel when fetching avatarBytes or inside the
composable via LaunchedEffect + withContext(Dispatchers.IO)) and expose a
decoded ImageBitmap state that the UI reads, keeping the composable lightweight
and replacing the synchronous remember(...) decode with a state that is set from
the background task.
🪄 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: 774c5063-90d3-4c5d-ab7a-d29e45dde544
📒 Files selected for processing (6)
tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/settings/tabs/about/AboutSettingsScreen.kttools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/settings/tabs/about/AboutSettingsViewModel.kttools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/settings/tabs/about/domain/AvatarByteArray.kttools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/settings/tabs/about/domain/ContributorUiModel.kttools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/settings/tabs/about/ui/ContributorItem.kttools/idea-plugin/src/main/resources/messages/Valkyrie.properties
d83a0dd to
78b7586
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/settings/tabs/about/domain/AvatarByteArray.kt`:
- Around line 5-7: The AvatarByteArray value class is incorrectly annotated with
`@Stable` while exposing a mutable ByteArray via its public bytes property; remove
the `@Stable` annotation from AvatarByteArray (keeping `@JvmInline` and the value
class) so Compose's stability contract is not violated, or alternatively make
the internal ByteArray private and expose a safe copy/accessor (e.g., fun
toByteArray(): ByteArray) instead—update the class definition around
AvatarByteArray/bytes accordingly.
🪄 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: bee2418c-2d72-4e6b-8171-ee7f980c094c
📒 Files selected for processing (7)
tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/settings/tabs/about/AboutSettingsScreen.kttools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/settings/tabs/about/AboutSettingsViewModel.kttools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/settings/tabs/about/domain/AvatarByteArray.kttools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/settings/tabs/about/domain/ContributorUiModel.kttools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/settings/tabs/about/ui/ContributorItem.kttools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/util/result/RunCatchingCancelable.kttools/idea-plugin/src/main/resources/messages/Valkyrie.properties
🚧 Files skipped from review as they are similar to previous changes (5)
- tools/idea-plugin/src/main/resources/messages/Valkyrie.properties
- tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/settings/tabs/about/domain/ContributorUiModel.kt
- tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/settings/tabs/about/ui/ContributorItem.kt
- tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/settings/tabs/about/AboutSettingsViewModel.kt
- tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/settings/tabs/about/AboutSettingsScreen.kt
|
@t-regbs @Goooler @LennartEgb @jonapoul @vkatz thanks for your contribution to the project ❤️ |
📝 Changelog
If this PR introduces user-facing changes, please update the relevant Unreleased section in changelogs: