Repository navigation
Release 0.1.0-alpha.24: editor preview integration (#5 #6 #7) and the browser https fix - #8
Merged
Merged
Conversation
SocketsHttpHandler does not exist in the browser: setting UseCookies or AllowAutoRedirect throws PlatformNotSupportedException, so a MarkdownServices created in a WebAssembly app failed in its static initializer. The browser now uses HttpClientHandler; the fetch API follows redirects itself, so the per-hop policy check applies on desktop only. Desktop behavior is unchanged. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
…chors MarkdownView gets block-level mapping between Markdown source offsets and rendered positions, so an editor preview can sync its caret and scroll: - ScrollToSourceOffset(offset) scrolls to the deepest block containing the offset (list items and paragraphs inside quotes included). The result says why nothing moved: NoDocument, OutOfRange or LayoutPending. - GetSourceRange(TextPoint) and GetSelectionSourceRange() map a rendered point or the selection back to the source range of the blocks it covers. TextPoint.Offset is an offset in the segment's plain text, never a source offset, so emphasis and links cannot be mistaken for source columns. - CaptureAnchor() / RestoreAnchor() save the character at the top of the outer ScrollViewer plus its pixel displacement, so width, font or theme changes keep the reading position. Anchors are tied to the new MarkdownView.DocumentId (not the snapshot Generation, which also changes on Complete()), so an anchor never restores onto a different document. - SourceText.ToLocation / ToOffset define the line/column convention: UTF-16 code units, CRLF counts as 2 and is not normalised. Closes #6 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…e source Task checkboxes stay read-only by default. With MarkdownView.IsTaskInteractionEnabled, a click on the box (or Space/Enter once it has focus) raises TaskToggleRequested instead of changing anything: StreamMark never edits the source or the snapshot, the host decides, edits its own text and assigns it back. A rejected request leaves the screen unchanged. - ListItemBlock.TaskMarker holds the source range of "[ ]" / "[x]", taken from Markdig's TaskList span. It enters ComputeFingerprint as a position relative to the list item, so a list that merely shifts does not produce an Update. - TaskToggleRequestedEventArgs carries the marker range, current and requested state, DocumentId and snapshot Version; ApplyTo(source) replaces only the character inside the brackets, so indentation and CRLF are preserved. MarkdownView.IsCurrent(request) lets the host reject a stale request. - Requests are only raised for a complete snapshot, not while streaming. - Clicking the task text still selects text. Task items expose a CheckBox automation peer with IToggleProvider. Closes #7 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ross a full-text replace MarkdownView.RefreshMarkdown(text) replaces the whole text without clearing the view. Assigning Markdown still means "a new document" and resets everything; StreamingDocument stays append-only. - The old content stays on screen until the new text is parsed. The view remembers StreamingDocument.Version at refresh time and does not apply a snapshot that has not caught up, so rapid A -> B -> C updates never show A or B once C is accepted. - SnapshotEdit aligns the old and new snapshots by content: common prefix and suffix, then a longest-common-subsequence match of what lies between (falls back to positional pairing above 1M block pairs). Blocks that only moved because text was added or removed before them become Update ops, so their views, layout and block state survive. No new DiffKind, so the three switches stay as they are. SnapshotDiff alone would treat every block after an insertion as removed and re-inserted. - BlockStateStore.Remap, SelectionRemap and the reading anchor follow the alignment. A selection endpoint inside a rewritten block is clamped to the paired new block; inside a deleted block it moves to the start of the next surviving block (or the document end), and a selection whose ends land on the same point is cleared. - StreamingDocument.Load is now atomic (clear, write and mark complete under one lock) so the worker can no longer pick up an incomplete intermediate snapshot between Reset and Complete. StreamingDocument.Version is exposed. - The Gallery NativeAOT smoke test checks the new alignment, task marker and line/column paths (0 IL warnings, all checks pass). - Notes the timing-sensitive LongCodeTests assertion as a known local flake. Closes #5 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This was referenced Oct 21, 2026
This branch was successfully deployed
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.
Brings the
release/0.1.0-alpha.24branch back tomain.0.1.0-alpha.24of the sixTKCode.StreamMark.*packages was published from this branch (CI run 39552495464).What it contains
ScrollToSourceOffset,GetSourceRange/GetSelectionSourceRange,CaptureAnchor/RestoreAnchor,SourceTextline/column helpers. Block-level precision; offsets are UTF-16 code units.IsTaskInteractionEnabled+TaskToggleRequested; StreamMark never edits the source, the host does.ListItemBlock.TaskMarkercarries the source range of[ ]/[x].RefreshMarkdown(text)keeps the old content, selection, block state and reading position across a full-text replace (SnapshotEditaligns old and new snapshots by content).StreamingDocument.Loadis now atomic andStreamingDocument.Versionis exposed.2bb0412Fetch https images with the platform handler in browsers — this fix was only on the alpha.23 release branch and is not onmainyet; merging this PR brings it in.0.1.0-alpha.24.Closes #5, closes #6, closes #7.
Notes for review
dotnet test StreamMark.slnx(Core 196, Avalonia 371); the publish run's native build, build-test (linux / macOS / windows) and NativeAOT smoke jobs all passed, 0 IL warnings.tools/cpu-bench.shwas run once but is not a valid measurement: the machine was heavily loaded (idle scenario 7.5% instead of 0.0%). The streaming hot path only gained O(1) work, but the benchmark should be re-run on a quiet machine and compared withdocs/benchmarks.md.MarkdownViewonly (notTranscriptView); find highlights are not recomputed afterRefreshMarkdown; precision is block-level.🤖 Generated with Claude Code