Skip to content

feat(docker): live icon preview on the container Icon URL field (OS-466)#2672

Open
elibosley wants to merge 1 commit into
masterfrom
feature/os-466-docker-icon-preview
Open

feat(docker): live icon preview on the container Icon URL field (OS-466)#2672
elibosley wants to merge 1 commit into
masterfrom
feature/os-466-docker-icon-preview

Conversation

@elibosley

@elibosley elibosley commented Jun 19, 2026

Copy link
Copy Markdown
Member

Summary

Implements OS-466 — a small QoL preview of the container icon next to the Icon URL field on the Docker Add/Edit form.

Changes

  • emhttp/plugins/dynamix.docker.manager/include/CreateDocker.php:
    • Added a preview <img id="contIconPreview"> next to the contIcon input, with onerror fallback to /plugins/dynamix.docker.manager/images/question.png (same fallback the container list uses).
    • Added a small JS block (inside the existing on-load $(function(){…}), after Settings population) that updates the preview src on input/change and hides it when empty. Initializing after population means it also shows the current icon when editing an existing container.

Notes

  • No change to how the icon is saved (contIcon<Icon> label).
  • php -l clean.

Testing to do on hardware

  • Type/paste an icon URL on Add Container → preview updates live.
  • Empty or broken URL → question-mark fallback, no broken-image glyph.
  • Edit an existing container with an icon → preview shows on load.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added live preview for container icon URLs. Users can now see the icon image as they enter or modify the URL, with automatic fallback to a placeholder if the image fails to load.

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@elibosley, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 53 minutes and 44 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 47cd4f96-1a15-45d7-bbe1-0041df6bd2ad

📥 Commits

Reviewing files that changed from the base of the PR and between 8a33e0e and 64b9c26.

📒 Files selected for processing (1)
  • emhttp/plugins/dynamix.docker.manager/include/CreateDocker.php

Walkthrough

In CreateDocker.php, the "Icon URL" form field gains a sibling <img> element that renders a live preview of the entered URL, falling back to a question-mark image on error. A self-invoking JavaScript block wires input/change listeners to contIcon and initializes the preview state on page load.

Changes

Icon URL Live Preview

Layer / File(s) Summary
Icon preview image element and JS event wiring
emhttp/plugins/dynamix.docker.manager/include/CreateDocker.php
The Icon URL input row now renders an <img id="contIconPreview"> with an onerror fallback to a default question image. A self-invoking JS block wires input/change listeners to update the image src and toggle visibility in real time, and initializes the preview state on load.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

A bunny typed a URL with flair,
And watched a tiny icon appear right there! 🐇
No more mystery, no more doubt,
The preview popped the image out.
"It works!" the rabbit thumped with glee,
A picture preview — now they can see! 🖼️

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: adding a live icon preview feature to the Docker container Icon URL field, with the issue reference (OS-466).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/os-466-docker-icon-preview

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown

🔧 PR Test Plugin Available

A test plugin has been generated for this PR that includes the modified files.

Version: 2026.06.19.1437
Build: View Workflow Run

📥 Installation Instructions:

Install via Unraid Web UI:

  1. Go to Plugins → Install Plugin
  2. Copy and paste this URL:
https://preview.dl.unraid.net/pr-plugins/pr-2672/webgui-pr-2672.plg
  1. Click Install

Alternative: Direct Download

⚠️ Important Notes:

  • Testing only: This plugin is for testing PR changes
  • Backup included: Original files are automatically backed up
  • Easy removal: Files are restored when plugin is removed
  • Conflicts: Remove this plugin before installing production updates
  • Post-merge behavior: This preview stays available after merge until preview storage expires or it is manually cleaned up

📝 Modified Files:

Click to expand file list
emhttp/plugins/dynamix.docker.manager/include/CreateDocker.php

🔄 To Remove:

Navigate to Plugins → Installed Plugins and remove webgui-pr-2672, or run:

plugin remove webgui-pr-2672

🤖 This comment is automatically generated and will be updated with each new push to this PR.

elibosley added a commit that referenced this pull request Jun 19, 2026
…(OS-469) (#2674)

## Summary
Implements
[OS-469](https://linear.app/lime-technology/issue/OS-469/pr-test-plugin-ship-a-diffpatch-so-multiple-pr-plugins-can-stack-on).
The per-PR test plugin used to package changed files as **whole-file
copies**, overwrite them on install, and **abort** if another
`webgui-pr-*` plugin already managed any of the same files — so two PRs
touching one file (e.g.
[#2672](#2672) +
[#2673](#2673), both editing
`CreateDocker.php`) couldn't be tested together.

Now it ships a **unified diff** and `patch`-applies it, so
non-overlapping edits to the same file stack.

## How it works
- **Build** (`pr-plugin-build.yml`): for changed **text** files, stage
base + head versions in system layout and emit `pr.patch` (`diff -ruN`,
paths apply with `patch -p1` at `/`). Changed **binary** files are
copied whole into `binary/` with a `binary_files.txt` list. Both go in
the same tarball.
- **Plugin** (`generate-pr-plugin.sh`): on install, `patch -p1 --dry-run
--forward` first — **abort with a clear message on a real reject**
(overlapping change), otherwise apply and save `applied.patch`. Binaries
are whole-file replaced with a per-binary conflict guard. On remove (and
before update), reverse the patch (`patch -R`) and restore binary
backups.
- **Upload/R2 plumbing unchanged** — still a single tarball with the
same URL/SHA wiring.

## Validation (local simulation)
- Two patches editing the same file at different lines → **both apply,
both changes coexist**.
- Reversing one → **only that change is removed, the other stays**.
- Overlapping edits → **dry-run fails → install aborts** cleanly.
- Generated `.plg` is well-formed XML (all placeholders substituted);
`bash -n` + YAML parse clean.

## Notes / still to verify
- Real validation needs CI + an Unraid box installing two stacked PR
plugins. Conveniently, **this PR touches `.github/**`, so it will itself
build a PR test plugin with the new code** — a live smoke test of the
generator.
- Binary deletions aren't handled (rare); text add/modify/delete are.
- `patch` is present in the Unraid base; uses `--forward`/`--batch` for
non-interactive apply with fuzz.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Chores**
* Improved plugin install/update and uninstall to use a deterministic,
patch-based manifest workflow for safer reversibility.
* Enhanced plugin package generation to build a patch-oriented payload,
distinguishing text changes from full binary replacements.
* Updated the uninstall confirmation flow to reflect the new removal
behavior.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Show a small preview image beside the Icon URL field on the Docker
Add/Edit form, updated live as the URL is typed/pasted, with the same
question-mark fallback used in the container list when the URL is empty
or broken. No change to how the icon is stored.

Closes OS-466

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@elibosley elibosley force-pushed the feature/os-466-docker-icon-preview branch from 8a33e0e to 64b9c26 Compare June 19, 2026 14:37
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.

1 participant