@1930dev/opencode-usage 0.3.0 → 0.3.2
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/dist/tui.js +6 -4
- package/package.json +1 -1
package/dist/tui.js
CHANGED
|
@@ -580,7 +580,8 @@ async function getUsageSnapshot(sinceMs, groupBy, includePct) {
|
|
|
580
580
|
}
|
|
581
581
|
// packages/plugin/layout.ts
|
|
582
582
|
var SIZE_WIDTH = { medium: 60, large: 88, xlarge: 116 };
|
|
583
|
-
var
|
|
583
|
+
var PADDING_X = 2;
|
|
584
|
+
var PADDING_Y = 1;
|
|
584
585
|
var WIDE_BAR = 12;
|
|
585
586
|
var COMPACT_BAR = 6;
|
|
586
587
|
var BUDGET_FIXED = WIDE_BAR + 6;
|
|
@@ -680,7 +681,7 @@ function barColor(pct, p) {
|
|
|
680
681
|
}
|
|
681
682
|
function chooseSize(terminal, needed) {
|
|
682
683
|
const held = (s) => terminal >= SIZE_WIDTH[s] + 2;
|
|
683
|
-
if (held("large") && SIZE_WIDTH.large -
|
|
684
|
+
if (held("large") && SIZE_WIDTH.large - PADDING_X * 2 >= needed)
|
|
684
685
|
return "large";
|
|
685
686
|
if (held("xlarge"))
|
|
686
687
|
return "xlarge";
|
|
@@ -715,7 +716,7 @@ function terminalWidth(api) {
|
|
|
715
716
|
}
|
|
716
717
|
function innerWidth(api, needed) {
|
|
717
718
|
const terminal = terminalWidth(api);
|
|
718
|
-
return Math.min(SIZE_WIDTH[chooseSize(terminal, needed)], terminal - 2) -
|
|
719
|
+
return Math.min(SIZE_WIDTH[chooseSize(terminal, needed)], terminal - 2) - PADDING_X * 2;
|
|
719
720
|
}
|
|
720
721
|
function neededWidth(snapshot) {
|
|
721
722
|
const labels = Object.values(snapshot.pct ?? {}).map((b) => compactLabel(b.label ?? b.source).length);
|
|
@@ -726,7 +727,8 @@ function Frame(props) {
|
|
|
726
727
|
return /* @__PURE__ */ jsxs("box", {
|
|
727
728
|
flexDirection: "column",
|
|
728
729
|
flexShrink: 0,
|
|
729
|
-
|
|
730
|
+
paddingX: PADDING_X,
|
|
731
|
+
paddingY: PADDING_Y,
|
|
730
732
|
children: [
|
|
731
733
|
/* @__PURE__ */ jsxs("box", {
|
|
732
734
|
flexDirection: "row",
|