Skip to content

Extended boxes no longer squeeze the price scale from off-screen - #104

Merged
alaa-eddine merged 2 commits into
devfrom
fix/autoscale-extended-box-window
Aug 30, 2026
Merged

alaa-eddine merged 2 commits into
devfrom
fix/autoscale-extended-box-window

Conversation

@alexgrover

@alexgrover alexgrover commented Aug 29, 2026 •

Copy link
Copy Markdown
Member

Summary

  • DrawingSceneRenderer.priceRange treated any box with extend != 'none' as visible everywhere on the time axis, so a box with a one-sided extension folded its top/bottom into the autoscale of windows its painted part never reaches. An indicator keeping an extend.right box near the latest bars (a common order-block idiom) flattened the candles in every earlier window the moment the user scrolled back through history.
  • The visibility helper is now direction-aware, mirroring the line semantics shipped in v0.6.11 (lineCoversWindow): extend.right covers [left, +inf), extend.left covers (-inf, right], extend.both still covers every window, and unextended boxes keep the plain overlap test. Polylines and labels (always 'none') and linefills (mapped to 'both'/'none') are unaffected.
  • New "extended boxes and autoscale" cases in test/drawing-extend-autoscale.test.ts pin the coverage rules per extend direction (written failing first), and the changelog carries the fix under [Unreleased].

Verification

  • Gate: typecheck, lint, full test suite (1438 tests), build — all green.
  • Workspace oracle suites: vela 23/23, vela-pro 11/11.
  • Real-runtime proof: reproduced with a Pine order-block indicator on BTCUSDT 1m over 50,000 bars (boxes anchored at the newest bars, extend.right); scrolling into earlier history squashed the candles before the fix and autoscales tightly after it, while windows the boxes genuinely cover still fold them into the scale.

Note

Low Risk
Localized change to drawing autoscale geometry with regression tests; no auth, data, or API surface changes.

Overview
Extended Pine boxes now follow the same direction-aware autoscale rules as extended lines (v0.6.11): DrawingSceneRenderer.priceRange no longer treats any extend != 'none' box as visible on the entire time axis.

One-sided extensions only fold top/bottom into the price scale when the visible bar window overlaps where the box is actually painted — anchor span plus extend.right toward [left, ∞) or extend.left toward (-∞, right]. extend.both still affects every window. Scrolling into history no longer flattens candles when an extend.right order-block box sits on the latest bars.

Tests in drawing-extend-autoscale.test.ts lock in the per-direction coverage; the changelog documents the fix under [Unreleased].

Reviewed by Cursor Bugbot for commit 25d69bd. Bugbot is set up for automated code reviews on this repo. Configure here.

Co-authored-by: Cursor <cursoragent@cursor.com>
@cursor

cursor Bot commented Aug 29, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_90c96e50-8ba5-4043-a9bd-640e9c473ba9)

@github-actions

github-actions Bot commented Aug 29, 2026 •

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@alexgrover

Copy link
Copy Markdown
Member Author

I have read the CLA Document and I hereby sign the CLA

@alaa-eddine
alaa-eddine merged commit 83e3617 into dev Aug 30, 2026
1 check passed
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants