Skip to content

Commit 94c93fd

Browse files
zhgchgli0718claude
andcommitted
stocks: revert price-range bounds to closes-only
Drops the cost-inclusive min/max — the cost tick clamping to the bar edge when it falls outside the closes window is the intended visual signal. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 88a9bd1 commit 94c93fd

2 files changed

Lines changed: 5 additions & 9 deletions

File tree

index.html

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2034,14 +2034,10 @@
20342034
</div>
20352035
);
20362036
}
2037-
// Anchor the bar's left edge at min(closes, cost) and right edge at
2038-
// max(closes, cost) so the cost tick always lands inside the bar even
2039-
// for deeply unrealized positions. Falls back to closes alone when
2040-
// cost is absent.
2041-
const minBound = hasCost ? Math.min(...closes, cost) : Math.min(...closes);
2042-
const maxBound = hasCost ? Math.max(...closes, cost) : Math.max(...closes);
2043-
const min = minBound;
2044-
const max = maxBound;
2037+
// Anchor the bar to closes alone — cost may fall outside the band and
2038+
// get clamped to 0% / 100%, which is the intended visual signal.
2039+
const min = Math.min(...closes);
2040+
const max = Math.max(...closes);
20452041
const cur = closes[closes.length - 1];
20462042
const span = max - min;
20472043
const clamp = (v) => span > 0 ? Math.max(0, Math.min(100, ((v - min) / span) * 100)) : 50;

sw.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
// Bump CACHE_VERSION when you change static assets to force clients to refresh.
1212

13-
const CACHE_VERSION = "v12";
13+
const CACHE_VERSION = "v13";
1414
const STATIC_CACHE = "dashboard-static-" + CACHE_VERSION;
1515
const PRECACHE_URLS = [
1616
"./",

0 commit comments

Comments
 (0)