fix(charts): preserve viewport on 30s candle refetch (#336) #822
No reviewers
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!822
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "cursor/gitlab-issue-workflow-56f6"
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?
Summary
Fixes https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/work_items/336 — the price chart time-scale viewport was resetting to full history every 30 seconds because
PriceChartLightweightCanvascalledtimeScale().fitContent()after each candle refetch.Changes
priceChartLightweightSeriesSync.ts— incrementalseries.update()from the first changed bar;setDataonly on first load, interval switch, or truncated history.fitContent()from the background data-refresh effect.fitContent()does not run on every refetch when overlays are enabled.docs/frontend.mdandskills/AGENTS_FRONTEND_PRICE_CHART.md.Acceptance checklist
npm run test:run -- src/components/charts/__tests__/priceChartLightweightSeriesSync.test.ts src/components/charts/__tests__/PriceChartLightweightCanvas.test.tsx— background data refresh does not call fitContentseries.update()for live tail updatespriceChartLightweightSeriesSync.test.ts— update tail bar when only the last candle changesfitContent()only on initial mount / indicator toggle / interval switch (setData)fitContent()once; indicator toggle effect unchangedsetData)npm run test:run -- src/components/charts/__tests__/PriceChart.test.tsx— reuses one chart instance across many interval switchesmake setup-cloud-localterra+make dev); scroll/zoom on/tradeor/charts, wait ≥30sVerification for third parties
Manual QA (optional): open chart, zoom into recent candles, wait 30+ seconds — viewport should stay put while the last candle may update.
Issue #336 left open until merge.
changed the description
changed the description
mentioned in issue #336
changed the description
Security review
Commit reviewed:
9c27c35016e52e61b3484a2c574f6e95c66da3feScope: Frontend chart UX only —
priceChartLightweightSeriesSync.ts(new),PriceChartLightweightCanvas.tsx(incrementalseries.update()vssetData/fitContent()on refetch), Vitest stubs/tests, and docs/skills updates. No API, auth, indexer, contract, or dependency changes.Method: Traced indexer candle data through existing
indexerCandlesToChartPointstrust boundary (Number.isFinitefiltering, unchanged) into the new sync helpers and canvas effects. Checked for injection, XSS, authz, secret leakage, SSRF, unsafe deserialization, and supply-chain deltas.Outcome:
FINDINGS: 0medium+Inline threads: None — no medium+ issues on this diff.
Notes (informational, below reporting threshold):
priceChartCandles.tsbefore reaching lightweight-charts; this MR does not bypass that boundary.aria-hidden); no newdangerouslySetInnerHTMLor DOM sinks.mentioned in commit
f95ffd174amentioned in commit
05be9cfc82mentioned in commit
9377f88b68