fix(drawing): horizontal line drawable in future zone — ignore futureOffset on price-only anchors - #270
Merged
363045841 merged 1 commit intoSep 30, 2026
Conversation
修正实现位置:类型联合(DrawingAnchorCommandInput)里水平图元的锚是
独立变体(futureOffset?: never),文档层拒绝是正确的契约防御;错在
completeDrawing 无差别传 { timestamp, futureOffset, price }——为水平
命令剥离 futureOffset(kind === 'horizontal-line' 时仅传 price),
未来区落点即可按价格创建水平线。
- placement 测试新增:未来槽落点创建水平线,命令锚仅含 price
- 验证:core 250 文件/2674 测试全绿、type-check 三段过、attw 过
EliteOtaku
force-pushed
the
pr/horizontal-anchor-future-offset
branch
from
September 29, 2026 16:07
8c23ce3 to
4c165b8
Compare
EliteOtaku
added a commit
to EliteOtaku/KCQ-NexusAI
that referenced
this pull request
Sep 29, 2026
…gger scope note)
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
问题
右缘空白(未来区)落点解析会为数据区外的点击携带
futureOffset,而DrawingDocument.resolveAnchor对horizontal-line显式抛INVALID_ANCHOR("Horizontal drawing anchors cannot use a future offset")。叠加
completeDrawing的执行顺序(先回置工具再 createDrawing),用户侧表现:都是未来区,水平线在任何位置都画不出来
修复
horizontal 锚仅价格语义(持久化 shape 为
{ type: 'horizontal', price },不含时间),
futureOffset对它无意义——忽略而非抛错。未来区按价格创建水平线与 TV 语义一致。
配套壳层修复(切品种/周期后 rAF 双帧
scrollToRight对齐最新数据,避免视口漂入未来区)已在 EliteOtaku/KCQ-NexusAI nexus/main,不影响本修复的正确性。
验证
DrawingDocument.test.ts新增用例:horizontal 锚携带 futureOffset 不抛且仅落 price(
{ type: 'horizontal', price: 9 })pnpm --filter @363045841yyt/klinechart-core test:249 文件 / 2670 测试全绿