Skip to content

Migrate to Jewel 0.34, IntelliJ IDEA 2025.3.3#925

Draft
egorikftp wants to merge 3 commits intomainfrom
feature/jewel_0.34
Draft

Migrate to Jewel 0.34, IntelliJ IDEA 2025.3.3#925
egorikftp wants to merge 3 commits intomainfrom
feature/jewel_0.34

Conversation

@egorikftp
Copy link
Member

@egorikftp egorikftp commented Mar 2, 2026


📝 Changelog

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

@egorikftp egorikftp changed the title Jewel 0.34 Jewel 0.34, IntelliJ IDEA 2025.3.3. Mar 2, 2026
@egorikftp egorikftp changed the title Jewel 0.34, IntelliJ IDEA 2025.3.3. Migrate to Jewel 0.34, IntelliJ IDEA 2025.3.3 Mar 2, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 2, 2026

Walkthrough

This pull request updates the project dependencies and build configuration across multiple modules. IntelliJ platform version is bumped to 2025.3.3, Compose is upgraded to 1.10.0, and Leviathan to 3.3.0. New Compose libraries are introduced through the version catalog, with the compose-hot-reload plugin removed. Multiple Gradle build files are updated to use version catalog aliases instead of direct dependency coordinates. The icon system is refactored, removing the custom KotlinLogo implementation and replacing references with AllIconsKeys. API adjustments include changing parameter types in InlineIconText and CodeHighlight functions, updating dependency injection patterns, and adding experimental API opt-ins. Documentation is updated to reflect these changes.

🚥 Pre-merge checks | ✅ 2 | ❌ 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 (2 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and accurately summarizes the main changes—migration to Jewel 0.34 and IntelliJ IDEA 2025.3.3—matching the commit messages and raw summary.
Description check ✅ Passed The PR description follows the template structure with the changelog checklist properly filled out. The IntelliJ Plugin changelog was updated, and the description references the migration objectives.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/jewel_0.34

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

@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.

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/jewel/InlineIconText.kt (1)

36-56: ⚠️ Potential issue | 🟠 Major

Guard against TextUnit.Unspecified for placeholder size.

On line 36, iconSize defaults to style.fontSize. If a style with unspecified font size is passed, lines 54–55 will propagate an invalid size into Placeholder, causing an IllegalArgumentException during layout. The Jetpack Compose Placeholder API requires both width and height to be specified values in sp or em; TextUnit.Unspecified is not permitted.

Resolve by checking if iconSize is unspecified and providing a fallback:

Proposed fix
 fun InlineIconText(
     text: String,
     key: IconKey,
     modifier: Modifier = Modifier,
     iconTint: Color = Color.Unspecified,
     style: TextStyle = JewelTheme.defaultTextStyle,
     iconSize: TextUnit = style.fontSize,
     textAlign: TextAlign = TextAlign.Unspecified,
     alternateText: String = "[icon]",
 ) {
+    val resolvedIconSize = if (iconSize.isUnspecified) 16.sp else iconSize
+
     val parts = text.split(alternateText)
@@
             placeholder = Placeholder(
-                width = iconSize,
-                height = iconSize,
+                width = resolvedIconSize,
+                height = resolvedIconSize,
                 placeholderVerticalAlign = PlaceholderVerticalAlign.TextCenter,
             ),
🤖 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/jewel/InlineIconText.kt`
around lines 36 - 56, InlineIconText currently passes iconSize directly into
Placeholder which can be TextUnit.Unspecified and crash; update the function to
guard iconSize by detecting if iconSize == TextUnit.Unspecified (or
style.fontSize is unspecified) and substitute a concrete fallback (e.g.,
style.fontSize.takeIf { it != TextUnit.Unspecified } ?: 16.sp or another
sensible default) before building inlineContent; ensure the computed safe size
variable is used for both width and height in InlineTextContent/Placeholder tied
to INLINE_CONTENT_ID so Placeholder always receives a valid TextUnit.
🧹 Nitpick comments (2)
tools/idea-plugin/build.gradle.kts (1)

95-96: Use shared constants for IDEA target values to reduce drift risk.

At Line 96 and Line 117, hardcoded target values are repeated. A local constant pair keeps this synchronized and easier to update.

♻️ Suggested refactor
+val targetIdeaVersion = "2025.3.3"
+val targetIdeaSinceBuild = "253.31033.145"
+
 intellijPlatform {
     buildSearchableOptions = false
     projectName = "valkyrie-plugin"
     pluginConfiguration {
         ideaVersion {
             // 2025.3.3 https://www.jetbrains.com/idea/download/other/
-            sinceBuild = "253.31033.145"
+            sinceBuild = targetIdeaSinceBuild
             untilBuild = provider { null }
         }
         changeNotes = provider { changelog.render(Changelog.OutputType.HTML) }
     }
@@
         ides {
             create(
                 type = IntelliJPlatformType.IntellijIdea,
-                version = "2025.3.3",
+                version = targetIdeaVersion,
             )
         }
     }

Also applies to: 117-117

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tools/idea-plugin/build.gradle.kts` around lines 95 - 96, Introduce shared
constants for the IntelliJ target builds and replace the two hardcoded literals
by referencing them: define top-level vals (e.g., ideaSinceBuild and
ideaUntilBuild) in build.gradle.kts, assign the current "253.31033.145" and the
matching until-build value to those constants, and then use those constants
where sinceBuild and untilBuild are set (the occurrences of sinceBuild at the
shown block and the other untilBuild/sinceBuild at the later occurrence around
line 117) so updates only need to change the constants.
README.md (1)

221-222: Clarify the 1.x compatibility range to avoid ambiguity.

At Line 221, 1.0.0 can be read as a single-version entry. Consider making the range explicit (e.g., 1.0.0 - 1.3.0) so users on intermediate versions don’t need to infer support.

✏️ Suggested doc tweak
-| 1.0.0          | IntelliJ IDEA 2025.3, Android Studio Panda 1   |
+| 1.0.0 - 1.3.0  | IntelliJ IDEA 2025.3, Android Studio Panda 1   |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` around lines 221 - 222, Update the ambiguous version row by
changing the single "1.0.0" entry to an explicit compatibility range (for
example "1.0.0 - 1.3.0") so it's clear which 1.x releases are supported; modify
the table row containing the "1.0.0" string (and adjust the adjacent "IntelliJ
IDEA 2025.3, Android Studio Panda 1" cell if needed) to reflect the chosen range
format, ensuring consistency with the later "1.4.0" row.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In
`@tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/jewel/InlineIconText.kt`:
- Around line 36-56: InlineIconText currently passes iconSize directly into
Placeholder which can be TextUnit.Unspecified and crash; update the function to
guard iconSize by detecting if iconSize == TextUnit.Unspecified (or
style.fontSize is unspecified) and substitute a concrete fallback (e.g.,
style.fontSize.takeIf { it != TextUnit.Unspecified } ?: 16.sp or another
sensible default) before building inlineContent; ensure the computed safe size
variable is used for both width and height in InlineTextContent/Placeholder tied
to INLINE_CONTENT_ID so Placeholder always receives a valid TextUnit.

---

Nitpick comments:
In `@README.md`:
- Around line 221-222: Update the ambiguous version row by changing the single
"1.0.0" entry to an explicit compatibility range (for example "1.0.0 - 1.3.0")
so it's clear which 1.x releases are supported; modify the table row containing
the "1.0.0" string (and adjust the adjacent "IntelliJ IDEA 2025.3, Android
Studio Panda 1" cell if needed) to reflect the chosen range format, ensuring
consistency with the later "1.4.0" row.

In `@tools/idea-plugin/build.gradle.kts`:
- Around line 95-96: Introduce shared constants for the IntelliJ target builds
and replace the two hardcoded literals by referencing them: define top-level
vals (e.g., ideaSinceBuild and ideaUntilBuild) in build.gradle.kts, assign the
current "253.31033.145" and the matching until-build value to those constants,
and then use those constants where sinceBuild and untilBuild are set (the
occurrences of sinceBuild at the shown block and the other untilBuild/sinceBuild
at the later occurrence around line 117) so updates only need to change the
constants.

ℹ️ Review info

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0ffaf91 and ea0fef5.

📒 Files selected for processing (22)
  • README.md
  • build.gradle.kts
  • gradle/libs.versions.toml
  • sdk/compose/codeviewer/build.gradle.kts
  • sdk/compose/foundation/build.gradle.kts
  • sdk/compose/highlights-core/build.gradle.kts
  • sdk/compose/icons/build.gradle.kts
  • sdk/intellij/psi/imagevector/build.gradle.kts
  • sdk/ir/compose/build.gradle.kts
  • tools/compose-app/build.gradle.kts
  • tools/idea-plugin/CHANGELOG.md
  • tools/idea-plugin/build.gradle.kts
  • tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ValkyrieToolWindow.kt
  • tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/jewel/InlineIconText.kt
  • tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/jewel/LinkIcon.kt
  • tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/jewel/highlight/CodeHighlight.kt
  • tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/jewel/icons/KotlinLogo.kt
  • tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/jewel/ui/placeholder/ErrorPlaceholder.kt
  • tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/di/DI.kt
  • tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/di/IntellijPlatformModule.kt
  • tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/mode/iconpack/existingpack/ui/ChooseExistingPackFile.kt
  • tools/idea-plugin/src/main/resources/messages/Valkyrie.properties
💤 Files with no reviewable changes (1)
  • tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/jewel/icons/KotlinLogo.kt

@egorikftp egorikftp marked this pull request as draft March 2, 2026 17:46
@egorikftp egorikftp force-pushed the feature/jewel_0.34 branch from ea0fef5 to 26dae5f Compare March 3, 2026 17:59
@egorikftp egorikftp force-pushed the feature/jewel_0.34 branch from 26dae5f to 816c31a Compare March 3, 2026 18:00
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.

1 participant