Price (USD) chart Y-axis renders negative values — price scale extends below zero #151
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:implement
agent:implement
agent:open_issues
agent:ready
agent:research
agent:security_audit
agent:verify
architecture
backend
blocker:hybrid
blocker:launch
blocker:limit-orders
blocker:v2
block:log_only
block:security
bug
ci
contracts
correctness
deploy
dev
devops
docs
documentation
duplicate
e2e
enhancement
epic
feature
frontend
functional-completion
gas
good first issue
governance
help wanted
high-risk
hooks
hybrid
indexer
infra
infrastructure
integrators
invalid
launch-blocker
limit-orders
localnet
localterra
low priority
missing-implementation
needs-design
ops
performance
priority
high
priority
medium
product
qa
QA
question
ready
ready
research
scripts
security
security-hardening
smartcontracts
tech-debt
testing
ux
UX
v2
verification
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
code/cl8y-dex-terraclassic#151
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Issue Summary
The Price (USD) chart on
/traderenders a Y-axis that extends into negative price territory (−25.00, −50.00 visible on screen). Asset prices cannot be negative. The chart scale is miscalculated or auto-scaled incorrectly, producing a misleading axis that a trader would reasonably interpret as a data or rendering error.Reproduction Steps
/tradeExpected Behavior
The Y-axis minimum should be clamped to 0 or to the lowest price in the visible data range — whichever is higher. Negative price values should never appear on a price chart.
Actual Behavior
The Y-axis auto-scales below zero, rendering negative price values (−25.00, −50.00) on the axis. The candles themselves render above zero but the axis extends well below the lowest candle, producing dead negative space and a misleading scale.
Environment Details
localterra(local Docker)VITE_NETWORK=local npm run devWallet / Device Details
Screenshots
Severity / Impact
P2 Polish. No funds are at risk and trades are not blocked. However a negative price axis is visually wrong and would cause any CEX-migrant trader to question whether the chart data is reliable. Undermines trust in the price surface at a glance. Found under W6-C1/C3 (Chart rendering — Display dimension).
cc: @PlasticDigits
mentioned in issue #116
mentioned in commit
28ceabb1f8Fix shipped on
main(28ceabb)What changed
autoscaleInfoProvideron the candlestick series inPriceChartLightweightCanvas.tsxthat composes with the default autoscale, then clampspriceRange.minValueto at leastmax(0, min(low) over logically visible bars). Pure logic lives infrontend-dapp/src/components/charts/priceChartPriceScale.tswith Vitest coverage in__tests__/priceChartPriceScale.test.ts.docs/frontend.md§ Trade page — price chart invariants (anchor#trade-page-price-chart-invariants) + new agent playbookskills/AGENTS_FRONTEND_PRICE_CHART.md(cross-linked fromAGENTS_FRONTEND_TRADE_PAGE_LAYOUT.md).Verification checklist (for QA / reviewers)
/trade→ pick a pair with USD candles → Price (USD) chart: no negative values on the right-hand price scale./chartswith an active pair (sharedPriceChartcomponent).cd frontend-dapp && npm run test -- --run src/components/charts/__tests__/priceChartPriceScale.test.tspasses.@totdking could you confirm on your localterra + Chrome setup from the issue description? Leaving the issue open until you verify.
/cc @PlasticDigits
mentioned in commit
9ded951a86mentioned in issue #149
mentioned in commit
a153784cd3mentioned in issue #150
Verification checklist (for QA / reviewers)
/trade→ pick a pair with USD candles → Price (USD) chart: no negative values on the right-hand price scale./chartswith an active pair (sharedPriceChartcomponent).cd frontend-dapp && npm run test -- --run src/components/charts/__tests__/priceChartPriceScale.test.tspasses.I cannot verify any of the following due to this
The chart part does not display on first sight which bleeds into #151 , #150 , #148 . thereby not allowing me to test and verify any of the fixes
cc -
@PlasticDigits
mentioned in commit
f881ec5c15Update (main @
f881ec5) — chart viewport / first paint (#151 follow-up)Context: The USD Y-axis autoscale clamp from earlier work remains in `priceChartPriceScale.ts` + `autoscaleInfoProvider`. @totdking reported the candle area missing on first sight (hard to verify the axis fix). Root cause for the blank region: the plot wrapper used a fixed `h-[min(52vh,560px)]` while the desktop chart cell is `overflow-hidden` inside a `react-resizable-panels` row — header + fixed plot height could exceed the panel, clipping the canvas below the fold.
What changed
Verification checklist (please tick on your localterra + Chrome setup)
@totdking — could you re-verify on your environment and confirm whether the chart is visible on first load? Leaving the issue open per instructions.
/cc @PlasticDigits
walked the chart visibility fix at HEAD
94adb5f.Source
Tests
Live walk on localnet @
94adb5fNotes for follow-up walks
ready for close on your side.
correction on the prior note — walking your checklist item 3 (
/chartsroute, sensible min height, not clipped) surfaces a regression. flagging before close./chartsroute at HEAD94adb5f— FAILheight: 3.35544e+07px; width: 1034pxdiv.min-h-[min(52vh,280px)] > div.w-full.h-full.min-h-[320px] > div.tv-lightweight-charts > table > tr > td > div > canvasRoot cause hypothesis
f881ec5addedflex-1 min-h-0+min-h-[min(52vh,280px)]on PriceChart/tradethis is fine — react-resizable-panels parent constrains the chart panel to a bounded row height/chartsthe chart sits in a page layout with no react-resizable-panels parent and no fixed grid row sizesflex-1+ theh-fullchain resolves against an unbounded ancestor, so available height is the entire page-min-heightOther checklist items
/tradewith candles + volume: PASS — resize cycle clean, no canvas blank-out, floor held/chartssensible min height not clipped: FAIL (see above)Fix suggestion
h-[min(52vh,560px)]when no resizable-panel parent is detected, but that defeats #151's original fix scopeleaving #151 open. happy to retest once a constraint lands on /charts side.
/cc @PlasticDigits
mentioned in commit
84dcae96e2mentioned in merge request !731
mr !731 opened for the /charts canvas bound — https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/13
scope: wraps PriceChart on /charts in h-[min(70vh,720px)] so the flex chain has a bounded parent. /trade fix from
f881ec5unaffected.leaving #151 close decision to you — happy to retest the full checklist post-merge if you want.
mentioned in commit
c955835f98mentioned in issue #211
mentioned in issue #214
mentioned in issue #225
marked as related to #225
mentioned in issue #227
marked as related to #227
mentioned in issue #229
marked as related to #229
mentioned in issue #524
marked as related to #524
mentioned in issue #543
marked as related to #543
mentioned in issue #561
mentioned in issue #680
mentioned in issue #717