Skip to content

Metadata row details: full-width layout and a decompiler-styled editor for text blobs - #3932

Open
siegfriedpammer wants to merge 5 commits into
masterfrom
metadata-row-details-full-width
Open

Metadata row details: full-width layout and a decompiler-styled editor for text blobs#3932
siegfriedpammer wants to merge 5 commits into
masterfrom
metadata-row-details-full-width

Conversation

@siegfriedpammer

@siegfriedpammer siegfriedpammer commented Jul 29, 2026

Copy link
Copy Markdown
Member

In the metadata viewer, the row-details content (introduced in #3759) was pinned to the left edge, and decoded text payloads rendered in a plain TextBox.

Two improvements to the details area:

Full-width layout — all three detail shapes (text blob, flags breakdown, typed sub-grid) now stretch across the host row, with the last sub-grid column star-sized to absorb the leftover width.

Decompiler-styled editor for text payloads — embedded source, Source Link JSON, and hex dumps now render in the theme-aware AvaloniaEdit editor with extension-driven syntax highlighting and line virtualization, so large embedded-source documents are no longer materialized up front. The decompiler-view look (user-selected font applied live, themed background, flat square-cornered selection) moved into DecompilerTextEditor itself, so the main text view and the details area match by construction. The blob editor is height-bounded (min 100px, max 400px, scrolls internally) and carries its own Copy / Select All context menu — previously a right-click inside the details area inherited the metadata grid's cell-oriented menu, whose entries are permanently disabled there.

Each behavior is pinned by a headless UI test; the full ILSpy.Tests suite is green (1121 passed).

🤖 Generated with Claude Code

The details content was pinned left and the text blob capped at 800px,
leaving dead space to the right of embedded-source text and the
flags/typed sub-grids. Let all three detail shapes stretch and give the
last sub-grid column the leftover width so the details area fills its
host row.

Assisted-by: Claude:claude-fable-5:Claude Code
@siegfriedpammer
siegfriedpammer force-pushed the metadata-row-details-full-width branch from 08a7ab3 to d3dc79a Compare July 29, 2026 16:54
@siegfriedpammer siegfriedpammer changed the title Stretch metadata row details across the full row width Metadata row details: full-width layout and a decompiler-styled editor for text blobs Jul 29, 2026
@christophwille
christophwille requested a review from Copilot July 29, 2026 17:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the metadata viewer’s row-details experience by (1) making details content use the full available row width and (2) rendering decoded text payloads (embedded source / Source Link JSON / hex) in the same decompiler-styled, theme-aware AvaloniaEdit-based editor used by the main decompiler view, including extension-driven syntax highlighting and bounded height.

Changes:

  • Moved decompiler-view styling (theme-aware background/selection + live font tracking) into DecompilerTextEditor, and removed per-view font/background/selection styling from DecompilerTextView.
  • Replaced row-details text payload rendering from TextBox to DecompilerTextEditor with optional extension-driven syntax highlighting plus a dedicated Copy / Select All context menu.
  • Updated CustomDebugInformation row-details plumbing/tests to use a typed TextBlobDetail (text + highlighting extension) and to assert the full-width layout/styling behaviors.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
ILSpy/TextView/DecompilerTextView.axaml.cs Stops applying font settings in the view; delegates font/background/selection behavior to DecompilerTextEditor.
ILSpy/TextView/DecompilerTextView.axaml Removes local selection/background/font styling and relies on DecompilerTextEditor for shared decompiler-view appearance.
ILSpy/TextView/DecompilerTextEditor.cs Centralizes decompiler-view styling and live DisplaySettings font tracking inside the editor control.
ILSpy/Metadata/MetadataRowDetails.cs Switches decoded text blob rendering to DecompilerTextEditor, enables syntax highlighting by extension, and adds editor-specific context menu.
ILSpy/Metadata/DebugTables/CustomDebugInformationTableTreeNode.cs Changes row-details text payloads to return TextBlobDetail (with extension) instead of raw strings/hex.
ILSpy.Tests/Metadata/MetadataRowDetailsTests.cs Adds headless UI tests covering full-width layout, editor highlighting/styling, and editor-owned context menu behavior.
ILSpy.Tests/Metadata/CustomDebugInformationRowDetailsTests.cs Updates fixture/tests to validate TextBlobDetail and extension-carrying embedded-source behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


var textReader = new StreamReader(embeddedSourceByteStream, detectEncodingFromByteOrderMarks: true);
return textReader.ReadToEnd();
return new TextBlobDetail(textReader.ReadToEnd(), GetEmbeddedSourceExtension());

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed: the reader is now using-scoped, which disposes the wrapped DeflateStream/MemoryStream chain; folded into the editor commit (34b3d01). (This reply was written by an AI agent on the author's behalf.)

The CustomDebugInformation details area rendered decoded text payloads
(embedded source, source-link JSON, hex dumps) in a plain TextBox, which
shows code without any highlighting and materializes the whole formatted
text up front, so large embedded-source documents were expensive. Text
payloads now travel as a TextBlobDetail tagged with a file extension --
".json" for source link, the parent document's extension for embedded
source, none for hex -- and render in the theme-aware AvaloniaEdit
editor, which colours them via the existing highlighting registry and
virtualizes long documents. The editor's ThemeChanged subscription moves
from the constructor to OnAttachedToVisualTree so it stays paired with
the detach-time unsubscribe now that editors can leave and re-enter the
visual tree inside recycled row-details containers.

Assisted-by: Claude:claude-fable-5:Claude Code
The text-blob editor in the metadata row-details area hardcoded its font
and lacked the text view's flat selection highlight, so embedded source
looked different from the decompiled code right next to it and ignored
the user's font choice in the Options page. The decompiler-view look
(user-selected font applied live while attached, themed background,
square-cornered translucent selection) now lives in DecompilerTextEditor
itself, giving every surface hosting the editor the same appearance by
construction; DecompilerTextView and BuildTextBlob drop their now
redundant per-site styling.

Assisted-by: Claude:claude-fable-5:Claude Code
A one-line payload (short hex dump, tiny source-link document) rendered
as a squeezed strip barely taller than the row itself, which does not
read as an expandable details area. Floor the editor at 100px so the
details region stays visually recognisable regardless of payload size.

Assisted-by: Claude:claude-fable-5:Claude Code
Right-clicking inside the details editor inherited the metadata grid's
cell-oriented context menu, whose Copy entries are enabled only for a
hovered DataGridCell -- inside the details area there is none, so the
menu showed permanently disabled entries and selected text could not be
copied by mouse. The editor now carries the decompiler view's editor
menu shape: Copy (rich HTML copy with plain fallback, enabled while a
selection exists) and Select All. Enablement is decided in
ContextMenu.Opening, which only the context-request gesture raises;
the test therefore raises ContextRequested instead of calling Open().

Assisted-by: Claude:claude-fable-5:Claude Code
@siegfriedpammer
siegfriedpammer force-pushed the metadata-row-details-full-width branch from d3dc79a to e0264b6 Compare July 29, 2026 19:00
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.

2 participants