Skip to content

Fixes #5391, #5392 - Add Terminal.Gui.Interop.Spectre with SpectreView and style bridge#5393

Merged
tig merged 12 commits into
developfrom
copilot/add-spectreview-rendering
May 25, 2026
Merged

Fixes #5391, #5392 - Add Terminal.Gui.Interop.Spectre with SpectreView and style bridge#5393
tig merged 12 commits into
developfrom
copilot/add-spectreview-rendering

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 24, 2026

Summary

Adds Terminal.Gui.Interop.Spectre — a separate assembly that bridges Spectre.Console rendering into Terminal.Gui applications.

Fixes #5391 — Style/Color conversion bridge
Fixes #5392 — SpectreView for rendering any IRenderable

SpectreView Scenario Demo

What's Included

SpectreView : View

A read-only View that renders any Spectre.Console IRenderable:

// Render a Spectre Table
spectreView.Renderable = new Table ().AddColumn ("Name").AddRow ("Alice");

// Render Spectre Markup (Markup implements IRenderable)
spectreView.Renderable = new Markup ("[bold red]Hello[/] [green]World[/]");

SpectreMarkupBridge

Bidirectional style conversion:

  • Style.ToAttribute() — Spectre → TG (colors + decorations)
  • Attribute.ToSpectreStyle() — TG → Spectre (round-trip safe)

UICatalog Scenario

"Spectre" scenario demonstrating Table, Panel, Rule, Tree, BarChart, Calendar, FigletText, and Markup rendering.

Architecture

  • Separate assembly (Terminal.Gui.Interop.Spectre) — no Spectre dependency in core TG
  • AOT-compatible, trimmable
  • NuGet package: Terminal.Gui.Interop.Spectre
  • Added to Terminal.sln

Tests

10 tests covering: style conversion, reverse conversion, round-trip, default/none colors, Markup rendering, Table/Panel/Rule/Tree/BarChart/FigletText, re-render on change, DimAuto content sizing, integration with Window.

Copilot AI changed the title [WIP] Add SpectreView to render IRenderable in Terminal.Gui app Add SpectreView to render Spectre.Console IRenderable inside Terminal.Gui May 24, 2026
Copilot finished work on behalf of tig May 24, 2026 00:35
Copilot AI requested a review from tig May 24, 2026 00:35
@tig

This comment was marked as outdated.

This comment was marked as outdated.

Copilot AI changed the title Add SpectreView to render Spectre.Console IRenderable inside Terminal.Gui Add SpectreView interop and UICatalog scenario for Spectre.Console renderables May 24, 2026
Copilot finished work on behalf of tig May 24, 2026 01:44
@tig
Copy link
Copy Markdown
Member

tig commented May 24, 2026

@copilot use gui-cs/tuirec to record a gif of the new scenario in action and add the gif to docs/images.

This comment was marked as outdated.

Copilot AI changed the title Add SpectreView interop and UICatalog scenario for Spectre.Console renderables Add SpectreView interop, UICatalog scenario, and demo GIF for Spectre.Console renderables May 24, 2026
Copilot finished work on behalf of tig May 24, 2026 01:53
@tig

This comment was marked as outdated.

This comment was marked as outdated.

Copilot AI changed the title Add SpectreView interop, UICatalog scenario, and demo GIF for Spectre.Console renderables Add SpectreView interop, UICatalog scenario, and validated demo GIF for Spectre.Console renderables May 24, 2026
Copilot finished work on behalf of tig May 24, 2026 02:09
@tig
Copy link
Copy Markdown
Member

tig commented May 24, 2026

@copilot see the code cleanup .md doc in ./.claude and use it on all touched files.

This comment was marked as outdated.

Copilot AI changed the title Add SpectreView interop, UICatalog scenario, validated demo GIF, and touched-file cleanup Add SpectreView interop, UICatalog scenario, validated demo GIF, and tuirec recording guidance docs May 24, 2026
Copilot finished work on behalf of tig May 24, 2026 02:46
tig and others added 2 commits May 24, 2026 07:44
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add SpectreMarkupBridge.ToSpectreStyle() for TG->Spectre conversion
- Add NuGet package metadata to interop project
- Add project to Terminal.sln
- Add tests for round-trip, Markup IRenderable, default/none colors
- Rename scenario to 'Spectre' / 'Demonstrates Spectre.Console integration'

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tig tig changed the title Add SpectreView interop, UICatalog scenario, validated demo GIF, and tuirec recording guidance docs Fixes #5391, #5392. Add Terminal.Gui.Interop.Spectre with SpectreView and style bridge May 24, 2026
tig and others added 2 commits May 24, 2026 07:55
Cycles through Table, Panel, Rule, Tree, BarChart, Calendar, Figlet, Markup.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tig tig marked this pull request as ready for review May 24, 2026 14:08
@tig tig requested review from BDisp and Copilot May 24, 2026 14:12
chatgpt-codex-connector[bot]

This comment was marked as outdated.

This comment was marked as resolved.

…l console

- Skip Segment.IsControlCode segments to prevent ANSI escapes in output
- Use ref col parameter in DrawSegment for consistent column tracking
- Replace global AnsiConsole.Console with dedicated null-output console
- Add GitVersion.MsBuild for consistent package versioning
- Add tests for control code skipping and zero-width character alignment

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Collaborator

@BDisp BDisp left a comment

Choose a reason for hiding this comment

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

Fantastic implementation done here!

@tig tig changed the title Fixes #5391, #5392. Add Terminal.Gui.Interop.Spectre with SpectreView and style bridge Fixes #5391, #5392 - Add Terminal.Gui.Interop.Spectre with SpectreView and style bridge May 25, 2026
@tig tig merged commit fb5216c into develop May 25, 2026
13 checks passed
@tig tig deleted the copilot/add-spectreview-rendering branch May 25, 2026 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants