8000 fix(web): keep summary notes and peak hour on one line for 0.9.8 by InfinityPacer · Pull Request #36 · InfinityPacer/meterleaf · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## [未发布]

## [0.9.8] - 2026-10-09

- 桌面 Tokens 摘要的环比、每次请求和输出改为同一行排列,与缓存命中率图例的排法一致。
- 窄屏趋势图下方的峰值小时改为「10/09 04时」格式,并按内容分配列宽,时间与数值不再折成两行。

## [0.9.7] - 2026-10-07

- 七天额度预估改为本周期已花金额加上剩余部分的推算,用得越多越接近实际,用满时等于已花金额。
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "meterleaf",
"version": "0.9.7",
"version": "0.9.8",
"private": true,
"type": "module",
"license": "Apache-2.0",
Expand Down
1 change: 0 additions & 1 deletion src/web/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1680,7 +1680,6 @@ export function App() {
month: "2-digit",
day: "2-digit",
hour: "2-digit",
minute: "2-digit",
hour12: false,
}
: { month: "2-digit", day: "2-digit" },
Expand Down
33 changes: 18 additions & 15 deletions src/web/components/UsageSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,26 +161,29 @@ export function UsageSummary({
<div>
<dt>Tokens</dt>
<dd>{compact(data.tokens)}</dd>
<small>
{/* 附注与命中率图例同一排法:一行内依次排列,放不下时整项换行。 */}
<small className="summary-notes">
{data.change ? (
<Change value={data.change.tokens} />
) : data.dailyTokens !== null ? (
`日均 ${compact(data.dailyTokens)}`
<span>
日均 <b>{compact(data.dailyTokens)}</b>
</span>
) : null}
</small>
{data.tokens !== null &&
data.requests !== null &&
data.requests > 0 && (
<small>
{data.tokensIncomplete ? "每次请求已知" : "每次请求"}{" "}
{compact(data.tokens / data.requests)}
</small>
{data.tokens !== null &&
data.requests !== null &&
data.requests > 0 && (
<span>
{data.tokensIncomplete ? "每次请求已知" : "每次请求"}{" "}
<b>{compact(data.tokens / data.requests)}</b>
</span>
)}
{data.composition.output !== null && (
<span title="模型生成内容的 Tokens 总量,不是缓存读取量">
输出 <b>{compact(data.composition.output)}</b>
</span>
)}
{data.composition.output !== null && (
<small title="模型生成内容的 Tokens 总量,不是缓存读取量">
输出 {compact(data.composition.output)}
</small>
)}
</small>
</div>
<div>
<dt>费用</dt>
Expand Down
21 changes: 21 additions & 0 deletions src/web/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -2173,6 +2173,20 @@ button[data-size="icon-sm"],
color: var(--muted);
font-variant-numeric: tabular-nums;
}
/* Tokens 格的附注沿用命中率图例的排法:同一行排列,数值用次一级灰度。 */
.usage-summary dl > div > .summary-notes {
display: flex;
flex-wrap: wrap;
gap: 2px 12px;
}
.summary-notes > span {
white-space: nowrap;
}
.summary-notes b {
color: var(--muted);
font-weight: inherit;
font-variant-numeric: tabular-nums;
}
.summary-change {
display: inline-flex;
align-items: center;
Expand Down Expand Up @@ -2205,6 +2219,13 @@ button[data-size="icon-sm"],
font-weight: 500;
font-variant-numeric: tabular-nums;
}
/* 窄屏按内容分配列宽,峰值的时间与数值留在一行;实在放不下时才换行。 */
@media (max-width: 900px) {
.trend-insights {
grid-template-columns: repeat(3, auto);
justify-content: space-between;
}
}
.account-menu-positioner {
z-index: 80;
}
Expand Down
Loading
0