Image assets (2/3): Angular client ImageAssetService + Image widget (replicates mxtommy/Kip #1081) - #50
Image assets (2/3): Angular client ImageAssetService + Image widget (replicates mxtommy/Kip #1081)#50mairas wants to merge 2 commits into
Conversation
resolveKipPluginBaseUrl() extracts the <server>/plugins/kip/ resolution (mirroring kip-series-api-client) and snapImageWidth() snaps a container width (x DPR) to the server's variant allow-list so the client requests stable, cache-friendly URLs. ImageAssetService wraps the plugin endpoints: upload (multipart FormData with progress), list, delete, cacheStats, purgeCache, and urlFor(id, cssWidth, dpr) for the widget. Requests are auto-authenticated by the JWT interceptor. 9 vitest cases green.
New widget-image renders a selected image (by id) via ImageAssetService, scaled to fit the widget with object-fit (contain/cover) over a configurable background that defaults to transparent so the dashboard shows through. It tracks its container width with the existing kipResizeObserver directive and requests a server variant matched to that width (x DPR) so a small widget never downloads a full-resolution image. Shows an empty state when nothing is selected. Registered in WidgetService (component map + Component-category definition); adds the `image` config block to IWidgetSvcConfig. 3 vitest cases (empty state, render+object-fit, background default/override).
Review: recommend close — superseded by #62Client-side image-asset plumbing ( Verified subset by both file set and substance. Adopting #62 alone captures everything in #50 plus the config UI and e2e harness. Recommend closing #50 in favor of #62. |
|
Superseded by #62 (its complete image feature is a strict superset of this). Closing per Tier 4 review. |
Replicates upstream PR mxtommy/Kip#1081 ("Image assets (2/3): Angular client ImageAssetService + Image widget") by dillan.
Method: commit-by-commit cherry-pick (linear history, no merge commits).
This is an experimental replica carried in the SKip fork for evaluation. It has not been built or tested against the fork — a build + review is required before merge.