@maxiaochao/pi-toolkit 0.2.4 → 0.2.5
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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
## 2026-09-09 - v0.2.5
|
|
2
|
+
|
|
3
|
+
- fix cache export: segment views lost the hover tooltip (it rendered inside the hidden all-history section); move to one page-level tooltip; e2e now asserts real rendering
|
|
4
|
+
|
|
1
5
|
## 2026-09-09 - v0.2.4
|
|
2
6
|
|
|
3
7
|
- fix cache export: hover tooltips now work across segment breaks; context segments also break on model changes; add headless-browser e2e tests
|
|
@@ -657,7 +657,7 @@ function renderDashboardView(requests, events, toolCalls, compactions, scopeLabe
|
|
|
657
657
|
`<th>Fresh</th><th>Cached</th><th>Written</th><th>Prompt</th><th>Hit rate</th><th>Output</th>` +
|
|
658
658
|
`<th>Stop</th></tr></thead><tbody>${rows}</tbody></table></div></div>` +
|
|
659
659
|
`<div class="usage-panel"><h2>Tool calls</h2>${toolRows}</div>` +
|
|
660
|
-
`</div
|
|
660
|
+
`</div>`
|
|
661
661
|
);
|
|
662
662
|
}
|
|
663
663
|
|
|
@@ -697,10 +697,16 @@ export function renderDashboard(data) {
|
|
|
697
697
|
...segmentViews.map((view) => `<section class="usage-context-view" data-context-view="${view.id}"${view.id === `segment-${latest.number}` ? "" : " hidden"}>${view.html}</section>`),
|
|
698
698
|
].join("");
|
|
699
699
|
|
|
700
|
+
// ONE shared tooltip for the whole page. tau's script grabs the first
|
|
701
|
+
// `.usage-tooltip` in the document; with one per view that element lived in
|
|
702
|
+
// the (hidden) all-history section, so segment views set text on an element
|
|
703
|
+
// whose ancestor was display:none -> nothing painted. A single tooltip
|
|
704
|
+
// outside the view sections renders under every view.
|
|
700
705
|
return `<div class="usage-view-controls"><label for="context-segment-select">View</label>` +
|
|
701
706
|
`<select id="context-segment-select" data-context-segment-select>${options}</select>` +
|
|
702
707
|
`<span>Default: latest Context segment. All-history values remain available; cache metrics reset where compaction rewrites the prefix or the model changes.</span></div>` +
|
|
703
|
-
views
|
|
708
|
+
views +
|
|
709
|
+
`<div class="usage-tooltip" role="status" aria-live="polite"></div>`;
|
|
704
710
|
}
|
|
705
711
|
|
|
706
712
|
// ---------------------------------------------------------------------------
|
|
@@ -158,7 +158,10 @@ const HOVER_SCRIPT = `
|
|
|
158
158
|
clientX: r.left + 30 + r.width * frac, clientY: r.top + r.height / 2, bubbles: true,
|
|
159
159
|
}));
|
|
160
160
|
const t = document.querySelector(".usage-tooltip");
|
|
161
|
-
|
|
161
|
+
// Actually-rendered check: getClientRects() returns 0 when the element or
|
|
162
|
+
// any ancestor is display:none, even if the element's own computed
|
|
163
|
+
// display is block (the old per-view tooltip blind spot).
|
|
164
|
+
return { visible: t.getClientRects().length > 0 && getComputedStyle(t).display !== "none", text: t.textContent || "" };
|
|
162
165
|
}
|
|
163
166
|
const requestOf = (r) => {
|
|
164
167
|
const m = (r.text || "").match(/Request (\\d+)/);
|
package/package.json
CHANGED