fix(dashboard): load icon helpers on Dashboard tile (#143) - #145
Conversation
composeIconSrc/composeIconFallback lived in composeManagerMain.js, which is only loaded on the Compose/Docker tab. On the Dashboard the stack render loop threw a ReferenceError, so the tile stayed on 'Loading...' and compose containers were never hidden from the Docker tile. Move the icon helpers into composeIcons.js and load it from both the Compose page and the dashboard tile. Also run container hiding before the render loop so a render failure can no longer disable it.
37e371f to
1f0f41d
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Several verified issues need addressing (data-URI proxying via query string, hash-compare edge case, repeated docker ps shell-outs, test cleanup gaps, and an out-of-scope pluginURL branch change).
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR addresses a Dashboard tile regression where icon helper functions were not loaded (causing a ReferenceError and a stuck “Loading…” tile), and makes container-hiding run before the render loop so hiding can’t be disabled by a render failure. It also expands the icon caching/serving path and adds Docker Manager icon seeding/repair behaviors.
Changes:
- Extract icon helper functions into a shared
composeIcons.jsand load it on both the Compose page and Dashboard tile. - Adjust Dashboard tile flow so compose-managed container hiding runs before stack rendering.
- Extend icon cache/serve + Docker Manager icon seeding/repair logic, and add/adjust related unit tests and constants.
File summaries
| File | Description |
|---|---|
| tests/unit/StackInfoTest.php | Updates DM icon seeding tests and adds new repair/metadata tests. |
| tests/bootstrap.php | Adds test constants for Docker Manager icon/cache paths. |
| source/compose.manager/README.md | Removes “(Beta)” from the name. |
| source/compose.manager/javascript/composeManagerMain.js | Switches icon resolution to shared helpers and passes container name. |
| source/compose.manager/javascript/composeIcons.js | New shared browser-side icon helper module for Compose + Dashboard. |
| source/compose.manager/include/Util.php | Adds PNG validation + stale-cache checks; enhances cache write safety; adds DM seeding/metadata repair and sync hooks. |
| source/compose.manager/include/Exec.php | Seeds Docker Manager icons during container icon resolution. |
| source/compose.manager/include/Defines.php | Adds constants for DM icon dirs/metadata file and icon label key. |
| source/compose.manager/include/ComposeManager.php | Loads composeIcons.js on the Compose page. |
| source/compose.manager/IconCache.php | Makes icon serving consistently cache-backed, supports refresh, and optional DM repair via ct. |
| source/compose.manager/compose.manager.dashboard.page | Loads composeIcons.js, passes container name to icon helper, and runs hiding pre-render. |
| compose.manager.plg | Updates version/build metadata and switches pluginURL branch target. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
IconCache.php?src=<data URI> puts the whole base64 payload in the query string, which trips browser/nginx URL length limits and breaks the icon. Data URIs are already inline, so proxying gains nothing; Docker Manager seeding for them still happens server-side in Exec.php.
composeIconSrc/composeIconFallback lived in composeManagerMain.js, which is only
loaded on the Compose/Docker tab. On the Dashboard the stack render loop threw a
ReferenceError, so the tile stayed on 'Loading...' and compose containers were
never hidden from the Docker tile.
Move the icon helpers into composeIcons.js and load it from both the Compose page
and the dashboard tile. Also run container hiding before the render loop so a
render failure can no longer disable it.