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.
- package/package.json +1 -1
- package/renderer/pet.js +7 -4
package/package.json
CHANGED
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.
|
|
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.
|
|
399
|
-
const room = box.
|
|
400
|
-
const w = Math.max(NAME_MIN, Math.min(
|
|
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
|
|