Skip to content

Fix Svelte image module reading the wrong resource field - #79

Open
krixkrix wants to merge 1 commit into
alexanderoster:developfrom
krixkrix:svelte-image-resource
Open

krixkrix wants to merge 1 commit into
alexanderoster:developfrom
krixkrix:svelte-image-resource

Conversation

@krixkrix

@krixkrix krixkrix commented Oct 9, 2026

Copy link
Copy Markdown

Summary

ModuleImage.svelte read module.imageresourceuuid, but AMCModule_Image.js sets imageresource, so no <image> content rendered in the Svelte client.

 imageURL
-  module.imageresourceuuid ? app.getImageURL(module.imageresourceuuid) : ''
+  uuid = module.imageresource
+  if (!uuid || uuid === nullUUID || !app) return ''
+  return app.getImageURL(uuid)

The null-UUID check matches the BuildList/PartList/ExecutionList thumbnails. Without it, the core default 00000000-… would request a broken image.

Evidence

WidgetTest, Dashboard → "Machine View" (<image resource="ui_logo">), Svelte client:

  • Before: heading only, no /api/image request
  • After: logo renders at maxheight="80"

Merge Danger

Door: two-way

Blast Radius: Svelte <image> only

ModuleImage.svelte read module.imageresourceuuid, but the core
AMCModule_Image sets imageresource, so no <image> content rendered in
the Svelte client. Read imageresource, and skip the null-UUID default
so an image without a resource renders nothing instead of a broken
image (same guard as the build/part/execution list thumbnails).

This branch has not been deployed

No deployments
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