feat(Core.Components):Add SpectreCanvas component.#78
Merged
LittleLittleCloud merged 12 commits intoRazorConsole:mainfrom Oct 31, 2025
Merged
feat(Core.Components):Add SpectreCanvas component.#78LittleLittleCloud merged 12 commits intoRazorConsole:mainfrom
LittleLittleCloud merged 12 commits intoRazorConsole:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds a SpectreCanvas component to RazorConsole that enables rendering pixel-based graphics with customizable colors. The implementation uses a registry pattern to pass pixel data between the Razor component and the Vdom translator.
- Introduces
SpectreCanvascomponent with support for configurable canvas dimensions, pixel width, scaling, and max width - Implements
CanvasDataRegistryfor managing pixel data across the rendering pipeline - Adds a gallery showcase with heart, checkerboard, and gradient examples
Reviewed Changes
Copilot reviewed 10 out of 12 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| src/RazorConsole.Core/Components/SpectreCanvas.razor | New component for rendering pixel arrays to Spectre.Console Canvas |
| src/RazorConsole.Core/Rendering/CanvasDataRegistry.cs | Registry for storing and retrieving pixel data by GUID |
| src/RazorConsole.Core/Vdom/Translators/CanvasElementTranslator.cs | Translator that converts Vdom nodes to Spectre.Console Canvas renderables |
| src/RazorConsole.Core/Vdom/VdomSpectreTranslator.cs | Registers the new CanvasElementTranslator |
| src/RazorConsole.Gallery/Components/SpectreCanvasGallery.razor | Gallery page demonstrating SpectreCanvas with three pixel art examples |
| src/RazorConsole.Gallery/Components/App.razor | Adds "Spectre Canvas" to the gallery menu |
| design-doc/builtin-components.md | Documents the SpectreCanvas component API |
src/RazorConsole.Core/Vdom/Translators/CanvasElementTranslator.cs
Outdated
Show resolved
Hide resolved
Member
|
@TeseySTD some comments from copilot makes sense, Could you resolve them could you also make a screenshot of canvas gallery and included it in PR description |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Skoreyko Misha <150385054+TeseySTD@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Skoreyko Misha <150385054+TeseySTD@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Skoreyko Misha <150385054+TeseySTD@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Skoreyko Misha <150385054+TeseySTD@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Skoreyko Misha <150385054+TeseySTD@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Skoreyko Misha <150385054+TeseySTD@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Skoreyko Misha <150385054+TeseySTD@users.noreply.github.com>
Member
Author
Done. |
LittleLittleCloud
approved these changes
Oct 31, 2025
13 tasks
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.
As discussed in issue #77, this PR introduces a new Canvas component that can render an array of pixels. It wraps the Canvas renderable from the Spectre.Console library.
Additionally, I've added:
Gallery examples to demonstrate usage:

Design documentation for component.