Skip to content

Bump Spectre.Console dependencies to 0.55.0 and fix breaking changes#46

Merged
boxofyellow merged 2 commits intomainfrom
copilot/update-dependency-versions
Apr 9, 2026
Merged

Bump Spectre.Console dependencies to 0.55.0 and fix breaking changes#46
boxofyellow merged 2 commits intomainfrom
copilot/update-dependency-versions

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 9, 2026

Recreates the dependency bump from PR #45, bumping all three Spectre.Console packages to 0.55.0 and fixing the breaking changes introduced by that release.

Dependency Updates

  • Spectre.Console: 0.54.0 → 0.55.0
  • Spectre.Console.Cli: 0.53.1 → 0.55.0
  • Spectre.Console.Testing: 0.54.0 → 0.55.0

Breaking Change Fixes

Spectre.Console 0.55.0 converts Style from a class to a struct and introduces a new TableCell type. The following fixes address the resulting build failures and test failures:

  1. TableCell ambiguous reference (ConsoleObjectRenderers.cs): Added using TableCell = Markdig.Extensions.Tables.TableCell; alias to resolve the ambiguity between Spectre.Console.TableCell and Markdig.Extensions.Tables.TableCell.

  2. Nullable Style struct unwrap (ConsoleRendererBase.Frame.cs): BorderStyle() now takes Style (not Style?), so used borderStyle!.Value in the branch that is guaranteed non-null.

  3. Ternary default resolved as struct, not null (ConsoleRendererBase.cs): Style.Plain : default had default inferred as default(Style) (a zero-initialized struct) instead of null. A non-null Nullable<Style> was always assigned, so NoBorder() was never called — all frames got visible borders regardless of IncludeDebug. Fixed by using (Style?)null.

  4. Ternary null triggering op_Implicit(string) with null (ConsoleRendererBase.cs): After fix Allow caller to overwrite styling #3, the remaining issue was that Style.Plain : null caused the compiler to prefer string as the type of null (since op_Implicit(String)->Style exists), generating a call to Style.op_Implicit(null) which throws NullReferenceException. Fixed by using (Style?)null.

  5. Test style comparison (RendererTests.cs): In 0.55.0, rendered segments now include colors inherited from the rendering context (e.g. #000000 on #000000 from the default TestConsole style). Updated Check() to only compare color components that were explicitly set in the expected style, while still strictly comparing decoration.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.46%. Comparing base (3d80bc6) to head (6450b17).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #46   +/-   ##
=======================================
  Coverage   90.46%   90.46%           
=======================================
  Files          18       18           
  Lines         839      839           
  Branches       86       86           
=======================================
  Hits          759      759           
  Misses         59       59           
  Partials       21       21           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Owner

@boxofyellow boxofyellow left a comment

Choose a reason for hiding this comment

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

@copilot please take a look at this comment.

else
{
Table.BorderStyle(borderStyle);
Table.BorderStyle(borderStyle!.Value);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

@copilot why is the ! required here? this is in the else block of the borderStyle == default check.

I don't recall, is/was Style an object or a struct?

This might be more readable

if (borderStyle.HasValue)
{
    Table.NoBorder(borderStyle.Value);
}
else
{
    Table.NoBorder();
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You're right — Style was a class in 0.54.0 and is now a struct in 0.55.0. The ! was a workaround: the compiler doesn't recognize borderStyle == default as a null-guard in its flow analysis (unlike borderStyle == null or borderStyle.HasValue), so it still emitted CS8629. Using HasValue/Value makes the intent explicit and avoids needing the null-forgiving operator. Fixed in 6450b17 (note: your example had NoBorder in both branches — I used BorderStyle in the HasValue branch).

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 9, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • notaplace.com
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/ConsoleMarkdownRenderer/ConsoleMarkdownRenderer/ConsoleMarkdownRenderer.Tests/bin/Release/net8.0/ConsoleMarkdownRenderer.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/ConsoleMarkdownRenderer/ConsoleMarkdownRenderer/ConsoleMarkdownRenderer.Tests/bin/Release/net8.0/ConsoleMarkdownRenderer.Tests.deps.json /home/REDACTED/work/ConsoleMarkdownRenderer/ConsoleMarkdownRenderer/ConsoleMarkdownRenderer.Tests/bin/Release/net8.0/testhost.dll --port 40265 --endpoint 127.0.0.1:040265 --role client --parentprocessid 4023 --telemetryoptedin false (dns block)
  • okforreallyrealsthisnotaplace.com
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/ConsoleMarkdownRenderer/ConsoleMarkdownRenderer/ConsoleMarkdownRenderer.Tests/bin/Release/net8.0/ConsoleMarkdownRenderer.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/ConsoleMarkdownRenderer/ConsoleMarkdownRenderer/ConsoleMarkdownRenderer.Tests/bin/Release/net8.0/ConsoleMarkdownRenderer.Tests.deps.json /home/REDACTED/work/ConsoleMarkdownRenderer/ConsoleMarkdownRenderer/ConsoleMarkdownRenderer.Tests/bin/Release/net8.0/testhost.dll --port 40265 --endpoint 127.0.0.1:040265 --role client --parentprocessid 4023 --telemetryoptedin false (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from boxofyellow April 9, 2026 23:34
@boxofyellow boxofyellow merged commit 41e969d into main Apr 9, 2026
8 checks passed
@boxofyellow boxofyellow deleted the copilot/update-dependency-versions branch April 9, 2026 23:37
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