Withings: Mashup Generation Failed when plugin is in a mashup
Core problem:
The plugin seems to work in fullscreen mode, but fails when in a mashup.
My setup:
The results:
Troubleshooting:
I've tried recreating the mashup, reinstalling the plugin, fore refreshing the screen generation.
Nothing seems to work so far.
Possible issues when comparing the fullsized template to the halfsized:
Issue #1 — Missing grid--cols-N class (likely the rendering killer)
Full template (line 6):
<div class="grid grid--cols-4">
Half template (line 6):
<div class="grid h-full">
The half template's grid has no column definition, yet its children use col--span-1 (line 7) and col--span-4 (line 50). The chart container could collapse to zero width, which makes Highcharts fail silently — producing a blank or broken image in the e-ink rendering pipeline.
Issue #2 — Conflicting CSS classes on the chart column
Half template (line 50):
<div class="col--span-4 col h-full gap--space-between">
This element has both col--span-4 (a CSS Grid child property) and col (likely a flexbox column container). These can conflict — col might override the display context, preventing the grid span from working correctly. The full template doesn't have this issue since its chart is outside the grid entirely.
Issue #3 — Missing guard on current_weight
Full template (line 7):
<% if current_weight %>
<span class="value value--tnums"><%= current_weight %></span>
Half template (line 9–13):
<% if local_assigns[:metrics].present? %>
<span class="value value--tnums"><%= current_weight %></span>
The full template guards current_weight independently. The half template only checks if metrics is present, then assumes current_weight exists. If there's a scenario where metrics is populated but current_weight is nil (e.g., the plugin sets metrics from the API but the weight calculation fails), the half template would render an empty value — not a crash, but a data inconsistency.
Issue #4 — Duplicate opposite: true key in sleep chart config
Half template (line 67):
{ ..., yAxis: 1, opposite: true, zIndex: 1, ..., tickAmount: 5, opposite: true, color: ... }
Full template (line 90):
{ ..., yAxis: 1, zIndex: 1, ..., tickAmount: 4, opposite: true, color: ... }
The half template has opposite: true twice in the same hash. Ruby uses last-writer-wins so it's not a crash, but it's a copy-paste bug.
Summary / Fix
The primary fix should be changing line 6 of the half template from:
<div class="grid h-full">
to:
<div class="grid grid--cols-5 h-full">
And optionally separating the conflicting classes on line 50 by wrapping the chart content in a nested div instead of combining col--span-4 with col on the same element.
Hi @matkovsky,
Thanks fore reporting and creating this issue, this is fixed in the core services the mashup should work as expected.
I'm marking this issue as resolved.