mirror of
https://github.com/Matysh/houseplan-card
synced 2026-09-28 19:01:34 +00:00
The "Follows the sun" background made the plan crawl in Firefox: 23 MB of textures per frame, sixteen of about twenty picture-cache tiles thrown away every frame, nine frames per second. The card's own JavaScript was idle for 89 % of that. The cost is the outer outline. It is a triple drop-shadow over the grouped paper footprint, and although the group holds paper silhouettes only and never changes on hover or pan, the filter lived in the plan's own layer — so every repaint of the plan re-ran three blur passes over the whole sheet. One hint moves the filtered paper into its own layer and unhooks it from the plan's repaints. Measured on a demo-stand pan (Chromium, CDP, summed RasterTask): 1456.6 ms against a static background's 96.7 ms before, 84.7 ms against 103.2 ms after. The new smoke measures that ratio and fails above two. The picture does not change: the outline outside the plan matches byte for byte and the frame's mean colour moves from 176.59 to 176.66 of 255. Splitting the layer does move the remaining content onto a different sub-pixel grid, so the diagonal wall hatch anti-aliases differently and the four day-cycle baselines are re-taken on the beta candidate. Issue: #532 User-Visible: yes
2 lines
2.5 KiB
JavaScript
2 lines
2.5 KiB
JavaScript
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="f40ffc9357a1340e70f3959e98bf17da6858dff6a2b4f32392befa4ce825f0b3";import{e9 as e,L as t,a2 as n,J as i,an as o,N as r,bo as s,bn as a,a1 as l,a0 as c,ax as u,ea as d,eb as f,bq as m,ec as g}from"./houseplan-card-CvCwcI3S.js";function v(e){if(!e.registry.authoritative)return null;const t=new Set,n=u(e.markers);for(const i of Object.values(e.registry.devices||{}))i?.id&&"service"!==i.entry_type&&!n.devices.has(i.id)&&i.area_id&&e.areaToSpace[i.area_id]&&t.add(i.id);for(const i of e.markers||[]){if(i.removed||"virtual"===i.binding)continue;const o=String(i.binding||"").indexOf(":");if(o<1)continue;const r=i.binding.slice(0,o),s=i.binding.slice(o+1),a="device"===r?e.registry.devices?.[s]:null,l="entity"===r?e.registry.entities?.[s]:null,c="device"===r?s:l?.device_id,u="device"===r?a?.area_id:l?.area_id||c&&e.registry.devices?.[c]?.area_id,d="string"==typeof i.room_id&&i.room_id.length>0&&null===i.area?"":i.area||u||"",f=d&&e.areaToSpace[d]||i.space||e.firstSpaceId;c&&e.registry.devices?.[c]&&e.spaceIds.has(f)&&(!n.devices.has(c)||"entity"===r&&n.liveEntities.has(s))&&t.add(c)}return t}function y(e,t){return e?.length?t?.length?g(e,t):e:t}function _(e,t){const n=l(e.rooms,t.walls,t.openCuts,[],i,t.cellCm,o,r);return{roomGeom:"ok"===n.status||"degraded-extra"===n.status?n.roomGeom:void 0,multiWallNodes:c(e.rooms,t.walls,t.openCuts,i,t.cellCm,o,r)}}function*h(l,c,u=_){try{let d=0;for(const f of c){const c=l.spaces.find(e=>String(e?.id)===f.id);if(!c)continue;const m=e(c,f),g=u(f,m);let v=null;for(const e of f.rooms){if(!e.id)continue;const a=t(e);if(!a)continue;const l=n(f.rooms,e.id,m.walls,m.openCuts,i,m.cellCm,o,r,g.roomGeom,g.multiWallNodes)||a;v=y(v,s(l,m.physicalBodies)),yield}const _=m.cellCm/o;d+=a(v)*_*_/1e4}return d}catch{return null}}function p(e,t,n=_){const i=h(e,t,n);let o=i.next();for(;!o.done;)o=i.next();return o.value}function b(e,t,n,i){if("system"!==e.type)return null;if("device_count"===e.key)return null===t.deviceCount?null:String(t.deviceCount);if("total_area"===e.key)return null===t.areaM2?null:m(t.areaM2,"mi"===n?.config?.unit_system?.length);try{return new Intl.DateTimeFormat(i||void 0,{dateStyle:"short",timeStyle:"short",timeZone:n?.config?.time_zone||void 0}).format(t.now)}catch{return t.now.toLocaleString()}}function S(e,t){const n=e?.states?.[t];if(!n)return null;const i=d(e,t);return i?f(i,String(n.attributes?.unit_of_measurement||"")):null}export{h as cleanFloorAreaSteps,v as representedHaDeviceIds,_ as spaceWallGeometry,S as summaryEntityValue,b as summarySystemValue,p as totalCleanFloorAreaM2};
|