From 49bb8bd8cb12a7d5f94eae5e337b589761fd47fb Mon Sep 17 00:00:00 2001 From: Zayden Date: Thu, 7 May 2026 23:45:12 +0700 Subject: [PATCH 01/11] docs: add design spec for dynamic icons (#31) 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 Entire-Checkpoint: 0c7c7943d240 --- .../specs/2026-05-07-dynamic-icons-design.md | 229 ++++++++++++++++++ 1 file changed, 229 insertions(+) create mode 100644 docs/superpowers/specs/2026-05-07-dynamic-icons-design.md diff --git a/docs/superpowers/specs/2026-05-07-dynamic-icons-design.md b/docs/superpowers/specs/2026-05-07-dynamic-icons-design.md new file mode 100644 index 0000000..fe804e6 --- /dev/null +++ b/docs/superpowers/specs/2026-05-07-dynamic-icons-design.md @@ -0,0 +1,229 @@ +# Dynamic Icons for File Groups — Design Spec + +**Issue:** [#31 — Feature: Dynamic Icons for File Groups](https://github.com/z8dn/advanced-android-project-view/issues/31) +**Date:** 2026-05-07 +**Status:** Approved (pending implementation) + +## Goal + +Let users override the icon used for a `ProjectFileGroup` in the project tree. Today, `ProjectFileGroupNode.getGroupIcon()` auto-detects an icon from the group's patterns (single inclusion pattern → file-type icon, otherwise folder). Users want to assign a meaningful icon — Cloud, Database, Settings, etc. — that survives changes to the patterns. + +## Non-goals + +- Custom user-supplied icon files (SVG/PNG from disk). AllIcons only. +- Searchable browsing of all `AllIcons.*` (~2000 entries). Curated set only. +- Per-file (child node) icon overrides. Group node only. +- Search scope icons. `ProjectFileGroupScope` extends `RangeBasedLocalSearchScope`, which does not surface an icon. +- Drag-to-reorder, favorites, or recently-used in the picker. + +## Decisions made during brainstorming + +| # | Decision | Rationale | +|---|----------|-----------| +| 1 | Icons sourced from `AllIcons` only | Theme-aware (light/dark), DPI-aware, zero bundling, matches IDE look. The issue itself proposes this. | +| 2 | Curated grid (~40 icons) as the picker | Best UX/effort ratio. Searchable list of all icons is overkill; free-text path input has poor discoverability. | +| 3 | Icon override is optional; auto-detection is the default fallback | No migration needed for existing groups. Users who like the auto behavior keep it. | +| 4 | Picker UX = compact row in Edit File Group dialog + popup picker dialog (Layout B) | Idiomatic for IntelliJ (matches file/path/color choosers). Keeps parent dialog tight. "Reset to auto" is a first-class button, not a hidden tile. | + +## Architecture + +Three new pieces, two modified files, one data-model field. + +``` +settings/ + AndroidViewSettings.kt (modified) — adds iconKey to ProjectFileGroup + ProjectFileGroupDialog.kt (modified) — adds icon row + AndroidViewSettingsConfigurable.kt (modified) — adds icon column to settings table + GroupIconPickerDialog.kt (new) — popup picker +nodes/ + ProjectFileGroupNode.kt (modified) — resolver: override → catalog → auto +utils/ + GroupIconCatalog.kt (new) — curated AllIcons registry +``` + +## Data model + +```kotlin +data class ProjectFileGroup( + var groupName: String = "", + var patterns: MutableList = mutableListOf(), + var iconKey: String? = null // NEW +) +``` + +`iconKey` is a stable string key (e.g. `"general.settings"`, `"nodes.module"`) that maps to a `GroupIconEntry` in the catalog. We never serialize `Icon` objects; we look them up at render time. + +**Persistence.** `XmlSerializerUtil.copyBean` serializes the new field transparently. Pre-existing `androidViewSettings.xml` files written by older plugin versions have no `