feat(app): experimental AvaloniaEdit renderer for Raw XML and Stream windows - #296
Merged
monil2233 merged 12 commits intoAug 23, 2026
Merged
Conversation
RawXmlViewModel.Lines is now ObservableCollection<TextLine> (plain, Color = StreamColor.Main) instead of ObservableCollection<string>, matching GameTextViewModel.Lines/StreamBuffer.Lines so a later task can generalize the AvaloniaEdit renderer to Raw XML. Raw XML's own visual behavior is unchanged (still plain green, unstyled). Also updates the two GenieDockFactory.cs call sites (CopyAll, SaveAs) that fed rx.ViewModel.Lines directly into IEnumerable<string> APIs — they now .Select(l => l.Text), matching the pattern already used for every other TextLine-backed tool in the same switch expressions.
monil2233
approved these changes
Aug 23, 2026
monil2233
left a comment
Contributor
There was a problem hiding this comment.
Reviewed against source and verified locally — build 0 warnings, full suites green (Core 1147, App 81). The generalization follows the #200 pattern faithfully: type-based template selection with the editor templates placed above the legacy ones, flags read once at layout build, config keys registered in the dump/categories/setter, and with both flags off the legacy path is untouched (the only legacy-path edit is the Raw XML ItemsControl retarget from x:String to TextLine, visually identical).
What I checked beyond the diff:
- Per-window highlight scoping survives the shared renderer:
GameLineEntrypasses each line's ownWindowintoDefaultHighlights.BuildStyleMap, so editor-mode Stream windows keep the same scoping semantics as the legacy renderer. - The
CopyAll/SaveAscall sites correctly follow theLinestype change. - The
dataDirectoryOverrideseam mirrors GenieCore's existingUseExplicitRoot— good to finally have dock-factory coverage that can't touch real AppData.
Three notes, none blocking:
- The one real caution before these flags ever default on:
GameLineEntrybuilds its style map eagerly, andBuildStyleMapfires highlight sound/TTS as a side effect.RebuildAll(re-attach / Reset) andReplaceLine(rules repaint) reconstruct every entry, which can re-fire alerts for the whole scrollback. That trait came with #200, but this PR multiplies the exposure across 12 stream windows — Combat especially. Worth a follow-up where onlyAppendfires alerts. - The new
RawXmlViewModel.Linesdoc comment cites "(#274)" — that's the automapper config-keys issue; should read #296 (or #200). I'll fix that in a follow-up. - Heads-up: this overlaps your draft #258 in
GameTextEditor.cs(Subscribe/Unsubscribe and Find wiring) — whichever lands second needs a small rebase, and once #258 is ready, its search-panel behavior on editor Stream windows is worth a re-look.
Merging. Thanks — this is exactly the follow-on flagged in #200, and the flag-off isolation story held up under review.
monil2233
added a commit
that referenced
this pull request
Aug 23, 2026
The TextLine unification note cited #274 (the automapper config keys), not the editor-renderer work it belongs to.
monil2233
added a commit
that referenced
this pull request
Aug 23, 2026
The static Bitmap caches were plain Dictionaries — fine for the app, which only touches them from the UI thread, but the App test suite now constructs two MainWindowViewModels from parallel xUnit collections (#296's DataDirectoryOverrideTests joined DockFactoryEditorWindowTests), and concurrent writes intermittently corrupt a plain Dictionary ("Operations that change non-concurrent collections must have exclusive access", seen once in a full-suite run). ConcurrentDictionary; a benign double-load races to last-wins, which is fine for identical sprites.
monil2233
added a commit
that referenced
this pull request
Aug 23, 2026
…indow keys The #296 editor-renderer flags landed with #config help entries but no rows in the settings reference, which documents the sibling useeditorgamewindow.
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.
Summary
GameTextEditorcontrol (previously game-window-only, behinduseeditorgamewindow) behind a newITextEditorHostcontract, and extends it to the Raw XML and Stream windows.useeditorrawxmlwindowanduseeditorstreamwindowconfig keys (default off, read once at dock-layout build time, same experimental contract as the existing game-window flag).GenieDockFactoryselectsEditorRawXmlTool/EditorStreamToolvs. the legacyRawXmlTool/StreamToolper flag — oneuseeditorstreamwindowflag governs all 12 Stream instances.ITextEditorHost.EnableColorizing/EnableLinks): on for Game/Stream, off for Raw XML, which stays a plain verbatim dump.RawXmlViewModel.Linesmoves fromObservableCollection<string>toObservableCollection<TextLine>, matchingGameTextViewModel/StreamBuffer, so the shared renderer has one consistent line type across all three window kinds.MainWindowViewModel'sdataDirectoryOverridetest seam (isolates data-dir discovery for tests without touching real per-user AppData) and new coverage:DataDirectoryOverrideTests,DockFactoryEditorWindowTests,EditorRawXmlWindowConfigTests,EditorStreamWindowConfigTests.All flags default off — with them off, the legacy per-line
ItemsControlrendering is untouched and byte-for-byte the same code path as before.Test plan
dotnet build src/Genie.App/Genie.App.csproj— succeedsdotnet test tests/Genie.Core.Tests— 1147 passeddotnet test tests/Genie.App.Tests— 81 passed, including the new editor-window/dock-factory/data-directory-override coverage