clauddy 1.13.0 → 1.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/renderer/pet.js +7 -4
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "clauddy",
3
3
  "desktopName": "clauddy.desktop",
4
- "version": "1.13.0",
4
+ "version": "1.13.1",
5
5
  "description": "A cute desktop pet that tracks your Claude Code usage",
6
6
  "main": "main.js",
7
7
  "bin": {
package/renderer/pet.js CHANGED
@@ -392,12 +392,15 @@ function renderBars(boxId, list, limit) {
392
392
  function fitNames(box) {
393
393
  const names = [...box.querySelectorAll('.mname')]
394
394
  // a collapsed section measures zero — it re-fits when it opens
395
- if (!names.length || !box.getBoundingClientRect().width) return
395
+ if (!names.length || !box.offsetWidth) return
396
396
  box.style.setProperty('--name-w', 'auto')
397
+ // offsetWidth, not getBoundingClientRect: the width we hand back is a layout px,
398
+ // so it has to be measured in layout px too. A CSS transform on an ancestor
399
+ // (the video stage scales the card) inflates the rect and squeezes the bars away.
397
400
  let widest = 0
398
- for (const n of names) widest = Math.max(widest, n.getBoundingClientRect().width)
399
- const room = box.getBoundingClientRect().width - BAR_MIN
400
- const w = Math.max(NAME_MIN, Math.min(Math.ceil(widest) + 1, room))
401
+ for (const n of names) widest = Math.max(widest, n.offsetWidth)
402
+ const room = box.offsetWidth - BAR_MIN
403
+ const w = Math.max(NAME_MIN, Math.min(widest + 2, room))
401
404
  box.style.setProperty('--name-w', `${w}px`)
402
405
  }
403
406