Repository navigation
Add the Magnifier drawing tool: a lower-timeframe inset area - #99
Merged
Merged
Conversation
Drag a rectangle over the chart and its interior redraws the same market at a lower timeframe, in the chart's own price style and colors, at true time/price positions. A timeframe chip on the rectangle's bottom-left corner doubles as a dropdown (only timeframes below the chart's are offered; Auto subdivides the chart timeframe), and the quick settings bar carries the same pick plus color/border overrides. The data rides a new neutral series gateway: a synchronous, cache-backed read of finer-timeframe bars for data-driven drawings (an async sibling of Projector.barsInRange), implemented over the feed's ranged fetch with window caching, request capping, live-edge refreshes, and best-effort partial answers while a widened window loads. Series-covering tools start above the pane's series stack so the opaque inset is never buried, and an armed tool can now show a placement hint at the bottom of the chart. Co-authored-by: Cursor <cursoragent@cursor.com>
…ing-tools doc conflicts Co-authored-by: Cursor <cursoragent@cursor.com>
alexgrover
marked this pull request as ready for review
August 29, 2026 17:46
Bugbot couldn't run - usage limit reachedBugbot 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_836dc553-8fa7-4b1a-ae52-23d9f7ec64a8) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Autoresolves to a clean subdivision (1h → 15m). On a chart already at the finest timeframe the tool says "No lower timeframe available" instead of guessing.Projector.seriesInRange, the async sibling ofbarsInRange), implemented over the feed's ranged fetch with window caching, a 5000-bar request cap, throttled live-edge refreshes, coalesced in-flight fetches, best-effort partial answers while a widened window loads, and failure parking. Exposed to the renderer through one optional port method; everything is additive and named neutrally.DrawingTypeMeta.coversSeries(an opaque inset starts above the pane's series stack instead of just under the candles) andDrawingTypeMeta.placementHint(a bottom-center prompt while the tool is armed).Verification
typecheck·lint·test(1433, incl. 15 new for the tool and the gateway) ·build.toJSON/fromJSONround-trips.oracle-tests/vela): 22/22.Test plan
persiston → the drawing and its timeframe surviveNote
Medium Risk
New ranged market-data fetching and canvas inset rendering add complexity and provider load, though capped and degraded safely; no auth or persistence schema breaks beyond a new drawing type.
Overview
Adds a Magnifier drawing (
magnifier, Measurements group): drag a rectangle and its interior shows the same symbol at a strictly lower timeframe, styled like the main series (candles/bars/line/area, Heikin Ashi transforms, theme colors) with live background loads and in-rectangle notices when data is loading, too wide, or unavailable.Introduces a drawing series gateway (
Projector.seriesInRange,DrawingSeriesServiceon the engine) so drawings can synchronously read finer-TF bars from a padded, LRU-cached ranged fetch (5000-bar cap, partial bars while widening, coalesced in-flight requests). The native renderer wires the gateway, repaints ononUpdate, and paints the inset (ghost outline only while placing—no fetch spam).Draw-order and UX seams:
coversSeriesplaces new opaque insets above the series stack;placementHintshows a bottom pill while the tool is armed. Timeframe is editable via a bottom-left chip dropdown and the quick settings bar (options filtered below the chart TF). Docs and changelog updated (~67 tools).Reviewed by Cursor Bugbot for commit e90e31f. Bugbot is set up for automated code reviews on this repo. Configure here.