Skip to content

[IDEA] Fix gutter icons with gradient#963

Merged
egorikftp merged 3 commits into
mainfrom
bug/fix-gutter-gradient
Apr 29, 2026
Merged

[IDEA] Fix gutter icons with gradient#963
egorikftp merged 3 commits into
mainfrom
bug/fix-gutter-gradient

Conversation

@egorikftp

@egorikftp egorikftp commented Apr 28, 2026

Copy link
Copy Markdown
Member

Before:
Screenshot 2026-04-27 at 17 30 52

After
Screenshot 2026-04-28 at 18 49 44


📝 Changelog

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

@egorikftp egorikftp force-pushed the bug/fix-gutter-gradient branch from da90b8c to 2687f2b Compare April 28, 2026 15:59
@coderabbitai

coderabbitai Bot commented Apr 28, 2026

Copy link
Copy Markdown

Walkthrough

This pull request refactors gradient XML generation in the SDK to consistently emit color stop items instead of conditionally using startColor/endColor attributes. It updates corresponding XML generator tests to reflect the new format. The PSI parser for gradients is enhanced to resolve gradient geometry arguments and color expressions more flexibly, supporting both direct calls and qualified references. New test fixtures and cases validate parsing of linear gradients using Compose color syntax, and a new gutter test verifies icon rendering with fully qualified Offset references. The changelog documents these gutter-related fixes.

🚥 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 clearly identifies the primary change: fixing gutter icons with gradients in the IntelliJ plugin.
Description check ✅ Passed The description includes before/after screenshots demonstrating the fix and marks the IntelliJ Plugin changelog as updated, fulfilling the core template requirements.
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.

✏️ 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 bug/fix-gutter-gradient

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@sdk/intellij/psi/imagevector/src/main/kotlin/io/github/composegears/valkyrie/sdk/intellij/psi/imagevector/common/FillParser.kt`:
- Around line 145-155: parseColorExpression currently only accepts expressions
whose text startsWith("Color."), so fully-qualified references like
androidx.compose.ui.graphics.Color.White are skipped; update
parseColorExpression (and the Branch handling KtDotQualifiedExpression) to
detect any occurrence of ".Color." (or use substringAfterLast("Color.")) to
extract the actual color identifier (e.g., "White") before calling getIrColor
and returning IrFill.Color, while keeping existing KtCallExpression parsing
intact.
🪄 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: 553eacbc-dbc4-4676-9c11-37cefcf4aa20

📥 Commits

Reviewing files that changed from the base of the PR and between 5f6c0a6 and 2687f2b.

📒 Files selected for processing (9)
  • sdk/generator/xml/src/commonMain/kotlin/io/github/composegears/valkyrie/sdk/generator/xml/IrToXmlGenerator.kt
  • sdk/generator/xml/src/commonTest/kotlin/io/github/composegears/valkyrie/sdk/generator/xml/IrToXmlGeneratorTest.kt
  • sdk/intellij/psi/imagevector/src/main/kotlin/io/github/composegears/valkyrie/sdk/intellij/psi/imagevector/common/FillParser.kt
  • sdk/intellij/psi/imagevector/src/test/kotlin/io/github/composegears/valkyrie/sdk/intellij/psi/imagevector/KtFileToImageVectorParserTest.kt
  • sdk/intellij/psi/imagevector/src/test/kotlin/io/github/composegears/valkyrie/sdk/intellij/psi/imagevector/expected/LinearGradientComposeColors.kt
  • sdk/test/sharedTestResources/imagevector/kt/backing/LinearGradient.compose.colors.kt
  • sdk/test/sharedTestResources/imagevector/kt/lazy/LinearGradient.compose.colors.kt
  • tools/idea-plugin/CHANGELOG.md
  • tools/idea-plugin/src/test/kotlin/io/github/composegears/valkyrie/gutter/ImageVectorGutterTest.kt

@egorikftp egorikftp merged commit b29b263 into main Apr 29, 2026
4 checks passed
@egorikftp egorikftp deleted the bug/fix-gutter-gradient branch April 29, 2026 12:46
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