Skip to content

Add read-only SysML v2 source text viewer with syntax highlighting - #11

Merged
Malcolmnixon merged 2 commits into
mainfrom
feature/source-text-viewer
Jul 20, 2026
Merged

Add read-only SysML v2 source text viewer with syntax highlighting#11
Malcolmnixon merged 2 commits into
mainfrom
feature/source-text-viewer

Conversation

@Malcolmnixon

Copy link
Copy Markdown
Member

This pull request introduces and documents a new feature that allows users to open any .sysml file in the workspace as a read-only, syntax-highlighted source-text tab using AvaloniaEdit. The changes span user-facing documentation, architectural design, requirements, and review configuration, and add new OTS (off-the-shelf) integration documentation for AvaloniaEdit. The implementation ensures that double-clicking a .sysml file in the workspace tree opens its raw source in a dedicated tab, reuses the tab if already open, and leverages an embedded, grammar-synchronized syntax highlighting definition.

User-Facing Feature Additions:

  • Users can now double-click any .sysml file in the workspace tree to open its read-only, syntax-highlighted source in a dedicated tab. Repeated double-clicks focus the existing tab instead of duplicating it. This is documented in the user guide and README. [1] [2]

App Shell & Workspace Panel Design/Behavior:

  • The MainWindowShell and workspace panel design docs are updated to describe the new source-text tab type, its tab identity logic, and the new OpenSourceTextTab and GetTabFilePath methods. The WorkspacePanelToolView now wires double-clicks on .sysml files to open these tabs, and supporting types (SourceTextDocumentViewModel/View) are described. [1] [2] [3] [4] [5] [6] [7]

OTS (Off-the-Shelf) Integration:

  • AvaloniaEdit is added as a documented OTS dependency, with a new design document explaining the integration pattern, highlighting resource loading, and how keyword highlighting is synchronized with the real SysML v2 lexer. [1] [2] [3] [4]

Requirements & Verification:

  • New software requirements and verification paths for AvaloniaEdit integration and the new tab-opening behavior are added to the requirements YAML files, with corresponding review and test coverage. [1] [2] [3] [4]

Spellchecking and Miscellaneous:

  • The spellchecker configuration is updated to recognize new terms related to AvaloniaEdit and syntax highlighting.

Malcolm Nixon and others added 2 commits July 20, 2026 14:38
- Double-clicking a .sysml file in the Workspace panel opens a new
  read-only tab showing the file's raw text, syntax highlighted via
  AvaloniaEdit (new Avalonia.AvaloniaEdit 12.0.0 dependency).
- MainWindowShell: new WorkbenchTabKind.SourceText, WorkbenchTab.FilePath,
  OpenSourceTextTab (dedupes/refocuses an already-open tab for the same
  file) and GetTabFilePath.
- New SourceTextDocumentViewModel/SourceTextDocumentView; self-authored
  Assets/SysML.xshd highlighting definition (keywords reflected from
  SysMLv2Lexer with a static fallback), plus comment/string/number rules.
- WorkbenchDockFactory: additive SourceTextTabClosed event; existing
  DiagramTabClosed/Dock OTS artifacts left untouched.
- MainWindowView: tab-tracking widened to the common Document base type
  to host both diagram and source-text tabs in the same tabbed area.
- WorkspacePanelToolView: double-tap handling to open .sysml files.
- Tests: MainWindowShellTests extended; new
  SourceTextDocumentViewModelTests and OtsSoftwareTests/AvaloniaEditTests.
- Companion docs: design/verification/reqstream/sysml2-model updates for
  MainWindowShell and WorkspacePanel, new AvaloniaEdit OTS design/
  verification/reqstream docs registered in requirements.yaml, ots.sysml,
  and .reviewmark.yaml (including the new AvaloniaEditTests.cs review
  coverage); user guide and README updated.
…tyle include

App.axaml was missing AvaloniaEdit's mandatory
avares://AvaloniaEdit/Themes/Fluent/AvaloniaEdit.xaml style include, so
TextEditor had no control theme/template applied at all. The tab's Text
property was still set correctly, so the existing view-model-level tests
never caught it - only the actual visual tree was empty. Added a headless
regression test that hosts a real TextEditor in a real shown Window and
asserts it gets a template/visual children, which fails without the style
include and passes with it.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Malcolmnixon
Malcolmnixon merged commit dc79775 into main Jul 20, 2026
6 checks passed
@Malcolmnixon
Malcolmnixon deleted the feature/source-text-viewer branch July 21, 2026 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant