feat: dynamic icons for file groups (#31)#60
Conversation
Captures the brainstorming outcome: AllIcons-only, curated 40-icon grid, optional override with auto-detect fallback, compact picker row in the Edit File Group dialog. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Entire-Checkpoint: 0c7c7943d240
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds the new persistent field that will hold a user-selected icon override key. Default null preserves existing behavior (auto-detection). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
37 entries spanning Nodes, General, Actions, FileTypes, Toolwindows, Vcs, and Debugger groups. Each entry built defensively via runCatching so a missing AllIcons member on a future SDK silently filters out instead of breaking class init. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extracts the override-or-fallback decision into a pure function that's trivially testable without IntelliJ test fixtures. The auto-detect logic stays inside ProjectFileGroupNode because it depends on FileTypeManager. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Modal DialogWrapper presenting GroupIconCatalog.entries as a horizontally- wrapping JBList with 48x48 cells. Pre-selects the entry matching the caller's initialKey, or the first available entry. Returns the selected key on OK; Cancel returns null. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
New 'Icon: [preview] [Choose…] [Reset to auto]' row between the group name field and the patterns section. The Reset button is disabled when no override is active. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds a leading 28-px icon column to the settings table that renders the custom icon (or auto-detected fallback) for each file group. Also fixes apply()/reset() to preserve iconKey when round-tripping ProjectFileGroup through settings — the previous two-arg constructor calls silently dropped the new field. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughAdds optional persisted per-group iconKey, a curated GroupIconCatalog, GroupIconResolver (catalog-first, auto-detect fallback), UI for picking/resetting icons and preview, settings-table icon column, node wiring, unit tests, docs, and a changelog entry. ChangesDynamic Icons for File Groups
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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 |
Qodana for JVM37 new problems were found
☁️ View the detailed Qodana report Contact Qodana teamContact us at qodana-support@jetbrains.com
|
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
`@src/main/kotlin/com/z8dn/plugins/a2pt/settings/AndroidViewSettingsConfigurable.kt`:
- Around line 195-210: The settings class duplicates fallback icon detection
from ProjectFileGroupNode.autoDetectIcon(), causing drift; extract the logic
into a shared utility (e.g., GroupIconResolver with a function like
resolveFallbackIcon(group: ProjectFileGroup): Icon) and replace the local logic
in AndroidViewSettingsConfigurable.resolveIcon and the fallback branch inside
ProjectFileGroupNode.autoDetectIcon to call
GroupIconResolver.resolveFallbackIcon instead, preserving the current checks
(GroupIconCatalog lookup, single inclusion pattern handling, extension and
filename heuristics, and default AllIcons.Nodes.Folder) so both callers use the
identical implementation.
🪄 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: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 77bcd0d6-c577-45f9-82e8-2688df821a59
📒 Files selected for processing (13)
CHANGELOG.mddocs/superpowers/plans/2026-05-08-dynamic-icons.mddocs/superpowers/specs/2026-05-07-dynamic-icons-design.mdsrc/main/kotlin/com/z8dn/plugins/a2pt/nodes/ProjectFileGroupNode.ktsrc/main/kotlin/com/z8dn/plugins/a2pt/settings/AndroidViewSettings.ktsrc/main/kotlin/com/z8dn/plugins/a2pt/settings/AndroidViewSettingsConfigurable.ktsrc/main/kotlin/com/z8dn/plugins/a2pt/settings/GroupIconPickerDialog.ktsrc/main/kotlin/com/z8dn/plugins/a2pt/settings/ProjectFileGroupDialog.ktsrc/main/kotlin/com/z8dn/plugins/a2pt/utils/GroupIconCatalog.ktsrc/main/kotlin/com/z8dn/plugins/a2pt/utils/GroupIconResolver.ktsrc/main/resources/messages/AndroidViewBundle.propertiessrc/test/kotlin/com/z8dn/plugins/a2pt/utils/GroupIconCatalogTest.ktsrc/test/kotlin/com/z8dn/plugins/a2pt/utils/GroupIconResolverTest.kt
Centralize the pattern-based auto-detect logic in GroupIconResolver and reuse it from ProjectFileGroupNode, the settings table, and the Edit File Group dialog. The dialog preview now reflects the icon that will actually render in the tree (e.g. Kotlin icon for *.kt) instead of a hardcoded folder, and refreshes as the user edits patterns. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Summary
Closes #31. Lets users override the icon used for a project file group from a curated set of IntelliJ `AllIcons` entries, with the existing auto-detection as the fallback.
Architecture
Spec: `docs/superpowers/specs/2026-05-07-dynamic-icons-design.md`
Plan: `docs/superpowers/plans/2026-05-08-dynamic-icons.md`
Tests
`./gradlew check` is green. New unit tests:
UI/Swing tests are intentionally omitted — there is no Swing test infrastructure in the repo and #31 doesn't justify setting that up.
Test plan
Out of scope
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation
Tests