Skip to content

Option to exclude vertical padding for live progress renderer#2100

Open
james-newell-forge wants to merge 1 commit intospectreconsole:mainfrom
james-newell-forge:feat/exclude_vertical_padding
Open

Option to exclude vertical padding for live progress renderer#2100
james-newell-forge wants to merge 1 commit intospectreconsole:mainfrom
james-newell-forge:feat/exclude_vertical_padding

Conversation

@james-newell-forge
Copy link
Copy Markdown

@james-newell-forge james-newell-forge commented Apr 24, 2026

Fixes: #1726

  • I have read the Contribution Guidelines
  • I have checked that there isn't already another pull request that solves the above issue
  • All newly added code is adequately covered by tests
  • All existing tests are still running without errors

No AI was used in commit

Changes

Currently, a live progress widget forces you to have a 1-top, 1-bottom vertical padding and there is no option to change this. This commit adds a new option to Progress.cs called ExcludeVerticalPadding that when set excludes the Padder added in DefaultProgressRenderer.cs (default false to keep existing behavior).

@james-newell-forge
Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree company="ForgeGlobal"

/// <param name="progress">The <see cref="Progress"/> instance.</param>
/// <param name="enabled">Whether or not to exclude the vertical padding.</param>
/// <returns>The same instance so that multiple calls can be chained.</returns>
public static Progress ExcludeVerticalPadding(this Progress progress, bool enabled)
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.

We should add two new methods that call this one to make the API consistent:

  • ExcludeVerticalPadding(this Progress progress)
  • IncludeVerticalPadding(this Progress progress)

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.

Make it possible to exclude linebreaks before and after Progress bars.

2 participants