Conversation
WalkthroughThis pull request integrates Tabler icons support into a Compose icon library and associated IDEA plugin. It adds a new 🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 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.
🧹 Nitpick comments (4)
tools/idea-plugin/src/test/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/data/TablerCodepointParserTest.kt (1)
8-26: Good coverage for the happy path; consider adding a negative/edge case.The test validates BMP (3-hex) and supplementary-plane (5-hex) codepoints plus hyphenated class names — good. One optional addition: a case with surrounding non-matching CSS (e.g.,
@font-face { ... }or unrelated rules) and a rule with a trailing;to lock in the;?branch of the regex.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tools/idea-plugin/src/test/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/data/TablerCodepointParserTest.kt` around lines 8 - 26, Add an extra negative/edge-case scenario to TablerCodepointParserTest: when building the css string passed to TablerCodepointParser().parse, include some unrelated CSS like an `@font-face` block and at least one icon rule that ends with a trailing semicolon (to exercise the regex branch that allows an optional ';'); then assert that parse still returns only the expected keys/values for "accessible", "aerial-lift", and "arrow-autofit-down" (and no entries from the unrelated block) to ensure the parser ignores non-matching rules and handles the ';' case.tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/data/TablerCodepointParser.kt (1)
5-8: Regex assumescontentis the sole declaration in the rule block.The pattern requires
{directly followed bycontent:and}closing right after the value (with optional;). This matches the currenttabler-icons.csslayout, but any additional declarations inside a.ti-*:beforeblock (e.g., a futurefont-family) would silently drop that icon from the parsed map. Consider making the body tolerant to extra declarations, e.g.:♻️ Suggested relaxed regex
- Regex("""\.ti-([a-z0-9-]+):before\s*\{\s*content:\s*"\\([A-Fa-f0-9]+)"\s*;?\s*}"""), + Regex("""\.ti-([a-z0-9-]+):before\s*\{[^}]*?content:\s*"\\([A-Fa-f0-9]+)"[^}]*}"""),Not blocking — the current CSS shape works with the existing regex.
🤖 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/standard/tabler/data/TablerCodepointParser.kt` around lines 5 - 8, The current TablerCodepointParser (subclassing RegexCssCodepointParser) uses a regex that requires the rule block to contain only the content declaration, so any extra declarations will prevent matches; update the Regex supplied to TablerCodepointParser to allow arbitrary declarations inside the braces and find the content value anywhere in the block (for example by matching ".ti-([a-z0-9-]+)\s*:\s*before\s*\{\s*[^}]*?content:\s*\"\\([A-Fa-f0-9]+)\"[^}]*\}" style logic) so the parser tolerates additional properties while still capturing the icon name and hex code.tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/data/TablerRepository.kt (1)
38-40: Consider surfacing HTTP failures with context for SVG/CSS downloads.
loadAndDecodeWoff2helpfully includes the source URL in its failure message (line 50), butdownloadSvgandloadCodepointscallbodyAsText()directly. Any Ktor exception (timeout, non-2xx if a response validator is configured, etc.) will propagate without the offending URL, which makes production triage harder. Consider wrapping these calls so failures include the URL, consistent with the WOFF2 path. Non-blocking — deferable if the project already handles this centrally in the sharedHttpClient.🤖 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/standard/tabler/data/TablerRepository.kt` around lines 38 - 40, downloadSvg and loadCodepoints call httpClient.get(...).bodyAsText() directly so Ktor exceptions lack the source URL; wrap their network calls in a try/catch (same pattern used by loadAndDecodeWoff2) to catch any Throwable and rethrow or throw a new IOException/RuntimeException that includes the resolved URL (resolveTablerSvgUrl(iconName, style) for downloadSvg and resolveTablerCodepointsUrl() for loadCodepoints) plus the original exception as the cause so error logs include the offending URL for easier triage.tools/idea-plugin/src/test/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/domain/TablerIconConfigBuilderTest.kt (1)
31-32: Reuse the domain style constants instead of redefining them.
TABLER_OUTLINE_STYLEandTABLER_FILLED_STYLEare already declared asinternalin the same package (...tabler.domain) inTablerUseCase.kt. Redefining localOUTLINE_STYLE/FILLED_STYLEduplicates the definition and risks silent drift if the production constants change (e.g., id/name). The test would still pass viaIconStyledata-class equality while no longer validating the real values emitted bybuildTablerIcons.♻️ Proposed fix
- assertThat(icons.map { it.style }).containsExactly(OUTLINE_STYLE, FILLED_STYLE, OUTLINE_STYLE) + assertThat(icons.map { it.style }).containsExactly(TABLER_OUTLINE_STYLE, TABLER_FILLED_STYLE, TABLER_OUTLINE_STYLE) @@ -private val OUTLINE_STYLE = IconStyle(id = "outline", name = "Outline") -private val FILLED_STYLE = IconStyle(id = "filled", name = "Filled")(The
IconStyleimport can then be dropped.)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tools/idea-plugin/src/test/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/domain/TablerIconConfigBuilderTest.kt` around lines 31 - 32, Replace the local test constants OUTLINE_STYLE and FILLED_STYLE in TablerIconConfigBuilderTest with the existing domain constants TABLER_OUTLINE_STYLE and TABLER_FILLED_STYLE (declared internal in TablerUseCase.kt) so the test validates the actual production values emitted by buildTablerIcons; update references in the test to use TABLER_OUTLINE_STYLE / TABLER_FILLED_STYLE and remove the now-unnecessary IconStyle import.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In
`@tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/data/TablerCodepointParser.kt`:
- Around line 5-8: The current TablerCodepointParser (subclassing
RegexCssCodepointParser) uses a regex that requires the rule block to contain
only the content declaration, so any extra declarations will prevent matches;
update the Regex supplied to TablerCodepointParser to allow arbitrary
declarations inside the braces and find the content value anywhere in the block
(for example by matching
".ti-([a-z0-9-]+)\s*:\s*before\s*\{\s*[^}]*?content:\s*\"\\([A-Fa-f0-9]+)\"[^}]*\}"
style logic) so the parser tolerates additional properties while still capturing
the icon name and hex code.
In
`@tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/data/TablerRepository.kt`:
- Around line 38-40: downloadSvg and loadCodepoints call
httpClient.get(...).bodyAsText() directly so Ktor exceptions lack the source
URL; wrap their network calls in a try/catch (same pattern used by
loadAndDecodeWoff2) to catch any Throwable and rethrow or throw a new
IOException/RuntimeException that includes the resolved URL
(resolveTablerSvgUrl(iconName, style) for downloadSvg and
resolveTablerCodepointsUrl() for loadCodepoints) plus the original exception as
the cause so error logs include the offending URL for easier triage.
In
`@tools/idea-plugin/src/test/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/data/TablerCodepointParserTest.kt`:
- Around line 8-26: Add an extra negative/edge-case scenario to
TablerCodepointParserTest: when building the css string passed to
TablerCodepointParser().parse, include some unrelated CSS like an `@font-face`
block and at least one icon rule that ends with a trailing semicolon (to
exercise the regex branch that allows an optional ';'); then assert that parse
still returns only the expected keys/values for "accessible", "aerial-lift", and
"arrow-autofit-down" (and no entries from the unrelated block) to ensure the
parser ignores non-matching rules and handles the ';' case.
In
`@tools/idea-plugin/src/test/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/domain/TablerIconConfigBuilderTest.kt`:
- Around line 31-32: Replace the local test constants OUTLINE_STYLE and
FILLED_STYLE in TablerIconConfigBuilderTest with the existing domain constants
TABLER_OUTLINE_STYLE and TABLER_FILLED_STYLE (declared internal in
TablerUseCase.kt) so the test validates the actual production values emitted by
buildTablerIcons; update references in the test to use TABLER_OUTLINE_STYLE /
TABLER_FILLED_STYLE and remove the now-unnecessary IconStyle import.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: cb951a43-5b6f-4720-85c9-e2b4c502faa8
📒 Files selected for processing (20)
sdk/compose/icons/api/icons.apisdk/compose/icons/api/icons.klib.apisdk/compose/icons/src/commonMain/kotlin/io/github/composegears/valkyrie/sdk/compose/icons/colored/TablerLogo.kttools/idea-plugin/CHANGELOG.mdtools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/service/PersistentSettings.kttools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/settings/InMemorySettings.kttools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/WebImportFlow.kttools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/WebImportSelectorScreen.kttools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/StandardImportScreenUI.kttools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/domain/CodepointGlyph.kttools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/TablerImportScreen.kttools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/data/TablerCodepointParser.kttools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/data/TablerRepository.kttools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/di/TablerModule.kttools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/domain/TablerUseCase.kttools/idea-plugin/src/main/resources/messages/Valkyrie.propertiestools/idea-plugin/src/test/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/domain/CodepointGlyphTest.kttools/idea-plugin/src/test/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/data/TablerCodepointParserTest.kttools/idea-plugin/src/test/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/data/TablerSvgPathResolverTest.kttools/idea-plugin/src/test/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/domain/TablerIconConfigBuilderTest.kt
Screen.Recording.2026-04-20.at.00.19.25.mov
📝 Changelog
If this PR introduces user-facing changes, please update the relevant Unreleased section in changelogs: