Skip to content

Commit 3b8ff81

Browse files
HduSyclaude
andcommitted
feat: draw cost donut as a continuous gapless ring
Remove the inter-segment gap so multi-model wedges butt together into one solid ring; segments stay readable via colour and the hover dim. Single-model still renders a full closed <circle> (a 360° arc degenerates). Bump version to 0.1.14. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent e32131b commit 3b8ff81

4 files changed

Lines changed: 8 additions & 9 deletions

File tree

src-tauri/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "tokenscope"
3-
version = "0.1.13"
3+
version = "0.1.14"
44
description = "Claude CLI token usage dashboard"
55
authors = ["you"]
66
edition = "2021"

src-tauri/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://schema.tauri.app/config/2",
33
"productName": "Tokenscope",
4-
"version": "0.1.13",
4+
"version": "0.1.14",
55
"identifier": "com.tokenscope.app",
66
"build": {
77
"beforeDevCommand": "pnpm dev",

src/charts.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ export function CostDonut({ models, theme, size = 104, thickness = 16 }:
137137
const total = models.reduce((s, m) => s + m.cost, 0) || 1e-9;
138138
const cx = size / 2, cy = size / 2;
139139
const rOut = (size - 2) / 2, rIn = rOut - thickness;
140-
// Inter-segment gap, only meaningful when there's more than one wedge to
141-
// separate. A single segment is drawn as a closed ring (see render below).
142-
const gap = models.length > 1 ? 0.045 : 0;
140+
// No inter-segment gap: wedges butt together into one continuous solid ring.
141+
// (Segments stay distinguishable by colour and the hover dim.)
142+
const gap = 0;
143143
let a = -Math.PI / 2;
144144
const arc = (a0: number, a1: number, rO: number, rI: number) => {
145145
const large = a1 - a0 > Math.PI ? 1 : 0;
@@ -167,9 +167,8 @@ export function CostDonut({ models, theme, size = 104, thickness = 16 }:
167167
<svg width={size} height={size} viewBox={`0 0 ${size} ${size}`} style={{ overflow: "visible" }}>
168168
{models.length === 1 ? (
169169
// Single model: a full closed ring (one 360° arc would be
170-
// degenerate, and the inter-segment gap would leave it open). Trace
171-
// both edges with a 1px card-coloured stroke for a crisp inset look,
172-
// matching the gapped multi-wedge donut.
170+
// degenerate). Trace both edges with a 1px card-coloured stroke for
171+
// a crisp inset look.
173172
<g onMouseEnter={() => setHi(0)} onMouseLeave={() => setHi(-1)} style={{ cursor: "default" }}>
174173
<circle cx={cx} cy={cy} r={(rOut + rIn) / 2}
175174
fill="none" stroke={models[0].color} strokeWidth={thickness} />

0 commit comments

Comments
 (0)