Skip to content

ADFA-6655 | Update Icons Repository to upstream 2.0.3 and add in-app help - #165

Open
jimturner-adfa wants to merge 5 commits into
mainfrom
ADFA-6655-update-icons-repository-plugin
Open

jimturner-adfa wants to merge 5 commits into
mainfrom
ADFA-6655-update-icons-repository-plugin

Conversation

@jimturner-adfa

@jimturner-adfa jimturner-adfa commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

ADFA-6655

Updates the Icons Repository plugin to the contributor's current version (GitHub issue appdevforall/CodeOnTheGo#2165), keeps the addons fixes upstream never picked up, and adds the in-app help the plugin never had.

Summary

Review by commit — the first is a verbatim import, the rest are ours:

  1. Import upstream e083ffa — src/ copied unchanged from omar-haidar/IconsRepository-Plugin (2026-10-22). The addons copy was last synced from 252e73a (2026-05-19). Upstream adds a view-model layer, ModuleDiscoveryEngine, an import-dialog manager and a faster search index. Does not build on its own.
  2. Reapply addons fixes — dispose() releases the project service, context, repository executor and static instance; the render pool and bitmap cache move from statics in IconViewHolder to the adapter. Manifest: display name, ${pluginVersion} (2.0.3), plugin.max_ide_version 26.99 (min is upstream's 26.42) and plugin.editor_tabs. Keeps the addons build setup (shared ../../libs, no aliyun mirrors or mavenLocal()). Upstream's SDK-guarded readAllBytes replaces the ADFA-5707 helper.
  3. Detach the adapter in onDestroyView — RecyclerView only calls onDetachedFromRecyclerView when the adapter is removed, so the executors were never shut down and every reopened tab leaked a 4-thread pool. Present before this PR too.
  4. In-app help (review clause 6.7) — Main implements DocumentationExtension (category plugin_dev.omar.plugin.iconsrepo); Tier 1/2 entries for the side-menu item, search, icon grid and every import-dialog control, wired with the 3-arg showTooltip; Tier 3 guide at assets/docs/index.html. Replaces the placeholder "No tooltip" / "No description".
  5. Set the text fields' icons in code — on device the search, name and hex fields rendered without the icons their layouts declare via app:startIconDrawable/app:endIconMode, leaving their tooltips unreachable. Root cause not found (other app: attributes in the same layouts do apply).

Not taken from upstream: its committed signing material, its bundled libs/*.jar, .idea/, .github/.

Testing

  • assemblePlugin builds; addons check passes. /plugin-review rubric: all clauses pass after commit 4 (6.7 was Fail before).
  • Pixel 6 Pro, Code on the Go release C-r-1112-1729:
    • Install registers 7 tooltip entries and the Tier 3 page.
    • Long-press shows the right text (never n/a) on the side-menu item, search icon and clear button, an icon tile, the preview, name, module, color, hex field, Import and Cancel; "See more" and the guide link work offline.
    • Search filters (home); import with colorPrimary writes ?attr/colorPrimary, custom #FF6200EE writes that tint; Bad_Name and an empty hex are rejected and nothing is written.
    • Six close/reopen cycles of the tab: thread count returns to 132–133 each time, no growth.
  • The final wording tweak to the import tooltip's summary (commit 5) was rebuilt but not re-checked on device.

Known limitations

  • Long-pressing the editor tab's title shows the host's generic "Interact with this plugin." — CoGo doesn't use EditorTabItem.tooltip there.
  • Reinstalling the same plugin version over itself did not take effect until the plugin was uninstalled first (CoGo behavior, not this plugin).
  • An import silently overwrites a drawable with the same name (upstream behavior); the guide says so.

🤖 Generated with Claude Code

yaturner and others added 5 commits November 13, 2026 11:24
Copy src/ verbatim from omar-haidar/IconsRepository-Plugin at e083ffa
(2026-10-22). The addons copy was last synced from upstream 252e73a
(2026-05-19). Upstream adds a view-model layer, ModuleDiscoveryEngine,
IconImportDialogManager and FastSearchIndexV2, and moves models/ and
repository/ under data/.

This commit is the unmodified upstream source only, so the next commit
shows exactly what addons changes on top. It drops the addons lifecycle
fixes and manifest entries; the next commit restores them. Build files
are untouched here, so this commit alone does not build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Upstream e083ffa never picked up the addons lifecycle fixes, so restore
them against the new layout:
- BasePlugin.dispose() drops the project service and plugin context.
- Main.dispose() shuts down IconRepository and clears the static
  instance; IconRepository gains shutdown().
- IconsAdapter owns the SVG render pool and bitmap cache (upstream keeps
  them static in IconViewHolder, so they outlive every adapter) and
  releases them, plus any pending search, on detach.

Manifest: display name "Icons Repository", version from
${pluginVersion}, plugin.max_ide_version 26.99 (min stays at upstream's
26.42) and plugin.editor_tabs, since Main contributes an editor tab.

Build: pluginVersion/versionName 2.0.3, recyclerview added and
material/appcompat raised to upstream's versions. Keeps the addons build
setup: shared ../../libs jars, no aliyun mirrors or mavenLocal(). Upstream
SvgToVectorImporter already guards readAllBytes by SDK level, which
replaces the ADFA-5707 Utils helper. README and doc page updated for the
new version range and module layout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
IconsAdapter releases its search and render executors in
onDetachedFromRecyclerView, but RecyclerView only calls that when the
adapter is removed. MainFragment never removed it, so every reopened tab
leaked a 4-thread render pool and a search thread. Remove the adapter
and the search text watcher in onDestroyView.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The plugin had no tooltips or offline help (review clause 6.7): the side
menu item's tooltip tag was the literal "No tooltip" and the editor tab's
was "No description".

Main now implements DocumentationExtension under the category
"plugin_dev.omar.plugin.iconsrepo". New help.IconsRepositoryHelp holds a
Tier 1 summary and Tier 2 detail for the side-menu item, the search field,
the icon grid and each import-dialog control (preview, name, module,
color, Import/Cancel), plus long-press wiring through the 3-argument
IdeTooltipService.showTooltip. Text fields get the tooltip on their start
and end icons, so a long-press in the text still selects text.

Every entry links to a Tier 3 guide at assets/docs/index.html, which
covers search, the import fields, what file gets written and where, and
that an import silently replaces a drawable with the same name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On device (Code on the Go release C-r-1112-1729), the search, icon name
and hex color fields rendered without the start and clear icons their
layouts declare with app:startIconDrawable / app:endIconMode, so the
tooltips wired to those icons had nothing to long-press. The cause was
not pinned down: other app: attributes in the same layouts (card corner
radius, stroke) do apply.

Set the start icon and clear-text end icon in code before wiring the
tooltips. Verified on a Pixel 6 Pro: the icons appear, the clear button
works, and long-press shows each field's tooltip.

Also mention the preview in the import tooltip's summary, since the
preview shares that entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants